commit 6d499032fa1794edc6c62f44048ba250176b5c59 Author: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> Date: Thu Jun 29 22:35:31 2023 +0800 v3 - main to cut out diff --git a/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..e5d8ed6fa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/ISSUE_TEMPLATE.md @@ -0,0 +1,37 @@ +--- +name: "\U0001F41E Bug" +about: File a bug/issue +title: "[BUG] " +labels: '' +assignees: '' + +--- + +<!-- +Note: Please search to see if an issue already exists for the bug you encountered. +--> + +### Environment: +<!-- linux? windows? or Mac? +Example: +- OS: Ubuntu 20.04 --> + +### Physical Memory Capacity: +<!-- 8G or above is better --> + +### Docker Image: +<!-- Did you pull the docker image before execute docker images --> + +### Code Version: +<!-- Did you pull code from github? Make sure the code is up to date--> + +### Component installation: +<!-- Has etcd, mysql, mongodb, redis or Kafka been installed on the server before Open-IM-Server deployment--> + + +### Log File: +<!-- view log file(logs/openIM.log) content. --> + + +### screenshot: +<!----> diff --git a/.github/ISSUE_TEMPLATE/deployment-issues.md b/.github/ISSUE_TEMPLATE/deployment-issues.md new file mode 100644 index 000000000..57d7cbcb7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/deployment-issues.md @@ -0,0 +1,36 @@ +--- +name: Deployment issues +about: Deployment issues +title: '' +labels: '' +assignees: '' + +--- + +If you are deploying OpenIM for the first time + + + +``` +git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive +``` + +screenshot here + +``` +cd Open-IM-Server/script ; chmod +x *.sh ; ./env_check.sh +``` + +screenshot here + +``` +cd .. ; docker-compose up -d +``` + +screenshot here + +``` +cd script ; ./docker_check_service.sh +``` + +screenshot here diff --git a/.github/ISSUE_TEMPLATE/update-.md b/.github/ISSUE_TEMPLATE/update-.md new file mode 100644 index 000000000..ba8da7270 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/update-.md @@ -0,0 +1,38 @@ +--- +name: 'update ' +about: update docker image +title: update docker image +labels: '' +assignees: '' + +--- + +``` +cd Open-IM-Server ; docker-compose down +``` + +screenshot here + +``` +git pull +``` + +screenshot here + +``` +docker-compose pull +``` + +screenshot here + +``` +chmod +x script/*.sh ; docker-compose up -d +``` + +screenshot here + +``` +cd script ; ./docker_check_service.sh +``` + +screenshot here 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 new file mode 100644 index 000000000..3390267f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +bin +logs +.devcontainer +components +logs +out-test +.github +.idea + + +deploy/open_im_demo +deploy/open_im_api +deploy/open_im_msg_gateway +deploy/open_im_msg_transfer +deploy/open_im_push +deploy/open_im_timer_task +deploy/open_im_rpc_user +deploy/open_im_rpc_friend +deploy/open_im_rpc_group +deploy/open_im_rpc_msg +deploy/open_im_rpc_auth +deploy/Open-IM-SDK-Core diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..be3279250 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ + +[submodule "cmd/Open-IM-SDK-Core"] + path = cmd/Open-IM-SDK-Core + url = https://github.com/OpenIMSDK/Open-IM-SDK-Core.git diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 000000000..4964bacb5 --- /dev/null +++ b/README.md @@ -0,0 +1,159 @@ +# Open-IM-Server + +![avatar](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/open-im-logo.png) + +[![LICENSE](https://img.shields.io/badge/license-Apache--2.0-green)](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/LICENSE) [![Language](https://img.shields.io/badge/Language-Go-blue.svg)](https://golang.org/) + +## Open-IM-Server: Open source Instant Messaging Server + +Instant messaging server. Backend in pure Golang, wire transport protocol is JSON over websocket. + +Everything is a message in Open-IM-Server, so you can extend custom messages easily, there is no need to modify the server code. + +Using microservice architectures, Open-IM-Server can be deployed using clusters. + +By deployment of the Open-IM-Server on the customer's server, developers can integrate instant messaging and real-time network capabilities into their own applications free of charge and quickly, and ensure the security and privacy of business data. + +## Features + +- Everything in Free +- Scalable architecture +- Easy integration +- Good scalability +- High performance +- Lightweight +- Supports multiple protocols + +## Community + +- Join the Telegram-OpenIM group: https://t.me/joinchat/zSJLPaHBNLZmODI1 +- 中文官网访问这里:[Open-IM中文开发文档](https://doc.rentsoft.cn/) + +## Quick start + +### Installing Open-IM-Server + +> Open-IM relies on five open source high-performance components: ETCD, MySQL, MongoDB, Redis, and Kafka. Privatization deployment Before Open-IM-Server, please make sure that the above five components have been installed. If your server does not have the above components, you must first install Missing components. If you have the above components, it is recommended to use them directly. If not, it is recommended to use Docker-compose, no To install dependencies, one-click deployment, faster and more convenient. + +#### Source code deployment + +1. Install [Go environment](https://golang.org/doc/install). Make sure Go version is at least 1.15. + +2. Clone the Open-IM project to your server. + + ``` + git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive + ``` + +3. Build and start Service. + + 1. Shell authorization + + ``` + #cd Open-IM-server/script + + chmod +x *.sh + ``` + + 2. Execute the build shell + + ``` + ./build_all_service.sh + ``` + + 3. Start service + + ``` + ./start_all.sh + ``` + + 4. Check service + + ``` + ./check_all.sh + ``` + + ![OpenIMServersonSystempng](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/Open-IM-Servers-on-System.png) + +#### Docker deployment + +All images are available at https://hub.docker.com/r/lyt1123/open_im_server + +1. [Install Docker](https://docs.docker.com/install/) 1.13 or above. + +2. [Install Docker Compose](https://docs.docker.com/compose/install/) 1.22 or above. + +3. Clone the Open-IM project to your server. + + ``` + git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive + ``` + +4. Start docker-compose with one click(Docker automatically pulls all images) + + ``` + cd Open-IM-Server + docker-compose up -d + ``` + +5. Check service + + ``` + ./docker_check_service.sh + ./check_all.sh + ``` + + ![OpenIMServersondockerpng](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/Open-IM-Servers-on-docker.png) + +### 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 + +#### Basic Component Configuration Instructions + +- ETCD + - Etcd is used for the discovery and registration of rpc services, etcd Schema is the prefix of the registered name, it is recommended to modify it to your company name, etcd address (ip+port) supports clustered deployment, you can fill in multiple ETCD addresses separated by commas, and also only one etcd address. +- MySQL + - mysql is used for full storage of messages and user relationships. Cluster deployment is not supported for the time being. Modify addresses and users, passwords, and database names. +- Mongo + - Mongo is used for offline storage of messages. The default storage is 7 days. Cluster deployment is temporarily not supported. Just modify the address and database name. +- Redis + - Redis is currently mainly used for message serial number storage and user token information storage. Cluster deployment is temporarily not supported. Just modify the corresponding redis address and password. +- Kafka + - Kafka is used as a message transfer storage queue to support cluster deployment, just modify the corresponding address + +#### Internal Service Configuration Instructions + +- credential&&push + - The Open-IM needs to use the three-party offline push function. Currently, Tencent's three-party push is used. It supports IOS, Android and OSX push. This information is some registration information pushed by Tencent. Developers need to go to Tencent Cloud Mobile Push to register the corresponding information. If you do not fill in the corresponding information, you cannot use the offline message push function +- api&&rpcport&&longconnsvr&&rpcregistername + - The api port is the http interface, longconnsvr is the websocket listening port, and rpcport is the internal service startup port. Both support cluster deployment. Make sure that these ports are not used. If you want to open multiple services for a single service, fill in multiple ports separated by commas. rpcregistername is the service name registered by each service to the registry etcd, no need to modify +- log&&modulename + - The log configuration includes the storage path of the log file, and the log is sent to elasticsearch for log viewing. Currently, the log is not supported to be sent to elasticsearch. The configuration does not need to be modified for the time being. The modulename is used to split the log according to the name of the service module. The default configuration is fine. +- multiloginpolicy&&tokenpolicy + - Open-IM supports multi-terminal login. Currently, there are three multi-terminal login policies. The PC terminal and the mobile terminal are online at the same time by default. When multiple policies are configured to be true, the first policy with true is used by default, and the token policy is the generated token policy. , The developer can customize the expiration time of the token + +### SCRIPT DESCRIPTION + +> Open-IM script provides service compilation, start, and stop scripts. There are four Open-IM script start modules, one is the http+rpc service start module, the second is the websocket service start module, then the msg_transfer module, and the last is the push module + +- path_info.cfg&&style_info.cfg&&functions.sh + - Contains the path information of each module, including the path where the source code is located, the name of the service startup, the shell print font style, and some functions for processing shell strings +- build_all_service.sh + - Compile the module, compile all the source code of Open-IM into a binary file and put it into the bin directory +- start_rpc_api_service.sh&&msg_gateway_start.sh&&msg_transfer_start.sh&&push_start.sh + - Independent script startup module, followed by api and rpc modules, message gateway module, message transfer module, and push module +- start_all.sh&&stop_all.sh + - Total script, start all services and close all services + +## Authentication Clow Chart + +![avatar](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/open-im-server.png) + +## Architecture + +![avatar](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/Architecture.jpg) + +## License + +Open-IM-Server is under the Apache 2.0 license. See the [LICENSE](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/LICENSE) file for details diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core new file mode 160000 index 000000000..3ecd23203 --- /dev/null +++ b/cmd/Open-IM-SDK-Core @@ -0,0 +1 @@ +Subproject commit 3ecd23203cd6bd746b1fcb0c70755bd2cbf5361c diff --git a/cmd/open_im_api/Makefile b/cmd/open_im_api/Makefile new file mode 100644 index 000000000..1f96bca5a --- /dev/null +++ b/cmd/open_im_api/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_api +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_api/main.go b/cmd/open_im_api/main.go new file mode 100644 index 000000000..a2f8522ef --- /dev/null +++ b/cmd/open_im_api/main.go @@ -0,0 +1,177 @@ +package main + +import ( + apiAuth "Open_IM/internal/api/auth" + apiChat "Open_IM/internal/api/chat" + "Open_IM/internal/api/conversation" + "Open_IM/internal/api/friend" + "Open_IM/internal/api/group" + "Open_IM/internal/api/manage" + "Open_IM/internal/api/office" + "Open_IM/internal/api/organization" + apiThird "Open_IM/internal/api/third" + "Open_IM/internal/api/user" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "flag" + "fmt" + "io" + "os" + "strconv" + + "github.com/gin-gonic/gin" + //"syscall" + "Open_IM/pkg/common/constant" +) + +func main() { + log.NewPrivateLog(constant.LogFileName) + gin.SetMode(gin.ReleaseMode) + f, _ := os.Create("../logs/api.log") + gin.DefaultWriter = io.MultiWriter(f) + + r := gin.Default() + r.Use(utils.CorsHandler()) + + log.Info("load config: ", config.Config) + // user routing group, which handles user registration and login services + userRouterGroup := r.Group("/user") + { + userRouterGroup.POST("/update_user_info", user.UpdateUserInfo) //1 + userRouterGroup.POST("/get_users_info", user.GetUsersInfo) //1 + userRouterGroup.POST("/get_self_user_info", user.GetSelfUserInfo) //1 + } + //friend routing group + friendRouterGroup := r.Group("/friend") + { + // friendRouterGroup.POST("/get_friends_info", friend.GetFriendsInfo) + friendRouterGroup.POST("/add_friend", friend.AddFriend) //1 + friendRouterGroup.POST("/delete_friend", friend.DeleteFriend) //1 + friendRouterGroup.POST("/get_friend_apply_list", friend.GetFriendApplyList) //1 + friendRouterGroup.POST("/get_self_friend_apply_list", friend.GetSelfFriendApplyList) //1 + friendRouterGroup.POST("/get_friend_list", friend.GetFriendList) //1 + friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse) //1 + friendRouterGroup.POST("/set_friend_remark", friend.SetFriendRemark) //1 + + friendRouterGroup.POST("/add_black", friend.AddBlack) //1 + friendRouterGroup.POST("/get_black_list", friend.GetBlacklist) //1 + friendRouterGroup.POST("/remove_black", friend.RemoveBlack) //1 + + friendRouterGroup.POST("/import_friend", friend.ImportFriend) //1 + friendRouterGroup.POST("/is_friend", friend.IsFriend) //1 + } + //group related routing group + groupRouterGroup := r.Group("/group") + { + groupRouterGroup.POST("/create_group", group.CreateGroup) //1 + groupRouterGroup.POST("/set_group_info", group.SetGroupInfo) //1 + groupRouterGroup.POST("join_group", group.JoinGroup) //1 + groupRouterGroup.POST("/quit_group", group.QuitGroup) //1 + groupRouterGroup.POST("/group_application_response", group.ApplicationGroupResponse) //1 + groupRouterGroup.POST("/transfer_group", group.TransferGroupOwner) //1 + groupRouterGroup.POST("/get_recv_group_applicationList", group.GetRecvGroupApplicationList) //1 + groupRouterGroup.POST("/get_user_req_group_applicationList", group.GetUserReqGroupApplicationList) + groupRouterGroup.POST("/get_groups_info", group.GetGroupsInfo) //1 + groupRouterGroup.POST("/kick_group", group.KickGroupMember) //1 + groupRouterGroup.POST("/get_group_member_list", group.GetGroupMemberList) //no use + groupRouterGroup.POST("/get_group_all_member_list", group.GetGroupAllMemberList) //1 + groupRouterGroup.POST("/get_group_members_info", group.GetGroupMembersInfo) //1 + groupRouterGroup.POST("/invite_user_to_group", group.InviteUserToGroup) //1 + groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList) //1 + groupRouterGroup.POST("/dismiss_group", group.DismissGroup) // + groupRouterGroup.POST("/mute_group_member", group.MuteGroupMember) + groupRouterGroup.POST("/cancel_mute_group_member", group.CancelMuteGroupMember) //MuteGroup + groupRouterGroup.POST("/mute_group", group.MuteGroup) + groupRouterGroup.POST("/cancel_mute_group", group.CancelMuteGroup) + } + //certificate + authRouterGroup := r.Group("/auth") + { + authRouterGroup.POST("/user_register", apiAuth.UserRegister) //1 + authRouterGroup.POST("/user_token", apiAuth.UserToken) //1 + } + //Third service + thirdGroup := r.Group("/third") + { + thirdGroup.POST("/tencent_cloud_storage_credential", apiThird.TencentCloudStorageCredential) + thirdGroup.POST("/ali_oss_credential", apiThird.AliOSSCredential) + thirdGroup.POST("/minio_storage_credential", apiThird.MinioStorageCredential) + thirdGroup.POST("/minio_upload", apiThird.MinioUploadFile) + } + //Message + chatGroup := r.Group("/msg") + { + chatGroup.POST("/newest_seq", apiChat.GetSeq) + chatGroup.POST("/send_msg", apiChat.SendMsg) + chatGroup.POST("/pull_msg_by_seq", apiChat.PullMsgBySeqList) + chatGroup.POST("/del_msg", apiChat.DelMsg) + } + //Manager + managementGroup := r.Group("/manager") + { + managementGroup.POST("/delete_user", manage.DeleteUser) //1 + managementGroup.POST("/send_msg", manage.ManagementSendMsg) + managementGroup.POST("/get_all_users_uid", manage.GetAllUsersUid) //1 + managementGroup.POST("/account_check", manage.AccountCheck) //1 + managementGroup.POST("/get_users_online_status", manage.GetUsersOnlineStatus) //1 + } + //Conversation + conversationGroup := r.Group("/conversation") + { //1 + conversationGroup.POST("/get_all_conversations", conversation.GetAllConversations) + conversationGroup.POST("/get_conversation", conversation.GetConversation) + conversationGroup.POST("/get_conversations", conversation.GetConversations) + conversationGroup.POST("/set_conversation", conversation.SetConversation) + conversationGroup.POST("/batch_set_conversation", conversation.BatchSetConversations) + conversationGroup.POST("/set_recv_msg_opt", conversation.SetRecvMsgOpt) + } + // office + officeGroup := r.Group("/office") + { + officeGroup.POST("/get_user_tags", office.GetUserTags) + officeGroup.POST("/get_user_tag_by_id", office.GetUserTagByID) + officeGroup.POST("/create_tag", office.CreateTag) + officeGroup.POST("/delete_tag", office.DeleteTag) + officeGroup.POST("/set_tag", office.SetTag) + officeGroup.POST("/send_msg_to_tag", office.SendMsg2Tag) + officeGroup.POST("/get_send_tag_log", office.GetTagSendLogs) + + officeGroup.POST("/create_one_work_moment", office.CreateOneWorkMoment) + officeGroup.POST("/delete_one_work_moment", office.DeleteOneWorkMoment) + officeGroup.POST("/like_one_work_moment", office.LikeOneWorkMoment) + officeGroup.POST("/comment_one_work_moment", office.CommentOneWorkMoment) + officeGroup.POST("/get_user_work_moments", office.GetUserWorkMoments) + officeGroup.POST("/get_user_friend_work_moments", office.GetUserFriendWorkMoments) + officeGroup.POST("/get_user_work_moments_comments_msg", office.GetUserWorkMomentsCommentsMsg) + officeGroup.POST("/clear_user_work_moments_comments_msg", office.ClearUserWorkMomentsCommentsMsg) + officeGroup.POST("/set_user_work_moments_level", office.SetUserWorkMomentsLevel) + } + + organizationGroup := r.Group("/organization") + { + organizationGroup.POST("/create_department", organization.CreateDepartment) + organizationGroup.POST("/update_department", organization.UpdateDepartment) + organizationGroup.POST("/get_sub_department", organization.GetSubDepartment) + organizationGroup.POST("/delete_department", organization.DeleteDepartment) + + organizationGroup.POST("/create_organization_user", organization.CreateOrganizationUser) + organizationGroup.POST("/update_organization_user", organization.UpdateOrganizationUser) + organizationGroup.POST("/create_department_member", organization.CreateDepartmentMember) + + organizationGroup.POST("/get_user_in_department", organization.GetUserInDepartment) + organizationGroup.POST("/update_user_In_department", organization.UpdateUserInDepartment) + organizationGroup.POST("/delete_organization_user", organization.DeleteOrganizationUser) + organizationGroup.POST("/get_department_member", organization.GetDepartmentMember) + organizationGroup.POST("/delete_user_in_department", organization.DeleteUserInDepartment) + } + + go apiThird.MinioInit() + ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port") + flag.Parse() + fmt.Println("start api server, port: ", *ginPort) + err := r.Run(":" + strconv.Itoa(*ginPort)) + if err != nil { + log.Error("", "run failed ", *ginPort, err.Error()) + } +} diff --git a/cmd/open_im_cms_api/Makefile b/cmd/open_im_cms_api/Makefile new file mode 100644 index 000000000..31304542d --- /dev/null +++ b/cmd/open_im_cms_api/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_cms_api +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_cms_api/main.go b/cmd/open_im_cms_api/main.go new file mode 100644 index 000000000..262020fea --- /dev/null +++ b/cmd/open_im_cms_api/main.go @@ -0,0 +1,17 @@ +package main + +import ( + "Open_IM/internal/cms_api" + "Open_IM/pkg/utils" + "fmt" + + "github.com/gin-gonic/gin" +) + +func main() { + gin.SetMode(gin.ReleaseMode) + router := cms_api.NewGinRouter() + router.Use(utils.CorsHandler()) + fmt.Println("start cms api server, port: ", 8000) + router.Run(":" + "8000") +} diff --git a/cmd/open_im_demo/Makefile b/cmd/open_im_demo/Makefile new file mode 100644 index 000000000..45829acd8 --- /dev/null +++ b/cmd/open_im_demo/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_demo +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_demo/main.go b/cmd/open_im_demo/main.go new file mode 100644 index 000000000..af7809547 --- /dev/null +++ b/cmd/open_im_demo/main.go @@ -0,0 +1,42 @@ +package main + +import ( + "Open_IM/internal/demo/register" + "Open_IM/pkg/utils" + "flag" + "fmt" + "io" + "os" + "strconv" + + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "github.com/gin-gonic/gin" +) + +func main() { + log.NewPrivateLog(constant.LogFileName) + gin.SetMode(gin.ReleaseMode) + f, _ := os.Create("../logs/api.log") + gin.DefaultWriter = io.MultiWriter(f) + + r := gin.Default() + r.Use(utils.CorsHandler()) + + authRouterGroup := r.Group("/auth") + { + authRouterGroup.POST("/code", register.SendVerificationCode) + authRouterGroup.POST("/verify", register.Verify) + authRouterGroup.POST("/password", register.SetPassword) + authRouterGroup.POST("/login", register.Login) + authRouterGroup.POST("/reset_password", register.ResetPassword) + } + + ginPort := flag.Int("port", 42233, "get ginServerPort from cmd,default 42233 as port") + flag.Parse() + fmt.Println("start demo api server, port: ", *ginPort) + err := r.Run(":" + strconv.Itoa(*ginPort)) + if err != nil { + log.Error("", "run failed ", *ginPort, err.Error()) + } +} diff --git a/cmd/open_im_msg_gateway/Makefile b/cmd/open_im_msg_gateway/Makefile new file mode 100644 index 000000000..566d8d9c2 --- /dev/null +++ b/cmd/open_im_msg_gateway/Makefile @@ -0,0 +1,24 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_msg_gateway +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_msg_gateway/main.go b/cmd/open_im_msg_gateway/main.go new file mode 100644 index 000000000..283f831b8 --- /dev/null +++ b/cmd/open_im_msg_gateway/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "Open_IM/internal/msg_gateway/gate" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "flag" + "fmt" + "sync" +) + +func main() { + log.NewPrivateLog(constant.LogFileName) + 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) + fmt.Println("start rpc/msg_gateway server, port: ", *rpcPort, *wsPort) + gate.Init(*rpcPort, *wsPort) + gate.Run() + wg.Wait() +} diff --git a/cmd/open_im_msg_transfer/Makefile b/cmd/open_im_msg_transfer/Makefile new file mode 100644 index 000000000..6a67b9bee --- /dev/null +++ b/cmd/open_im_msg_transfer/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_msg_transfer +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_msg_transfer/main.go b/cmd/open_im_msg_transfer/main.go new file mode 100644 index 000000000..9dfabecda --- /dev/null +++ b/cmd/open_im_msg_transfer/main.go @@ -0,0 +1,19 @@ +package main + +import ( + "Open_IM/internal/msg_transfer/logic" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "fmt" + "sync" +) + +func main() { + var wg sync.WaitGroup + wg.Add(1) + log.NewPrivateLog(constant.LogFileName) + logic.Init() + fmt.Println("start msg_transfer server") + logic.Run() + wg.Wait() +} diff --git a/cmd/open_im_push/Makefile b/cmd/open_im_push/Makefile new file mode 100644 index 000000000..df7b9e88a --- /dev/null +++ b/cmd/open_im_push/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_push +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_push/main.go b/cmd/open_im_push/main.go new file mode 100644 index 000000000..95e8521dd --- /dev/null +++ b/cmd/open_im_push/main.go @@ -0,0 +1,22 @@ +package main + +import ( + "Open_IM/internal/push/logic" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "flag" + "fmt" + "sync" +) + +func main() { + rpcPort := flag.Int("port", 10700, "rpc listening port") + flag.Parse() + var wg sync.WaitGroup + wg.Add(1) + log.NewPrivateLog(constant.LogFileName) + fmt.Println("start push rpc server, port: ", *rpcPort) + logic.Init(*rpcPort) + logic.Run() + wg.Wait() +} 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..20d9a4d1c --- /dev/null +++ b/cmd/open_im_timer_task/main.go @@ -0,0 +1,63 @@ +package main + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" +) + +func main() { + log.NewPrivateLog(constant.LogFileName) + //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.SelectAllUserID() + // 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_admin_cms/Makefile b/cmd/rpc/open_im_admin_cms/Makefile new file mode 100644 index 000000000..f6efc1c08 --- /dev/null +++ b/cmd/rpc/open_im_admin_cms/Makefile @@ -0,0 +1,23 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_admin_cms +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/rpc/open_im_admin_cms/main.go b/cmd/rpc/open_im_admin_cms/main.go new file mode 100644 index 000000000..c69135645 --- /dev/null +++ b/cmd/rpc/open_im_admin_cms/main.go @@ -0,0 +1,15 @@ +package main + +import ( + rpcMessageCMS "Open_IM/internal/rpc/admin_cms" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 11000, "rpc listening port") + flag.Parse() + fmt.Println("start cms rpc server, port: ", *rpcPort) + rpcServer := rpcMessageCMS.NewAdminCMSServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/rpc/open_im_auth/Makefile b/cmd/rpc/open_im_auth/Makefile new file mode 100644 index 000000000..da280c3b5 --- /dev/null +++ b/cmd/rpc/open_im_auth/Makefile @@ -0,0 +1,24 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_auth +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/rpc/open_im_auth/main.go b/cmd/rpc/open_im_auth/main.go new file mode 100644 index 000000000..53b0f9de5 --- /dev/null +++ b/cmd/rpc/open_im_auth/main.go @@ -0,0 +1,16 @@ +package main + +import ( + rpcAuth "Open_IM/internal/rpc/auth" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 10600, "RpcToken default listen port 10800") + flag.Parse() + fmt.Println("start auth rpc server, port: ", *rpcPort) + rpcServer := rpcAuth.NewRpcAuthServer(*rpcPort) + rpcServer.Run() + +} diff --git a/cmd/rpc/open_im_friend/Makefile b/cmd/rpc/open_im_friend/Makefile new file mode 100644 index 000000000..c47cbcf1d --- /dev/null +++ b/cmd/rpc/open_im_friend/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_friend +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/rpc/open_im_friend/main.go b/cmd/rpc/open_im_friend/main.go new file mode 100644 index 000000000..85d05e39c --- /dev/null +++ b/cmd/rpc/open_im_friend/main.go @@ -0,0 +1,16 @@ +package main + +import ( + "Open_IM/internal/rpc/friend" + "flag" + "fmt" +) + +func main() { + + rpcPort := flag.Int("port", 10200, "get RpcFriendPort from cmd,default 12000 as port") + flag.Parse() + fmt.Println("start friend rpc server, port: ", *rpcPort) + rpcServer := friend.NewFriendServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/rpc/open_im_group/Makefile b/cmd/rpc/open_im_group/Makefile new file mode 100644 index 000000000..e7d1cb29d --- /dev/null +++ b/cmd/rpc/open_im_group/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_group +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/rpc/open_im_group/main.go b/cmd/rpc/open_im_group/main.go new file mode 100644 index 000000000..7afc7ec57 --- /dev/null +++ b/cmd/rpc/open_im_group/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "Open_IM/internal/rpc/group" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 10500, "get RpcGroupPort from cmd,default 16000 as port") + flag.Parse() + fmt.Println("start group rpc server, port: ", *rpcPort) + rpcServer := group.NewGroupServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/rpc/open_im_message_cms/Makefile b/cmd/rpc/open_im_message_cms/Makefile new file mode 100644 index 000000000..4ac4cba3a --- /dev/null +++ b/cmd/rpc/open_im_message_cms/Makefile @@ -0,0 +1,23 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_message_cms +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/rpc/open_im_message_cms/main.go b/cmd/rpc/open_im_message_cms/main.go new file mode 100644 index 000000000..16151a2ed --- /dev/null +++ b/cmd/rpc/open_im_message_cms/main.go @@ -0,0 +1,15 @@ +package main + +import ( + rpcMessageCMS "Open_IM/internal/rpc/message_cms" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 10900, "rpc listening port") + flag.Parse() + fmt.Println("start msg cms rpc server, port: ", *rpcPort) + rpcServer := rpcMessageCMS.NewMessageCMSServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/rpc/open_im_msg/Makefile b/cmd/rpc/open_im_msg/Makefile new file mode 100644 index 000000000..7214d3fe1 --- /dev/null +++ b/cmd/rpc/open_im_msg/Makefile @@ -0,0 +1,23 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_msg +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/rpc/open_im_msg/main.go b/cmd/rpc/open_im_msg/main.go new file mode 100644 index 000000000..95908f48a --- /dev/null +++ b/cmd/rpc/open_im_msg/main.go @@ -0,0 +1,15 @@ +package main + +import ( + rpcChat "Open_IM/internal/rpc/msg" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 10300, "rpc listening port") + flag.Parse() + fmt.Println("start msg rpc server, port: ", *rpcPort) + rpcServer := rpcChat.NewRpcChatServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/rpc/open_im_office/Makefile b/cmd/rpc/open_im_office/Makefile new file mode 100644 index 000000000..b86230c64 --- /dev/null +++ b/cmd/rpc/open_im_office/Makefile @@ -0,0 +1,23 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_office +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/rpc/open_im_office/main.go b/cmd/rpc/open_im_office/main.go new file mode 100644 index 000000000..c9a05c791 --- /dev/null +++ b/cmd/rpc/open_im_office/main.go @@ -0,0 +1,15 @@ +package main + +import ( + rpc "Open_IM/internal/rpc/office" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 11100, "rpc listening port") + flag.Parse() + fmt.Println("start office rpc server, port: ", *rpcPort) + rpcServer := rpc.NewOfficeServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/rpc/open_im_organization/Makefile b/cmd/rpc/open_im_organization/Makefile new file mode 100644 index 000000000..77d658db9 --- /dev/null +++ b/cmd/rpc/open_im_organization/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_organization +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/rpc/open_im_organization/main.go b/cmd/rpc/open_im_organization/main.go new file mode 100644 index 000000000..906ac510f --- /dev/null +++ b/cmd/rpc/open_im_organization/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "Open_IM/internal/rpc/organization" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 11200, "get RpcOrganizationPort from cmd,default 11200 as port") + flag.Parse() + fmt.Println("start organization rpc server, port: ", *rpcPort) + rpcServer := organization.NewServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/rpc/open_im_statistics/Makefile b/cmd/rpc/open_im_statistics/Makefile new file mode 100644 index 000000000..37dbb3efe --- /dev/null +++ b/cmd/rpc/open_im_statistics/Makefile @@ -0,0 +1,23 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_statistics +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/rpc/open_im_statistics/main.go b/cmd/rpc/open_im_statistics/main.go new file mode 100644 index 000000000..b87440abf --- /dev/null +++ b/cmd/rpc/open_im_statistics/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "Open_IM/internal/rpc/statistics" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 10800, "rpc listening port") + flag.Parse() + fmt.Println("start statistics rpc server, port: ", *rpcPort) + rpcServer := statistics.NewStatisticsServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/rpc/open_im_user/Makefile b/cmd/rpc/open_im_user/Makefile new file mode 100644 index 000000000..c379db284 --- /dev/null +++ b/cmd/rpc/open_im_user/Makefile @@ -0,0 +1,25 @@ +.PHONY: all build run gotool install clean help + +BINARY_NAME=open_im_user +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/rpc/open_im_user/main.go b/cmd/rpc/open_im_user/main.go new file mode 100644 index 000000000..d8644d028 --- /dev/null +++ b/cmd/rpc/open_im_user/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "Open_IM/internal/rpc/user" + "flag" + "fmt" +) + +func main() { + rpcPort := flag.Int("port", 10100, "rpc listening port") + flag.Parse() + fmt.Println("start user rpc server, port: ", *rpcPort) + rpcServer := user.NewUserServer(*rpcPort) + rpcServer.Run() +} diff --git a/cmd/test/main.go b/cmd/test/main.go new file mode 100644 index 000000000..87d5165f7 --- /dev/null +++ b/cmd/test/main.go @@ -0,0 +1,69 @@ +package main + +import ( + "Open_IM/pkg/utils" + "context" + "fmt" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "time" +) + +type MongoMsg struct { + UID string + Msg []string +} + + +func main() { + //"mongodb://%s:%s@%s/%s/?maxPoolSize=%d" + uri := "mongodb://user:pass@sample.host:27017/?maxPoolSize=20&w=majority" + DBAddress := "127.0.0.1:37017" + DBDatabase := "new-test-db" + Collection := "new-test-collection" + DBMaxPoolSize := 100 + uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", + DBAddress,DBDatabase, + DBMaxPoolSize) + + mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) + if err != nil { + panic(err) + } + filter := bson.M{"uid":"my_uid"} + ctx, _ := context.WithTimeout(context.Background(), 30*time.Second) + for i:=0; i < 2; i++{ + + if err = mongoClient.Database(DBDatabase).Collection(Collection).FindOneAndUpdate(ctx, filter, + bson.M{"$push": bson.M{"msg": utils.Int32ToString(int32(i))}}).Err(); err != nil{ + fmt.Println("FindOneAndUpdate failed ", i, ) + var mmsg MongoMsg + mmsg.UID = "my_uid" + mmsg.Msg = append(mmsg.Msg, utils.Int32ToString(int32(i))) + _, err := mongoClient.Database(DBDatabase).Collection(Collection).InsertOne(ctx, &mmsg) + if err != nil { + fmt.Println("insertone failed ", err.Error(), i) + } else{ + fmt.Println("insertone ok ", i) + } + + }else { + fmt.Println("FindOneAndUpdate ok ", i) + } + + } + + var mmsg MongoMsg + + if err = mongoClient.Database(DBDatabase).Collection(Collection).FindOne(ctx, filter).Decode(&mmsg); err != nil { + fmt.Println("findone failed ", err.Error()) + }else{ + fmt.Println("findone ok ", mmsg.UID) + for i, v:=range mmsg.Msg{ + fmt.Println("find value: ", i, v) + } + } + + +} diff --git a/config/config.yaml b/config/config.yaml new file mode 100644 index 000000000..d61292bdc --- /dev/null +++ b/config/config.yaml @@ -0,0 +1,609 @@ +# 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: 2.0.0 +#---------------Infrastructure configuration---------------------# +etcd: + etcdSchema: openIM #默认即可 + etcdAddr: [ 127.0.0.1:2379 ] #单机部署时,默认即可 + +mysql: + dbMysqlAddress: [ 127.0.0.1:13306 ] #mysql地址 目前仅支持单机,默认即可 + dbMysqlUserName: root #mysql用户名,建议修改 + dbMysqlPassword: openIM # mysql密码,建议修改 + dbMysqlDatabaseName: openIM_v2 #默认即可 + dbTableName: eMsg #默认即可 + dbMsgTableNum: 1 + dbMaxOpenConns: 20 + dbMaxIdleConns: 10 + dbMaxLifeTime: 120 + +mongo: + dbUri: ""#当dbUri值不为空则直接使用该值 + dbAddress: [ 127.0.0.1:37017 ] #mongo地址 目前仅支持单机,默认即可 + dbDirect: false + dbTimeout: 10 + dbDatabase: openIM #mongo db 默认即可 + dbSource: admin + dbUserName: #mongo用户名,建议先不设置 + dbPassword: #mongo密码,建议先不设置 + dbMaxPoolSize: 20 + dbRetainChatRecords: 3650 #mongo保存离线消息时间(天),根据需求修改 + +redis: + dbAddress: 127.0.0.1:16379 #redis地址 目前仅支持单机,默认即可 + dbMaxIdle: 128 + dbMaxActive: 0 + dbIdleTimeout: 120 + dbPassWord: openIM #redis密码 建议修改 + +kafka: + ws2mschat: + addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 + topic: "ws2ms_chat" + ms2pschat: + addr: [ 127.0.0.1:9092 ] #kafka配置,默认即可 + 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 +#如果是单机模式,用0.0.0.0或者不填,默认即可 +serverip: 0.0.0.0 + +# endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问 +endpoints: + api: openim_api + cmsapi: openim_cms_api + push: openim_push + msg_gateway: openim_msg_gateway + rpc_auth: openim_rpc_auth + rpc_friend: openim_rpc_friend + rpc_group: openim_rpc_group + rpc_msg: openim_rpc_msg + rpc_user: openim_rpc_user + rpc_statistic: openim_rpc_statistic + rpc_admin_cms: openim_rpc_admin_cms + rpc_message_cms: openim_rpc_admin_cms + rpc_office: openim_rpc_office + +api: + openImApiPort: [ 10000 ] #api服务端口,默认即可,需要开放此端口或做nginx转发 +cmsapi: + openImCmsApiPort: [ 8000 ] #管理后台api服务端口,默认即可,需要开放此端口或做nginx转发 +sdk: + openImSdkWsPort: [ 30000 ] #jssdk服务端口,默认即可,项目中使用jssdk才需开放此端口或做nginx转发 +#对象存储服务,以下配置二选一,目前支持两种,腾讯云和minio,二者配置好其中一种即可(如果使用minio参考https://doc.rentsoft.cn/#/qa/minio搭建minio服务器) +credential: #腾讯cos,发送图片、视频、文件时需要,请自行申请后替换,必须修改 + tencent: + appID: 1302656840 + region: ap-chengdu + bucket: echat-1302656840 + secretID: AKIDGNYVChzIQinu7QEgtNp0hnNgqcV8vZTC + secretKey: kz15vW83qM6dBUWIq681eBZA0c0vlIbe + minio: #MinIO 发送图片、视频、文件时需要,请自行申请后替换,必须修改。 客户端初始化InitSDK,中 object_storage参数为minio + bucket: openim + location: us-east-1 + endpoint: http://127.0.0.1:9000 + endpointInner: http://127.0.0.1:9000 #minio内网地址 + endpointInnerEnable: true #是否启用minio内网地址 启用可以让桶初始化,IM server连接minio走内网地址访问 + accessKeyID: user12345 + secretAccessKey: key12345 + ali: # ali oss + regionID: "oss-cn-beijing" + accessKeyID: "" + accessKeySecret: "" + stsEndpoint: "sts.cn-beijing.aliyun.com" + ossEndpoint: "oss-cn-beijing.aliyuncs.com" + bucket: "bucket1" + finalHost: "http://bucket1.oss-cn-beijing.aliyuncs.com" + stsDurationSeconds: 3600 + OssRoleArn: "acs:ram::xxx:role/xxx" + + + +rpcport: #rpc服务端口 默认即可 + openImUserPort: [ 10100 ] + openImFriendPort: [ 10200 ] + openImOfflineMessagePort: [ 10300 ] + openImOnlineRelayPort: [ 10400 ] + openImGroupPort: [ 10500 ] + openImAuthPort: [ 10600 ] + openImPushPort: [ 10700 ] + openImStatisticsPort: [ 10800 ] + openImMessageCmsPort: [ 10900 ] + openImAdminCmsPort: [ 11000 ] + openImOfficePort: [ 11100 ] + openImOrganizationPort: [ 11200 ] + c2c: + callbackBeforeSendMsg: + switch: false + timeoutStrategy: 1 #1:send + callbackAfterSendMsg: + switch: false + state: + stateChange: + switch: false + +rpcregistername: #rpc注册服务名,默认即可 + openImUserName: User + openImFriendName: Friend + openImOfflineMessageName: OfflineMessage + openImPushName: Push + openImOnlineMessageRelayName: OnlineMessageRelay + openImGroupName: Group + openImAuthName: Auth + OpenImStatisticsName: Statistics + OpenImMessageCMSName: MessageCMS + openImAdminCMSName: AdminCMS + openImOfficeName: Office + openImOrganizationName: Organization + +log: + storageLocation: ../logs/ + rotationTime: 24 + remainRotationCount: 3 #日志数量 + #日志级别 6表示全都打印,测试阶段建议设置为6 + remainLogLevel: 6 + elasticSearchSwitch: false + elasticSearchAddr: [ 127.0.0.1:9201 ] + elasticSearchUser: "" + elasticSearchPassword: "" + +modulename: #日志文件按模块命名,默认即可 + longConnSvrName: msg_gateway + msgTransferName: msg_transfer + pushName: push + +longconnsvr: + openImWsPort: [ 17778 ] # ws服务端口,默认即可,要开放此端口或做nginx转发 + websocketMaxConnNum: 10000 + websocketMaxMsgLen: 4096 + websocketTimeOut: 10 + +## 推送只能开启一个 enable代表开启 +push: + tpns: #腾讯推送,暂未测试 暂不要使用 + ios: + accessID: 1600018281 + secretKey: 3cd68a77a95b89e5089a1aca523f318f + android: + accessID: 111 + secretKey: 111 + enable: false + jpns: #极光推送 在极光后台申请后,修改以下四项,必须修改 + appKey: cf47465a368f24c659608e7e + masterSecret: 02204efe3f3832947a236ee5 + pushUrl: "https://api.jpush.cn/v3/push" + pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" + enable: true + getui: #个推推送,暂未测试 暂不要使用 + pushUrl: "https://restapi.getui.com/v2/$appId" + masterSecret: "" + appKey: "" + intent: "" + enable: false + + + +manager: + #app管理员userID和对应的secret 建议修改。 用于管理后台登录,也可以用户管理后台对应的api + appManagerUid: [ "openIM123456","openIM654321", "openIM333", "openIMAdmin"] + secrets: [ "openIM1","openIM2", "openIM333", "openIMAdmin"] + +secret: tuoyun +# 多端互踢策略 +# 1:多平台登录:Android、iOS、Windows、Mac 每种平台只能一个在线,web端可以多个同时在线 +multiloginpolicy: 1 + +#token config +tokenpolicy: + accessSecret: "open_im_server" #token生成相关,默认即可 + # Token effective time day as a unit + accessExpire: 3650 #token过期时间(天) 默认即可 +messageverify: + friendVerify: false + +# c2c: +# callbackBeforeSendMsg: +# switch: false +# timeoutStrategy: 1 #1:send +# callbackAfterSendMsg: +# switch: false +# state: +# stateChange: +# switch: false +#ios系统推送声音以及标记计数 +iospush: + pushSound: "xxx" + badgeCount: true + +callback: + # callback url 需要自行更换callback url + callbackUrl : "http://127.0.0.1:8080/callback" + # 开启关闭操作前后回调的配置 + callbackbeforeSendSingleMsg: + enable: false # 回调是否启用 + callbackTimeOut: 2 # 回调超时时间 + callbackFailedContinue: true # 回调超时是否继续执行代码 + callbackAfterSendSingleMsg: + enable: false + callbackTimeOut: 2 + callbackBeforeSendGroupMsg: + enable: false + callbackTimeOut: 2 + callbackFailedContinue: true + callbackAfterSendGroupMsg: + enable: false + callbackTimeOut: 2 + callbackWordFilter: + enable: false + callbackTimeOut: 2 + callbackFailedContinue: true + + +notification: + groupCreated: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: true + title: "create group title" # xx create the group + desc: "create group desc" + ext: "create group ext" + defaultTips: + tips: "create the group" # xx create the group + + groupInfoSet: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "groupInfoSet title" + desc: "groupInfoSet desc" + ext: "groupInfoSet ext" + defaultTips: + tips: "modified the group profile" # group info changed by xx + + joinGroupApplication: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: false + title: "joinGroupApplication title" + desc: "joinGroupApplication desc" + ext: "joinGroupApplication ext" + defaultTips: + tips: "apply to join the group" # group info changed by xx + + memberQuit: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "memberQuit title" + desc: "memberQuit desc" + ext: "memberQuit ext" + defaultTips: + tips: "quit group chat" # group info changed by xx + + groupApplicationAccepted: + conversation: + reliabilityLevel: 2 + unreadCount: true + offlinePush: + switch: false + title: "groupApplicationAccepted title" + desc: "groupApplicationAccepted desc" + ext: "groupApplicationAccepted ext" + defaultTips: + tips: "was allowed to join the group" # group info changed by xx + + groupApplicationRejected: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: false + title: " title" + desc: " desc" + ext: " ext" + defaultTips: + tips: "was rejected into the group" # group info changed by xx + + groupOwnerTransferred: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "groupOwnerTransferred title" + desc: "groupOwnerTransferred desc" + ext: "groupOwnerTransferred ext" + defaultTips: + tips: "become a new group owner" # group info changed by xx + + memberKicked: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "memberKicked title" + desc: "memberKicked desc" + ext: "memberKicked ext" + defaultTips: + tips: "was kicked out of the group" # group info changed by xx + + memberInvited: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "memberInvited title" + desc: "memberInvited desc" + ext: "memberInvited ext" + defaultTips: + tips: "was invited into the group" # group info changed by xx + + memberEnter: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "memberEnter title" + desc: "memberEnter desc" + ext: "memberEnter ext" + defaultTips: + tips: "entered the group" # group info changed by xx + + groupDismissed: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "groupDismissed title" + desc: "groupDismissed desc" + ext: "groupDismissed ext" + defaultTips: + tips: "group dismissed" + + + groupMuted: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "groupMuted title" + desc: "groupMuted desc" + ext: "groupMuted ext" + defaultTips: + tips: "group Muted" + + groupCancelMuted: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "groupCancelMuted title" + desc: "groupCancelMuted desc" + ext: "groupCancelMuted ext" + defaultTips: + tips: "group Cancel Muted" + + + groupMemberMuted: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "groupMemberMuted title" + desc: "groupMemberMuted desc" + ext: "groupMemberMuted ext" + defaultTips: + tips: "group Member Muted" + + groupMemberCancelMuted: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: false + title: "groupMemberCancelMuted title" + desc: "groupMemberCancelMuted desc" + ext: "groupMemberCancelMuted ext" + defaultTips: + tips: "group Member Cancel Muted" + #############################friend################################# + + friendApplicationAdded: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Somebody applies to add you as a friend" + desc: "Somebody applies to add you as a friend" + ext: "Somebody applies to add you as a friend" + defaultTips: + tips: "I applies to add you as a friend" # + + friendApplicationApproved: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Someone applies to add your friend application" + desc: "Someone applies to add your friend application" + ext: "Someone applies to add your friend application" + defaultTips: + tips: "I applies to add your friend application" # + + + friendApplicationRejected: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Someone rejected your friend application" + desc: "Someone rejected your friend application" + ext: "Someone rejected your friend application" + defaultTips: + tips: "I rejected your friend application" # + + + + + + friendAdded: + conversation: + reliabilityLevel: 3 + unreadCount: true + offlinePush: + switch: true + title: "We have become friends" + desc: "We have become friends" + ext: "We have become friends" + defaultTips: + tips: "We have become friends" # + + + + friendDeleted: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "deleted a friend" + desc: "deleted a friend" + ext: "deleted a friend" + defaultTips: + tips: "deleted a friend" # + + + friendRemarkSet: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Your friend's profile has been changed" + desc: "Your friend's profile has been changed" + ext: "Your friend's profile has been changed" + defaultTips: + tips: "Your friend's profile has been changed" # + + + + blackAdded: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "blocked a user" + desc: "blocked a user" + ext: "blocked a user" + defaultTips: + tips: "blocked a user" # + + + blackDeleted: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Remove a blocked user" + desc: "Remove a blocked user" + ext: "Remove a blocked user" + defaultTips: + tips: "Remove a blocked user" + + #####################user######################### + userInfoUpdated: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "Remove a blocked user" + desc: "Remove a blocked user" + ext: "Remove a blocked user" + defaultTips: + tips: "remove a blocked user" + + #####################conversation######################### + conversationOptUpdate: + conversation: + reliabilityLevel: 2 + unreadCount: false + offlinePush: + switch: true + title: "conversation opt update" + desc: "conversation opt update" + ext: "conversation opt update" + defaultTips: + tips: "conversation opt update" + + conversationSetPrivate: + conversation: + reliabilityLevel: 2 + unreadCount: true + offlinePush: + switch: true + title: "burn after reading" + desc: "burn after reading" + ext: "burn after reading" + defaultTips: + openTips: "burn after reading was opened" + closeTips: "burn after reading was closed" + + + +#---------------demo configuration---------------------# +#The following configuration items are applied to openIM Demo configuration +#是否启动demo,如果自身没有账号体系,设置为true +demoswitch: true +demo: + #demo对外服务端口,默认即可,需要开放此端口或做nginx转发 + openImDemoPort: [ 42233 ] + alismsverify: #阿里云短信配置,在阿里云申请成功后修改以下四项,必须修改 + accessKeyId: LTAI5tJPkn4HuuePdiLdGqe7 + accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV + signName: 托云信息技术 + verificationCodeTemplateCode: SMS_226810164 + superCode: 666666 #超级验证码,建议修改掉,收不到短信验证码时可以用此替代 + # second + codeTTL: 300 + mail: #仅支持qq邮箱,具体操作参考 https://service.mail.qq.com/cgi-bin/help?subtype=1&id=28&no=1001256 必须修改 + title: "openIM" + senderMail: "765567899@qq.com" + senderAuthorizationCode: "gxyausfoevlzbfag" + smtpAddr: "smtp.qq.com" + smtpPort: 25 #需开放此端口 出口方向 + +rtc: + port: 11300 + address: 127.0.0.1 \ No newline at end of file diff --git a/deploy.Dockerfile b/deploy.Dockerfile new file mode 100644 index 000000000..1738bda80 --- /dev/null +++ b/deploy.Dockerfile @@ -0,0 +1,39 @@ +FROM golang as build + +# go mod Installation source, container environment variable addition will override the default variable value +ENV GO111MODULE=on +ENV GOPROXY=https://goproxy.cn,direct + +# Set up the working directory +WORKDIR /Open-IM-Server +# add all files to the container +COPY . . + +WORKDIR /Open-IM-Server/script +RUN chmod +x *.sh + +RUN /bin/sh -c ./build_all_service.sh + +#Blank image Multi-Stage Build +FROM ubuntu + +RUN rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\ +&&apt-get install net-tools +#Non-interactive operation +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get install -y vim curl tzdata gawk +#Time zone adjusted to East eighth District +RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata + + +#set directory to map logs,config file,script file. +VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"] + +#Copy scripts files and binary files to the blank image +COPY --from=build /Open-IM-Server/script /Open-IM-Server/script +COPY --from=build /Open-IM-Server/bin /Open-IM-Server/bin + +WORKDIR /Open-IM-Server/script + +CMD ["./docker_start_all.sh"] diff --git a/deploy/.dockerignore b/deploy/.dockerignore new file mode 100644 index 000000000..019893ce7 --- /dev/null +++ b/deploy/.dockerignore @@ -0,0 +1,6 @@ +# 先设为忽略所有内容 +**/** + + +# 然后逐个排除 +!open_im_* \ No newline at end of file diff --git a/deploy/Makefile b/deploy/Makefile new file mode 100644 index 000000000..8250a06a4 --- /dev/null +++ b/deploy/Makefile @@ -0,0 +1,158 @@ + +GREEN_PREFIX="\033[32m" +COLOR_SUFFIX="\033[0m" +SKY_BLUE_PREFIX="\033[36m" + + +# 编译所有需要的组件源码 +win-build-all: + go env -w GOOS=linux + + make build-api && make build-msg-gateway && make build-msg-transfer && make build-push && make build-timer-task + make build-rpc-user && make build-rpc-friend && make build-rpc-group && make build-rpc-msg && make build-rpc-auth + make build-demo + + go env -w GOOS=windows + +# 编译 open_im_api +build-api: + echo -e ${GREEN_PREFIX} "open_im_api building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_api ../cmd/open_im_api/main.go + echo -e ${GREEN_PREFIX} "open_im_api build ok" ${COLOR_SUFFIX} + +# 编译 open_im_msg_gateway +build-msg-gateway: + echo -e ${GREEN_PREFIX} "open_im_msg_gateway building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_msg_gateway ../cmd/open_im_msg_gateway/main.go + echo -e ${GREEN_PREFIX} "open_im_msg_gateway build ok" ${COLOR_SUFFIX} + +# 编译 open_im_msg_transfer +build-msg-transfer: + echo -e ${GREEN_PREFIX} "open_im_msg_transfer building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_msg_transfer ../cmd/open_im_msg_transfer/main.go + echo -e ${GREEN_PREFIX} "open_im_msg_transfer build ok" ${COLOR_SUFFIX} + +# 编译 open_im_push +build-push: + echo -e ${GREEN_PREFIX} "open_im_push building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_push ../cmd/open_im_push/main.go + echo -e ${GREEN_PREFIX} "open_im_push build ok" ${COLOR_SUFFIX} + +# 编译 open_im_timer_task +build-timer-task: + echo -e ${GREEN_PREFIX} "open_im_timer_task building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_timer_task ../cmd/open_im_timer_task/main.go + echo -e ${GREEN_PREFIX} "open_im_timer_task build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-user +build-rpc-user: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_user building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_user ../cmd/rpc/open_im_user/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_user build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-friend +build-rpc-friend: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_friend building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_friend ../cmd/rpc/open_im_friend/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_friend build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-group +build-rpc-group: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_group building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_group ../cmd/rpc/open_im_group/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_group build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-auth +build-rpc-auth: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_auth building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_auth ../cmd/rpc/open_im_auth/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_auth build ok" ${COLOR_SUFFIX} + +# 编译 build-rpc-msg +build-rpc-msg: + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_msg building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_rpc_msg ../cmd/rpc/open_im_msg/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_rpc_msg build ok" ${COLOR_SUFFIX} + +# 编译 open_im_demo +build-demo: + echo -e ${SKY_BLUE_PREFIX} "open_im_demo building..." ${COLOR_SUFFIX} + go build -ldflags="-w -s" -o open_im_demo ../cmd/open_im_demo/main.go + echo -e ${SKY_BLUE_PREFIX} "open_im_demo build ok" ${COLOR_SUFFIX} + +# 打包所有组件为镜像 +image-all: + make image-api && make image-msg-gateway && make image-msg-transfer & make image-push && make image-timer-task + make image-rpc-user && make image-rpc-friend && make image-rpc-group && make image-rpc-msg && make image-rpc-auth + make image-demo + +# 打包 open_im_api +image-api: + echo -e ${GREEN_PREFIX} "IMAGE:openim/api building..." ${COLOR_SUFFIX} + docker build -t openim/api:latest -f ./dockerfiles/Dockerfile.api . + echo -e ${GREEN_PREFIX} "IMAGE:openim/api build ok" ${COLOR_SUFFIX} + +# 打包 open_im_msg_gateway +image-msg-gateway: + echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_gateway building..." ${COLOR_SUFFIX} + docker build -t openim/msg_gateway:latest -f ./dockerfiles/Dockerfile.msg_gateway . + echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_gateway build ok" ${COLOR_SUFFIX} + +# 打包 open_im_msg_transfer +image-msg-transfer: + echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_transfer building..." ${COLOR_SUFFIX} + docker build -t openim/msg_transfer:latest -f ./dockerfiles/Dockerfile.msg_transfer . + echo -e ${GREEN_PREFIX} "IMAGE:openim/msg_transfer build ok" ${COLOR_SUFFIX} + +# 打包 open_im_push +image-push: + echo -e ${GREEN_PREFIX} "IMAGE:openim/push building..." ${COLOR_SUFFIX} + docker build -t openim/push:latest -f ./dockerfiles/Dockerfile.push . + echo -e ${GREEN_PREFIX} "IMAGE:openim/push build ok" ${COLOR_SUFFIX} + +# 打包 open_im_timer_task +image-timer-task: + echo -e ${GREEN_PREFIX} "IMAGE:openim/timer_task building..." ${COLOR_SUFFIX} + docker build -t openim/timer_task:latest -f ./dockerfiles/Dockerfile.timer_task . + echo -e ${GREEN_PREFIX} "IMAGE:openim/timer_task build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-user +image-rpc-user: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_user building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_user:latest -f ./dockerfiles/Dockerfile.rpc_user . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_user build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-friend +image-rpc-friend: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_friend building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_friend:latest -f ./dockerfiles/Dockerfile.rpc_friend . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_friend build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-group +image-rpc-group: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_group building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_group:latest -f ./dockerfiles/Dockerfile.rpc_group . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_group build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-auth +image-rpc-auth: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_auth building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_auth:latest -f ./dockerfiles/Dockerfile.rpc_auth . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_auth build ok" ${COLOR_SUFFIX} + +# 打包 build-rpc-msg +image-rpc-msg: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_msg building..." ${COLOR_SUFFIX} + docker build -t openim/rpc_msg:latest -f ./dockerfiles/Dockerfile.rpc_msg . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/rpc_msg build ok" ${COLOR_SUFFIX} + +# 打包 open_im_demo +image-demo: + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/demo building..." ${COLOR_SUFFIX} + docker build -t openim/demo:latest -f ./dockerfiles/Dockerfile.demo . + echo -e ${SKY_BLUE_PREFIX} "IMAGE:openim/demo build ok" ${COLOR_SUFFIX} + +.PHONY: win-build-all build-api build-msg-gateway build-msg-transfer build-push + build-timer-task build-rpc-user build-rpc-friend build-rpc-group build-rpc-msg build-demo + image-all image-api image-msg-gateway image-msg-transfer image-push + image-timer-task image-rpc-user image-rpc-friend image-rpc-group image-rpc-msg image-demo diff --git a/deploy/config.example.yaml b/deploy/config.example.yaml new file mode 100644 index 000000000..08d8858e4 --- /dev/null +++ b/deploy/config.example.yaml @@ -0,0 +1,183 @@ +# 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: [ openim_etcd:2379 ] + +mysql: + dbMysqlAddress: [ openim_mysql:3306 ] # openim_mysql 是对应的mysql服务的host + dbMysqlUserName: openIM + dbMysqlPassword: openIM + dbMysqlDatabaseName: openIM + dbTableName: eMsg + dbMsgTableNum: 1 + dbMaxOpenConns: 20 + dbMaxIdleConns: 10 + dbMaxLifeTime: 120 + +mongo: + dbUri: ""#当dbUri值不为空则直接使用该值 + dbAddress: [ openim_mongo:27017 ] + dbDirect: false + dbTimeout: 10 + dbDatabase: openIM + dbSource: admin + dbUserName: + dbPassword: + dbMaxPoolSize: 20 + dbRetainChatRecords: 7 + +redis: + dbAddress: openim_redis:6379 + dbMaxIdle: 128 + dbMaxActive: 0 + dbIdleTimeout: 120 + dbPassWord: openIM + +kafka: + ws2mschat: + addr: [ openim_kafka:9092 ] + topic: "ws2ms_chat" + ms2pschat: + addr: [ openim_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: 0.0.0.0 + +# endpoints 内部组件间访问的端点host名称,访问时,可以内部直接访问 host:port 来访问 +# 新增的这一段配置节,主要是位了注册到etcd时,可以使用同一network下的容器名(host)来访问不同的容器,拆分到不同容器后原来全部使用serverip的形式不能用了 +endpoints: + api: openim_api + push: openim_push + msg_gateway: openim_msg_gateway + rpc_auth: openim_rpc_auth + rpc_friend: openim_rpc_friend + rpc_group: openim_rpc_group + rpc_msg: openim_rpc_msg + rpc_user: openim_rpc_user + +api: + openImApiPort: [ 10000 ] +sdk: + openImSdkWsPort: [ 30000 ] +cmsapi: + openImCmsApiPort: [ 8000 ] + +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 ] + openImStatisticsPort: [ 10800 ] + openImMessageCmsPort: [ 10900 ] + openImAdminCmsPort: [ 11000 ] + +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: cf47465a368f24c659608e7e + masterSecret: 02204efe3f3832947a236ee5 + pushUrl: "https://api.jpush.cn/v3/push" + pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" +manager: + appManagerUid: ["openIM123456","openIM654321"] + secrets: ["openIM1","openIM2"] + +secret: tuoyun + +multiloginpolicy: 1 + +#token config +tokenpolicy: + accessSecret: "open_im_server" + # Token effective time day as a unit + accessExpire: 7 + +messagecallback: + callbackSwitch: false + callbackUrl: "http://www.xxx.com/msg/judge" + #TimeOut use second as unit + callbackTimeOut: 10 + + +#---------------demo configuration---------------------# +#The following configuration items are applied to openIM Demo configuration +demoswitch: true +demo: + openImDemoPort: [ 42233 ] + alismsverify: + accessKeyId: LTAI5tJPkn4HuuePdiLdGqe71 + accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV1 + signName: OpenIM Corporation + verificationCodeTemplateCode: SMS_2268101641 + superCode: 666666 + mail: + title: "openIM" + senderMail: "1765567899@qq.com" + senderAuthorizationCode: "1gxyausfoevlzbfag" + smtpAddr: "smtp.qq.com" + smtpPort: 25 + + diff --git a/deploy/dockerfiles/Dockerfile.api b/deploy/dockerfiles/Dockerfile.api new file mode 100644 index 000000000..9c70d735d --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.api @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_api $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.demo b/deploy/dockerfiles/Dockerfile.demo new file mode 100644 index 000000000..ac77ad8d3 --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.demo @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_demo $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.msg_gateway b/deploy/dockerfiles/Dockerfile.msg_gateway new file mode 100644 index 000000000..ffd012bc4 --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.msg_gateway @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_msg_gateway $WORKDIR/main + +# 创建用于挂载的几个目录,重命名可执行文件为 main,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.msg_transfer b/deploy/dockerfiles/Dockerfile.msg_transfer new file mode 100644 index 000000000..a82c4da8b --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.msg_transfer @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_msg_transfer $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.push b/deploy/dockerfiles/Dockerfile.push new file mode 100644 index 000000000..b929dd82c --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.push @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_push $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_auth b/deploy/dockerfiles/Dockerfile.rpc_auth new file mode 100644 index 000000000..a8e50fdb1 --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_auth @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_auth $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_friend b/deploy/dockerfiles/Dockerfile.rpc_friend new file mode 100644 index 000000000..cfa2fe18c --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_friend @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_friend $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_group b/deploy/dockerfiles/Dockerfile.rpc_group new file mode 100644 index 000000000..d56a0fefe --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_group @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_group $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_msg b/deploy/dockerfiles/Dockerfile.rpc_msg new file mode 100644 index 000000000..01b5de02f --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_msg @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_msg $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.rpc_user b/deploy/dockerfiles/Dockerfile.rpc_user new file mode 100644 index 000000000..5be6298bd --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.rpc_user @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_rpc_user $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/dockerfiles/Dockerfile.timer_task b/deploy/dockerfiles/Dockerfile.timer_task new file mode 100644 index 000000000..0c2222cfb --- /dev/null +++ b/deploy/dockerfiles/Dockerfile.timer_task @@ -0,0 +1,16 @@ +FROM alpine:3.13 + +# 设置固定的项目路径 +ENV WORKDIR /app +ENV CONFIG_NAME $WORKDIR/config/config.yaml + +# 将可执行文件复制到目标目录 +ADD ./open_im_timer_task $WORKDIR/main + +# 创建用于挂载的几个目录,添加可执行权限 +RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/db && \ + chmod +x $WORKDIR/main + + +WORKDIR $WORKDIR +CMD ./main \ No newline at end of file diff --git a/deploy/env.yaml b/deploy/env.yaml new file mode 100644 index 000000000..423807e4f --- /dev/null +++ b/deploy/env.yaml @@ -0,0 +1,101 @@ +version: "3.7" +networks: + openim: + external: true + +services: + mysql: + networks: + - openim + image: mysql:5.7 + # ports: + # #- 13306:3306 + # - 23306:33060 + container_name: openim_mysql + volumes: + - ./components/mysql/data:/var/lib/mysql + - /etc/localtime:/etc/localtime + environment: + MYSQL_ROOT_PASSWORD: openIM + restart: always + + mongodb: + networks: + - openim + image: mongo:4.4.5-bionic + # ports: + # - 37017:27017 + container_name: openim_mongo + volumes: + - ./components/mongodb/data/db:/data/db + - ./components/mongodb/data/logs:/data/logs + - ./components/mongodb/data/conf:/etc/mongo + environment: + TZ: Asia/Shanghai + # - MONGO_INITDB_ROOT_USERNAME=openIM + # - MONGO_INITDB_ROOT_PASSWORD=openIM + restart: always + + redis: + networks: + - openim + image: redis:6.2.4-alpine + # ports: + # - 16379:6379 + container_name: openim_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: + networks: + - openim + image: wurstmeister/zookeeper + # ports: + # - 2181:2181 + container_name: openim_zookeeper + volumes: + - /etc/localtime:/etc/localtime + environment: + TZ: Asia/Shanghai + restart: always + + kafka: + networks: + - openim + image: wurstmeister/kafka + container_name: openim_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://0.0.0.0:9092 + depends_on: + - zookeeper + + etcd: + networks: + - openim + image: quay.io/coreos/etcd + # ports: + # - 2379:2379 + # - 2380:2380 + container_name: openim_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/deploy/openim.yaml b/deploy/openim.yaml new file mode 100644 index 000000000..350729399 --- /dev/null +++ b/deploy/openim.yaml @@ -0,0 +1,223 @@ +version: "3.7" +networks: + openim: + external: true + +services: + api: + networks: + - openim + image: openim/api + container_name: openim_api + ports: + - 10000:10000 # API,必须开 + volumes: + - ./logs:/app/logs + # Dockerfile 里定义了配置文件的路径环境变量,CONFIG_NAME,默认指向了 /app/config/config.yaml + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + msg_gateway: + networks: + - openim + image: openim/msg_gateway + container_name: openim_msg_gateway + ports: + - 17778:17778 # 消息,必须开 + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + msg_transfer: + networks: + - openim + image: openim/msg_transfer + container_name: openim_msg_transfer + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + push: + networks: + - openim + image: openim/push + container_name: openim_push + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + timer_task: + networks: + - openim + image: openim/timer_task + container_name: openim_timer_task + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + rpc_user: + networks: + - openim + image: openim/rpc_user + container_name: openim_rpc_user + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" + + rpc_friend: + networks: + - openim + image: openim/rpc_friend + container_name: openim_rpc_friend + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + + rpc_group: + networks: + - openim + image: openim/rpc_group + container_name: openim_rpc_group + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + + rpc_auth: + networks: + - openim + image: openim/rpc_auth + container_name: openim_rpc_auth + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + + rpc_msg: + networks: + - openim + image: openim/rpc_msg + container_name: openim_rpc_msg + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always + # depends_on: + # - kafka + # # - mysql + # # - mongodb + # - redis + # - etcd + + demo: + networks: + - openim + image: openim/demo + container_name: openim_demo + ports: + - 42233:42233 + volumes: + - ./logs:/app/logs + - ./config/config.yaml:/app/config/config.yaml + - ./db/sdk:/app/db/sdk + restart: always \ No newline at end of file diff --git a/deploy/readme.md b/deploy/readme.md new file mode 100644 index 000000000..61fbd9700 --- /dev/null +++ b/deploy/readme.md @@ -0,0 +1,30 @@ + +### 以docker-compose 形式单独部署 +```sh +# 查看 ./Makefile ,先编译各个需要的源码到 ../bin +# win-* 表示在win平台编译位linux二进制,其实就是处理了 go env -w GOOS=linux +make win-build-all + +# 得到各个二进制程序之后,打包为镜像 +# 目前没有处理 Open-IM-SDK-Core ,需要的话可以自己单独处理这个模块 +make image-all + +# docker-compose.yaml 分成了两部分,一部分是openIM的镜像容器 openim.yaml,一部分是依赖的环境 env.yaml +# 两部分使用一个外部的网络来联通,所以首先创建用到的 network +docker network create openim --attachable=true -d bridge + +# 处理openim组件需要的挂载目录,主要是处理config目录 +mkdir ./config +cp ./config.example.yaml ./config/config.yaml # 修改 ./config/config.yaml 内容,比如各个依赖组件的 host + +# 然后拉起env.yaml +docker-compose -f ./env.yaml up -d + +# 等env 容器全部拉起成功之后,拉起openim.yaml +docker-compose -f ./openim.yaml up -d + +# 查看容器运行,推荐使用下 portainer ,web查看容器情况,查看日志等等 +docker container ps -a | grep openim + +# 正常应该是查看api,demo等的容器日志,看到gin打印的路由日志才算是成功 +``` \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..c67203773 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,116 @@ +version: "3" +#fixme Clone openIM Server project before using docker-compose,project address:https://github.com/OpenIMSDK/Open-IM-Server.git + +services: + mysql: + image: mysql:5.7 + ports: + - 13306:3306 + - 23306:33060 + 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: + - 37017:27017 + container_name: mongo + volumes: + - ./components/mongodb/data/db:/data/db + - ./components/mongodb/data/logs:/data/logs + - ./components/mongodb/data/conf:/etc/mongo + environment: + - TZ=Asia/Shanghai + # cache + - wiredTigerCacheSizeGB=1 +# environment: +# - MONGO_INITDB_ROOT_USERNAME=openIM +# - MONGO_INITDB_ROOT_PASSWORD=openIM + + + #TZ: Asia/Shanghai + restart: always + + redis: + image: redis + ports: + - 16379: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: 127.0.0.1:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092 + KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092 + network_mode: "host" + depends_on: + - zookeeper + + 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_server: + image: openim/open_im_server:v2.0.5 + container_name: open_im_server + volumes: + - ./logs:/Open-IM-Server/logs + - ./config/config.yaml:/Open-IM-Server/config/config.yaml + - ./db/sdk:/Open-IM-Server/db/sdk + - ./script:/Open-IM-Server/script + restart: always + depends_on: + - kafka + - mysql + - mongodb + - redis + - etcd + network_mode: "host" + logging: + driver: json-file + options: + max-size: "1g" + max-file: "2" diff --git a/docs/Architecture.jpg b/docs/Architecture.jpg new file mode 100644 index 000000000..138a72472 Binary files /dev/null and b/docs/Architecture.jpg differ diff --git a/docs/Open-IM-Servers-on-System.png b/docs/Open-IM-Servers-on-System.png new file mode 100644 index 000000000..3c8a10202 Binary files /dev/null and b/docs/Open-IM-Servers-on-System.png differ diff --git a/docs/Open-IM-Servers-on-docker.png b/docs/Open-IM-Servers-on-docker.png new file mode 100644 index 000000000..c66f7fb09 Binary files /dev/null and b/docs/Open-IM-Servers-on-docker.png differ diff --git a/docs/Open-IM.png b/docs/Open-IM.png new file mode 100644 index 000000000..b61706550 Binary files /dev/null and b/docs/Open-IM.png differ diff --git a/docs/Wechat.jpg b/docs/Wechat.jpg new file mode 100644 index 000000000..d3caf1a44 Binary files /dev/null and b/docs/Wechat.jpg differ diff --git a/docs/open-im-logo.png b/docs/open-im-logo.png new file mode 100644 index 000000000..4fb6a6700 Binary files /dev/null and b/docs/open-im-logo.png differ diff --git a/docs/open-im-server.png b/docs/open-im-server.png new file mode 100644 index 000000000..35df36f39 Binary files /dev/null and b/docs/open-im-server.png differ diff --git a/go.mod b/go.mod new file mode 100644 index 000000000..f005f9ce0 --- /dev/null +++ b/go.mod @@ -0,0 +1,69 @@ +module Open_IM + +go 1.15 + +require ( + github.com/Shopify/sarama v1.19.0 + github.com/Shopify/toxiproxy v2.1.4+incompatible // indirect + github.com/alibabacloud-go/darabonba-openapi v0.1.11 + github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8 + github.com/alibabacloud-go/sts-20150401 v1.1.0 + github.com/alibabacloud-go/tea v1.1.17 + github.com/antonfisher/nested-logrus-formatter v1.3.0 + github.com/bwmarrin/snowflake v0.3.0 + github.com/coreos/etcd v3.3.27+incompatible // indirect + github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // 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/fatih/structs v1.1.0 + 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/go-playground/validator/v10 v10.4.1 + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/gogo/protobuf v1.3.2 + github.com/golang-jwt/jwt/v4 v4.1.0 + github.com/golang/protobuf v1.5.2 + github.com/golang/snappy v0.0.4 // indirect + github.com/gorilla/websocket v1.4.2 + github.com/jinzhu/copier v0.3.4 + github.com/jinzhu/gorm v1.9.16 + github.com/jinzhu/now v1.1.3 // indirect + github.com/jonboulle/clockwork v0.2.2 // indirect + github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible + github.com/lestrrat-go/strftime v1.0.4 // indirect + github.com/lib/pq v1.2.0 // indirect + //github.com/livekit/protocol v0.11.14-0.20220223195254-d8c251e13231 // indirect + //github.com/livekit/server-sdk-go v0.9.1 + github.com/mattn/go-sqlite3 v1.14.6 // indirect + github.com/minio/minio-go/v7 v7.0.22 + github.com/mitchellh/mapstructure v1.4.2 + github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 + github.com/olivere/elastic/v7 v7.0.23 + github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/pkg/errors v0.9.1 + 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.8.1 + github.com/spf13/viper v1.9.0 + github.com/stretchr/testify v1.7.0 + 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 v3.3.27+incompatible + go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698 + go.mongodb.org/mongo-driver v1.8.3 + golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd + google.golang.org/grpc v1.42.0 + google.golang.org/grpc/examples v0.0.0-20220311002955-722367c4a737 // indirect + google.golang.org/protobuf v1.27.1 + gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect + gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df + gopkg.in/ini.v1 v1.66.2 // indirect + gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 + 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.0 diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..cec54f0ff --- /dev/null +++ b/go.sum @@ -0,0 +1,1138 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= +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= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alibabacloud-go/darabonba-openapi v0.1.7/go.mod h1:6FV1Bt1AItYIlC2rVopPTumrRNtkfPBmrPVAZ8v2bLk= +github.com/alibabacloud-go/darabonba-openapi v0.1.11 h1:w59gtSA0s87p0U5NNG/N/PIHsRP3rtj7qCP9hx9+GL8= +github.com/alibabacloud-go/darabonba-openapi v0.1.11/go.mod h1:MPJMxv7HYrFm5m9uOZWkDYsAWyZztEgnBRfk9Fg0eIU= +github.com/alibabacloud-go/darabonba-string v1.0.0/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 h1:NqugFkGxx1TXSh/pBcU00Y6bljgDPaFdh5MUSeJ7e50= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY= +github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8 h1:KXMiCg99Jx7B6V+DlRFbWwL9UCGippE5z1wGzhyimiA= +github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8/go.mod h1:8aL6tSyQIWJygF7W/Vqxdf/QDbN2S+u57k36bEA8hD8= +github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q= +github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= +github.com/alibabacloud-go/openapi-util v0.0.8/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/openapi-util v0.0.9 h1:Z0DP4LFzkM/rW2nxOMiiLoQVZSeE3jVc5jrZ9Fd/UX0= +github.com/alibabacloud-go/openapi-util v0.0.9/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/sts-20150401 v1.1.0 h1:1yVyKz02ES6aKo3xVjmoPLBH1OAmmSqPkhKRdjEkmYs= +github.com/alibabacloud-go/sts-20150401 v1.1.0/go.mod h1:QW4O/c7Hp4krHYt+6xwnoG8EyZW3V9GYkl6EgIBmxJc= +github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg= +github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.11/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.15/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.1.17 h1:05R5DnaJXe9sCNIe8KUgWHC/z6w/VZIwczgUwzRnul8= +github.com/alibabacloud-go/tea v1.1.17/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= +github.com/alibabacloud-go/tea-utils v1.3.9 h1:TtbzxS+BXrisA7wzbAMRtlU8A2eWLg0ufm7m/Tl6fc4= +github.com/alibabacloud-go/tea-utils v1.3.9/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= +github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY= +github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= +github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/antonfisher/nested-logrus-formatter v1.3.0 h1:8zixYquU1Odk+vzAaAQPAdRh1ZjmUXNQ1T+dUBvlhVo= +github.com/antonfisher/nested-logrus-formatter v1.3.0/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aws/aws-sdk-go v1.38.3/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bep/debounce v1.2.0 h1:wXds8Kq8qRfwAOpAxHrJDbCXgC5aHSzgQb/0gKsHQqo= +github.com/bep/debounce v1.2.0/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0= +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/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/coreos/etcd v0.5.0-alpha.5 h1:0Qi6Jzjk2CDuuGlIeecpu+em2nrjhOgz2wsIwCmQHmc= +github.com/coreos/etcd v3.3.27+incompatible h1:QIudLb9KeBsE5zyYxd1mjzRSkzLg9Wf9QlRwFgd6oTA= +github.com/coreos/etcd v3.3.27+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +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= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/channels v1.1.0 h1:F1taHcn7/F0i8DYqKXJnyhJcVpp2kgFcNePxXtnyu4k= +github.com/eapache/channels v1.1.0/go.mod h1:jMm2qB5Ubtg9zLd+inMZd2/NUvXgzmWXsDaLyQIGfH0= +github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= +github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= +github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= +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.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss= +github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +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/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +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.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= +github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.0.0-rc1/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.1.0 h1:nAbevmWlS2Ic4m4+/An5NXkaGqlqpbBgdcuThZxnZyI= +github.com/go-logr/logr v1.1.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.0.0 h1:y5pcs7gk8uL+w55/cmuTqhhg5Vjsn8NhlZgr8atE60c= +github.com/go-logr/stdr v1.0.0/go.mod h1:ALK2+RP34e8Kg4N/jgsMDWyZb/T282UsFmhyUqyzpmc= +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.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-redis/redis/v8 v8.11.3 h1:GCjoYp8c+yQTJfc0n69iwSiHjvuAdruxl7elnZCxgt8= +github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN0F/oD9XeKc= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +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= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +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.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +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 v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +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= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +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.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/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/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/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4 h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jinzhu/copier v0.3.4 h1:mfU6jI9PtCeUjkjQ322dlff9ELjGDu975C2p/nrubVI= +github.com/jinzhu/copier v0.3.4/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= +github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= +github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.3 h1:PlHq1bSCSZL9K0wUhbm2pGLoTWs2GwVhsP6emvGV/ZI= +github.com/jinzhu/now v1.1.3/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jxskiss/base62 v0.0.0-20191017122030-4f11678b909b h1:XUr8tvMEILhphQPp3TFcIudb5KTOzFeD0pJyDn5+5QI= +github.com/jxskiss/base62 v0.0.0-20191017122030-4f11678b909b/go.mod h1:a5Mn24iYVJRUQSkFupGByqykzD+k+wFI8J91zGHuPf8= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= +github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= +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/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/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/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= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= +github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= +github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= +github.com/lestrrat-go/strftime v1.0.4 h1:T1Rb9EPkAhgxKqbcMIPguPq8glqXTA1koF8n9BHElA8= +github.com/lestrrat-go/strftime v1.0.4/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR76fd03sz+Qz4g= +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/lithammer/shortuuid/v3 v3.0.6 h1:pr15YQyvhiSX/qPxncFtqk+v4xLEpOZObbsY/mKrcvA= +github.com/lithammer/shortuuid/v3 v3.0.6/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts= +github.com/lithammer/shortuuid/v3 v3.0.7 h1:trX0KTHy4Pbwo/6ia8fscyHoGA+mf1jWbPJVuvyJQQ8= +github.com/lithammer/shortuuid/v3 v3.0.7/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts= +github.com/livekit/protocol v0.11.13 h1:5iWXKTeFMfERpE/0ocoLUOQtPV1BKwas151nZm0YVt0= +github.com/livekit/protocol v0.11.13/go.mod h1:YoHW9YbWbPnuVsgwBB4hAINKT+V68jmfh9zXBSSn6Wg= +github.com/livekit/protocol v0.11.14-0.20220223195254-d8c251e13231 h1:2bSLRW/t4sosQkqoxI9b6PN296FBw4Xiy9cT9tZPi3w= +github.com/livekit/protocol v0.11.14-0.20220223195254-d8c251e13231/go.mod h1:3pHsWUtQmWaH8mG0cXrQWpbf3Vo+kj0U+In77CEXu90= +github.com/livekit/server-sdk-go v0.9.1 h1:AhshcG4o1Domyo0rfB5lYKnczOZT5nOQQPIkG9jFfE0= +github.com/livekit/server-sdk-go v0.9.1/go.mod h1:I31XJ1SmfUW7DFX3sltpVf9GwvuTO0jr05zscP1nrwA= +github.com/magefile/mage v1.11.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +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= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= +github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg= +github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0/go.mod h1:fcEyUyXZXoV4Abw8DX0t7wyL8mCDxXyU4iAFZfT3IHw= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4= +github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= +github.com/minio/minio-go/v7 v7.0.22 h1:iXhsiRyYh1ozm/+jN2qGgEIahYjEkvcpuu6NcdpSxcA= +github.com/minio/minio-go/v7 v7.0.22/go.mod h1:ei5JjmxwHaMrgsMrn4U/+Nmg+d8MKS1U2DAn1ou4+Do= +github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= +github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/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 h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +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/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= +github.com/onsi/gomega v1.15.0 h1:WjP/FQ/sk43MRmnEcT+MlDw2TFvkrXlprrPST/IudjU= +github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= +github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +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/pion/datachannel v1.5.2 h1:piB93s8LGmbECrpO84DnkIVWasRMk3IimbcXkTQLE6E= +github.com/pion/datachannel v1.5.2/go.mod h1:FTGQWaHrdCwIJ1rw6xBIfZVkslikjShim5yr05XFuCQ= +github.com/pion/dtls/v2 v2.1.2/go.mod h1:o6+WvyLDAlXF7YiPB/RlskRoeK+/JtuaZa5emwQcWus= +github.com/pion/dtls/v2 v2.1.3 h1:3UF7udADqous+M2R5Uo2q/YaP4EzUoWKdfX2oscCUio= +github.com/pion/dtls/v2 v2.1.3/go.mod h1:o6+WvyLDAlXF7YiPB/RlskRoeK+/JtuaZa5emwQcWus= +github.com/pion/ice/v2 v2.2.1 h1:R3MeuJZpU1ty3diPqpD5OxaxcZ15eprAc+EtUiSoFxg= +github.com/pion/ice/v2 v2.2.1/go.mod h1:Op8jlPtjeiycsXh93Cs4jK82C9j/kh7vef6ztIOvtIQ= +github.com/pion/interceptor v0.1.7/go.mod h1:Lh3JSl/cbJ2wP8I3ccrjh1K/deRGRn3UlSPuOTiHb6U= +github.com/pion/interceptor v0.1.8 h1:5K27KMw8enTB1jVDFrjadK8sZjI5JbPJ91OVfiih5fE= +github.com/pion/interceptor v0.1.8/go.mod h1:Lh3JSl/cbJ2wP8I3ccrjh1K/deRGRn3UlSPuOTiHb6U= +github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= +github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= +github.com/pion/mdns v0.0.5 h1:Q2oj/JB3NqfzY9xGZ1fPzZzK7sDSD8rZPOvcIQ10BCw= +github.com/pion/mdns v0.0.5/go.mod h1:UgssrvdD3mxpi8tMxAXbsppL3vJ4Jipw1mTCW+al01g= +github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= +github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= +github.com/pion/rtcp v1.2.6/go.mod h1:52rMNPWFsjr39z9B9MhnkqhPLoeHTv1aN63o/42bWE0= +github.com/pion/rtcp v1.2.9 h1:1ujStwg++IOLIEoOiIQ2s+qBuJ1VN81KW+9pMPsif+U= +github.com/pion/rtcp v1.2.9/go.mod h1:qVPhiCzAm4D/rxb6XzKeyZiQK69yJpbUDJSF7TgrqNo= +github.com/pion/rtp v1.7.0/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko= +github.com/pion/rtp v1.7.4 h1:4dMbjb1SuynU5OpA3kz1zHK+u+eOCQjW3MAeVHf1ODA= +github.com/pion/rtp v1.7.4/go.mod h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko= +github.com/pion/sctp v1.8.0/go.mod h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s= +github.com/pion/sctp v1.8.2 h1:yBBCIrUMJ4yFICL3RIvR4eh/H2BTTvlligmSTy+3kiA= +github.com/pion/sctp v1.8.2/go.mod h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s= +github.com/pion/sdp/v3 v3.0.4 h1:2Kf+dgrzJflNCSw3TV5v2VLeI0s/qkzy2r5jlR0wzf8= +github.com/pion/sdp/v3 v3.0.4/go.mod h1:bNiSknmJE0HYBprTHXKPQ3+JjacTv5uap92ueJZKsRk= +github.com/pion/srtp/v2 v2.0.5 h1:ks3wcTvIUE/GHndO3FAvROQ9opy0uLELpwHJaQ1yqhQ= +github.com/pion/srtp/v2 v2.0.5/go.mod h1:8k6AJlal740mrZ6WYxc4Dg6qDqqhxoRG2GSjlUhDF0A= +github.com/pion/stun v0.3.5 h1:uLUCBCkQby4S1cf6CGuR9QrVOKcvUwFeemaC865QHDg= +github.com/pion/stun v0.3.5/go.mod h1:gDMim+47EeEtfWogA37n6qXZS88L5V6LqFcf+DZA2UA= +github.com/pion/transport v0.12.2/go.mod h1:N3+vZQD9HlDP5GWkZ85LohxNsDcNgofQmyL6ojX5d8Q= +github.com/pion/transport v0.12.3/go.mod h1:OViWW9SP2peE/HbwBvARicmAVnesphkNkCVZIWJ6q9A= +github.com/pion/transport v0.13.0 h1:KWTA5ZrQogizzYwPEciGtHPLwpAjE91FgXnyu+Hv2uY= +github.com/pion/transport v0.13.0/go.mod h1:yxm9uXpK9bpBBWkITk13cLo1y5/ur5VQpG22ny6EP7g= +github.com/pion/turn/v2 v2.0.8 h1:KEstL92OUN3k5k8qxsXHpr7WWfrdp7iJZHx99ud8muw= +github.com/pion/turn/v2 v2.0.8/go.mod h1:+y7xl719J8bAEVpSXBXvTxStjJv3hbz9YFflvkpcGPw= +github.com/pion/udp v0.1.1 h1:8UAPvyqmsxK8oOjloDk4wUt63TzFe9WEJkg5lChlj7o= +github.com/pion/udp v0.1.1/go.mod h1:6AFo+CMdKQm7UiA0eUPA8/eVCTx8jBIITLZHc9DWX5M= +github.com/pion/webrtc/v3 v3.1.25-0.20220225075517-37e16a3b15a3 h1:TzOKzLajJt/Le720iy7bFry5HBBLWB3v6n9jEO4WJDs= +github.com/pion/webrtc/v3 v3.1.25-0.20220225075517-37e16a3b15a3/go.mod h1:mO/yv7fBN3Lp7YNlnYcTj1jtpvNvssJG+7eh6itZ4xM= +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= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo= +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/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +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/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= +github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= +github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +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/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 v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= +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/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/gunit v1.4.2/go.mod h1:ZjM1ozSIMJlAz/ay4SG8PeKF00ckUp+zMHZXV9/bvak= +github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= +github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +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.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +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/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +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/thoas/go-funk v0.9.0 h1:Yzu8aTjTb1sqHZzSZLBt4qaZrFfjNizhA7IfnefjEzo= +github.com/thoas/go-funk v0.9.0/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM= +github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/twitchtv/twirp v8.1.0+incompatible h1:KGXanpa9LXdVE/V5P/tA27rkKFmXRGCtSNT7zdeeVOY= +github.com/twitchtv/twirp v8.1.0+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A= +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/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +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/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/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= +go.etcd.io/etcd v0.0.0-20200402134248-51bdeb39e698/go.mod h1:YoUyTScD3Vcv2RBm3eGVOq7i1ULiz3OuXoQFWOirmAM= +go.etcd.io/etcd v0.5.0-alpha.5 h1:VOolFSo3XgsmnYDLozjvZ6JL6AAwIDu1Yx1y+4EYLDo= +go.etcd.io/etcd v3.3.27+incompatible h1:5hMrpf6REqTHV2LW2OclNpRtxI0k9ZplMemJsMSWju0= +go.etcd.io/etcd v3.3.27+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.mongodb.org/mongo-driver v1.8.3 h1:TDKlTkGDKm9kkJVUOAXDK5/fkqKHJVwYQSpoRfB43R4= +go.mongodb.org/mongo-driver v1.8.3/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838 h1:71vQrMauZZhcTVK6KdYM+rklehEEwb3E+ZhaE5jrPrE= +golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk= +golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/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-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/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-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/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-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201026091529-146b70c837a4/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/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-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +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-20190227155943-e225da77a7e6/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-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/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/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/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/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +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= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 h1:z+ErRPu0+KS02Td3fOAgdX+lnPDh/VyaABEJPD4JRQs= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/grpc v1.29.0 h1:2pJjwYOdkZ9HlN4sWRYBg9ttH5bCOlsueaM+b/oYjwo= +google.golang.org/grpc v1.29.0/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0 h1:raiipEjMOIC/TO2AvyTxP25XFdLxNIBwzDh3FM3XztI= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc/examples v0.0.0-20220311002955-722367c4a737 h1:rLsBNkV6Gc/K6J87wfvo/BSg/TQGd28++7sS+hs8qDw= +google.golang.org/grpc/examples v0.0.0-20220311002955-722367c4a737/go.mod h1:wKDg0brwMZpaizQ1i7IzYcJjH1TmbJudYdnQC9+J+LE= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= +gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE= +gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= +gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c= +gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= +gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= +gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= +gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= +gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +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.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +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-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.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go new file mode 100644 index 000000000..fed744d4f --- /dev/null +++ b/internal/api/auth/auth.go @@ -0,0 +1,91 @@ +package apiAuth + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/auth" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func UserRegister(c *gin.Context) { + params := api.UserRegisterReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + if params.Secret != config.Config.Secret { + log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"}) + return + } + req := &rpc.UserRegisterReq{UserInfo: &open_im_sdk.UserInfo{}} + utils.CopyStructFields(req.UserInfo, ¶ms) + //copier.Copy(req.UserInfo, ¶ms) + req.OperationID = params.OperationID + log.NewInfo(req.OperationID, "UserRegister args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + client := rpc.NewAuthClient(etcdConn) + reply, err := client.UserRegister(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "call rpc err ", err) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "internal service err"}) + return + } + if reply.CommonResp.ErrCode != 0 { + log.NewError(req.OperationID, "UserRegister failed ", err) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": reply.CommonResp.ErrMsg}) + return + + } + + pbDataToken := &rpc.UserTokenReq{Platform: params.Platform, FromUserID: params.UserID, OperationID: params.OperationID} + replyToken, err := client.UserToken(context.Background(), pbDataToken) + if err != nil { + log.NewError(req.OperationID, "UserToken failed ", err.Error(), pbDataToken) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + resp := api.UserRegisterResp{CommResp: api.CommResp{ErrCode: replyToken.CommonResp.ErrCode, ErrMsg: replyToken.CommonResp.ErrMsg}, + UserToken: api.UserTokenInfo{UserID: req.UserInfo.UserID, Token: replyToken.Token, ExpiredTime: replyToken.ExpiredTime}} + log.NewInfo(req.OperationID, "UserRegister return ", resp) + c.JSON(http.StatusOK, resp) + +} + +func UserToken(c *gin.Context) { + params := api.UserTokenReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + if params.Secret != config.Config.Secret { + log.NewError(params.OperationID, "params.Secret != config.Config.Secret", params.Secret, config.Config.Secret) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "not authorized"}) + return + } + req := &rpc.UserTokenReq{Platform: params.Platform, FromUserID: params.UserID, OperationID: params.OperationID} + log.NewInfo(req.OperationID, "UserToken args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAuthName) + client := rpc.NewAuthClient(etcdConn) + reply, err := client.UserToken(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "UserToken failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + resp := api.UserTokenResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}, + UserToken: api.UserTokenInfo{UserID: req.FromUserID, Token: reply.Token, ExpiredTime: reply.ExpiredTime}} + log.NewInfo(req.OperationID, "UserRegister return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/chat/del_msg.go b/internal/api/chat/del_msg.go new file mode 100644 index 000000000..81b705953 --- /dev/null +++ b/internal/api/chat/del_msg.go @@ -0,0 +1,43 @@ +package apiChat + +import ( + api "Open_IM/pkg/base_info" + "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" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func DelMsg(c *gin.Context) { + var ( + req api.DelMsgReq + resp api.DelMsgResp + reqPb pbCommon.DelMsgListReq + ) + if err := c.BindJSON(&req); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, &req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + msgClient := pbChat.NewChatClient(grpcConn) + respPb, err := msgClient.DelMsgList(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsgList failed", err.Error(), reqPb) + c.JSON(http.StatusOK, gin.H{"errCode": constant.ErrServer.ErrCode, "errMsg": constant.ErrServer.ErrMsg + err.Error()}) + return + } + resp.ErrCode = respPb.ErrCode + resp.ErrMsg = respPb.ErrMsg + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/chat/get_max_min_seq.go b/internal/api/chat/get_max_min_seq.go new file mode 100644 index 000000000..95a4b1340 --- /dev/null +++ b/internal/api/chat/get_max_min_seq.go @@ -0,0 +1,61 @@ +package apiChat + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbMsg "Open_IM/pkg/proto/chat" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +type paramsUserNewestSeq struct { + ReqIdentifier int `json:"reqIdentifier" binding:"required"` + SendID string `json:"sendID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + MsgIncr int `json:"msgIncr" binding:"required"` +} + +func GetSeq(c *gin.Context) { + params := paramsUserNewestSeq{} + 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 ok, err := token_verify.VerifyToken(token, params.SendID); !ok { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err" + err.Error()}) + return + } + 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) + + if grpcConn == nil { + log.ErrorByKv("get grpcConn err", pbData.OperationID, "args", params) + } + msgClient := pbMsg.NewChatClient(grpcConn) + reply, err := msgClient.GetMaxAndMinSeq(context.Background(), &pbData) + if err != nil { + log.NewError(params.OperationID, "UserGetSeq rpc failed, ", params, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "UserGetSeq rpc failed, " + err.Error()}) + return + } + + c.JSON(http.StatusOK, gin.H{ + "errCode": reply.ErrCode, + "errMsg": reply.ErrMsg, + "msgIncr": params.MsgIncr, + "reqIdentifier": params.ReqIdentifier, + "data": gin.H{ + "maxSeq": reply.MaxSeq, + "minSeq": reply.MinSeq, + }, + }) + +} diff --git a/internal/api/chat/pull_msg.go b/internal/api/chat/pull_msg.go new file mode 100644 index 000000000..515e9b743 --- /dev/null +++ b/internal/api/chat/pull_msg.go @@ -0,0 +1,68 @@ +package apiChat + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/chat" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +type paramsUserPullMsg struct { + ReqIdentifier *int `json:"reqIdentifier" binding:"required"` + SendID string `json:"sendID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + Data struct { + SeqBegin *int64 `json:"seqBegin" binding:"required"` + SeqEnd *int64 `json:"seqEnd" binding:"required"` + } +} + +type paramsUserPullMsgBySeqList struct { + ReqIdentifier int `json:"reqIdentifier" binding:"required"` + SendID string `json:"sendID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + SeqList []uint32 `json:"seqList"` +} + +func PullMsgBySeqList(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 ok, err := token_verify.VerifyToken(token, params.SendID); !ok { + if err != nil { + log.NewError(params.OperationID, utils.GetSelfFuncName(), err.Error(), token, params.SendID) + } + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "token validate err"}) + return + } + pbData := open_im_sdk.PullMessageBySeqListReq{} + pbData.UserID = params.SendID + pbData.OperationID = params.OperationID + pbData.SeqList = params.SeqList + + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + msgClient := pbChat.NewChatClient(grpcConn) + reply, err := msgClient.PullMessageBySeqList(context.Background(), &pbData) + if err != nil { + log.ErrorByKv("PullMessageBySeqList error", pbData.OperationID, "err", err.Error()) + return + } + log.InfoByKv("rpc call success to PullMessageBySeqList", pbData.OperationID, "ReplyArgs", reply.String(), len(reply.List)) + c.JSON(http.StatusOK, gin.H{ + "errCode": reply.ErrCode, + "errMsg": reply.ErrMsg, + "reqIdentifier": params.ReqIdentifier, + "data": reply.List, + }) +} diff --git a/internal/api/chat/send_msg.go b/internal/api/chat/send_msg.go new file mode 100644 index 000000000..a28dcd1ce --- /dev/null +++ b/internal/api/chat/send_msg.go @@ -0,0 +1,99 @@ +package apiChat + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "context" + + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +type paramsUserSendMsg struct { + SenderPlatformID int32 `json:"senderPlatformID" binding:"required"` + SendID string `json:"sendID" binding:"required"` + SenderNickName string `json:"senderNickName"` + SenderFaceURL string `json:"senderFaceUrl"` + OperationID string `json:"operationID" binding:"required"` + Data struct { + SessionType int32 `json:"sessionType" binding:"required"` + MsgFrom int32 `json:"msgFrom" binding:"required"` + ContentType int32 `json:"contentType" binding:"required"` + RecvID string `json:"recvID" ` + GroupID string `json:"groupID" ` + ForceList []string `json:"forceList"` + Content []byte `json:"content" binding:"required"` + Options map[string]bool `json:"options" ` + ClientMsgID string `json:"clientMsgID" binding:"required"` + CreateTime int64 `json:"createTime" binding:"required"` + OffLineInfo *open_im_sdk.OfflinePushInfo `json:"offlineInfo" ` + } +} + +func newUserSendMsgReq(token string, params *paramsUserSendMsg) *pbChat.SendMsgReq { + pbData := pbChat.SendMsgReq{ + Token: token, + OperationID: params.OperationID, + MsgData: &open_im_sdk.MsgData{ + SendID: params.SendID, + RecvID: params.Data.RecvID, + GroupID: params.Data.GroupID, + ClientMsgID: params.Data.ClientMsgID, + SenderPlatformID: params.SenderPlatformID, + SenderNickname: params.SenderNickName, + SenderFaceURL: params.SenderFaceURL, + SessionType: params.Data.SessionType, + MsgFrom: params.Data.MsgFrom, + ContentType: params.Data.ContentType, + Content: params.Data.Content, + CreateTime: params.Data.CreateTime, + Options: params.Data.Options, + OfflinePushInfo: params.Data.OffLineInfo, + }, + } + return &pbData +} + +func SendMsg(c *gin.Context) { + params := paramsUserSendMsg{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + log.ErrorByKv("json unmarshal err", "", "err", err.Error(), "data", c.PostForm("data")) + return + } + + token := c.Request.Header.Get("token") + + log.InfoByKv("api call success to sendMsgReq", params.OperationID, "Parameters", params) + + pbData := newUserSendMsgReq(token, ¶ms) + log.Info("", "", "api SendMsg call start..., [data: %s]", pbData.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + client := pbChat.NewChatClient(etcdConn) + + log.Info("", "", "api SendMsg call, api call rpc...") + + reply, err := client.SendMsg(context.Background(), pbData) + if err != nil { + log.NewError(params.OperationID, "SendMsg rpc failed, ", params, err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": "SendMsg rpc failed, " + err.Error()}) + return + } + log.Info("", "", "api SendMsg call end..., [data: %s] [reply: %s]", pbData.String(), reply.String()) + + c.JSON(http.StatusOK, gin.H{ + "errCode": reply.ErrCode, + "errMsg": reply.ErrMsg, + "data": gin.H{ + "clientMsgID": reply.ClientMsgID, + "serverMsgID": reply.ServerMsgID, + "sendTime": reply.SendTime, + }, + }) + +} diff --git a/internal/api/conversation/conversation.go b/internal/api/conversation/conversation.go new file mode 100644 index 000000000..3d580864f --- /dev/null +++ b/internal/api/conversation/conversation.go @@ -0,0 +1,218 @@ +package conversation + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func SetConversation(c *gin.Context) { + var ( + req api.SetConversationReq + resp api.SetConversationResp + reqPb pbUser.SetConversationReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + reqPb.Conversation = &pbUser.Conversation{} + err := utils.CopyStructFields(&reqPb, req) + err = utils.CopyStructFields(reqPb.Conversation, req.Conversation) + if err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()}) + return + } + resp.ErrMsg = respPb.CommonResp.ErrMsg + resp.ErrCode = respPb.CommonResp.ErrCode + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func BatchSetConversations(c *gin.Context) { + var ( + req api.BatchSetConversationsReq + resp api.BatchSetConversationsResp + reqPb pbUser.BatchSetConversationsReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.BatchSetConversations(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp.Data, respPb); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.ErrMsg = respPb.CommonResp.ErrMsg + resp.ErrCode = respPb.CommonResp.ErrCode + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetAllConversations(c *gin.Context) { + var ( + req api.GetAllConversationsReq + resp api.GetAllConversationsResp + reqPb pbUser.GetAllConversationsReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.GetAllConversations(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()}) + return + } + resp.ErrMsg = respPb.CommonResp.ErrMsg + resp.ErrCode = respPb.CommonResp.ErrCode + if err := utils.CopyStructFields(&resp.Conversations, respPb.Conversations); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed, ", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetConversation(c *gin.Context) { + var ( + req api.GetConversationReq + resp api.GetConversationResp + reqPb pbUser.GetConversationReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.GetConversation(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetConversation rpc failed, ", reqPb.String(), err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()}) + return + } + resp.ErrMsg = respPb.CommonResp.ErrMsg + resp.ErrCode = respPb.CommonResp.ErrCode + if err := utils.CopyStructFields(&resp.Conversation, respPb.Conversation); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetConversations(c *gin.Context) { + var ( + req api.GetConversationsReq + resp api.GetConversationsResp + reqPb pbUser.GetConversationsReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.GetConversations(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()}) + return + } + resp.ErrMsg = respPb.CommonResp.ErrMsg + resp.ErrCode = respPb.CommonResp.ErrCode + if err := utils.CopyStructFields(&resp.Conversations, respPb.Conversations); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func SetRecvMsgOpt(c *gin.Context) { + var ( + req api.SetRecvMsgOptReq + resp api.SetRecvMsgOptResp + reqPb pbUser.SetRecvMsgOptReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", reqPb.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pbUser.NewUserClient(etcdConn) + respPb, err := client.SetRecvMsgOpt(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetRecvMsgOpt rpc failed, ", reqPb.String(), err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()}) + return + } + resp.ErrMsg = respPb.CommonResp.ErrMsg + resp.ErrCode = respPb.CommonResp.ErrCode + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +//Deprecated +func SetReceiveMessageOpt(c *gin.Context) { + +} + +//Deprecated +func GetReceiveMessageOpt(c *gin.Context) { + +} + +//Deprecated +func GetAllConversationMessageOpt(c *gin.Context) { + +} diff --git a/internal/api/friend/friend.go b/internal/api/friend/friend.go new file mode 100644 index 000000000..054878c0c --- /dev/null +++ b/internal/api/friend/friend.go @@ -0,0 +1,456 @@ +package friend + +import ( + jsonData "Open_IM/internal/utils" + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/friend" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func AddBlack(c *gin.Context) { + params := api.AddBlacklistReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.AddBlacklistReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "AddBlacklist args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.AddBlacklist(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "AddBlacklist failed ", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add blacklist rpc server failed"}) + return + } + resp := api.AddBlacklistResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "AddBlacklist api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func ImportFriend(c *gin.Context) { + params := api.ImportFriendReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.ImportFriendReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "ImportFriend args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.ImportFriend(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "ImportFriend failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "ImportFriend failed "}) + return + } + resp := api.ImportFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + if resp.ErrCode == 0 { + for _, v := range RpcResp.UserIDResultList { + resp.UserIDResultList = append(resp.UserIDResultList, api.UserIDResult{UserID: v.UserID, Result: v.Result}) + } + } + if len(resp.UserIDResultList) == 0 { + resp.UserIDResultList = []api.UserIDResult{} + } + log.NewInfo(req.OperationID, "ImportFriend api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func AddFriend(c *gin.Context) { + params := api.AddFriendReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.AddFriendReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + req.ReqMsg = params.ReqMsg + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "AddFriend args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.AddFriend(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "AddFriend failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call AddFriend rpc server failed"}) + return + } + + resp := api.AddFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "AddFriend api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func AddFriendResponse(c *gin.Context) { + params := api.AddFriendResponseReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.AddFriendResponseReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + req.HandleMsg = params.HandleMsg + req.HandleResult = params.Flag + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + utils.CopyStructFields(req, ¶ms) + log.NewInfo(req.CommID.OperationID, "AddFriendResponse args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.AddFriendResponse(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "AddFriendResponse failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add_friend_response rpc server failed"}) + return + } + + resp := api.AddFriendResponseResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "AddFriendResponse api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func DeleteFriend(c *gin.Context) { + params := api.DeleteFriendReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.DeleteFriendReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "DeleteFriend args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.DeleteFriend(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "DeleteFriend failed ", err, req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call delete_friend rpc server failed"}) + return + } + + resp := api.DeleteFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "DeleteFriend api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetBlacklist(c *gin.Context) { + params := api.GetBlackListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetBlacklistReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "GetBlacklist args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.GetBlacklist(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "GetBlacklist failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get blacklist rpc server failed"}) + return + } + + resp := api.GetBlackListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + for _, v := range RpcResp.BlackUserInfoList { + black := open_im_sdk.PublicUserInfo{} + utils.CopyStructFields(&black, v) + resp.BlackUserInfoList = append(resp.BlackUserInfoList, &black) + } + resp.Data = jsonData.JsonDataList(resp.BlackUserInfoList) + log.NewInfo(req.CommID.OperationID, "GetBlacklist api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func SetFriendRemark(c *gin.Context) { + params := api.SetFriendRemarkReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.SetFriendRemarkReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + req.Remark = params.Remark + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "SetFriendComment args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.SetFriendRemark(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "SetFriendComment failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call set friend comment rpc server failed"}) + return + } + resp := api.SetFriendRemarkResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + + log.NewInfo(req.CommID.OperationID, "SetFriendComment api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func RemoveBlack(c *gin.Context) { + params := api.RemoveBlackListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.RemoveBlacklistReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + + log.NewInfo(req.CommID.OperationID, "RemoveBlacklist args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.RemoveBlacklist(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "RemoveBlacklist failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call remove blacklist rpc server failed"}) + return + } + resp := api.RemoveBlackListResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.CommID.OperationID, "RemoveBlacklist api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func IsFriend(c *gin.Context) { + params := api.IsFriendReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.IsFriendReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms.ParamsCommFriend) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "IsFriend args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.IsFriend(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "IsFriend failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call add friend rpc server failed"}) + return + } + resp := api.IsFriendResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + resp.Response.Friend = RpcResp.Response + + log.NewInfo(req.CommID.OperationID, "IsFriend api return ", resp) + c.JSON(http.StatusOK, resp) +} + +// +//func GetFriendsInfo(c *gin.Context) { +// params := api.GetFriendsInfoReq{} +// if err := c.BindJSON(¶ms); err != nil { +// log.NewError("0", "BindJSON failed ", err.Error()) +// c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) +// return +// } +// req := &rpc.GetFriendsInfoReq{} +// utils.CopyStructFields(req.CommID, params) +// var ok bool +// ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) +// if !ok { +// log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) +// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) +// return +// } +// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo args ", req.String()) +// +// etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) +// client := rpc.NewFriendClient(etcdConn) +// RpcResp, err := client.GetFriendsInfo(context.Background(), req) +// if err != nil { +// log.NewError(req.CommID.OperationID, "GetFriendsInfo failed ", err.Error(), req.String()) +// c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call search friend rpc server failed"}) +// return +// } +// +// resp := api.GetFriendsInfoResp{CommResp:api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} +// utils.CopyStructFields(&resp, RpcResp) +// c.JSON(http.StatusOK, resp) +// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo api return ", resp) +//} + +func GetFriendList(c *gin.Context) { + params := api.GetFriendListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetFriendListReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "GetFriendList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.GetFriendList(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "GetFriendList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get friend list rpc server failed"}) + return + } + + resp := api.GetFriendListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, FriendInfoList: RpcResp.FriendInfoList} + resp.Data = jsonData.JsonDataList(resp.FriendInfoList) + log.NewInfo(req.CommID.OperationID, "GetFriendList api return ", resp) + c.JSON(http.StatusOK, resp) + //c.JSON(http.StatusOK, resp) +} + +func GetFriendApplyList(c *gin.Context) { + params := api.GetFriendApplyListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetFriendApplyListReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "GetFriendApplyList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + + RpcResp, err := client.GetFriendApplyList(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "GetFriendApplyList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get friend apply list rpc server failed"}) + return + } + + resp := api.GetFriendApplyListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, FriendRequestList: RpcResp.FriendRequestList} + resp.Data = jsonData.JsonDataList(resp.FriendRequestList) + log.NewInfo(req.CommID.OperationID, "GetFriendApplyList api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetSelfFriendApplyList(c *gin.Context) { + params := api.GetSelfApplyListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetSelfApplyListReq{CommID: &rpc.CommID{}} + utils.CopyStructFields(req.CommID, ¶ms) + var ok bool + ok, req.CommID.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.CommID.OperationID) + if !ok { + log.NewError(req.CommID.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.CommID.OperationID, "GetSelfApplyList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + RpcResp, err := client.GetSelfApplyList(context.Background(), req) + if err != nil { + log.NewError(req.CommID.OperationID, "GetSelfApplyList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call get self apply list rpc server failed"}) + return + } + resp := api.GetSelfApplyListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, FriendRequestList: RpcResp.FriendRequestList} + resp.Data = jsonData.JsonDataList(resp.FriendRequestList) + log.NewInfo(req.CommID.OperationID, "GetSelfApplyList api return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/group/group.go b/internal/api/group/group.go new file mode 100644 index 000000000..35365cc10 --- /dev/null +++ b/internal/api/group/group.go @@ -0,0 +1,698 @@ +package group + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/group" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + + "github.com/gin-gonic/gin" + + "net/http" + "strings" + + jsonData "Open_IM/internal/utils" +) + +func KickGroupMember(c *gin.Context) { + params := api.KickGroupMemberReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + req := &rpc.KickGroupMemberReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + + log.NewInfo(req.OperationID, "KickGroupMember args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.KickGroupMember(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + var memberListResp api.KickGroupMemberResp + memberListResp.ErrMsg = RpcResp.ErrMsg + memberListResp.ErrCode = RpcResp.ErrCode + for _, v := range RpcResp.Id2ResultList { + memberListResp.UserIDResultList = append(memberListResp.UserIDResultList, &api.UserIDResult{UserID: v.UserID, Result: v.Result}) + } + if len(memberListResp.UserIDResultList) == 0 { + memberListResp.UserIDResultList = []*api.UserIDResult{} + } + + log.NewInfo(req.OperationID, "KickGroupMember api return ", memberListResp) + c.JSON(http.StatusOK, memberListResp) +} + +func GetGroupMembersInfo(c *gin.Context) { + params := api.GetGroupMembersInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetGroupMembersInfoReq{} + utils.CopyStructFields(req, params) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + //c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + api.SetErrCodeMsg(c, http.StatusInternalServerError) + return + } + log.NewInfo(req.OperationID, "GetGroupMembersInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + + RpcResp, err := client.GetGroupMembersInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + memberListResp := api.GetGroupMembersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, MemberList: RpcResp.MemberList} + memberListResp.Data = jsonData.JsonDataList(RpcResp.MemberList) + log.NewInfo(req.OperationID, "GetGroupMembersInfo api return ", memberListResp) + c.JSON(http.StatusOK, memberListResp) +} + +func GetGroupMemberList(c *gin.Context) { + params := api.GetGroupMemberListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetGroupMemberListReq{} + utils.CopyStructFields(req, params) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "GetGroupMemberList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + + RpcResp, err := client.GetGroupMemberList(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberList failed, ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + memberListResp := api.GetGroupMemberListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, MemberList: RpcResp.MemberList, NextSeq: RpcResp.NextSeq} + memberListResp.Data = jsonData.JsonDataList(memberListResp.MemberList) + + log.NewInfo(req.OperationID, "GetGroupMemberList api return ", memberListResp) + c.JSON(http.StatusOK, memberListResp) +} + +func GetGroupAllMemberList(c *gin.Context) { + params := api.GetGroupAllMemberReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetGroupAllMemberReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "GetGroupAllMember args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.GetGroupAllMember(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupAllMember failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + memberListResp := api.GetGroupAllMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, MemberList: RpcResp.MemberList} + memberListResp.Data = jsonData.JsonDataList(memberListResp.MemberList) + log.NewInfo(req.OperationID, "GetGroupAllMember api return ", memberListResp) + c.JSON(http.StatusOK, memberListResp) +} + +func GetJoinedGroupList(c *gin.Context) { + params := api.GetJoinedGroupListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetJoinedGroupListReq{} + utils.CopyStructFields(req, params) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "GetJoinedGroupList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.GetJoinedGroupList(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetJoinedGroupList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + GroupListResp := api.GetJoinedGroupListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: RpcResp.GroupList} + GroupListResp.Data = jsonData.JsonDataList(GroupListResp.GroupInfoList) + log.NewInfo(req.OperationID, "GetJoinedGroupList api return ", GroupListResp) + c.JSON(http.StatusOK, GroupListResp) +} + +func InviteUserToGroup(c *gin.Context) { + params := api.InviteUserToGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.InviteUserToGroupReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "InviteUserToGroup args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.InviteUserToGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "InviteUserToGroup failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.InviteUserToGroupResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + for _, v := range RpcResp.Id2ResultList { + resp.UserIDResultList = append(resp.UserIDResultList, &api.UserIDResult{UserID: v.UserID, Result: v.Result}) + } + + if len(resp.UserIDResultList) == 0 { + resp.UserIDResultList = *new([]*api.UserIDResult) + } + + log.NewInfo(req.OperationID, "InviteUserToGroup api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func CreateGroup(c *gin.Context) { + params := api.CreateGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + // + req := &rpc.CreateGroupReq{GroupInfo: &open_im_sdk.GroupInfo{}} + utils.CopyStructFields(req.GroupInfo, ¶ms) + + for _, v := range params.MemberList { + req.InitMemberList = append(req.InitMemberList, &rpc.GroupAddMemberInfo{UserID: v.UserID, RoleLevel: v.RoleLevel}) + } + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + req.OwnerUserID = params.OwnerUserID + req.OperationID = params.OperationID + log.NewInfo(req.OperationID, "CreateGroup args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.CreateGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "CreateGroup failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + + resp := api.CreateGroupResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + if RpcResp.ErrCode == 0 { + utils.CopyStructFields(&resp.GroupInfo, RpcResp.GroupInfo) + resp.Data = jsonData.JsonDataOne(&resp.GroupInfo) + } + log.NewInfo(req.OperationID, "CreateGroup api return ", resp) + c.JSON(http.StatusOK, resp) +} + +// 群主或管理员收到的 +func GetRecvGroupApplicationList(c *gin.Context) { + params := api.GetGroupApplicationListReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetGroupApplicationListReq{} + utils.CopyStructFields(req, params) + //var ok bool + //ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + //if !ok { + // log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + // c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + // return + //} + log.NewInfo(req.OperationID, "GetGroupApplicationList args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.GetGroupApplicationList(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupApplicationList failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.GetGroupApplicationListResp{CommResp: api.CommResp{ErrCode: reply.ErrCode, ErrMsg: reply.ErrMsg}, GroupRequestList: reply.GroupRequestList} + resp.Data = jsonData.JsonDataList(resp.GroupRequestList) + log.NewInfo(req.OperationID, "GetGroupApplicationList api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetUserReqGroupApplicationList(c *gin.Context) { + var params api.GetUserReqGroupApplicationListReq + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", utils.GetSelfFuncName(), err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetUserReqApplicationListReq{} + utils.CopyStructFields(req, params) + //ok, req.OpUserID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token")) + //if !ok { + // log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + // c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + // return + //} + log.NewInfo(req.OperationID, "GetGroupsInfo args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.GetUserReqApplicationList(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupsInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + log.NewInfo(req.OperationID, RpcResp) + resp := api.GetGroupApplicationListResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, GroupRequestList: RpcResp.GroupRequestList} + log.NewInfo(req.OperationID, "GetGroupApplicationList api return ", resp) + resp.Data = jsonData.JsonDataList(resp.GroupRequestList) + c.JSON(http.StatusOK, resp) +} + +func GetGroupsInfo(c *gin.Context) { + params := api.GetGroupInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetGroupsInfoReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "GetGroupsInfo args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.GetGroupsInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetGroupsInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + + resp := api.GetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, GroupInfoList: RpcResp.GroupInfoList} + resp.Data = jsonData.JsonDataList(resp.GroupInfoList) + log.NewInfo(req.OperationID, "GetGroupsInfo api return ", resp) + c.JSON(http.StatusOK, resp) +} + +//process application +func ApplicationGroupResponse(c *gin.Context) { + params := api.ApplicationGroupResponseReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GroupApplicationResponseReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "ApplicationGroupResponse args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.GroupApplicationResponse(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GroupApplicationResponse failed ", req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.ApplicationGroupResponseResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "ApplicationGroupResponse api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func JoinGroup(c *gin.Context) { + params := api.JoinGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.JoinGroupReq{} + utils.CopyStructFields(req, params) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "JoinGroup args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + + RpcResp, err := client.JoinGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "JoinGroup failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + resp := api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg} + log.NewInfo(req.OperationID, "JoinGroup api return", RpcResp.String()) + c.JSON(http.StatusOK, resp) +} + +func QuitGroup(c *gin.Context) { + params := api.QuitGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.QuitGroupReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "QuitGroup args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.QuitGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "call quit group rpc server failed,err=%s", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + resp := api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg} + log.NewInfo(req.OperationID, "QuitGroup api return", RpcResp.String()) + c.JSON(http.StatusOK, resp) +} + +func SetGroupInfo(c *gin.Context) { + params := api.SetGroupInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.SetGroupInfoReq{GroupInfo: &open_im_sdk.GroupInfo{}} + utils.CopyStructFields(req.GroupInfo, ¶ms) + req.OperationID = params.OperationID + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "SetGroupInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + RpcResp, err := client.SetGroupInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "SetGroupInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + resp := api.SetGroupInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + c.JSON(http.StatusOK, resp) + log.NewInfo(req.OperationID, "SetGroupInfo api return ", resp) +} + +func TransferGroupOwner(c *gin.Context) { + params := api.TransferGroupOwnerReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.TransferGroupOwnerReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "TransferGroupOwner args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.TransferGroupOwner(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "TransferGroupOwner failed ", req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.TransferGroupOwnerResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "TransferGroupOwner api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func DismissGroup(c *gin.Context) { + params := api.DismissGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.DismissGroupReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.DismissGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.DismissGroupResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func MuteGroupMember(c *gin.Context) { + params := api.MuteGroupMemberReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.MuteGroupMemberReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.MuteGroupMember(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.MuteGroupMemberResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func CancelMuteGroupMember(c *gin.Context) { + params := api.CancelMuteGroupMemberReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.CancelMuteGroupMemberReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.CancelMuteGroupMember(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.CancelMuteGroupMemberResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func MuteGroup(c *gin.Context) { + params := api.MuteGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.MuteGroupReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.MuteGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.MuteGroupResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func CancelMuteGroup(c *gin.Context) { + params := api.CancelMuteGroupReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.CancelMuteGroupReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := rpc.NewGroupClient(etcdConn) + reply, err := client.CancelMuteGroup(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()}) + return + } + + resp := api.CancelMuteGroupResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/manage/management_chat.go b/internal/api/manage/management_chat.go new file mode 100644 index 000000000..e1c1bc0ff --- /dev/null +++ b/internal/api/manage/management_chat.go @@ -0,0 +1,296 @@ +/* +** description(""). +** copyright('open-im,www.open-im.io'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/9/15 15:23). + */ +package manage + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/proto/sdk_ws" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "github.com/go-playground/validator/v10" + "github.com/golang/protobuf/proto" + "github.com/mitchellh/mapstructure" + "net/http" + "strings" +) + +var validate *validator.Validate + +func newUserSendMsgReq(params *ManagementSendMsgReq) *pbChat.SendMsgReq { + var newContent string + var err error + switch params.ContentType { + case constant.Text: + newContent = params.Content["text"].(string) + case constant.Picture: + fallthrough + case constant.Custom: + fallthrough + case constant.Voice: + fallthrough + case constant.File: + newContent = utils.StructToJsonString(params.Content) + case constant.Revoke: + newContent = params.Content["revokeMsgClientID"].(string) + + default: + } + var options map[string]bool + if params.IsOnlineOnly { + options = make(map[string]bool, 5) + utils.SetSwitchFromOptions(options, constant.IsOfflinePush, false) + utils.SetSwitchFromOptions(options, constant.IsHistory, false) + utils.SetSwitchFromOptions(options, constant.IsPersistent, false) + utils.SetSwitchFromOptions(options, constant.IsSenderSync, false) + } + pbData := pbChat.SendMsgReq{ + OperationID: params.OperationID, + MsgData: &open_im_sdk.MsgData{ + SendID: params.SendID, + RecvID: params.RecvID, + GroupID: params.GroupID, + ClientMsgID: utils.GetMsgID(params.SendID), + SenderPlatformID: params.SenderPlatformID, + SenderNickname: params.SenderNickname, + SenderFaceURL: params.SenderFaceURL, + SessionType: params.SessionType, + MsgFrom: constant.SysMsgType, + ContentType: params.ContentType, + Content: []byte(newContent), + // ForceList: params.ForceList, + CreateTime: utils.GetCurrentTimestampByMill(), + Options: options, + OfflinePushInfo: params.OfflinePushInfo, + }, + } + if params.ContentType == constant.OANotification { + var tips open_im_sdk.TipsComm + tips.JsonDetail = utils.StructToJsonString(params.Content) + pbData.MsgData.Content, err = proto.Marshal(&tips) + if err != nil { + log.Error(params.OperationID, "Marshal failed ", err.Error(), tips.String()) + } + } + return &pbData +} +func init() { + validate = validator.New() +} + +func ManagementSendMsg(c *gin.Context) { + var data interface{} + params := ManagementSendMsgReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + log.ErrorByKv("json unmarshal err", c.PostForm("operationID"), "err", err.Error(), "content", c.PostForm("content")) + return + } + switch params.ContentType { + case constant.Text: + data = TextElem{} + case constant.Picture: + data = PictureElem{} + case constant.Voice: + data = SoundElem{} + case constant.Video: + data = VideoElem{} + case constant.File: + data = FileElem{} + //case constant.AtText: + // data = AtElem{} + //case constant.Merger: + // data = + //case constant.Card: + //case constant.Location: + case constant.Custom: + data = CustomElem{} + case constant.Revoke: + data = RevokeElem{} + case constant.OANotification: + data = OANotificationElem{} + params.SessionType = constant.NotificationChatType + //case constant.HasReadReceipt: + //case constant.Typing: + //case constant.Quote: + default: + c.JSON(http.StatusBadRequest, gin.H{"errCode": 404, "errMsg": "contentType err"}) + log.ErrorByKv("contentType err", c.PostForm("operationID"), "content", c.PostForm("content")) + return + } + if err := mapstructure.WeakDecode(params.Content, &data); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 401, "errMsg": err.Error()}) + log.ErrorByKv("content to Data struct err", "", "err", err.Error()) + return + } else if err := validate.Struct(data); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 403, "errMsg": err.Error()}) + log.ErrorByKv("data args validate err", "", "err", err.Error()) + return + } + log.NewInfo("", data, params) + token := c.Request.Header.Get("token") + claims, err := token_verify.ParseToken(token, params.OperationID) + 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": ""}) + return + } + if !utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "not authorized", "sendTime": 0, "MsgID": ""}) + return + + } + switch params.SessionType { + case constant.SingleChatType: + if len(params.RecvID) == 0 { + log.NewError(params.OperationID, "recvID is a null string") + c.JSON(http.StatusBadRequest, gin.H{"errCode": 405, "errMsg": "recvID is a null string", "sendTime": 0, "MsgID": ""}) + return + } + case constant.GroupChatType: + if len(params.GroupID) == 0 { + log.NewError(params.OperationID, "groupID is a null string") + c.JSON(http.StatusBadRequest, gin.H{"errCode": 405, "errMsg": "groupID is a null string", "sendTime": 0, "MsgID": ""}) + return + } + + } + log.InfoByKv("Ws call success to ManagementSendMsgReq", params.OperationID, "Parameters", params) + + 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) + client := pbChat.NewChatClient(etcdConn) + + log.Info("", "", "api ManagementSendMsg call, api call rpc...") + + RpcResp, err := client.SendMsg(context.Background(), pbData) + if err != nil { + log.NewError(params.OperationID, "call delete UserSendMsg rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call UserSendMsg rpc server failed"}) + return + } + log.Info("", "", "api ManagementSendMsg call end..., [data: %s] [reply: %s]", pbData.String(), RpcResp.String()) + resp := api.ManagementSendMsgResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, ResultList: server_api_params.UserSendMsgResp{ServerMsgID: RpcResp.ServerMsgID, ClientMsgID: RpcResp.ClientMsgID, SendTime: RpcResp.SendTime}} + log.Info(params.OperationID, "ManagementSendMsg return", resp) + c.JSON(http.StatusOK, resp) + +} + +// +//type MergeElem struct { +// Title string `json:"title"` +// AbstractList []string `json:"abstractList"` +// MultiMessage []*MsgStruct `json:"multiMessage"` +//} +// +//type QuoteElem struct { +// Text string `json:"text"` +// QuoteMessage *MsgStruct `json:"quoteMessage"` +//} +type ManagementSendMsgReq struct { + OperationID string `json:"operationID" binding:"required"` + SendID string `json:"sendID" binding:"required"` + RecvID string `json:"recvID" ` + GroupID string `json:"groupID" ` + SenderNickname string `json:"senderNickname" ` + SenderFaceURL string `json:"senderFaceURL" ` + SenderPlatformID int32 `json:"senderPlatformID"` + ForceList []string `json:"forceList" ` + Content map[string]interface{} `json:"content" binding:"required"` + ContentType int32 `json:"contentType" binding:"required"` + SessionType int32 `json:"sessionType" binding:"required"` + IsOnlineOnly bool `json:"isOnlineOnly"` + OfflinePushInfo *open_im_sdk.OfflinePushInfo `json:"offlinePushInfo"` +} + +type PictureBaseInfo struct { + UUID string `mapstructure:"uuid"` + Type string `mapstructure:"type" ` + Size int64 `mapstructure:"size" ` + Width int32 `mapstructure:"width" ` + Height int32 `mapstructure:"height"` + Url string `mapstructure:"url" ` +} + +type PictureElem struct { + SourcePath string `mapstructure:"sourcePath"` + SourcePicture PictureBaseInfo `mapstructure:"sourcePicture"` + BigPicture PictureBaseInfo `mapstructure:"bigPicture" ` + SnapshotPicture PictureBaseInfo `mapstructure:"snapshotPicture"` +} +type SoundElem struct { + UUID string `mapstructure:"uuid"` + SoundPath string `mapstructure:"soundPath"` + SourceURL string `mapstructure:"sourceUrl"` + DataSize int64 `mapstructure:"dataSize"` + Duration int64 `mapstructure:"duration"` +} +type VideoElem struct { + VideoPath string `mapstructure:"videoPath"` + VideoUUID string `mapstructure:"videoUUID"` + VideoURL string `mapstructure:"videoUrl"` + VideoType string `mapstructure:"videoType"` + VideoSize int64 `mapstructure:"videoSize"` + Duration int64 `mapstructure:"duration"` + SnapshotPath string `mapstructure:"snapshotPath"` + SnapshotUUID string `mapstructure:"snapshotUUID"` + SnapshotSize int64 `mapstructure:"snapshotSize"` + SnapshotURL string `mapstructure:"snapshotUrl"` + SnapshotWidth int32 `mapstructure:"snapshotWidth"` + SnapshotHeight int32 `mapstructure:"snapshotHeight"` +} +type FileElem struct { + FilePath string `mapstructure:"filePath"` + UUID string `mapstructure:"uuid"` + SourceURL string `mapstructure:"sourceUrl"` + FileName string `mapstructure:"fileName"` + FileSize int64 `mapstructure:"fileSize"` +} +type AtElem struct { + Text string `mapstructure:"text"` + AtUserList []string `mapstructure:"atUserList"` + IsAtSelf bool `mapstructure:"isAtSelf"` +} +type LocationElem struct { + Description string `mapstructure:"description"` + Longitude float64 `mapstructure:"longitude"` + Latitude float64 `mapstructure:"latitude"` +} +type CustomElem struct { + Data string `mapstructure:"data" validate:"required"` + Description string `mapstructure:"description"` + Extension string `mapstructure:"extension"` +} +type TextElem struct { + Text string `mapstructure:"text" validate:"required"` +} + +type RevokeElem struct { + RevokeMsgClientID string `mapstructure:"revokeMsgClientID" validate:"required"` +} +type OANotificationElem struct { + NotificationName string `mapstructure:"notificationName" validate:"required"` + NotificationFaceURL string `mapstructure:"notificationFaceURL" validate:"required"` + NotificationType int32 `mapstructure:"notificationType" validate:"required"` + Text string `mapstructure:"text" validate:"required"` + Url string `mapstructure:"url"` + MixType int32 `mapstructure:"mixType"` + PictureElem PictureElem `mapstructure:"pictureElem"` + SoundElem SoundElem `mapstructure:"soundElem"` + VideoElem VideoElem `mapstructure:"videoElem"` + FileElem FileElem `mapstructure:"fileElem"` + Ex string `mapstructure:"ex"` +} diff --git a/internal/api/manage/management_user.go b/internal/api/manage/management_user.go new file mode 100644 index 000000000..5bcc19be0 --- /dev/null +++ b/internal/api/manage/management_user.go @@ -0,0 +1,180 @@ +/* +** description(""). +** copyright('open-im,www.open-im.io'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/9/15 10:28). + */ +package manage + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbRelay "Open_IM/pkg/proto/relay" + rpc "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func DeleteUser(c *gin.Context) { + params := api.DeleteUsersReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.DeleteUsersReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "DeleteUser args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + + RpcResp, err := client.DeleteUsers(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "call delete users rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call delete users rpc server failed"}) + return + } + resp := api.DeleteUsersResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, FailedUserIDList: RpcResp.FailedUserIDList} + if len(RpcResp.FailedUserIDList) == 0 { + resp.FailedUserIDList = []string{} + } + log.NewInfo(req.OperationID, "DeleteUser api return", resp) + c.JSON(http.StatusOK, resp) +} +func GetAllUsersUid(c *gin.Context) { + params := api.GetAllUsersUidReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetAllUserIDReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "GetAllUsersUid args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.GetAllUserID(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "call GetAllUsersUid users rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call GetAllUsersUid users rpc server failed"}) + return + } + resp := api.GetAllUsersUidResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserIDList: RpcResp.UserIDList} + if len(RpcResp.UserIDList) == 0 { + resp.UserIDList = []string{} + } + log.NewInfo(req.OperationID, "GetAllUsersUid api return", resp) + c.JSON(http.StatusOK, resp) + +} +func AccountCheck(c *gin.Context) { + params := api.AccountCheckReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.AccountCheckReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "AccountCheck args ", req.String()) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + + RpcResp, err := client.AccountCheck(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "call AccountCheck users rpc server failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call AccountCheck users rpc server failed"}) + return + } + resp := api.AccountCheckResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, ResultList: RpcResp.ResultList} + if len(RpcResp.ResultList) == 0 { + resp.ResultList = []*rpc.AccountCheckResp_SingleUserStatus{} + } + log.NewInfo(req.OperationID, "AccountCheck api return", resp) + c.JSON(http.StatusOK, resp) +} +func GetUsersOnlineStatus(c *gin.Context) { + params := api.GetUsersOnlineStatusReq{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &pbRelay.GetUsersOnlineStatusReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "GetUsersOnlineStatus args ", req.String()) + var wsResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult + var respResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult + flag := false + grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) + for _, v := range grpcCons { + client := pbRelay.NewOnlineMessageRelayServiceClient(v) + reply, err := client.GetUsersOnlineStatus(context.Background(), req) + if err != nil { + log.NewError(params.OperationID, "GetUsersOnlineStatus rpc err", req.String(), err.Error()) + continue + } else { + if reply.ErrCode == 0 { + wsResult = append(wsResult, reply.SuccessResult...) + } + } + } + log.NewInfo(params.OperationID, "call GetUsersOnlineStatus rpc server is success", wsResult) + //Online data merge of each node + for _, v1 := range params.UserIDList { + flag = false + temp := new(pbRelay.GetUsersOnlineStatusResp_SuccessResult) + for _, v2 := range wsResult { + if v2.UserID == v1 { + flag = true + temp.UserID = v1 + temp.Status = constant.OnlineStatus + temp.DetailPlatformStatus = append(temp.DetailPlatformStatus, v2.DetailPlatformStatus...) + } + + } + if !flag { + temp.UserID = v1 + temp.Status = constant.OfflineStatus + } + respResult = append(respResult, temp) + } + resp := api.GetUsersOnlineStatusResp{CommResp: api.CommResp{ErrCode: 0, ErrMsg: ""}, SuccessResult: respResult} + if len(respResult) == 0 { + resp.SuccessResult = []*pbRelay.GetUsersOnlineStatusResp_SuccessResult{} + } + log.NewInfo(req.OperationID, "GetUsersOnlineStatus api return", resp) + c.JSON(http.StatusOK, resp) + +} diff --git a/internal/api/office/tag.go b/internal/api/office/tag.go new file mode 100644 index 000000000..2471ddd87 --- /dev/null +++ b/internal/api/office/tag.go @@ -0,0 +1,280 @@ +package office + +import ( + apistruct "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbOffice "Open_IM/pkg/proto/office" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func GetUserTags(c *gin.Context) { + var ( + req apistruct.GetUserTagsReq + resp apistruct.GetUserTagsResp + reqPb pbOffice.GetUserTagsReq + respPb *pbOffice.GetUserTagsResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.UserID = userID + reqPb.OperationID = req.OperationID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.GetUserTags(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserTags rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + if respPb.Tags != nil { + resp.Data.Tags = respPb.Tags + } else { + resp.Data.Tags = []*pbOffice.Tag{} + } + c.JSON(http.StatusOK, resp) +} + +func CreateTag(c *gin.Context) { + var ( + req apistruct.CreateTagReq + resp apistruct.CreateTagResp + reqPb pbOffice.CreateTagReq + respPb *pbOffice.CreateTagResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.CreateTag(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + c.JSON(http.StatusOK, resp) +} + +func DeleteTag(c *gin.Context) { + var ( + req apistruct.DeleteTagReq + resp apistruct.DeleteTagResp + reqPb pbOffice.DeleteTagReq + respPb *pbOffice.DeleteTagResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.DeleteTag(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + c.JSON(http.StatusOK, resp) +} + +func SetTag(c *gin.Context) { + var ( + req apistruct.SetTagReq + resp apistruct.SetTagResp + reqPb pbOffice.SetTagReq + respPb *pbOffice.SetTagResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.SetTag(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + c.JSON(http.StatusOK, resp) +} + +func SendMsg2Tag(c *gin.Context) { + var ( + req apistruct.SendMsg2TagReq + resp apistruct.SendMsg2TagResp + reqPb pbOffice.SendMsg2TagReq + respPb *pbOffice.SendMsg2TagResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.SendID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.SendMsg2Tag(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + c.JSON(http.StatusOK, resp) +} + +func GetTagSendLogs(c *gin.Context) { + var ( + req apistruct.GetTagSendLogsReq + resp apistruct.GetTagSendLogsResp + reqPb pbOffice.GetTagSendLogsReq + respPb *pbOffice.GetTagSendLogsResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.UserID = userID + reqPb.OperationID = req.OperationID + reqPb.Pagination = &pbCommon.RequestPagination{ + PageNumber: req.PageNumber, + ShowNumber: req.ShowNumber, + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.GetTagSendLogs(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + if respPb.TagSendLogs != nil { + resp.Data.Logs = respPb.TagSendLogs + } else { + resp.Data.Logs = []*pbOffice.TagSendLog{} + } + resp.Data.ShowNumber = respPb.Pagination.ShowNumber + resp.Data.CurrentPage = respPb.Pagination.CurrentPage + c.JSON(http.StatusOK, resp) +} + +func GetUserTagByID(c *gin.Context) { + var ( + req apistruct.GetUserTagByIDReq + resp apistruct.GetUserTagByIDResp + reqPb pbOffice.GetUserTagByIDReq + respPb *pbOffice.GetUserTagByIDResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.UserID = userID + reqPb.OperationID = req.OperationID + reqPb.TagID = req.TagID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.GetUserTagByID(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTagByID failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Data.Tag = respPb.Tag + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/office/work_moments.go b/internal/api/office/work_moments.go new file mode 100644 index 000000000..ac7619dda --- /dev/null +++ b/internal/api/office/work_moments.go @@ -0,0 +1,371 @@ +package office + +import ( + apiStruct "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbOffice "Open_IM/pkg/proto/office" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func CreateOneWorkMoment(c *gin.Context) { + var ( + req apiStruct.CreateOneWorkMomentReq + resp apiStruct.CreateOneWorkMomentResp + reqPb pbOffice.CreateOneWorkMomentReq + respPb *pbOffice.CreateOneWorkMomentResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.CreateOneWorkMoment(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CreateOneWorkMoment rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateOneWorkMoment rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func DeleteOneWorkMoment(c *gin.Context) { + var ( + req apiStruct.DeleteOneWorkMomentReq + resp apiStruct.DeleteOneWorkMomentResp + reqPb pbOffice.DeleteOneWorkMomentReq + respPb *pbOffice.DeleteOneWorkMomentResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.DeleteOneWorkMoment(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DeleteOneWorkMoment rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "DeleteOneWorkMoment rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func LikeOneWorkMoment(c *gin.Context) { + var ( + req apiStruct.LikeOneWorkMomentReq + resp apiStruct.LikeOneWorkMomentResp + reqPb pbOffice.LikeOneWorkMomentReq + respPb *pbOffice.LikeOneWorkMomentResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.LikeOneWorkMoment(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "LikeOneWorkMoment rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "LikeOneWorkMoment rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func CommentOneWorkMoment(c *gin.Context) { + var ( + req apiStruct.CommentOneWorkMomentReq + resp apiStruct.CommentOneWorkMomentResp + reqPb pbOffice.CommentOneWorkMomentReq + respPb *pbOffice.CommentOneWorkMomentResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.CommentOneWorkMoment(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CommentOneWorkMoment rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CommentOneWorkMoment rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetUserWorkMoments(c *gin.Context) { + var ( + req apiStruct.GetUserWorkMomentsReq + resp apiStruct.GetUserWorkMomentsResp + reqPb pbOffice.GetUserWorkMomentsReq + respPb *pbOffice.GetUserWorkMomentsResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.OperationID = req.OperationID + reqPb.Pagination = &pbCommon.RequestPagination{ + PageNumber: req.PageNumber, + ShowNumber: req.ShowNumber, + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.GetUserWorkMoments(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMoments rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMoments rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Data.WorkMoments = respPb.WorkMoments + resp.Data.ShowNumber = respPb.Pagination.ShowNumber + resp.Data.CurrentPage = respPb.Pagination.CurrentPage + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetUserFriendWorkMoments(c *gin.Context) { + var ( + req apiStruct.GetUserFriendWorkMomentsReq + resp apiStruct.GetUserFriendWorkMomentsResp + reqPb pbOffice.GetUserFriendWorkMomentsReq + respPb *pbOffice.GetUserFriendWorkMomentsResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.OperationID = req.OperationID + reqPb.Pagination = &pbCommon.RequestPagination{ + PageNumber: req.PageNumber, + ShowNumber: req.ShowNumber, + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.GetUserFriendWorkMoments(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserFriendWorkMoments rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserFriendWorkMoments rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Data.WorkMoments = respPb.WorkMoments + resp.Data.ShowNumber = respPb.Pagination.ShowNumber + resp.Data.CurrentPage = respPb.Pagination.CurrentPage + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetUserWorkMomentsCommentsMsg(c *gin.Context) { + var ( + req apiStruct.GetUserWorkMomentsCommentsMsgReq + resp apiStruct.GetUserWorkMomentsCommentsMsgResp + reqPb pbOffice.GetUserWorkMomentsCommentsMsgReq + respPb *pbOffice.GetUserWorkMomentsCommentsMsgResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.OperationID = req.OperationID + reqPb.Pagination = &pbCommon.RequestPagination{ + PageNumber: req.PageNumber, + ShowNumber: req.ShowNumber, + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.GetUserWorkMomentsCommentsMsg(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMomentsCommentsMsg rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMomentsCommentsMsg rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Data.CurrentPage = respPb.Pagination.CurrentPage + resp.Data.ShowNumber = respPb.Pagination.ShowNumber + resp.Data.CommentMsgs = respPb.CommentsMsgs + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func SetUserWorkMomentsLevel(c *gin.Context) { + var ( + req apiStruct.SetUserWorkMomentsLevelReq + resp apiStruct.SetUserWorkMomentsLevelResp + reqPb pbOffice.SetUserWorkMomentsLevelReq + respPb *pbOffice.SetUserWorkMomentsLevelResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.SetUserWorkMomentsLevel(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetUserWorkMomentsLevel rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "SetUserWorkMomentsLevel rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func ClearUserWorkMomentsCommentsMsg(c *gin.Context) { + var ( + req apiStruct.ClearUserWorkMomentsCommentsMsgReq + resp apiStruct.ClearUserWorkMomentsCommentsMsgResp + reqPb pbOffice.ClearUserWorkMomentsCommentsMsgReq + respPb *pbOffice.ClearUserWorkMomentsCommentsMsgResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.UserID = userID + reqPb.OperationID = req.OperationID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.ClearUserWorkMomentsCommentsMsg(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ClearUserWorkMomentsCommentsMsg rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "ClearUserWorkMomentsCommentsMsg rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/organization/organization.go b/internal/api/organization/organization.go new file mode 100644 index 000000000..250e9eef0 --- /dev/null +++ b/internal/api/organization/organization.go @@ -0,0 +1,439 @@ +package organization + +import ( + jsonData "Open_IM/internal/utils" + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/organization" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func CreateDepartment(c *gin.Context) { + params := api.CreateDepartmentReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.CreateDepartmentReq{DepartmentInfo: &open_im_sdk.Department{}} + utils.CopyStructFields(req, ¶ms) + utils.CopyStructFields(req.DepartmentInfo, ¶ms) + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + " " + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.CreateDepartment(context.Background(), req) + if err != nil { + errMsg := "rpc CreateDepartment failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.CreateDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, Department: RpcResp.DepartmentInfo} + apiResp.Data = jsonData.JsonDataOne(RpcResp.DepartmentInfo) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func UpdateDepartment(c *gin.Context) { + params := api.UpdateDepartmentReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.UpdateDepartmentReq{DepartmentInfo: &open_im_sdk.Department{}} + utils.CopyStructFields(req, ¶ms) + utils.CopyStructFields(req.DepartmentInfo, ¶ms) + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.UpdateDepartment(context.Background(), req) + if err != nil { + errMsg := "rpc UpdateDepartment failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.UpdateDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func GetSubDepartment(c *gin.Context) { + params := api.GetSubDepartmentReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.GetSubDepartmentReq{} + utils.CopyStructFields(req, ¶ms) + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.GetSubDepartment(context.Background(), req) + if err != nil { + errMsg := "rpc GetDepartment failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.GetSubDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, DepartmentList: RpcResp.DepartmentList} + apiResp.Data = jsonData.JsonDataList(RpcResp.DepartmentList) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func DeleteDepartment(c *gin.Context) { + params := api.DeleteDepartmentReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.DeleteDepartmentReq{} + utils.CopyStructFields(req, ¶ms) + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.DeleteDepartment(context.Background(), req) + if err != nil { + errMsg := "rpc DeleteDepartment failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.DeleteDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func CreateOrganizationUser(c *gin.Context) { + params := api.CreateOrganizationUserReq{OrganizationUser: &open_im_sdk.OrganizationUser{}} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + req := &rpc.CreateOrganizationUserReq{OrganizationUser: &open_im_sdk.OrganizationUser{}} + utils.CopyStructFields(req, ¶ms) + utils.CopyStructFields(req.OrganizationUser, ¶ms) + + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.CreateOrganizationUser(context.Background(), req) + if err != nil { + errMsg := "rpc CreateOrganizationUser failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.CreateOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func UpdateOrganizationUser(c *gin.Context) { + params := api.UpdateOrganizationUserReq{OrganizationUser: &open_im_sdk.OrganizationUser{}} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + req := &rpc.UpdateOrganizationUserReq{OrganizationUser: &open_im_sdk.OrganizationUser{}} + utils.CopyStructFields(req, ¶ms) + utils.CopyStructFields(req.OrganizationUser, ¶ms) + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.UpdateOrganizationUser(context.Background(), req) + if err != nil { + errMsg := "rpc UpdateOrganizationUser failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.UpdateOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func CreateDepartmentMember(c *gin.Context) { + params := api.CreateDepartmentMemberReq{UserInDepartment: &open_im_sdk.UserInDepartment{}} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + req := &rpc.CreateDepartmentMemberReq{UserInDepartment: &open_im_sdk.UserInDepartment{}} + utils.CopyStructFields(req, ¶ms) + utils.CopyStructFields(req.UserInDepartment, ¶ms) + + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.CreateDepartmentMember(context.Background(), req) + if err != nil { + errMsg := "rpc CreateDepartmentMember failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.CreateDepartmentMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func GetUserInDepartment(c *gin.Context) { + params := api.GetUserInDepartmentReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + req := &rpc.GetUserInDepartmentReq{} + utils.CopyStructFields(req, ¶ms) + + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.GetUserInDepartment(context.Background(), req) + if err != nil { + errMsg := "rpc GetUserInDepartment failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.GetUserInDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, UserInDepartment: RpcResp.UserInDepartment} + apiResp.Data = jsonData.JsonDataOne(RpcResp.UserInDepartment) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func UpdateUserInDepartment(c *gin.Context) { + params := api.UpdateUserInDepartmentReq{DepartmentMember: &open_im_sdk.DepartmentMember{}} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + req := &rpc.UpdateUserInDepartmentReq{DepartmentMember: &open_im_sdk.DepartmentMember{}} + utils.CopyStructFields(req, ¶ms) + + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.UpdateUserInDepartment(context.Background(), req) + if err != nil { + errMsg := "rpc UpdateUserInDepartment failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.UpdateUserInDepartmentResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func DeleteOrganizationUser(c *gin.Context) { + params := api.DeleteOrganizationUserReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + req := &rpc.DeleteOrganizationUserReq{} + utils.CopyStructFields(req, ¶ms) + + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.DeleteOrganizationUser(context.Background(), req) + if err != nil { + errMsg := "rpc DeleteOrganizationUser failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.DeleteOrganizationUserResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func GetDepartmentMember(c *gin.Context) { + params := api.GetDepartmentMemberReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + + req := &rpc.GetDepartmentMemberReq{} + utils.CopyStructFields(req, ¶ms) + + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.GetDepartmentMember(context.Background(), req) + if err != nil { + errMsg := "rpc GetDepartmentMember failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.GetDepartmentMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, UserInDepartmentList: RpcResp.UserInDepartmentList} + apiResp.Data = jsonData.JsonDataList(RpcResp.UserInDepartmentList) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} + +func DeleteUserInDepartment(c *gin.Context) { + params := api.DeleteUserInDepartmentReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.DeleteUserInDepartmentReq{} + utils.CopyStructFields(req, ¶ms) + + err, opUserID := token_verify.ParseTokenGetUserID(c.Request.Header.Get("token"), req.OperationID) + req.OpUserID = opUserID + if err != nil { + errMsg := "ParseTokenGetUserID failed " + err.Error() + c.Request.Header.Get("token") + log.NewError(req.OperationID, errMsg, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api args ", req.String(), "params", params) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOrganizationName) + client := rpc.NewOrganizationClient(etcdConn) + RpcResp, err := client.DeleteUserInDepartment(context.Background(), req) + if err != nil { + errMsg := "rpc DeleteUserInDepartment failed " + err.Error() + req.String() + log.NewError(req.OperationID, errMsg) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": errMsg}) + return + } + + apiResp := api.GetDepartmentMemberResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "api return ", apiResp) + c.JSON(http.StatusOK, apiResp) +} diff --git a/internal/api/third/ali_oss_credential.go b/internal/api/third/ali_oss_credential.go new file mode 100644 index 000000000..6f5bc7c04 --- /dev/null +++ b/internal/api/third/ali_oss_credential.go @@ -0,0 +1,95 @@ +package apiThird + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "fmt" + openapi "github.com/alibabacloud-go/darabonba-openapi/client" + sts20150401 "github.com/alibabacloud-go/sts-20150401/client" + "github.com/alibabacloud-go/tea/tea" + "github.com/fatih/structs" + + //"github.com/fatih/structs" + "github.com/gin-gonic/gin" + "net/http" + "time" +) + +var stsClient *sts20150401.Client + +/** + * 使用AK&SK初始化账号Client + * @param accessKeyId + * @param accessKeySecret + * @return Client + * @throws Exception + */ +func getStsClient() *sts20150401.Client { + if stsClient != nil { + return stsClient + } + conf := &openapi.Config{ + // 您的AccessKey ID + AccessKeyId: tea.String(config.Config.Credential.Ali.AccessKeyID), + // 您的AccessKey Secret + AccessKeySecret: tea.String(config.Config.Credential.Ali.AccessKeySecret), + // Endpoint + Endpoint: tea.String(config.Config.Credential.Ali.StsEndpoint), + } + result, err := sts20150401.NewClient(conf) + if err != nil { + log.NewError("", "alists client初始化失败 ", err) + } + stsClient = result + return stsClient +} + +func AliOSSCredential(c *gin.Context) { + req := api.OSSCredentialReq{} + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "AliOSSCredential args ", userID) + + stsResp, err := getStsClient().AssumeRole(&sts20150401.AssumeRoleRequest{ + DurationSeconds: tea.Int64(config.Config.Credential.Ali.StsDurationSeconds), + Policy: nil, + RoleArn: tea.String(config.Config.Credential.Ali.OssRoleArn), + RoleSessionName: tea.String(fmt.Sprintf("%s-%d", userID, time.Now().Unix())), + }) + + resp := api.OSSCredentialResp{} + if err != nil { + resp.ErrCode = constant.ErrTencentCredential.ErrCode + resp.ErrMsg = err.Error() + } else { + resp = api.OSSCredentialResp{ + CommResp: api.CommResp{}, + OssData: api.OSSCredentialRespData{ + Endpoint: config.Config.Credential.Ali.OssEndpoint, + AccessKeyId: *stsResp.Body.Credentials.AccessKeyId, + AccessKeySecret: *stsResp.Body.Credentials.AccessKeySecret, + Token: *stsResp.Body.Credentials.SecurityToken, + Bucket: config.Config.Credential.Ali.Bucket, + FinalHost: config.Config.Credential.Ali.FinalHost, + }, + Data: nil, + } + } + + resp.Data = structs.Map(&resp.OssData) + log.NewInfo(req.OperationID, "AliOSSCredential return ", resp) + + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/third/minio_init.go b/internal/api/third/minio_init.go new file mode 100644 index 000000000..b3d66b934 --- /dev/null +++ b/internal/api/third/minio_init.go @@ -0,0 +1,67 @@ +package apiThird + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "context" + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" + url2 "net/url" +) + +var ( + minioClient *minio.Client +) + +func MinioInit() { + operationID := utils.OperationIDGenerator() + log.NewInfo(operationID, utils.GetSelfFuncName(), "minio config: ", config.Config.Credential.Minio) + var initUrl string + if config.Config.Credential.Minio.EndpointInnerEnable { + initUrl = config.Config.Credential.Minio.EndpointInner + } else { + initUrl = config.Config.Credential.Minio.Endpoint + } + log.NewInfo(operationID, utils.GetSelfFuncName(), "use initUrl: ", initUrl) + minioUrl, err := url2.Parse(initUrl) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "parse failed, please check config/config.yaml", err.Error()) + return + } + log.NewInfo(operationID, utils.GetSelfFuncName(), "Parse ok ", config.Config.Credential.Minio) + minioClient, err = minio.New(minioUrl.Host, &minio.Options{ + Creds: credentials.NewStaticV4(config.Config.Credential.Minio.AccessKeyID, config.Config.Credential.Minio.SecretAccessKey, ""), + Secure: false, + }) + log.NewInfo(operationID, utils.GetSelfFuncName(), "new ok ", config.Config.Credential.Minio) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "init minio client failed", err.Error()) + return + } + opt := minio.MakeBucketOptions{ + Region: config.Config.Credential.Minio.Location, + ObjectLocking: false, + } + err = minioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.Bucket, opt) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "MakeBucket failed ", err.Error()) + exists, err := minioClient.BucketExists(context.Background(), config.Config.Credential.Minio.Bucket) + if err == nil && exists { + log.NewWarn(operationID, utils.GetSelfFuncName(), "We already own ", config.Config.Credential.Minio.Bucket) + } else { + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) + } + log.NewError(operationID, utils.GetSelfFuncName(), "create bucket failed and bucket not exists") + return + } + } + // 自动化桶public的代码 + //err = minioClient.SetBucketPolicy(context.Background(), config.Config.Credential.Minio.Bucket, policy.BucketPolicyReadWrite) + //if err != nil { + // log.NewError("", utils.GetSelfFuncName(), "SetBucketPolicy failed please set in web", err.Error()) + // return + //} + log.NewInfo(operationID, utils.GetSelfFuncName(), "minio create and set policy success") +} diff --git a/internal/api/third/minio_storage_credential.go b/internal/api/third/minio_storage_credential.go new file mode 100644 index 000000000..f9f4c078d --- /dev/null +++ b/internal/api/third/minio_storage_credential.go @@ -0,0 +1,138 @@ +package apiThird + +import ( + apiStruct "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + _ "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "github.com/minio/minio-go/v7" + _ "github.com/minio/minio-go/v7" + cr "github.com/minio/minio-go/v7/pkg/credentials" + "net/http" +) + +func MinioUploadFile(c *gin.Context) { + var ( + req apiStruct.MinioUploadFileReq + resp apiStruct.MinioUploadFileResp + ) + defer func() { + if r := recover(); r != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), r) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "missing file or snapShot args"}) + return + } + }() + if err := c.Bind(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + ok, _ := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError("", utils.GetSelfFuncName(), "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req) + switch req.FileType { + // videoType upload snapShot + case constant.VideoType: + snapShotFile, err := c.FormFile("snapShot") + if err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "missing snapshot arg: " + err.Error()}) + return + } + snapShotFileObj, err := snapShotFile.Open() + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "Open file error", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + snapShotNewName, snapShotNewType := utils.GetNewFileNameAndContentType(snapShotFile.Filename, constant.ImageType) + log.Debug(req.OperationID, utils.GetSelfFuncName(), snapShotNewName, snapShotNewType) + _, err = minioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, snapShotNewName, snapShotFileObj, snapShotFile.Size, minio.PutObjectOptions{ContentType: snapShotNewType}) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject snapShotFile error", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + resp.SnapshotURL = config.Config.Credential.Minio.Endpoint + "/" + config.Config.Credential.Minio.Bucket + "/" + snapShotNewName + resp.SnapshotNewName = snapShotNewName + } + file, err := c.FormFile("file") + if err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "missing file arg: " + err.Error()}) + return + } + fileObj, err := file.Open() + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "Open file error", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "invalid file path" + err.Error()}) + return + } + newName, newType := utils.GetNewFileNameAndContentType(file.Filename, req.FileType) + log.Debug(req.OperationID, utils.GetSelfFuncName(), newName, newType) + _, err = minioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, minio.PutObjectOptions{ContentType: newType}) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "open file error") + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "invalid file path" + err.Error()}) + return + } + resp.NewName = newName + resp.URL = config.Config.Credential.Minio.Endpoint + "/" + config.Config.Credential.Minio.Bucket + "/" + newName + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp}) + return +} + +func MinioStorageCredential(c *gin.Context) { + var ( + req apiStruct.MinioStorageCredentialReq + resp apiStruct.MiniostorageCredentialResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + ok, _ := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError("", utils.GetSelfFuncName(), "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + var stsOpts cr.STSAssumeRoleOptions + stsOpts.AccessKey = config.Config.Credential.Minio.AccessKeyID + stsOpts.SecretKey = config.Config.Credential.Minio.SecretAccessKey + stsOpts.DurationSeconds = constant.MinioDurationTimes + var endpoint string + if config.Config.Credential.Minio.EndpointInnerEnable { + endpoint = config.Config.Credential.Minio.EndpointInner + } else { + endpoint = config.Config.Credential.Minio.Endpoint + } + li, err := cr.NewSTSAssumeRole(endpoint, stsOpts) + if err != nil { + log.NewError("", utils.GetSelfFuncName(), "NewSTSAssumeRole failed", err.Error(), stsOpts, config.Config.Credential.Minio.Endpoint) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + v, err := li.Get() + if err != nil { + log.NewError("0", utils.GetSelfFuncName(), "li.Get error", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + resp.SessionToken = v.SessionToken + resp.SecretAccessKey = v.SecretAccessKey + resp.AccessKeyID = v.AccessKeyID + resp.BucketName = config.Config.Credential.Minio.Bucket + resp.StsEndpointURL = config.Config.Credential.Minio.Endpoint + c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp}) +} diff --git a/internal/api/third/tencent_cloud_storage_credential.go b/internal/api/third/tencent_cloud_storage_credential.go new file mode 100644 index 000000000..ed293791e --- /dev/null +++ b/internal/api/third/tencent_cloud_storage_credential.go @@ -0,0 +1,72 @@ +package apiThird + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "github.com/fatih/structs" + + //"github.com/fatih/structs" + "github.com/gin-gonic/gin" + sts "github.com/tencentyun/qcloud-cos-sts-sdk/go" + "net/http" + "time" +) + +func TencentCloudStorageCredential(c *gin.Context) { + req := api.TencentCloudStorageCredentialReq{} + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(req.OperationID, "TencentCloudStorageCredential args ", userID) + + cli := sts.NewClient( + config.Config.Credential.Tencent.SecretID, + config.Config.Credential.Tencent.SecretKey, + nil, + ) + + opt := &sts.CredentialOptions{ + DurationSeconds: int64(time.Hour.Seconds()), + Region: config.Config.Credential.Tencent.Region, + Policy: &sts.CredentialPolicy{ + Statement: []sts.CredentialPolicyStatement{ + { + Action: []string{ + "name/cos:PostObject", + "name/cos:PutObject", + }, + Effect: "allow", + Resource: []string{ + "qcs::cos:" + config.Config.Credential.Tencent.Region + ":uid/" + config.Config.Credential.Tencent.AppID + ":" + config.Config.Credential.Tencent.Bucket + "/*", + }, + }, + }, + }, + } + res, err := cli.GetCredential(opt) + resp := api.TencentCloudStorageCredentialResp{} + if err != nil { + resp.ErrCode = constant.ErrTencentCredential.ErrCode + resp.ErrMsg = err.Error() + } else { + resp.CosData.Bucket = config.Config.Credential.Tencent.Bucket + resp.CosData.Region = config.Config.Credential.Tencent.Region + resp.CosData.CredentialResult = res + } + + resp.Data = structs.Map(&resp.CosData) + log.NewInfo(req.OperationID, "TencentCloudStorageCredential return ", resp) + + c.JSON(http.StatusOK, resp) +} diff --git a/internal/api/user/user.go b/internal/api/user/user.go new file mode 100644 index 000000000..1756a9f8d --- /dev/null +++ b/internal/api/user/user.go @@ -0,0 +1,129 @@ +package user + +import ( + jsonData "Open_IM/internal/utils" + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + rpc "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func GetUsersInfo(c *gin.Context) { + params := api.GetUsersInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) + return + } + req := &rpc.GetUserInfoReq{} + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.GetUserInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + var publicUserInfoList []*open_im_sdk.PublicUserInfo + for _, v := range RpcResp.UserInfoList { + publicUserInfoList = append(publicUserInfoList, + &open_im_sdk.PublicUserInfo{UserID: v.UserID, Nickname: v.Nickname, FaceURL: v.FaceURL, Gender: v.Gender, Ex: v.Ex}) + } + + resp := api.GetUsersInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfoList: publicUserInfoList} + resp.Data = jsonData.JsonDataList(resp.UserInfoList) + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func UpdateUserInfo(c *gin.Context) { + params := api.UpdateSelfUserInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()}) + return + } + req := &rpc.UpdateUserInfoReq{UserInfo: &open_im_sdk.UserInfo{}} + utils.CopyStructFields(req.UserInfo, ¶ms) + + req.OperationID = params.OperationID + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + log.NewInfo(params.OperationID, "UpdateUserInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.UpdateUserInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "UpdateUserInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + resp := api.UpdateUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "UpdateUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetSelfUserInfo(c *gin.Context) { + params := api.GetSelfUserInfoReq{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) + return + } + req := &rpc.GetUserInfoReq{} + + utils.CopyStructFields(req, ¶ms) + var ok bool + ok, req.OpUserID = token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + req.UserIDList = append(req.UserIDList, req.OpUserID) + log.NewInfo(params.OperationID, "GetUserInfo args ", req.String()) + + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := rpc.NewUserClient(etcdConn) + RpcResp, err := client.GetUserInfo(context.Background(), req) + if err != nil { + log.NewError(req.OperationID, "GetUserInfo failed ", err.Error(), req.String()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "call rpc server failed"}) + return + } + if len(RpcResp.UserInfoList) == 1 { + resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}, UserInfo: RpcResp.UserInfoList[0]} + resp.Data = jsonData.JsonDataOne(resp.UserInfo) + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + } else { + resp := api.GetSelfUserInfoResp{CommResp: api.CommResp{ErrCode: RpcResp.CommonResp.ErrCode, ErrMsg: RpcResp.CommonResp.ErrMsg}} + log.NewInfo(req.OperationID, "GetUserInfo api return ", resp) + c.JSON(http.StatusOK, resp) + } + +} diff --git a/internal/cms_api/admin/admin.go b/internal/cms_api/admin/admin.go new file mode 100644 index 000000000..02b2390c5 --- /dev/null +++ b/internal/cms_api/admin/admin.go @@ -0,0 +1,42 @@ +package admin + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbAdmin "Open_IM/pkg/proto/admin_cms" + "Open_IM/pkg/utils" + "context" + "strings" + + "github.com/gin-gonic/gin" +) + +// register +func AdminLogin(c *gin.Context) { + var ( + req cms_api_struct.AdminLoginRequest + resp cms_api_struct.AdminLoginResponse + reqPb pbAdmin.AdminLoginReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewInfo("0", utils.GetSelfFuncName(), err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.Secret = req.Secret + reqPb.AdminID = req.AdminName + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImAdminCMSName) + client := pbAdmin.NewAdminCMSClient(etcdConn) + respPb, err := client.AdminLogin(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.Token = respPb.Token + openIMHttp.RespHttp200(c, constant.OK, resp) +} diff --git a/internal/cms_api/group/group.go b/internal/cms_api/group/group.go new file mode 100644 index 000000000..740fd5821 --- /dev/null +++ b/internal/cms_api/group/group.go @@ -0,0 +1,450 @@ +package group + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + commonPb "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "strings" + + pbGroup "Open_IM/pkg/proto/group" + + "github.com/gin-gonic/gin" +) + +func GetGroupById(c *gin.Context) { + var ( + req cms_api_struct.GetGroupByIdRequest + resp cms_api_struct.GetGroupByIdResponse + reqPb pbGroup.GetGroupByIdReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.GetGroupById(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupById failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.GroupName = respPb.CMSGroup.GroupInfo.GroupName + resp.GroupID = respPb.CMSGroup.GroupInfo.GroupID + resp.CreateTime = (utils.UnixSecondToTime(int64(respPb.CMSGroup.GroupInfo.CreateTime))).String() + resp.ProfilePhoto = respPb.CMSGroup.GroupInfo.FaceURL + resp.GroupMasterName = respPb.CMSGroup.GroupMasterName + resp.GroupMasterId = respPb.CMSGroup.GroupMasterId + resp.IsBanChat = constant.GroupIsBanChat(respPb.CMSGroup.GroupInfo.Status) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetGroups(c *gin.Context) { + var ( + req cms_api_struct.GetGroupsRequest + resp cms_api_struct.GetGroupsResponse + reqPb pbGroup.GetGroupsReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.Pagination = &commonPb.RequestPagination{} + utils.CopyStructFields(&reqPb.Pagination, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.GetGroups(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetUserInfo failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + for _, v := range respPb.CMSGroups { + resp.Groups = append(resp.Groups, cms_api_struct.GroupResponse{ + GroupName: v.GroupInfo.GroupName, + GroupID: v.GroupInfo.GroupID, + GroupMasterName: v.GroupMasterName, + GroupMasterId: v.GroupMasterId, + CreateTime: (utils.UnixSecondToTime(int64(v.GroupInfo.CreateTime))).String(), + IsBanChat: constant.GroupIsBanChat(v.GroupInfo.Status), + IsBanPrivateChat: false, + ProfilePhoto: v.GroupInfo.FaceURL, + }) + } + resp.GroupNums = int(respPb.GroupNum) + resp.CurrentPage = int(respPb.Pagination.PageNumber) + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetGroupByName(c *gin.Context) { + var ( + req cms_api_struct.GetGroupRequest + resp cms_api_struct.GetGroupResponse + reqPb pbGroup.GetGroupReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupName = req.GroupName + reqPb.Pagination = &commonPb.RequestPagination{} + utils.CopyStructFields(&reqPb.Pagination, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.GetGroup(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroup failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrServer, nil) + return + } + for _, v := range respPb.CMSGroups { + resp.Groups = append(resp.Groups, cms_api_struct.GroupResponse{ + GroupName: v.GroupInfo.GroupName, + GroupID: v.GroupInfo.GroupID, + GroupMasterName: v.GroupMasterName, + GroupMasterId: v.GroupMasterId, + CreateTime: (utils.UnixSecondToTime(int64(v.GroupInfo.CreateTime))).String(), + IsBanChat: constant.GroupIsBanChat(v.GroupInfo.Status), + IsBanPrivateChat: false, + ProfilePhoto: v.GroupInfo.FaceURL, + }) + } + resp.CurrentPage = int(respPb.Pagination.PageNumber) + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.GroupNums = int(respPb.GroupNums) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func CreateGroup(c *gin.Context) { + var ( + req cms_api_struct.CreateGroupRequest + _ cms_api_struct.CreateGroupResponse + reqPb pbGroup.CreateGroupReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupInfo = &commonPb.GroupInfo{} + reqPb.GroupInfo.GroupName = req.GroupName + reqPb.GroupInfo.CreatorUserID = req.GroupMasterId + reqPb.OwnerUserID = req.GroupMasterId + reqPb.OpUserID = req.GroupMasterId + for _, v := range req.GroupMembers { + reqPb.InitMemberList = append(reqPb.InitMemberList, &pbGroup.GroupAddMemberInfo{ + UserID: v, + RoleLevel: 1, + }) + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.CreateGroup(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "CreateGroup failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrServer, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func BanGroupChat(c *gin.Context) { + var ( + req cms_api_struct.BanGroupChatRequest + reqPb pbGroup.OperateGroupStatusReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.Status = constant.GroupBanChat + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateGroupStatus(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BanGroupChat failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) + +} + +func BanPrivateChat(c *gin.Context) { + var ( + req cms_api_struct.BanPrivateChatRequest + reqPb pbGroup.OperateGroupStatusReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.Status = constant.GroupBanPrivateChat + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateGroupStatus(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "OperateGroupStatus failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func OpenGroupChat(c *gin.Context) { + var ( + req cms_api_struct.BanPrivateChatRequest + reqPb pbGroup.OperateGroupStatusReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.Status = constant.GroupOk + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateGroupStatus(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "OperateGroupStatus failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func OpenPrivateChat(c *gin.Context) { + var ( + req cms_api_struct.BanPrivateChatRequest + reqPb pbGroup.OperateGroupStatusReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "OpenPrivateChat failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.Status = constant.GroupOk + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateGroupStatus(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "OperateGroupStatus failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func GetGroupMembers(c *gin.Context) { + var ( + req cms_api_struct.GetGroupMembersRequest + reqPb pbGroup.GetGroupMembersCMSReq + resp cms_api_struct.GetGroupMembersResponse + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.Pagination = &commonPb.RequestPagination{ + PageNumber: int32(req.PageNumber), + ShowNumber: int32(req.ShowNumber), + } + reqPb.GroupId = req.GroupId + reqPb.UserName = req.UserName + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.GetGroupMembersCMS(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupMembersCMS failed:", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.ResponsePagination = cms_api_struct.ResponsePagination{ + CurrentPage: int(respPb.Pagination.CurrentPage), + ShowNumber: int(respPb.Pagination.ShowNumber), + } + resp.MemberNums = int(respPb.MemberNums) + for _, groupMembers := range respPb.Members { + resp.GroupMembers = append(resp.GroupMembers, cms_api_struct.GroupMemberResponse{ + MemberPosition: int(groupMembers.RoleLevel), + MemberNickName: groupMembers.Nickname, + MemberId: groupMembers.UserID, + JoinTime: utils.UnixSecondToTime(int64(groupMembers.JoinTime)).String(), + }) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func AddGroupMembers(c *gin.Context) { + var ( + req cms_api_struct.RemoveGroupMembersRequest + resp cms_api_struct.RemoveGroupMembersResponse + reqPb pbGroup.AddGroupMembersCMSReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationId, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserIds = req.Members + reqPb.GroupId = req.GroupId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.AddGroupMembersCMS(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationId, utils.GetSelfFuncName(), "AddGroupMembersCMS failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.Success = respPb.Success + resp.Failed = respPb.Failed + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func RemoveGroupMembers(c *gin.Context) { + var ( + req cms_api_struct.RemoveGroupMembersRequest + resp cms_api_struct.RemoveGroupMembersResponse + reqPb pbGroup.RemoveGroupMembersCMSReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserIds = req.Members + reqPb.GroupId = req.GroupId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + respPb, err := client.RemoveGroupMembersCMS(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "RemoveGroupMembersCMS failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.Success = respPb.Success + resp.Failed = respPb.Failed + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func DeleteGroup(c *gin.Context) { + var ( + req cms_api_struct.DeleteGroupRequest + _ cms_api_struct.DeleteGroupResponse + reqPb pbGroup.DeleteGroupReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.DeleteGroup(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "DeleteGroup failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func SetGroupMaster(c *gin.Context) { + var ( + req cms_api_struct.SetGroupMasterRequest + _ cms_api_struct.SetGroupMasterResponse + reqPb pbGroup.OperateUserRoleReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.UserId = req.UserId + reqPb.RoleLevel = constant.GroupOwner + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateUserRole(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "DeleteGroup failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrServer, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func SetGroupOrdinaryUsers(c *gin.Context) { + var ( + req cms_api_struct.SetGroupMemberRequest + _ cms_api_struct.AdminLoginResponse + reqPb pbGroup.OperateUserRoleReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.GroupId = req.GroupId + reqPb.UserId = req.UserId + reqPb.RoleLevel = constant.GroupOrdinaryUsers + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.OperateUserRole(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "DeleteGroup failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func AlterGroupInfo(c *gin.Context) { + var ( + req cms_api_struct.AlterGroupInfoRequest + _ cms_api_struct.SetGroupMasterResponse + reqPb pbGroup.SetGroupInfoReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.OpUserID = c.MustGet("userID").(string) + reqPb.GroupInfo = &commonPb.GroupInfo{ + GroupID: req.GroupID, + GroupName: req.GroupName, + Introduction: req.Introduction, + Notification: req.Notification, + FaceURL: req.ProfilePhoto, + GroupType: int32(req.GroupType), + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + _, err := client.SetGroupInfo(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "DeleteGroup failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} diff --git a/internal/cms_api/message_cms/message.go b/internal/cms_api/message_cms/message.go new file mode 100644 index 000000000..c5ced390e --- /dev/null +++ b/internal/cms_api/message_cms/message.go @@ -0,0 +1,109 @@ +package messageCMS + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbMessage "Open_IM/pkg/proto/message_cms" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "strings" + + "Open_IM/pkg/common/constant" + + "github.com/gin-gonic/gin" +) + +func BroadcastMessage(c *gin.Context) { + var ( + reqPb pbMessage.BoradcastMessageReq + ) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + client := pbMessage.NewMessageCMSClient(etcdConn) + _, err := client.BoradcastMessage(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetChatLogs rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func MassSendMassage(c *gin.Context) { + var ( + reqPb pbMessage.MassSendMessageReq + ) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + client := pbMessage.NewMessageCMSClient(etcdConn) + _, err := client.MassSendMessage(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetChatLogs rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func WithdrawMessage(c *gin.Context) { + var ( + reqPb pbMessage.WithdrawMessageReq + ) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + client := pbMessage.NewMessageCMSClient(etcdConn) + _, err := client.WithdrawMessage(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetChatLogs rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func GetChatLogs(c *gin.Context) { + var ( + req cms_api_struct.GetChatLogsRequest + resp cms_api_struct.GetChatLogsResponse + reqPb pbMessage.GetChatLogsReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + reqPb.Pagination = &pbCommon.RequestPagination{ + PageNumber: int32(req.PageNumber), + ShowNumber: int32(req.ShowNumber), + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImMessageCMSName) + client := pbMessage.NewMessageCMSClient(etcdConn) + respPb, err := client.GetChatLogs(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetChatLogs rpc failed", err.Error()) + openIMHttp.RespHttp200(c, err, resp) + return + } + //utils.CopyStructFields(&resp, &respPb) + for _, chatLog := range respPb.ChatLogs { + resp.ChatLogs = append(resp.ChatLogs, cms_api_struct.ChatLog{ + SessionType: int(chatLog.SessionType), + ContentType: int(chatLog.ContentType), + SenderNickName: chatLog.SenderNickName, + SenderId: chatLog.SenderId, + SearchContent: chatLog.SearchContent, + WholeContent: chatLog.WholeContent, + ReceiverNickName: chatLog.ReciverNickName, + ReceiverID: chatLog.ReciverId, + GroupName: chatLog.GroupName, + GroupId: chatLog.GroupId, + Date: chatLog.Date, + }) + } + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.CurrentPage = int(respPb.Pagination.CurrentPage) + resp.ChatLogsNum = int(respPb.ChatLogsNum) + openIMHttp.RespHttp200(c, constant.OK, resp) +} diff --git a/internal/cms_api/middleware/cors.go b/internal/cms_api/middleware/cors.go new file mode 100644 index 000000000..139a001af --- /dev/null +++ b/internal/cms_api/middleware/cors.go @@ -0,0 +1,23 @@ +package middleware + +import ( + "github.com/gin-gonic/gin" + "net/http" +) + +func CorsHandler() gin.HandlerFunc { + return func(context *gin.Context) { + context.Writer.Header().Set("Access-Control-Allow-Origin", "*") + context.Header("Access-Control-Allow-Methods", "*") + context.Header("Access-Control-Allow-Headers", "*") + context.Header("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") // 跨域关键设置 让浏览器可以解析 + context.Header("Access-Control-Max-Age", "172800") // 缓存请求信息 单位为秒 + context.Header("Access-Control-Allow-Credentials", "false") // 跨域请求是否需要带cookie信息 默认设置为true + context.Header("content-type", "application/json") // 设置返回格式是json + //Release all option pre-requests + if context.Request.Method == http.MethodOptions { + context.JSON(http.StatusOK, "Options Request!") + } + context.Next() + } +} diff --git a/internal/cms_api/middleware/jwt_auth.go b/internal/cms_api/middleware/jwt_auth.go new file mode 100644 index 000000000..a6f1af993 --- /dev/null +++ b/internal/cms_api/middleware/jwt_auth.go @@ -0,0 +1,24 @@ +package middleware + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/utils" + "github.com/gin-gonic/gin" +) + +func JWTAuth() gin.HandlerFunc { + return func(c *gin.Context) { + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), "") + log.NewInfo("0", utils.GetSelfFuncName(), "userID: ", userID) + c.Set("userID", userID) + if !ok { + log.NewError("","GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.Abort() + http.RespHttp200(c, constant.ErrParseToken, nil) + return + } + } +} diff --git a/internal/cms_api/organization/organization.go b/internal/cms_api/organization/organization.go new file mode 100644 index 000000000..f775283ca --- /dev/null +++ b/internal/cms_api/organization/organization.go @@ -0,0 +1,49 @@ +package organization + +import ( + "github.com/gin-gonic/gin" +) + +func GetStaffs(c *gin.Context) { + +} + +func GetOrganizations(c *gin.Context) { + +} + +func GetSquads(c *gin.Context) { + +} + +func AlterStaff(c *gin.Context) { + +} + +func AddOrganization(c *gin.Context) { + +} + +func InquireOrganization(g *gin.Context) { + +} + +func AlterOrganization(c *gin.Context) { + +} + +func DeleteOrganization(g *gin.Context) { + +} + +func GetOrganizationSquads(c *gin.Context) { + +} + +func AlterStaffsInfo(c *gin.Context) { + +} + +func AddChildOrganization(c *gin.Context) { + +} diff --git a/internal/cms_api/router.go b/internal/cms_api/router.go new file mode 100644 index 000000000..941cc5bf5 --- /dev/null +++ b/internal/cms_api/router.go @@ -0,0 +1,95 @@ +package cms_api + +import ( + "Open_IM/internal/cms_api/admin" + "Open_IM/internal/cms_api/group" + messageCMS "Open_IM/internal/cms_api/message_cms" + "Open_IM/internal/cms_api/middleware" + "Open_IM/internal/cms_api/organization" + "Open_IM/internal/cms_api/statistics" + "Open_IM/internal/cms_api/user" + + "github.com/gin-gonic/gin" +) + +func NewGinRouter() *gin.Engine { + gin.SetMode(gin.ReleaseMode) + baseRouter := gin.Default() + router := baseRouter.Group("/api") + router.Use(middleware.CorsHandler()) + adminRouterGroup := router.Group("/admin") + { + adminRouterGroup.POST("/login", admin.AdminLogin) + } + r2 := router.Group("") + r2.Use(middleware.JWTAuth()) + statisticsRouterGroup := r2.Group("/statistics") + { + statisticsRouterGroup.GET("/get_messages_statistics", statistics.GetMessagesStatistics) + statisticsRouterGroup.GET("/get_user_statistics", statistics.GetUserStatistics) + statisticsRouterGroup.GET("/get_group_statistics", statistics.GetGroupStatistics) + statisticsRouterGroup.GET("/get_active_user", statistics.GetActiveUser) + statisticsRouterGroup.GET("/get_active_group", statistics.GetActiveGroup) + } + organizationRouterGroup := r2.Group("/organization") + { + organizationRouterGroup.GET("/get_staffs", organization.GetStaffs) + organizationRouterGroup.GET("/get_organizations", organization.GetOrganizations) + organizationRouterGroup.GET("/get_squad", organization.GetSquads) + organizationRouterGroup.POST("/add_organization", organization.AddOrganization) + organizationRouterGroup.POST("/alter_staff", organization.AlterStaff) + organizationRouterGroup.GET("/inquire_organization", organization.InquireOrganization) + organizationRouterGroup.POST("/alter_organization", organization.AlterOrganization) + organizationRouterGroup.POST("/delete_organization", organization.DeleteOrganization) + organizationRouterGroup.POST("/get_organization_squad", organization.GetOrganizationSquads) + organizationRouterGroup.PATCH("/alter_corps_info", organization.AlterStaffsInfo) + organizationRouterGroup.POST("/add_child_org", organization.AddChildOrganization) + } + groupRouterGroup := r2.Group("/group") + { + groupRouterGroup.GET("/get_group_by_id", group.GetGroupById) + groupRouterGroup.GET("/get_groups", group.GetGroups) + groupRouterGroup.GET("/get_group_by_name", group.GetGroupByName) + groupRouterGroup.GET("/get_group_members", group.GetGroupMembers) + groupRouterGroup.POST("/create_group", group.CreateGroup) + groupRouterGroup.POST("/add_members", group.AddGroupMembers) + groupRouterGroup.POST("/remove_members", group.RemoveGroupMembers) + groupRouterGroup.POST("/ban_group_private_chat", group.BanPrivateChat) + groupRouterGroup.POST("/open_group_private_chat", group.OpenPrivateChat) + groupRouterGroup.POST("/ban_group_chat", group.BanGroupChat) + groupRouterGroup.POST("/open_group_chat", group.OpenGroupChat) + groupRouterGroup.POST("/delete_group", group.DeleteGroup) + groupRouterGroup.POST("/get_members_in_group", group.GetGroupMembers) + groupRouterGroup.POST("/set_group_master", group.SetGroupMaster) + groupRouterGroup.POST("/set_group_ordinary_user", group.SetGroupOrdinaryUsers) + groupRouterGroup.POST("/alter_group_info", group.AlterGroupInfo) + } + userRouterGroup := r2.Group("/user") + { + userRouterGroup.POST("/resign", user.ResignUser) + userRouterGroup.GET("/get_user", user.GetUserById) + userRouterGroup.POST("/alter_user", user.AlterUser) + userRouterGroup.GET("/get_users", user.GetUsers) + userRouterGroup.POST("/add_user", user.AddUser) + userRouterGroup.POST("/unblock_user", user.UnblockUser) + userRouterGroup.POST("/block_user", user.BlockUser) + userRouterGroup.GET("/get_block_users", user.GetBlockUsers) + userRouterGroup.GET("/get_block_user", user.GetBlockUserById) + userRouterGroup.POST("/delete_user", user.DeleteUser) + userRouterGroup.GET("/get_users_by_name", user.GetUsersByName) + } + friendRouterGroup := r2.Group("/friend") + { + friendRouterGroup.POST("/get_friends_by_id") + friendRouterGroup.POST("/set_friend") + friendRouterGroup.POST("/remove_friend") + } + messageCMSRouterGroup := r2.Group("/message") + { + messageCMSRouterGroup.GET("/get_chat_logs", messageCMS.GetChatLogs) + messageCMSRouterGroup.POST("/broadcast_message", messageCMS.BroadcastMessage) + messageCMSRouterGroup.POST("/mass_send_message", messageCMS.MassSendMassage) + messageCMSRouterGroup.POST("/withdraw_message", messageCMS.WithdrawMessage) + } + return baseRouter +} diff --git a/internal/cms_api/statistics/statistics.go b/internal/cms_api/statistics/statistics.go new file mode 100644 index 000000000..c8a9488ca --- /dev/null +++ b/internal/cms_api/statistics/statistics.go @@ -0,0 +1,224 @@ +package statistics + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pb "Open_IM/pkg/proto/statistics" + "Open_IM/pkg/utils" + "context" + "strings" + + "github.com/gin-gonic/gin" +) + +func GetMessagesStatistics(c *gin.Context) { + var ( + req cms_api_struct.GetMessageStatisticsRequest + resp cms_api_struct.GetMessageStatisticsResponse + reqPb pb.GetMessageStatisticsReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetMessageStatistics(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetMessageStatistics failed", err.Error()) + openIMHttp.RespHttp200(c, err, resp) + return + } + // utils.CopyStructFields(&resp, respPb) + resp.GroupMessageNum = int(respPb.GroupMessageNum) + resp.PrivateMessageNum = int(respPb.PrivateMessageNum) + for _, v := range respPb.PrivateMessageNumList { + resp.PrivateMessageNumList = append(resp.PrivateMessageNumList, struct { + Date string "json:\"date\"" + MessageNum int "json:\"message_num\"" + }{ + Date: v.Date, + MessageNum: int(v.Num), + }) + } + for _, v := range respPb.GroupMessageNumList { + resp.GroupMessageNumList = append(resp.GroupMessageNumList, struct { + Date string "json:\"date\"" + MessageNum int "json:\"message_num\"" + }{ + Date: v.Date, + MessageNum: int(v.Num), + }) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetUserStatistics(c *gin.Context) { + var ( + req cms_api_struct.GetUserStatisticsRequest + resp cms_api_struct.GetUserStatisticsResponse + reqPb pb.GetUserStatisticsReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetUserStatistics(context.Background(), &reqPb) + if err != nil { + log.NewError("0", utils.GetSelfFuncName(), "GetUserStatistics failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + // utils.CopyStructFields(&resp, respPb) + resp.ActiveUserNum = int(respPb.ActiveUserNum) + resp.IncreaseUserNum = int(respPb.IncreaseUserNum) + resp.TotalUserNum = int(respPb.TotalUserNum) + for _, v := range respPb.ActiveUserNumList { + resp.ActiveUserNumList = append(resp.ActiveUserNumList, struct { + Date string "json:\"date\"" + ActiveUserNum int "json:\"active_user_num\"" + }{ + Date: v.Date, + ActiveUserNum: int(v.Num), + }) + } + for _, v := range respPb.IncreaseUserNumList { + resp.IncreaseUserNumList = append(resp.IncreaseUserNumList, struct { + Date string "json:\"date\"" + IncreaseUserNum int "json:\"increase_user_num\"" + }{ + Date: v.Date, + IncreaseUserNum: int(v.Num), + }) + } + for _, v := range respPb.TotalUserNumList { + resp.TotalUserNumList = append(resp.TotalUserNumList, struct { + Date string "json:\"date\"" + TotalUserNum int "json:\"total_user_num\"" + }{ + Date: v.Date, + TotalUserNum: int(v.Num), + }) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetGroupStatistics(c *gin.Context) { + var ( + req cms_api_struct.GetGroupStatisticsRequest + resp cms_api_struct.GetGroupStatisticsResponse + reqPb pb.GetGroupStatisticsReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetGroupStatistics(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupStatistics failed", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + // utils.CopyStructFields(&resp, respPb) + resp.IncreaseGroupNum = int(respPb.GetIncreaseGroupNum()) + resp.TotalGroupNum = int(respPb.GetTotalGroupNum()) + for _, v := range respPb.IncreaseGroupNumList { + resp.IncreaseGroupNumList = append(resp.IncreaseGroupNumList, + struct { + Date string "json:\"date\"" + IncreaseGroupNum int "json:\"increase_group_num\"" + }{ + Date: v.Date, + IncreaseGroupNum: int(v.Num), + }) + } + for _, v := range respPb.TotalGroupNumList { + resp.TotalGroupNumList = append(resp.TotalGroupNumList, + struct { + Date string "json:\"date\"" + TotalGroupNum int "json:\"total_group_num\"" + }{ + Date: v.Date, + TotalGroupNum: int(v.Num), + }) + + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetActiveUser(c *gin.Context) { + var ( + req cms_api_struct.GetActiveUserRequest + resp cms_api_struct.GetActiveUserResponse + reqPb pb.GetActiveUserReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetActiveUser(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetActiveUser failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + utils.CopyStructFields(&resp.ActiveUserList, respPb.Users) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetActiveGroup(c *gin.Context) { + var ( + req cms_api_struct.GetActiveGroupRequest + resp cms_api_struct.GetActiveGroupResponse + reqPb pb.GetActiveGroupReq + ) + reqPb.StatisticsReq = &pb.StatisticsReq{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.StatisticsReq, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImStatisticsName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetActiveGroup(context.Background(), &reqPb) + if err != nil { + log.NewError("0", utils.GetSelfFuncName(), "GetActiveGroup failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + for _, group := range respPb.Groups { + resp.ActiveGroupList = append(resp.ActiveGroupList, struct { + GroupName string "json:\"group_name\"" + GroupId string "json:\"group_id\"" + MessageNum int "json:\"message_num\"" + }{ + GroupName: group.GroupName, + GroupId: group.GroupId, + MessageNum: int(group.MessageNum), + }) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} diff --git a/internal/cms_api/user/user.go b/internal/cms_api/user/user.go new file mode 100644 index 000000000..a0e5dc188 --- /dev/null +++ b/internal/cms_api/user/user.go @@ -0,0 +1,307 @@ +package user + +import ( + "Open_IM/pkg/cms_api_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + commonPb "Open_IM/pkg/proto/sdk_ws" + pb "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "context" + "fmt" + "net/http" + "strings" + + "github.com/gin-gonic/gin" +) + +func GetUserById(c *gin.Context) { + var ( + req cms_api_struct.GetUserRequest + resp cms_api_struct.GetUserResponse + reqPb pb.GetUserByIdReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetUserById(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + if respPb.User.UserId == "" { + openIMHttp.RespHttp200(c, constant.OK, nil) + return + } + utils.CopyStructFields(&resp, respPb.User) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetUsersByName(c *gin.Context) { + var ( + req cms_api_struct.GetUsersByNameRequest + resp cms_api_struct.GetUsersByNameResponse + reqPb pb.GetUsersByNameReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserName = req.UserName + reqPb.Pagination = &commonPb.RequestPagination{ + PageNumber: int32(req.PageNumber), + ShowNumber: int32(req.ShowNumber), + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetUsersByName(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "rpc", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + utils.CopyStructFields(&resp.Users, respPb.Users) + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.CurrentPage = int(respPb.Pagination.CurrentPage) + resp.UserNums = respPb.UserNums + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetUsers(c *gin.Context) { + var ( + req cms_api_struct.GetUsersRequest + resp cms_api_struct.GetUsersResponse + reqPb pb.GetUsersReq + ) + reqPb.Pagination = &commonPb.RequestPagination{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb.Pagination, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetUsers(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, resp) + return + } + utils.CopyStructFields(&resp.Users, respPb.User) + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.CurrentPage = int(respPb.Pagination.CurrentPage) + resp.UserNums = respPb.UserNums + openIMHttp.RespHttp200(c, constant.OK, resp) + +} + +func ResignUser(c *gin.Context) { + var ( + req cms_api_struct.ResignUserRequest + resp cms_api_struct.ResignUserResponse + reqPb pb.ResignUserReq + ) + if err := c.ShouldBind(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": http.StatusBadRequest, "errMsg": err.Error()}) + return + } + utils.CopyStructFields(&reqPb, &req) + fmt.Println(reqPb.UserId) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.ResignUser(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, resp) + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func AlterUser(c *gin.Context) { + var ( + req cms_api_struct.AlterUserRequest + resp cms_api_struct.AlterUserResponse + reqPb pb.AlterUserReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.AlterUser(context.Background(), &reqPb) + if err != nil { + log.NewError("0", "microserver failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func AddUser(c *gin.Context) { + var ( + req cms_api_struct.AddUserRequest + reqPb pb.AddUserReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.AddUser(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} + +func BlockUser(c *gin.Context) { + var ( + req cms_api_struct.BlockUserRequest + resp cms_api_struct.BlockUserResponse + reqPb pb.BlockUserReq + ) + if err := c.BindJSON(&req); err != nil { + fmt.Println(err) + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + fmt.Println(reqPb) + _, err := client.BlockUser(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, resp) + return + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func UnblockUser(c *gin.Context) { + var ( + req cms_api_struct.UnblockUserRequest + resp cms_api_struct.UnBlockUserResponse + reqPb pb.UnBlockUserReq + ) + if err := c.ShouldBind(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + utils.CopyStructFields(&reqPb, &req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.UnBlockUser(context.Background(), &reqPb) + if err != nil { + openIMHttp.RespHttp200(c, err, resp) + return + } + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetBlockUsers(c *gin.Context) { + var ( + req cms_api_struct.GetBlockUsersRequest + resp cms_api_struct.GetBlockUsersResponse + reqPb pb.GetBlockUsersReq + respPb *pb.GetBlockUsersResp + ) + reqPb.Pagination = &commonPb.RequestPagination{} + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "ShouldBindQuery failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, resp) + return + } + utils.CopyStructFields(&reqPb.Pagination, &req) + log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "blockUsers", reqPb.Pagination, req) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetBlockUsers(context.Background(), &reqPb) + if err != nil { + log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetBlockUsers rpc", err.Error()) + openIMHttp.RespHttp200(c, err, resp) + return + } + for _, v := range respPb.BlockUsers { + resp.BlockUsers = append(resp.BlockUsers, cms_api_struct.BlockUser{ + UserResponse: cms_api_struct.UserResponse{ + UserId: v.User.UserId, + ProfilePhoto: v.User.ProfilePhoto, + Nickname: v.User.Nickname, + IsBlock: v.User.IsBlock, + CreateTime: v.User.CreateTime, + }, + BeginDisableTime: v.BeginDisableTime, + EndDisableTime: v.EndDisableTime, + }) + } + resp.ShowNumber = int(respPb.Pagination.ShowNumber) + resp.CurrentPage = int(respPb.Pagination.CurrentPage) + resp.UserNums = respPb.UserNums + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func GetBlockUserById(c *gin.Context) { + var ( + req cms_api_struct.GetBlockUserRequest + resp cms_api_struct.GetBlockUserResponse + reqPb pb.GetBlockUserByIdReq + ) + if err := c.ShouldBindQuery(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserId = req.UserId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + respPb, err := client.GetBlockUserById(context.Background(), &reqPb) + if err != nil { + log.NewError("0", "GetBlockUserById rpc failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + resp.EndDisableTime = respPb.BlockUser.EndDisableTime + resp.BeginDisableTime = respPb.BlockUser.BeginDisableTime + utils.CopyStructFields(&resp, respPb.BlockUser.User) + openIMHttp.RespHttp200(c, constant.OK, resp) +} + +func DeleteUser(c *gin.Context) { + var ( + req cms_api_struct.DeleteUserRequest + reqPb pb.DeleteUserReq + ) + if err := c.BindJSON(&req); err != nil { + log.NewError("0", "BindJSON failed ", err.Error()) + openIMHttp.RespHttp200(c, constant.ErrArgs, nil) + return + } + reqPb.UserId = req.UserId + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImUserName) + client := pb.NewUserClient(etcdConn) + _, err := client.DeleteUser(context.Background(), &reqPb) + if err != nil { + log.NewError("0", "DeleteUser rpc failed ", err.Error()) + openIMHttp.RespHttp200(c, err, nil) + return + } + openIMHttp.RespHttp200(c, constant.OK, nil) +} diff --git a/internal/demo/register/login.go b/internal/demo/register/login.go new file mode 100644 index 000000000..e6de926dc --- /dev/null +++ b/internal/demo/register/login.go @@ -0,0 +1,70 @@ +package register + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + http2 "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "encoding/json" + "fmt" + "github.com/gin-gonic/gin" + "net/http" +) + +type ParamsLogin struct { + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + Password string `json:"password"` + Platform int32 `json:"platform"` + OperationID string `json:"operationID" binding:"required"` +} + +func Login(c *gin.Context) { + params := ParamsLogin{} + if err := c.BindJSON(¶ms); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + var account string + if params.Email != "" { + account = params.Email + } else { + account = params.PhoneNumber + } + + r, err := im_mysql_model.GetRegister(account) + if err != nil { + log.NewError(params.OperationID, "user have not register", params.Password, account, err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.NotRegistered, "errMsg": "Mobile phone number is not registered"}) + return + } + if r.Password != params.Password { + log.NewError(params.OperationID, "password err", params.Password, account, r.Password, r.Account) + c.JSON(http.StatusOK, gin.H{"errCode": constant.PasswordErr, "errMsg": "password err"}) + return + } + url := fmt.Sprintf("http://%s:10000/auth/user_token", utils.ServerIP) + openIMGetUserToken := api.UserTokenReq{} + openIMGetUserToken.OperationID = params.OperationID + openIMGetUserToken.Platform = params.Platform + openIMGetUserToken.Secret = config.Config.Secret + openIMGetUserToken.UserID = account + openIMGetUserTokenResp := api.UserTokenResp{} + bMsg, err := http2.Post(url, openIMGetUserToken, 2) + if err != nil { + log.NewError(params.OperationID, "request openIM get user token error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.GetIMTokenErr, "errMsg": err.Error()}) + return + } + err = json.Unmarshal(bMsg, &openIMGetUserTokenResp) + if err != nil || openIMGetUserTokenResp.ErrCode != 0 { + log.NewError(params.OperationID, "request get user token", account, "err", "") + c.JSON(http.StatusOK, gin.H{"errCode": constant.GetIMTokenErr, "errMsg": ""}) + return + } + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMGetUserTokenResp.UserToken}) + +} diff --git a/internal/demo/register/reset_password.go b/internal/demo/register/reset_password.go new file mode 100644 index 000000000..b668f4f62 --- /dev/null +++ b/internal/demo/register/reset_password.go @@ -0,0 +1,56 @@ +package register + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "github.com/gin-gonic/gin" + "net/http" +) + +type resetPasswordRequest struct { + VerificationCode string `json:"verificationCode" binding:"required"` + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + NewPassword string `json:"newPassword" binding:"required"` + OperationID string `json:"operationID"` +} + +func ResetPassword(c *gin.Context) { + var ( + req resetPasswordRequest + ) + if err := c.BindJSON(&req); err != nil { + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + var account string + if req.Email != "" { + account = req.Email + } else { + account = req.PhoneNumber + } + if req.VerificationCode != config.Config.Demo.SuperCode { + accountKey := account + "_" + constant.VerificationCodeForResetSuffix + v, err := db.DB.GetAccountCode(accountKey) + if err != nil || v != req.VerificationCode { + log.NewError(req.OperationID, "password Verification code error", account, req.VerificationCode, v) + c.JSON(http.StatusOK, gin.H{"errCode": constant.CodeInvalidOrExpired, "errMsg": "Verification code error!"}) + return + } + } + user, err := im_mysql_model.GetRegister(account) + if err != nil || user.Account == "" { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "get register error", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.NotRegistered, "errMsg": "user not register!"}) + return + } + if err := im_mysql_model.ResetPassword(account, req.NewPassword); err != nil { + c.JSON(http.StatusOK, gin.H{"errCode": constant.ResetPasswordFailed, "errMsg": "reset password failed: "+err.Error()}) + return + } + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "reset password success"}) +} diff --git a/internal/demo/register/send_code.go b/internal/demo/register/send_code.go new file mode 100644 index 000000000..37e355b46 --- /dev/null +++ b/internal/demo/register/send_code.go @@ -0,0 +1,130 @@ +package register + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "fmt" + openapi "github.com/alibabacloud-go/darabonba-openapi/client" + dysmsapi20170525 "github.com/alibabacloud-go/dysmsapi-20170525/v2/client" + "github.com/alibabacloud-go/tea/tea" + "github.com/gin-gonic/gin" + "gopkg.in/gomail.v2" + "math/rand" + "net/http" + "time" +) + +type paramsVerificationCode struct { + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + OperationID string `json:"operationID" binding:"required"` + UsedFor int `json:"usedFor"` +} + +func SendVerificationCode(c *gin.Context) { + params := paramsVerificationCode{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("", "BindJSON failed", "err:", err.Error(), "phoneNumber", params.PhoneNumber, "email", params.Email) + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + var account string + if params.Email != "" { + account = params.Email + } else { + account = params.PhoneNumber + } + var accountKey string + if params.UsedFor == 0 { + params.UsedFor = constant.VerificationCodeForRegister + } + switch params.UsedFor { + case constant.VerificationCodeForRegister: + _, err := im_mysql_model.GetRegister(account) + if err == nil { + log.NewError(params.OperationID, "The phone number has been registered", params) + c.JSON(http.StatusOK, gin.H{"errCode": constant.HasRegistered, "errMsg": "The phone number has been registered"}) + return + } + ok, err := db.DB.JudgeAccountEXISTS(account) + if ok || err != nil { + log.NewError(params.OperationID, "The phone number has been registered", params) + c.JSON(http.StatusOK, gin.H{"errCode": constant.RepeatSendCode, "errMsg": "The phone number has been registered"}) + return + } + accountKey = account + "_" + constant.VerificationCodeForRegisterSuffix + + case constant.VerificationCodeForReset: + accountKey = account + "_" + constant.VerificationCodeForResetSuffix + } + rand.Seed(time.Now().UnixNano()) + code := 100000 + rand.Intn(900000) + log.NewInfo(params.OperationID, params.UsedFor,"begin store redis", accountKey, code) + err := db.DB.SetAccountCode(accountKey, code, config.Config.Demo.CodeTTL) + if err != nil { + log.NewError(params.OperationID, "set redis error", accountKey, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + return + } + log.NewDebug("", config.Config.Demo) + if params.Email != "" { + m := gomail.NewMessage() + m.SetHeader(`From`, config.Config.Demo.Mail.SenderMail) + m.SetHeader(`To`, []string{account}...) + m.SetHeader(`Subject`, config.Config.Demo.Mail.Title) + m.SetBody(`text/html`, fmt.Sprintf("%d", code)) + if err := gomail.NewDialer(config.Config.Demo.Mail.SmtpAddr, config.Config.Demo.Mail.SmtpPort, config.Config.Demo.Mail.SenderMail, config.Config.Demo.Mail.SenderAuthorizationCode).DialAndSend(m); err != nil { + log.ErrorByKv("send mail error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.MailSendCodeErr, "errMsg": ""}) + return + } + } else { + client, err := CreateClient(tea.String(config.Config.Demo.AliSMSVerify.AccessKeyID), tea.String(config.Config.Demo.AliSMSVerify.AccessKeySecret)) + if err != nil { + log.NewError(params.OperationID, "create sendSms client err", "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + return + } + + sendSmsRequest := &dysmsapi20170525.SendSmsRequest{ + PhoneNumbers: tea.String(account), + SignName: tea.String(config.Config.Demo.AliSMSVerify.SignName), + TemplateCode: tea.String(config.Config.Demo.AliSMSVerify.VerificationCodeTemplateCode), + TemplateParam: tea.String(fmt.Sprintf("{\"code\":\"%d\"}", code)), + } + + response, err := client.SendSms(sendSmsRequest) + if err != nil { + log.NewError(params.OperationID, "sendSms error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + return + } + if *response.Body.Code != "OK" { + log.NewError(params.OperationID, "alibabacloud sendSms error", account, "err", response.Body.Code, response.Body.Message) + c.JSON(http.StatusOK, gin.H{"errCode": constant.SmsSendCodeErr, "errMsg": "Enter the superCode directly in the verification code box, SuperCode can be configured in config.xml"}) + return + } + } + + data := make(map[string]interface{}) + data["account"] = account + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "Verification code has been set!", "data": data}) +} + +func CreateClient(accessKeyId *string, accessKeySecret *string) (result *dysmsapi20170525.Client, err error) { + c := &openapi.Config{ + // 您的AccessKey ID + AccessKeyId: accessKeyId, + // 您的AccessKey Secret + AccessKeySecret: accessKeySecret, + } + + // 访问的域名 + c.Endpoint = tea.String("dysmsapi.aliyuncs.com") + result = &dysmsapi20170525.Client{} + result, err = dysmsapi20170525.NewClient(c) + return result, err +} diff --git a/internal/demo/register/set_password.go b/internal/demo/register/set_password.go new file mode 100644 index 000000000..804e8eb11 --- /dev/null +++ b/internal/demo/register/set_password.go @@ -0,0 +1,89 @@ +package register + +import ( + api "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + http2 "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "encoding/json" + "fmt" + "github.com/gin-gonic/gin" + "net/http" +) + +type ParamsSetPassword struct { + Email string `json:"email"` + Name string `json:"name"` + PhoneNumber string `json:"phoneNumber"` + Password string `json:"password"` + VerificationCode string `json:"verificationCode"` + Platform int32 `json:"platform" binding:"required,min=1,max=7"` + Ex string `json:"ex"` + OperationID string `json:"operationID" binding:"required"` +} + +func SetPassword(c *gin.Context) { + params := ParamsSetPassword{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError(params.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + var account string + if params.Email != "" { + account = params.Email + } else { + account = params.PhoneNumber + } + if params.Name == "" { + params.Name = account + } + if params.VerificationCode != config.Config.Demo.SuperCode { + accountKey := account + "_" + constant.VerificationCodeForRegisterSuffix + v, err := db.DB.GetAccountCode(accountKey) + if err != nil || v != params.VerificationCode { + log.NewError(params.OperationID, "password Verification code error", account, params.VerificationCode) + data := make(map[string]interface{}) + data["PhoneNumber"] = account + c.JSON(http.StatusOK, gin.H{"errCode": constant.CodeInvalidOrExpired, "errMsg": "Verification code error!", "data": data}) + return + } + } + url := fmt.Sprintf("http://%s:10000/auth/user_register", utils.ServerIP) + openIMRegisterReq := api.UserRegisterReq{} + openIMRegisterReq.OperationID = params.OperationID + openIMRegisterReq.Platform = params.Platform + openIMRegisterReq.UserID = account + openIMRegisterReq.Nickname = params.Name + openIMRegisterReq.Secret = config.Config.Secret + openIMRegisterResp := api.UserRegisterResp{} + bMsg, err := http2.Post(url, openIMRegisterReq, 2) + if err != nil { + log.NewError(params.OperationID, "request openIM register error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": err.Error()}) + return + } + err = json.Unmarshal(bMsg, &openIMRegisterResp) + if err != nil || openIMRegisterResp.ErrCode != 0 { + log.NewError(params.OperationID, "request openIM register error", account, "err", "resp: ", openIMRegisterResp.ErrCode) + if err != nil { + log.NewError(params.OperationID, utils.GetSelfFuncName(), err.Error()) + } + c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": "register failed: " + openIMRegisterResp.ErrMsg}) + return + } + log.Info(params.OperationID, "begin store mysql", account, params.Password) + err = im_mysql_model.SetPassword(account, params.Password, params.Ex) + if err != nil { + log.NewError(params.OperationID, "set phone number password error", account, "err", err.Error()) + c.JSON(http.StatusOK, gin.H{"errCode": constant.RegisterFailed, "errMsg": err.Error()}) + return + } + log.Info(params.OperationID, "end setPassword", account, params.Password) + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "", "data": openIMRegisterResp.UserToken}) + return +} diff --git a/internal/demo/register/verify.go b/internal/demo/register/verify.go new file mode 100644 index 000000000..01fafbb92 --- /dev/null +++ b/internal/demo/register/verify.go @@ -0,0 +1,80 @@ +package register + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + + "github.com/gin-gonic/gin" + "net/http" +) + +type paramsCertification struct { + Email string `json:"email"` + PhoneNumber string `json:"phoneNumber"` + VerificationCode string `json:"verificationCode"` + OperationID string `json:"operationID" binding:"required"` + UsedFor int `json:"usedFor"` +} + +func Verify(c *gin.Context) { + params := paramsCertification{} + if err := c.BindJSON(¶ms); err != nil { + log.NewError("", "request params json parsing failed", "", "err", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()}) + return + } + log.NewInfo("recv req: ", params) + + var account string + if params.Email != "" { + account = params.Email + } else { + account = params.PhoneNumber + } + + if params.VerificationCode == config.Config.Demo.SuperCode { + log.InfoByKv("Super Code Verified successfully", account) + data := make(map[string]interface{}) + data["account"] = account + data["verificationCode"] = params.VerificationCode + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "Verified successfully!", "data": data}) + return + } + log.NewInfo("0", " params.VerificationCode != config.Config.Demo.SuperCode", params.VerificationCode, config.Config.Demo) + log.NewInfo(params.OperationID, "begin get form redis", account) + if params.UsedFor == 0 { + params.UsedFor = constant.VerificationCodeForRegister + } + var accountKey string + switch params.UsedFor { + case constant.VerificationCodeForRegister: + accountKey = account + "_" + constant.VerificationCodeForRegisterSuffix + case constant.VerificationCodeForReset: + accountKey = account + "_" + constant.VerificationCodeForResetSuffix + } + + code, err := db.DB.GetAccountCode(accountKey) + log.NewInfo(params.OperationID, "redis phone number and verificating Code", accountKey, code, params) + if err != nil { + log.NewError(params.OperationID, "Verification code expired", accountKey, "err", err.Error()) + data := make(map[string]interface{}) + data["account"] = account + c.JSON(http.StatusOK, gin.H{"errCode": constant.CodeInvalidOrExpired, "errMsg": "Verification code expired!", "data": data}) + return + } + if params.VerificationCode == code { + log.Info(params.OperationID, "Verified successfully", account) + data := make(map[string]interface{}) + data["account"] = account + data["verificationCode"] = params.VerificationCode + c.JSON(http.StatusOK, gin.H{"errCode": constant.NoError, "errMsg": "Verified successfully!", "data": data}) + return + } else { + log.Info(params.OperationID, "Verification code error", account, params.VerificationCode) + data := make(map[string]interface{}) + data["account"] = account + c.JSON(http.StatusOK, gin.H{"errCode": constant.CodeInvalidOrExpired, "errMsg": "Verification code error!", "data": data}) + } +} diff --git a/internal/msg_gateway/gate/init.go b/internal/msg_gateway/gate/init.go new file mode 100644 index 000000000..8f2f2e35b --- /dev/null +++ b/internal/msg_gateway/gate/init.go @@ -0,0 +1,35 @@ +package gate + +import ( + "Open_IM/pkg/common/config" + + "Open_IM/pkg/statistics" + "fmt" + "github.com/go-playground/validator/v10" + "sync" +) + +var ( + rwLock *sync.RWMutex + validate *validator.Validate + ws WServer + rpcSvr RPCServer + sendMsgCount uint64 + userCount uint64 +) + +func Init(rpcPort, wsPort int) { + //log initialization + + rwLock = new(sync.RWMutex) + validate = validator.New() + statistics.NewStatistics(&sendMsgCount, config.Config.ModuleName.LongConnSvrName, fmt.Sprintf("%d second recv to msg_gateway sendMsgCount", sendMsgCount), 300) + statistics.NewStatistics(&userCount, config.Config.ModuleName.LongConnSvrName, fmt.Sprintf("%d second add user conn", userCount), 300) + ws.onInit(wsPort) + rpcSvr.onInit(rpcPort) +} + +func Run() { + go ws.run() + go rpcSvr.run() +} diff --git a/internal/msg_gateway/gate/logic.go b/internal/msg_gateway/gate/logic.go new file mode 100644 index 000000000..567b4e8c1 --- /dev/null +++ b/internal/msg_gateway/gate/logic.go @@ -0,0 +1,297 @@ +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" + pbRtc "Open_IM/pkg/proto/rtc" + sdk_ws "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "bytes" + "context" + "encoding/gob" + "github.com/golang/protobuf/proto" + "github.com/gorilla/websocket" + "google.golang.org/grpc" + "runtime" + "strconv" + "strings" +) + +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{} + dec := gob.NewDecoder(b) + err := dec.Decode(&m) + if err != nil { + log.NewError("", "ws Decode err", 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.NewError("", "ws args validate err", err.Error()) + ws.sendErrMsg(conn, 201, err.Error(), m.ReqIdentifier, m.MsgIncr, m.OperationID) + return + } + //if !utils.VerifyToken(m.Token, m.SendID) { + // ws.sendErrMsg(conn, 202, "token validate err", m.ReqIdentifier, m.MsgIncr,m.OperationID) + // return + //} + log.NewInfo(m.OperationID, "Basic Info Authentication Success", m) + + switch m.ReqIdentifier { + case constant.WSGetNewestSeq: + ws.getSeqReq(conn, &m) + case constant.WSSendMsg: + ws.sendMsgReq(conn, &m) + case constant.WSSendSignalMsg: + ws.sendSignalMsgReq(conn, &m) + case constant.WSPullMsgBySeqList: + ws.pullMsgBySeqListReq(conn, &m) + default: + } + log.NewInfo("", "goroutine num is ", runtime.NumGoroutine()) +} +func (ws *WServer) getSeqReq(conn *UserConn, m *Req) { + log.NewInfo(m.OperationID, "Ws call success to getNewSeq", m.MsgIncr, m.SendID, m.ReqIdentifier, m.Data) + rpcReq := pbChat.GetMaxAndMinSeqReq{} + nReply := new(pbChat.GetMaxAndMinSeqResp) + rpcReq.UserID = m.SendID + rpcReq.OperationID = m.OperationID + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + if grpcConn == nil { + log.ErrorByKv("get grpcConn err", rpcReq.OperationID, "args", m) + } + msgClient := pbChat.NewChatClient(grpcConn) + rpcReply, err := msgClient.GetMaxAndMinSeq(context.Background(), &rpcReq) + if err != nil { + log.Error(rpcReq.OperationID, "rpc call failed to getSeqReq", err, rpcReq.String()) + nReply.ErrCode = 500 + nReply.ErrMsg = err.Error() + ws.getSeqResp(conn, m, nReply) + } else { + log.InfoByKv("rpc call success to getSeqReq", rpcReq.OperationID, "replyData", rpcReply.String()) + ws.getSeqResp(conn, m, rpcReply) + } +} +func (ws *WServer) getSeqResp(conn *UserConn, m *Req, pb *pbChat.GetMaxAndMinSeqResp) { + var mReplyData sdk_ws.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, + } + ws.sendMsg(conn, mReply) +} + +func (ws *WServer) pullMsgBySeqListReq(conn *UserConn, m *Req) { + log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq start", m.SendID, m.ReqIdentifier, m.MsgIncr, m.Data) + nReply := new(sdk_ws.PullMessageBySeqListResp) + isPass, errCode, errMsg, data := ws.argsValidate(m, constant.WSPullMsgBySeqList) + if isPass { + rpcReq := sdk_ws.PullMessageBySeqListReq{} + rpcReq.SeqList = data.(sdk_ws.PullMessageBySeqListReq).SeqList + rpcReq.UserID = m.SendID + rpcReq.OperationID = m.OperationID + log.NewInfo(m.OperationID, "Ws call success to pullMsgBySeqListReq middle", m.SendID, m.ReqIdentifier, m.MsgIncr, data.(sdk_ws.PullMessageBySeqListReq).SeqList) + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + msgClient := pbChat.NewChatClient(grpcConn) + reply, err := msgClient.PullMessageBySeqList(context.Background(), &rpcReq) + if err != nil { + log.NewError(rpcReq.OperationID, "pullMsgBySeqListReq err", err.Error()) + nReply.ErrCode = 200 + nReply.ErrMsg = err.Error() + ws.pullMsgBySeqListResp(conn, m, nReply) + } else { + log.NewInfo(rpcReq.OperationID, "rpc call success to pullMsgBySeqListReq", reply.String(), len(reply.List)) + ws.pullMsgBySeqListResp(conn, m, reply) + } + } else { + nReply.ErrCode = errCode + nReply.ErrMsg = errMsg + ws.pullMsgBySeqListResp(conn, m, nReply) + } +} +func (ws *WServer) pullMsgBySeqListResp(conn *UserConn, m *Req, pb *sdk_ws.PullMessageBySeqListResp) { + log.NewInfo(m.OperationID, "pullMsgBySeqListResp come here ", pb.String()) + c, _ := proto.Marshal(pb) + mReply := Resp{ + ReqIdentifier: m.ReqIdentifier, + MsgIncr: m.MsgIncr, + ErrCode: pb.GetErrCode(), + ErrMsg: pb.GetErrMsg(), + OperationID: m.OperationID, + Data: c, + } + log.NewInfo(m.OperationID, "pullMsgBySeqListResp all data is ", mReply.ReqIdentifier, mReply.MsgIncr, mReply.ErrCode, mReply.ErrMsg, + len(mReply.Data)) + + ws.sendMsg(conn, mReply) + +} +func (ws *WServer) sendMsgReq(conn *UserConn, m *Req) { + sendMsgCount++ + log.NewInfo(m.OperationID, "Ws call success to sendMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, m.Data) + nReply := new(pbChat.SendMsgResp) + isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendMsg) + if isPass { + data := pData.(sdk_ws.MsgData) + pbData := pbChat.SendMsgReq{ + Token: m.Token, + OperationID: m.OperationID, + MsgData: &data, + } + log.NewInfo(m.OperationID, "Ws call success to sendMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, data) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + client := pbChat.NewChatClient(etcdConn) + reply, err := client.SendMsg(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) + } else { + log.NewInfo(pbData.OperationID, "rpc call success to sendMsgReq", reply.String()) + ws.sendMsgResp(conn, m, reply) + } + + } else { + nReply.ErrCode = errCode + nReply.ErrMsg = errMsg + ws.sendMsgResp(conn, m, nReply) + } + +} +func (ws *WServer) sendMsgResp(conn *UserConn, m *Req, pb *pbChat.SendMsgResp) { + // := make(map[string]interface{}) + + var mReplyData sdk_ws.UserSendMsgResp + mReplyData.ClientMsgID = pb.GetClientMsgID() + mReplyData.ServerMsgID = pb.GetServerMsgID() + mReplyData.SendTime = pb.GetSendTime() + 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) sendSignalMsgReq(conn *UserConn, m *Req) { + log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq start", m.MsgIncr, m.ReqIdentifier, m.SendID, m.Data) + nReply := new(pbChat.SendMsgResp) + isPass, errCode, errMsg, pData := ws.argsValidate(m, constant.WSSendSignalMsg) + if isPass { + signalResp := pbRtc.SignalResp{} + //isPass2, errCode2, errMsg2, signalResp, msgData := ws.signalMessageAssemble(pData.(*sdk_ws.SignalReq), m.OperationID) + connGrpc, err := grpc.Dial(config.Config.Rtc.Address+":"+strconv.Itoa(config.Config.Rtc.Port), grpc.WithInsecure()) + if err != nil { + log.NewError(m.OperationID, utils.GetSelfFuncName(), "grpc.Dial failed", err.Error()) + ws.sendSignalMsgResp(conn, 204, "create grpc failed"+err.Error(), m, nil) + return + } + rtcClient := pbRtc.NewRtcServiceClient(connGrpc) + req := &pbRtc.SignalMessageAssembleReq{ + SignalReq: pData.(*pbRtc.SignalReq), + OperationID: m.OperationID, + } + respPb, err := rtcClient.SignalMessageAssemble(context.Background(), req) + if err != nil { + log.NewError(m.OperationID, utils.GetSelfFuncName(), "SignalMessageAssemble", err.Error(), config.Config.Rtc.Address+":"+strconv.Itoa(config.Config.Rtc.Port)) + ws.sendSignalMsgResp(conn, 204, "grpc SignalMessageAssemble failed: "+err.Error(), m, &signalResp) + return + } + signalResp.Payload = respPb.SignalResp.Payload + msgData := sdk_ws.MsgData{} + utils.CopyStructFields(&msgData, respPb.MsgData) + log.NewInfo(m.OperationID, utils.GetSelfFuncName(), respPb.String()) + if respPb.IsPass { + pbData := pbChat.SendMsgReq{ + Token: m.Token, + OperationID: m.OperationID, + MsgData: &msgData, + } + log.NewInfo(m.OperationID, utils.GetSelfFuncName(), "pbData: ", pbData) + log.NewInfo(m.OperationID, "Ws call success to sendSignalMsgReq middle", m.ReqIdentifier, m.SendID, m.MsgIncr, msgData) + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + client := pbChat.NewChatClient(etcdConn) + reply, err := client.SendMsg(context.Background(), &pbData) + if err != nil { + log.NewError(pbData.OperationID, utils.GetSelfFuncName(), "rpc sendMsg err", err.Error()) + nReply.ErrCode = 200 + nReply.ErrMsg = err.Error() + ws.sendSignalMsgResp(conn, 200, err.Error(), m, &signalResp) + } else { + log.NewInfo(pbData.OperationID, "rpc call success to sendMsgReq", reply.String()) + ws.sendSignalMsgResp(conn, 0, "", m, &signalResp) + } + } else { + log.NewError(m.OperationID, utils.GetSelfFuncName(), respPb.IsPass, respPb.CommonResp.ErrCode, respPb.CommonResp.ErrMsg) + ws.sendSignalMsgResp(conn, respPb.CommonResp.ErrCode, respPb.CommonResp.ErrMsg, m, &signalResp) + } + } else { + ws.sendSignalMsgResp(conn, errCode, errMsg, m, nil) + } + +} +func (ws *WServer) sendSignalMsgResp(conn *UserConn, errCode int32, errMsg string, m *Req, pb *pbRtc.SignalResp) { + // := make(map[string]interface{}) + log.Debug(m.OperationID, "SignalMsgResp is", pb.String()) + b, _ := proto.Marshal(pb) + mReply := Resp{ + ReqIdentifier: m.ReqIdentifier, + MsgIncr: m.MsgIncr, + ErrCode: errCode, + ErrMsg: errMsg, + OperationID: m.OperationID, + Data: b, + } + ws.sendMsg(conn, mReply) +} +func (ws *WServer) sendMsg(conn *UserConn, mReply interface{}) { + var b bytes.Buffer + enc := gob.NewEncoder(&b) + err := enc.Encode(mReply) + if err != nil { + uid, platform := ws.getUserUid(conn) + log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "Encode Msg error", conn.RemoteAddr().String(), uid, platform, err.Error()) + return + } + err = ws.writeMsg(conn, websocket.BinaryMessage, b.Bytes()) + if err != nil { + uid, platform := ws.getUserUid(conn) + log.NewError(mReply.(Resp).OperationID, mReply.(Resp).ReqIdentifier, mReply.(Resp).ErrCode, mReply.(Resp).ErrMsg, "WS WriteMsg error", conn.RemoteAddr().String(), uid, platform, err.Error()) + } +} +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/open_im_media/room.go b/internal/msg_gateway/gate/open_im_media/room.go new file mode 100644 index 000000000..83796da29 --- /dev/null +++ b/internal/msg_gateway/gate/open_im_media/room.go @@ -0,0 +1,58 @@ +package open_im_media + +const ( + // Address gRPC服务地址 + Address = "127.0.0.1:11300" +) + +//var roomClient *lksdk.RoomServiceClient + +type Media struct { +} + +func NewMedia() *Media { + return &Media{} +} + +//func (m *Media) GetJoinToken(room, identity string, operationID string, data *open_im_sdk.ParticipantMetaData) (string, string, error) { +// var newData pbRtc.ParticipantMetaData +// copier.Copy(&newData, data) +// conn, err := grpc.Dial(Address, grpc.WithInsecure()) +// if err != nil { +// return "", "", err +// } +// defer conn.Close() +// c := pbRtc.NewRtcServiceClient(conn) +// req := &pbRtc.GetJoinTokenReq{Room: room, OperationID: operationID, Identity: identity, MetaData: &newData} +// resp, err := c.GetJoinToken(context.Background(), req) +// if err != nil { +// return "", "", err +// } +// if resp.CommonResp.ErrCode != 0 { +// return "", "", errors.New(resp.CommonResp.ErrMsg) +// } +// return resp.Jwt, resp.LiveURL, nil +// //at := auth.NewAccessToken(m.ApiKey, m.ApiSecret) +// //grant := &auth.VideoGrant{ +// // RoomJoin: true, +// // Room: room, +// //} +// //at.AddGrant(grant). +// // SetIdentity(identity). +// // SetValidFor(time.Hour) +// // +// //return at.ToJWT() +//} + +func init() { + //roomClient = lksdk.NewRoomServiceClient(MediaAddress, ApiKey, ApiSecret) +} + +func (m *Media) CreateRoom(roomName string) (error, error) { + return nil, nil + //return roomClient.CreateRoom(context.Background(), &livekit.CreateRoomRequest{ + // Name: roomName, + // EmptyTimeout: 60 * 3, + //}) + +} diff --git a/internal/msg_gateway/gate/rpc_server.go b/internal/msg_gateway/gate/rpc_server.go new file mode 100644 index 000000000..a088303cb --- /dev/null +++ b/internal/msg_gateway/gate/rpc_server.go @@ -0,0 +1,149 @@ +package gate + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbRelay "Open_IM/pkg/proto/relay" + "Open_IM/pkg/utils" + "bytes" + "context" + "encoding/gob" + "fmt" + "github.com/golang/protobuf/proto" + "net" + "strings" + + "github.com/gorilla/websocket" + "google.golang.org/grpc" +) + +type RPCServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func (r *RPCServer) onInit(rpcPort int) { + r.rpcPort = rpcPort + r.rpcRegisterName = config.Config.RpcRegisterName.OpenImOnlineMessageRelayName + r.etcdSchema = config.Config.Etcd.EtcdSchema + r.etcdAddr = config.Config.Etcd.EtcdAddr +} +func (r *RPCServer) run() { + ip := utils.ServerIP + registerAddress := ip + ":" + utils.IntToString(r.rpcPort) + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.ErrorByArgs(fmt.Sprintf("fail to listening consumer, err:%v\n", err)) + return + } + defer listener.Close() + srv := grpc.NewServer() + defer srv.GracefulStop() + pbRelay.RegisterOnlineMessageRelayServiceServer(srv, r) + err = getcdv3.RegisterEtcd4Unique(r.etcdSchema, strings.Join(r.etcdAddr, ","), ip, r.rpcPort, r.rpcRegisterName, 10) + if err != nil { + log.ErrorByKv("register push message rpc to etcd err", "", "err", err.Error()) + } + err = srv.Serve(listener) + if err != nil { + log.ErrorByKv("push message rpc listening err", "", "err", err.Error()) + return + } +} +func (r *RPCServer) OnlinePushMsg(_ context.Context, in *pbRelay.OnlinePushMsgReq) (*pbRelay.OnlinePushMsgResp, error) { + log.InfoByKv("PushMsgToUser is arriving", in.OperationID, "args", in.String()) + var resp []*pbRelay.SingleMsgToUser + msgBytes, _ := proto.Marshal(in.MsgData) + 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()) + } + var tag bool + recvID := in.PushToUserID + platformList := genPlatformArray() + for _, v := range platformList { + if conn := ws.getUserConn(recvID, v); conn != nil { + tag = true + resultCode := sendMsgToUser(conn, replyBytes.Bytes(), in, v, recvID) + temp := &pbRelay.SingleMsgToUser{ + ResultCode: resultCode, + RecvID: recvID, + RecvPlatFormID: constant.PlatformNameToID(v), + } + resp = append(resp, temp) + } else { + temp := &pbRelay.SingleMsgToUser{ + ResultCode: -1, + RecvID: recvID, + RecvPlatFormID: constant.PlatformNameToID(v), + } + resp = append(resp, temp) + } + } + if !tag { + log.NewError(in.OperationID, "push err ,no matched ws conn not in map", in.String()) + } + return &pbRelay.OnlinePushMsgResp{ + Resp: resp, + }, nil +} +func (r *RPCServer) GetUsersOnlineStatus(_ context.Context, req *pbRelay.GetUsersOnlineStatusReq) (*pbRelay.GetUsersOnlineStatusResp, error) { + log.NewInfo(req.OperationID, "rpc GetUsersOnlineStatus arrived server", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + log.NewError(req.OperationID, "no permission GetUsersOnlineStatus ", req.OpUserID) + return &pbRelay.GetUsersOnlineStatusResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + var resp pbRelay.GetUsersOnlineStatusResp + for _, userID := range req.UserIDList { + platformList := genPlatformArray() + temp := new(pbRelay.GetUsersOnlineStatusResp_SuccessResult) + temp.UserID = userID + for _, platform := range platformList { + if conn := ws.getUserConn(userID, platform); conn != nil { + ps := new(pbRelay.GetUsersOnlineStatusResp_SuccessDetail) + ps.Platform = platform + ps.Status = constant.OnlineStatus + temp.Status = constant.OnlineStatus + temp.DetailPlatformStatus = append(temp.DetailPlatformStatus, ps) + + } + } + if temp.Status == constant.OnlineStatus { + resp.SuccessResult = append(resp.SuccessResult, temp) + } + } + log.NewInfo(req.OperationID, "GetUsersOnlineStatus rpc return ", resp.String()) + return &resp, nil +} +func sendMsgToUser(conn *UserConn, bMsg []byte, in *pbRelay.OnlinePushMsgReq, 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", constant.PlatformIDToName(in.MsgData.SenderPlatformID), "recvPlatform", RecvPlatForm, "args", in.String(), "recvID", RecvID) + ResultCode = -2 + return ResultCode + } else { + log.InfoByKv("PushMsgToUser is success By Ws", in.OperationID, "args", in.String(), "recvPlatForm", RecvPlatForm, "recvID", RecvID) + ResultCode = 0 + return ResultCode + } + +} +func genPlatformArray() (array []string) { + for i := 1; i <= constant.LinuxPlatformID; i++ { + array = append(array, constant.PlatformIDToName(int32(i))) + } + return array +} diff --git a/internal/msg_gateway/gate/validate.go b/internal/msg_gateway/gate/validate.go new file mode 100644 index 000000000..329f93655 --- /dev/null +++ b/internal/msg_gateway/gate/validate.go @@ -0,0 +1,253 @@ +/* +** description(""). +** copyright('Open_IM,www.Open_IM.io'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/5/21 15:29). + */ +package gate + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + pbRtc "Open_IM/pkg/proto/rtc" + 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" ` + 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"` +} +type MsgData struct { + PlatformID int32 `mapstructure:"platformID" validate:"required"` + SessionType int32 `mapstructure:"sessionType" validate:"required"` + MsgFrom int32 `mapstructure:"msgFrom" validate:"required"` + ContentType int32 `mapstructure:"contentType" validate:"required"` + RecvID string `mapstructure:"recvID" 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, returnData interface{}) { + switch r { + case constant.WSSendMsg: + data := open_im_sdk.MsgData{} + 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.WSSendSignalMsg: + data := pbRtc.SignalReq{} + 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 + +} + +//func (ws *WServer) signalMessageAssemble(s *open_im_sdk.SignalReq, operationID string) (isPass bool, errCode int32, errMsg string, r *open_im_sdk.SignalResp, msgData *open_im_sdk.MsgData) { +// var msg open_im_sdk.MsgData +// var resp open_im_sdk.SignalResp +// media := open_im_media.NewMedia() +// msg.MsgFrom = constant.UserMsgType +// msg.ContentType = constant.SignalingNotification +// reqData, e := proto.Marshal(s) +// if e != nil { +// return false, 201, e.Error(), nil, nil +// } +// msg.Content = reqData +// msg.CreateTime = utils.GetCurrentTimestampByMill() +// options := make(map[string]bool, 6) +// utils.SetSwitchFromOptions(options, constant.IsHistory, false) +// utils.SetSwitchFromOptions(options, constant.IsPersistent, false) +// utils.SetSwitchFromOptions(options, constant.IsSenderSync, true) +// utils.SetSwitchFromOptions(options, constant.IsConversationUpdate, false) +// utils.SetSwitchFromOptions(options, constant.IsSenderConversationUpdate, false) +// utils.SetSwitchFromOptions(options, constant.IsUnreadCount, false) +// utils.SetSwitchFromOptions(options, constant.IsOfflinePush, true) +// msg.Options = options +// switch payload := s.Payload.(type) { +// case *open_im_sdk.SignalReq_Invite: +// token, liveURL, err2 := media.GetJoinToken(payload.Invite.Invitation.RoomID, payload.Invite.Invitation.InviterUserID, operationID, payload.Invite.Participant) +// if err2 != nil { +// return false, 202, err2.Error(), nil, nil +// } +// invite := open_im_sdk.SignalResp_Invite{&open_im_sdk.SignalInviteReply{ +// Token: token, +// RoomID: payload.Invite.Invitation.RoomID, +// LiveURL: liveURL, +// }} +// resp.Payload = &invite +// msg.SenderPlatformID = payload.Invite.Invitation.PlatformID +// msg.SessionType = payload.Invite.Invitation.SessionType +// msg.OfflinePushInfo = payload.Invite.OfflinePushInfo +// msg.SendID = payload.Invite.Invitation.InviterUserID +// if len(payload.Invite.Invitation.InviteeUserIDList) > 0 { +// msg.RecvID = payload.Invite.Invitation.InviteeUserIDList[0] +// } else { +// return false, 203, errors.New("InviteeUserIDList is null").Error(), nil, nil +// } +// msg.ClientMsgID = utils.GetMsgID(payload.Invite.Invitation.InviterUserID) +// return true, 0, "", &resp, &msg +// case *open_im_sdk.SignalReq_InviteInGroup: +// token, liveURL, err2 := media.GetJoinToken(payload.InviteInGroup.Invitation.RoomID, payload.InviteInGroup.Invitation.InviterUserID, operationID, payload.InviteInGroup.Participant) +// if err2 != nil { +// return false, 204, err2.Error(), nil, nil +// } +// inviteGroup := open_im_sdk.SignalResp_InviteInGroup{&open_im_sdk.SignalInviteInGroupReply{ +// RoomID: payload.InviteInGroup.Invitation.RoomID, +// Token: token, +// LiveURL: liveURL, +// }} +// resp.Payload = &inviteGroup +// msg.SenderPlatformID = payload.InviteInGroup.Invitation.PlatformID +// msg.SessionType = payload.InviteInGroup.Invitation.SessionType +// msg.OfflinePushInfo = payload.InviteInGroup.OfflinePushInfo +// msg.SendID = payload.InviteInGroup.Invitation.InviterUserID +// if len(payload.InviteInGroup.Invitation.InviteeUserIDList) > 0 { +// msg.GroupID = payload.InviteInGroup.Invitation.GroupID +// } else { +// return false, 205, errors.New("InviteeUserIDList is null").Error(), nil, nil +// } +// msg.ClientMsgID = utils.GetMsgID(payload.InviteInGroup.Invitation.InviterUserID) +// +// return true, 0, "", &resp, &msg +// case *open_im_sdk.SignalReq_Cancel: +// cancel := open_im_sdk.SignalResp_Cancel{&open_im_sdk.SignalCancelReply{}} +// resp.Payload = &cancel +// msg.OfflinePushInfo = payload.Cancel.OfflinePushInfo +// msg.SendID = payload.Cancel.Invitation.InviterUserID +// msg.SenderPlatformID = payload.Cancel.Invitation.PlatformID +// msg.SessionType = payload.Cancel.Invitation.SessionType +// if len(payload.Cancel.Invitation.InviteeUserIDList) > 0 { +// switch payload.Cancel.Invitation.SessionType { +// case constant.SingleChatType: +// msg.RecvID = payload.Cancel.Invitation.InviteeUserIDList[0] +// case constant.GroupChatType: +// msg.GroupID = payload.Cancel.Invitation.GroupID +// } +// } else { +// return false, 206, errors.New("InviteeUserIDList is null").Error(), nil, nil +// } +// msg.ClientMsgID = utils.GetMsgID(payload.Cancel.OpUserID) +// return true, 0, "", &resp, &msg +// case *open_im_sdk.SignalReq_Accept: +// token, liveURL, err2 := media.GetJoinToken(payload.Accept.Invitation.RoomID, payload.Accept.OpUserID, operationID, payload.Accept.Participant) +// if err2 != nil { +// return false, 207, err2.Error(), nil, nil +// } +// accept := open_im_sdk.SignalResp_Accept{&open_im_sdk.SignalAcceptReply{ +// Token: token, +// LiveURL: liveURL, +// RoomID: payload.Accept.Invitation.RoomID, +// }} +// resp.Payload = &accept +// msg.OfflinePushInfo = payload.Accept.OfflinePushInfo +// msg.SendID = payload.Accept.OpUserID +// msg.SenderPlatformID = payload.Accept.Invitation.PlatformID +// msg.SessionType = payload.Accept.Invitation.SessionType +// if len(payload.Accept.Invitation.InviteeUserIDList) > 0 { +// switch payload.Accept.Invitation.SessionType { +// case constant.SingleChatType: +// msg.RecvID = payload.Accept.Invitation.InviterUserID +// case constant.GroupChatType: +// msg.GroupID = payload.Accept.Invitation.GroupID +// } +// } else { +// return false, 208, errors.New("InviteeUserIDList is null").Error(), nil, nil +// } +// msg.ClientMsgID = utils.GetMsgID(payload.Accept.OpUserID) +// return true, 0, "", &resp, &msg +// case *open_im_sdk.SignalReq_HungUp: +// case *open_im_sdk.SignalReq_Reject: +// reject := open_im_sdk.SignalResp_Reject{&open_im_sdk.SignalRejectReply{}} +// resp.Payload = &reject +// msg.OfflinePushInfo = payload.Reject.OfflinePushInfo +// msg.SendID = payload.Reject.OpUserID +// msg.SenderPlatformID = payload.Reject.Invitation.PlatformID +// msg.SessionType = payload.Reject.Invitation.SessionType +// if len(payload.Reject.Invitation.InviteeUserIDList) > 0 { +// switch payload.Reject.Invitation.SessionType { +// case constant.SingleChatType: +// msg.RecvID = payload.Reject.Invitation.InviterUserID +// case constant.GroupChatType: +// msg.GroupID = payload.Reject.Invitation.GroupID +// } +// } else { +// return false, 209, errors.New("InviteeUserIDList is null").Error(), nil, nil +// } +// msg.ClientMsgID = utils.GetMsgID(payload.Reject.OpUserID) +// return true, 0, "", &resp, &msg +// } +// return false, 210, errors.New("InviteeUserIDList is null").Error(), nil, nil +//} diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go new file mode 100644 index 000000000..7c602a5fc --- /dev/null +++ b/internal/msg_gateway/gate/ws_server.go @@ -0,0 +1,285 @@ +package gate + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/utils" + "bytes" + "encoding/gob" + "github.com/garyburd/redigo/redis" + "net/http" + "sync" + "time" + + "github.com/gorilla/websocket" +) + +type UserConn struct { + *websocket.Conn + w *sync.Mutex +} +type WServer struct { + wsAddr string + wsMaxConnNum int + wsUpGrader *websocket.Upgrader + wsConnToUser map[*UserConn]map[string]string + wsUserToConn map[string]map[string]*UserConn +} + +func (ws *WServer) onInit(wsPort int) { + ws.wsAddr = ":" + utils.IntToString(wsPort) + ws.wsMaxConnNum = config.Config.LongConnSvr.WebsocketMaxConnNum + ws.wsConnToUser = make(map[*UserConn]map[string]string) + ws.wsUserToConn = make(map[string]map[string]*UserConn) + ws.wsUpGrader = &websocket.Upgrader{ + HandshakeTimeout: time.Duration(config.Config.LongConnSvr.WebsocketTimeOut) * time.Second, + ReadBufferSize: config.Config.LongConnSvr.WebsocketMaxMsgLen, + CheckOrigin: func(r *http.Request) bool { return true }, + } +} + +func (ws *WServer) run() { + http.HandleFunc("/", ws.wsHandler) //Get request from client to handle by wsHandler + err := http.ListenAndServe(ws.wsAddr, nil) //Start listening + if err != nil { + log.ErrorByKv("Ws listening err", "", "err", err.Error()) + } +} + +func (ws *WServer) wsHandler(w http.ResponseWriter, r *http.Request) { + if ws.headerCheck(w, r) { + query := r.URL.Query() + conn, err := ws.wsUpGrader.Upgrade(w, r, nil) //Conn is obtained through the upgraded escalator + if err != nil { + log.ErrorByKv("upgrade http conn err", "", "err", err) + return + } else { + //Connection mapping relationship, + //userID+" "+platformID->conn + + //Initialize a lock for each user + newConn := &UserConn{conn, new(sync.Mutex)} + ws.addUserConn(query["sendID"][0], int32(utils.StringToInt64(query["platformID"][0])), newConn, query["token"][0]) + go ws.readMsg(newConn) + } + } +} + +func (ws *WServer) readMsg(conn *UserConn) { + for { + messageType, msg, err := conn.ReadMessage() + if messageType == websocket.PingMessage { + log.NewInfo("", "this is a pingMessage") + } + if err != nil { + uid, platform := ws.getUserUid(conn) + log.ErrorByKv("WS ReadMsg error", "", "userIP", conn.RemoteAddr().String(), "userUid", uid, "platform", platform, "error", err.Error()) + ws.delUserConn(conn) + return + } else { + //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 *UserConn, a int, msg []byte) error { + conn.w.Lock() + defer conn.w.Unlock() + return conn.WriteMessage(a, msg) + +} +func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int32, newConn *UserConn, token string, operationID string) { + switch config.Config.MultiLoginPolicy { + case constant.AllLoginButSameTermKick: + if oldConnMap, ok := ws.wsUserToConn[uid]; ok { // user->map[platform->conn] + if oldConn, ok := oldConnMap[constant.PlatformIDToName(platformID)]; ok { + log.NewDebug(operationID, uid, platformID, "kick old conn") + ws.sendKickMsg(oldConn, newConn) + m, err := db.DB.GetTokenMapByUidPid(uid, constant.PlatformIDToName(platformID)) + if err != nil && err != redis.ErrNil { + log.NewError(operationID, "get token from redis err", err.Error()) + return + } + if m == nil { + log.NewError(operationID, "get token from redis err", "m is nil") + return + } + for k, _ := range m { + if k != token { + m[k] = constant.KickedToken + } + } + log.NewDebug(operationID, "get map is ", m) + err = db.DB.SetTokenMapByUidPid(uid, platformID, m) + if err != nil { + log.NewError(operationID, "SetTokenMapByUidPid err", err.Error()) + return + } + err = oldConn.Close() + delete(oldConnMap, constant.PlatformIDToName(platformID)) + ws.wsUserToConn[uid] = oldConnMap + if len(oldConnMap) == 0 { + delete(ws.wsUserToConn, uid) + } + delete(ws.wsConnToUser, oldConn) + if err != nil { + log.NewError(operationID, "conn close err", err.Error(), uid, platformID) + } + + } else { + log.NewWarn(operationID, "abnormal uid-conn ", uid, platformID, oldConnMap[constant.PlatformIDToName(platformID)]) + } + + } else { + log.NewDebug(operationID, "no other conn", ws.wsUserToConn, uid, platformID) + } + + case constant.SingleTerminalLogin: + case constant.WebAndOther: + } +} +func (ws *WServer) sendKickMsg(oldConn, newConn *UserConn) { + mReply := Resp{ + ReqIdentifier: constant.WSKickOnlineMsg, + ErrCode: constant.ErrTokenInvalid.ErrCode, + ErrMsg: constant.ErrTokenInvalid.ErrMsg, + } + var b bytes.Buffer + enc := gob.NewEncoder(&b) + err := enc.Encode(mReply) + if err != nil { + log.NewError(mReply.OperationID, mReply.ReqIdentifier, mReply.ErrCode, mReply.ErrMsg, "Encode Msg error", oldConn.RemoteAddr().String(), newConn.RemoteAddr().String(), err.Error()) + return + } + err = ws.writeMsg(oldConn, websocket.BinaryMessage, b.Bytes()) + if err != nil { + log.NewError(mReply.OperationID, mReply.ReqIdentifier, mReply.ErrCode, mReply.ErrMsg, "WS WriteMsg error", oldConn.RemoteAddr().String(), newConn.RemoteAddr().String(), err.Error()) + } +} +func (ws *WServer) addUserConn(uid string, platformID int32, conn *UserConn, token string) { + rwLock.Lock() + defer rwLock.Unlock() + operationID := utils.OperationIDGenerator() + ws.MultiTerminalLoginChecker(uid, platformID, conn, token, operationID) + if oldConnMap, ok := ws.wsUserToConn[uid]; ok { + oldConnMap[constant.PlatformIDToName(platformID)] = conn + ws.wsUserToConn[uid] = oldConnMap + log.Debug(operationID, "user not first come in, add conn ", uid, platformID, conn, oldConnMap) + } else { + i := make(map[string]*UserConn) + i[constant.PlatformIDToName(platformID)] = conn + ws.wsUserToConn[uid] = i + log.Debug(operationID, "user first come in, new user, conn", uid, platformID, conn, ws.wsUserToConn[uid]) + } + if oldStringMap, ok := ws.wsConnToUser[conn]; ok { + oldStringMap[constant.PlatformIDToName(platformID)] = uid + ws.wsConnToUser[conn] = oldStringMap + } else { + i := make(map[string]string) + i[constant.PlatformIDToName(platformID)] = uid + ws.wsConnToUser[conn] = i + } + count := 0 + for _, v := range ws.wsUserToConn { + count = count + len(v) + } + log.Debug(operationID, "WS Add operation", "", "wsUser added", ws.wsUserToConn, "connection_uid", uid, "connection_platform", constant.PlatformIDToName(platformID), "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) + userCount = uint64(len(ws.wsUserToConn)) + +} + +func (ws *WServer) delUserConn(conn *UserConn) { + rwLock.Lock() + defer rwLock.Unlock() + var platform, uid string + if oldStringMap, ok := ws.wsConnToUser[conn]; ok { + for k, v := range oldStringMap { + platform = k + uid = v + } + if oldConnMap, ok := ws.wsUserToConn[uid]; ok { + delete(oldConnMap, platform) + ws.wsUserToConn[uid] = oldConnMap + if len(oldConnMap) == 0 { + delete(ws.wsUserToConn, uid) + } + count := 0 + for _, v := range ws.wsUserToConn { + count = count + len(v) + } + log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn), "online_conn_num", count) + } else { + log.WarnByKv("WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn)) + } + userCount = uint64(len(ws.wsUserToConn)) + delete(ws.wsConnToUser, conn) + + } + err := conn.Close() + if err != nil { + log.ErrorByKv("close err", "", "uid", uid, "platform", platform) + + } + +} + +func (ws *WServer) getUserConn(uid string, platform string) *UserConn { + rwLock.RLock() + defer rwLock.RUnlock() + if connMap, ok := ws.wsUserToConn[uid]; ok { + if conn, flag := connMap[platform]; flag { + return conn + } + } + return nil +} +func (ws *WServer) getSingleUserAllConn(uid string) map[string]*UserConn { + rwLock.RLock() + defer rwLock.RUnlock() + if connMap, ok := ws.wsUserToConn[uid]; ok { + return connMap + } + return nil +} +func (ws *WServer) getUserUid(conn *UserConn) (uid, platform string) { + rwLock.RLock() + defer rwLock.RUnlock() + + if stringMap, ok := ws.wsConnToUser[conn]; ok { + for k, v := range stringMap { + platform = k + uid = v + } + return uid, platform + } + return "", "" +} +func (ws *WServer) headerCheck(w http.ResponseWriter, r *http.Request) bool { + status := http.StatusUnauthorized + query := r.URL.Query() + if len(query["token"]) != 0 && len(query["sendID"]) != 0 && len(query["platformID"]) != 0 { + if ok, err, msg := token_verify.WsVerifyToken(query["token"][0], query["sendID"][0], query["platformID"][0]); !ok { + e := err.(*constant.ErrInfo) + log.ErrorByKv("Token verify failed", "", "query", query, msg) + w.Header().Set("Sec-Websocket-Version", "13") + http.Error(w, e.ErrMsg, int(e.ErrCode)) + return false + } else { + log.InfoByKv("Connection Authentication Success", "", "token", query["token"][0], "userID", query["sendID"][0]) + return true + } + } else { + log.ErrorByKv("Args err", "", "query", query) + w.Header().Set("Sec-Websocket-Version", "13") + http.Error(w, http.StatusText(status), status) + return false + } +} +func genMapKey(uid string, platformID int32) string { + return uid + " " + constant.PlatformIDToName(platformID) +} diff --git a/internal/msg_transfer/logic/db.go b/internal/msg_transfer/logic/db.go new file mode 100644 index 000000000..806b782c0 --- /dev/null +++ b/internal/msg_transfer/logic/db.go @@ -0,0 +1,23 @@ +package logic + +import ( + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" +) + +func saveUserChat(uid string, msg *pbMsg.MsgDataToMQ) error { + time := utils.GetCurrentTimestampByMill() + seq, err := db.DB.IncrUserSeq(uid) + if err != nil { + log.NewError(msg.OperationID, "data insert to redis err", err.Error(), msg.String()) + return err + } + msg.MsgData.Seq = uint32(seq) + pbSaveData := pbMsg.MsgDataToDB{} + pbSaveData.MsgData = msg.MsgData + log.NewInfo(msg.OperationID, "IncrUserSeq cost time", utils.GetCurrentTimestampByMill()-time) + return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) +// return db.DB.SaveUserChatMongo2(uid, pbSaveData.MsgData.SendTime, &pbSaveData) +} diff --git a/internal/msg_transfer/logic/history_msg_handler.go b/internal/msg_transfer/logic/history_msg_handler.go new file mode 100644 index 000000000..0b9f5c1c3 --- /dev/null +++ b/internal/msg_transfer/logic/history_msg_handler.go @@ -0,0 +1,142 @@ +package logic + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + kfk "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbMsg "Open_IM/pkg/proto/chat" + pbPush "Open_IM/pkg/proto/push" + "Open_IM/pkg/statistics" + "Open_IM/pkg/utils" + "context" + "github.com/Shopify/sarama" + "github.com/golang/protobuf/proto" + "strings" +) + +type fcb func(msg []byte, msgKey string) + +type HistoryConsumerHandler struct { + msgHandle map[string]fcb + historyConsumerGroup *kfk.MConsumerGroup + singleMsgCount uint64 + groupMsgCount uint64 +} + +func (mc *HistoryConsumerHandler) Init() { + statistics.NewStatistics(&mc.singleMsgCount, config.Config.ModuleName.MsgTransferName, "singleMsgCount insert to mongo ", 300) + statistics.NewStatistics(&mc.groupMsgCount, config.Config.ModuleName.MsgTransferName, "groupMsgCount insert to mongo ", 300) + + mc.msgHandle = make(map[string]fcb) + mc.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = mc.handleChatWs2Mongo + mc.historyConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V0_10_2_0, + OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ws2mschat.Topic}, + config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMongo) + +} + +func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string) { + time := utils.GetCurrentTimestampByNano() + msgFromMQ := pbMsg.MsgDataToMQ{} + err := proto.Unmarshal(msg, &msgFromMQ) + if err != nil { + log.Error("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) + return + } + operationID := msgFromMQ.OperationID + log.NewInfo(operationID, "msg come mongo!!!", "", "msg", string(msg)) + //Control whether to store offline messages (mongo) + isHistory := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsHistory) + //Control whether to store history messages (mysql) + isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent) + isSenderSync := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsSenderSync) + switch msgFromMQ.MsgData.SessionType { + case constant.SingleChatType: + log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = SingleChatType", isHistory, isPersist) + if isHistory { + err := saveUserChat(msgKey, &msgFromMQ) + if err != nil { + log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) + return + } + mc.singleMsgCount++ + log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", utils.GetCurrentTimestampByNano()-time) + } + if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { + } else { + go sendMessageToPush(&msgFromMQ, msgKey) + } + log.NewDebug(operationID, "saveUserChat cost time ", utils.GetCurrentTimestampByNano()-time) + case constant.GroupChatType: + log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = GroupChatType", isHistory, isPersist) + if isHistory { + err := saveUserChat(msgFromMQ.MsgData.RecvID, &msgFromMQ) + if err != nil { + log.NewError(operationID, "group data insert to mongo err", msgFromMQ.String(), msgFromMQ.MsgData.RecvID, err.Error()) + return + } + mc.groupMsgCount++ + } + go sendMessageToPush(&msgFromMQ, msgFromMQ.MsgData.RecvID) + case constant.NotificationChatType: + log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = NotificationChatType", isHistory, isPersist) + if isHistory { + err := saveUserChat(msgKey, &msgFromMQ) + if err != nil { + log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String()) + return + } + mc.singleMsgCount++ + log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", utils.GetCurrentTimestampByNano()-time) + } + if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID { + } else { + go sendMessageToPush(&msgFromMQ, msgKey) + } + log.NewDebug(operationID, "saveUserChat cost time ", utils.GetCurrentTimestampByNano()-time) + default: + log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String()) + return + } + log.NewDebug(msgFromMQ.OperationID, "msg_transfer handle topic data to database success...", msgFromMQ.String()) +} + +func (HistoryConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (HistoryConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } +func (mc *HistoryConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, + claim sarama.ConsumerGroupClaim) error { + for msg := range claim.Messages() { + log.InfoByKv("kafka get info to mongo", "", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) + mc.msgHandle[msg.Topic](msg.Value, string(msg.Key)) + sess.MarkMessage(msg, "") + } + return nil +} +func sendMessageToPush(message *pbMsg.MsgDataToMQ, pushToUserID string) { + log.Info(message.OperationID, "msg_transfer send message to push", "message", message.String()) + rpcPushMsg := pbPush.PushMsgReq{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} + mqPushMsg := pbMsg.PushMsgDataToMQ{OperationID: message.OperationID, MsgData: message.MsgData, PushToUserID: pushToUserID} + grpcConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImPushName) + if grpcConn == nil { + log.Error(rpcPushMsg.OperationID, "rpc dial failed", "push data", rpcPushMsg.String()) + pid, offset, err := producer.SendMessage(&mqPushMsg) + if err != nil { + log.Error(mqPushMsg.OperationID, "kafka send failed", "send data", message.String(), "pid", pid, "offset", offset, "err", err.Error()) + } + return + } + msgClient := pbPush.NewPushMsgServiceClient(grpcConn) + _, err := msgClient.PushMsg(context.Background(), &rpcPushMsg) + if err != nil { + log.Error(rpcPushMsg.OperationID, "rpc send failed", rpcPushMsg.OperationID, "push data", rpcPushMsg.String(), "err", err.Error()) + pid, offset, err := producer.SendMessage(&mqPushMsg) + if err != nil { + log.Error("kafka send failed", mqPushMsg.OperationID, "send data", mqPushMsg.String(), "pid", pid, "offset", offset, "err", err.Error()) + } + } else { + log.Info("rpc send success", rpcPushMsg.OperationID, "push data", rpcPushMsg.String()) + + } +} diff --git a/internal/msg_transfer/logic/init.go b/internal/msg_transfer/logic/init.go new file mode 100644 index 000000000..20326bbfc --- /dev/null +++ b/internal/msg_transfer/logic/init.go @@ -0,0 +1,25 @@ +package logic + +import ( + "Open_IM/pkg/common/config" + + "Open_IM/pkg/common/kafka" +) + +var ( + persistentCH PersistentConsumerHandler + historyCH HistoryConsumerHandler + producer *kafka.Producer +) + +func Init() { + + persistentCH.Init() + historyCH.Init() + producer = kafka.NewKafkaProducer(config.Config.Kafka.Ms2pschat.Addr, config.Config.Kafka.Ms2pschat.Topic) +} +func Run() { + //register mysqlConsumerHandler to + go persistentCH.persistentConsumerGroup.RegisterHandleAndConsumer(&persistentCH) + go historyCH.historyConsumerGroup.RegisterHandleAndConsumer(&historyCH) +} diff --git a/internal/msg_transfer/logic/persistent_msg_handler.go b/internal/msg_transfer/logic/persistent_msg_handler.go new file mode 100644 index 000000000..5400d54d6 --- /dev/null +++ b/internal/msg_transfer/logic/persistent_msg_handler.go @@ -0,0 +1,78 @@ +/* +** description(""). +** copyright('tuoyun,www.tuoyun.net'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/5/11 15:37). + */ +package logic + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db/mysql_model/im_mysql_msg_model" + kfk "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" + "github.com/Shopify/sarama" + "github.com/golang/protobuf/proto" +) + +type PersistentConsumerHandler struct { + msgHandle map[string]fcb + persistentConsumerGroup *kfk.MConsumerGroup +} + +func (pc *PersistentConsumerHandler) Init() { + pc.msgHandle = make(map[string]fcb) + pc.msgHandle[config.Config.Kafka.Ws2mschat.Topic] = pc.handleChatWs2Mysql + pc.persistentConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V0_10_2_0, + OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ws2mschat.Topic}, + config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.ConsumerGroupID.MsgToMySql) + +} + +func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey string) { + log.NewInfo("msg come here mysql!!!", "", "msg", string(msg)) + var tag bool + msgFromMQ := pbMsg.MsgDataToMQ{} + err := proto.Unmarshal(msg, &msgFromMQ) + if err != nil { + log.NewError(msgFromMQ.OperationID, "msg_transfer Unmarshal msg err", "msg", string(msg), "err", err.Error()) + return + } + //Control whether to store history messages (mysql) + isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent) + //Only process receiver data + if isPersist { + switch msgFromMQ.MsgData.SessionType { + case constant.SingleChatType, constant.NotificationChatType: + if msgKey == msgFromMQ.MsgData.RecvID { + tag = true + } + case constant.GroupChatType: + if msgKey == msgFromMQ.MsgData.SendID || utils.IsContain(msgFromMQ.MsgData.SendID, config.Config.Manager.AppManagerUid) { + tag = true + } + } + if tag { + log.NewInfo(msgFromMQ.OperationID, "msg_transfer msg persisting", string(msg)) + if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil { + log.NewError(msgFromMQ.OperationID, "Message insert failed", "err", err.Error(), "msg", msgFromMQ.String()) + return + } + } + + } +} +func (PersistentConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (PersistentConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } +func (pc *PersistentConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, + claim sarama.ConsumerGroupClaim) error { + for msg := range claim.Messages() { + log.InfoByKv("kafka get info to mysql", "", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) + pc.msgHandle[msg.Topic](msg.Value, string(msg.Key)) + sess.MarkMessage(msg, "") + } + return nil +} diff --git a/internal/push/content_struct/content.go b/internal/push/content_struct/content.go new file mode 100644 index 000000000..c27b3f92a --- /dev/null +++ b/internal/push/content_struct/content.go @@ -0,0 +1,85 @@ +/* +** description(""). +** copyright('open-im,www.open-im.io'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/5/27 11:24). + */ +package content_struct + +import ( + "encoding/json" +) + +type Content struct { + IsDisplay int32 `json:"isDisplay"` + ID string `json:"id"` + Text string `json:"text"` +} + +func NewContentStructString(isDisplay int32, ID string, text string) string { + c := Content{IsDisplay: isDisplay, ID: ID, Text: text} + return c.contentToString() +} + +func (c *Content) contentToString() string { + data, _ := json.Marshal(c) + dataString := string(data) + return dataString +} + +type groupMemberFullInfo struct { + GroupId string `json:"groupID"` + UserId string `json:"userId"` + Role int `json:"role"` + JoinTime uint64 `json:"joinTime"` + NickName string `json:"nickName"` + FaceUrl string `json:"faceUrl"` +} + +type AgreeOrRejectGroupMember struct { + GroupId string `json:"groupID"` + UserId string `json:"userId"` + Role int `json:"role"` + JoinTime uint64 `json:"joinTime"` + NickName string `json:"nickName"` + FaceUrl string `json:"faceUrl"` + Reason string `json:"reason"` +} +type AtTextContent struct { + Text string `json:"text"` + AtUserList []string `json:"atUserList"` + IsAtSelf bool `json:"isAtSelf"` +} + +type CreateGroupSysMsg struct { + uIdCreator string `creatorUid` + initMemberList []groupMemberFullInfo `json: initMemberList` + CreateTime uint64 `json:"CreateTime"` + Text string `json:"text"` +} + +type NotificationContent struct { + IsDisplay int32 `json:"isDisplay"` + DefaultTips string `json:"defaultTips"` + Detail string `json:"detail"` +} + +func (c *NotificationContent) ContentToString() string { + data, _ := json.Marshal(c) + dataString := string(data) + return dataString +} + +type KickGroupMemberApiReq struct { + GroupID string `json:"groupID"` + UidList []string `json:"uidList"` + Reason string `json:"reason"` + OperationID string `json:"operationID"` +} + +func NewCreateGroupSysMsgString(create *CreateGroupSysMsg, text string) string { + create.Text = text + jstring, _ := json.Marshal(create) + + return string(jstring) +} diff --git a/internal/push/getui/push.go b/internal/push/getui/push.go new file mode 100644 index 000000000..b91b51fc2 --- /dev/null +++ b/internal/push/getui/push.go @@ -0,0 +1,222 @@ +package getui + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "bytes" + "crypto/sha256" + "errors" + + //"crypto/sha512" + "encoding/hex" + "encoding/json" + "io/ioutil" + "net/http" + "strconv" + "time" +) + +var ( + GetuiClient *Getui + + TokenExpireError = errors.New("token expire") +) + +const ( + PushURL = "/push/single/alias" + AuthURL = "/auth" +) + +func init() { + GetuiClient = newGetuiClient() +} + +type Getui struct{} + +type GetuiCommonResp struct { + Code int `json:"code"` + Msg string `json:"msg"` + Data interface{} `json:"data"` +} + +type AuthReq struct { + Sign string `json:"sign"` + Timestamp string `json:"timestamp"` + Appkey string `json:"appkey"` +} + +type AuthResp struct { + ExpireTime string `json:"expire_time"` + Token string `json:"token"` +} + +type PushReq struct { + RequestID string `json:"request_id"` + Audience struct { + Alias []string `json:"alias"` + } `json:"audience"` + PushMessage struct { + Notification Notification `json:"notification,omitempty"` + Transmission string `json:"transmission,omitempty"` + } `json:"push_message"` + PushChannel struct { + Ios Ios `json:"ios"` + Android Android `json:"android"` + } `json:"push_channel"` +} + +type Ios struct { + Aps struct { + Sound string `json:"sound"` + Alert Alert `json:"alert"` + } `json:"aps"` +} + +type Alert struct { + Title string `json:"title"` + Body string `json:"body"` +} + +type Android struct { + Ups struct { + Notification Notification `json:"notification"` + } `json:"ups"` +} + +type Notification struct { + Title string `json:"title"` + Body string `json:"body"` + ClickType string `json:"click_type"` +} + +type PushResp struct { +} + +func newGetuiClient() *Getui { + return &Getui{} +} + +func (g *Getui) Push(userIDList []string, alert, detailContent, operationID string) (resp string, err error) { + token, err := db.DB.GetGetuiToken() + log.NewDebug(operationID, utils.GetSelfFuncName(), "token:", token) + if err != nil { + log.NewError(operationID, utils.OperationIDGenerator(), "GetGetuiToken failed", err.Error()) + } + if token == "" || err != nil { + token, err = g.getTokenAndSave2Redis(operationID) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "getTokenAndSave2Redis failed", err.Error()) + return "", utils.Wrap(err, "") + } + } + pushReq := PushReq{ + RequestID: utils.OperationIDGenerator(), + Audience: struct { + Alias []string `json:"alias"` + }{Alias: []string{userIDList[0]}}, + } + pushReq.PushMessage.Notification = Notification{ + Title: alert, + Body: alert, + ClickType: "startapp", + } + pushReq.PushChannel.Ios.Aps.Sound = "default" + pushReq.PushChannel.Ios.Aps.Alert = Alert{ + Title: alert, + Body: alert, + } + pushReq.PushChannel.Android.Ups.Notification = Notification{ + Title: alert, + Body: alert, + ClickType: "startapp", + } + pushResp := PushResp{} + err = g.request(PushURL, pushReq, token, &pushResp, operationID) + switch err { + case TokenExpireError: + token, err = g.getTokenAndSave2Redis(operationID) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "getTokenAndSave2Redis failed, ", err.Error()) + } else { + log.NewInfo(operationID, utils.GetSelfFuncName(), "getTokenAndSave2Redis: ", token) + } + } + if err != nil { + return "", utils.Wrap(err, "push failed") + } + respBytes, err := json.Marshal(pushResp) + return string(respBytes), utils.Wrap(err, "") +} + +func (g *Getui) Auth(operationID string, timeStamp int64) (token string, expireTime int64, err error) { + log.NewInfo(operationID, utils.GetSelfFuncName(), config.Config.Push.Getui.AppKey, timeStamp, config.Config.Push.Getui.MasterSecret) + h := sha256.New() + h.Write([]byte(config.Config.Push.Getui.AppKey + strconv.Itoa(int(timeStamp)) + config.Config.Push.Getui.MasterSecret)) + sum := h.Sum(nil) + sign := hex.EncodeToString(sum) + log.NewInfo(operationID, utils.GetSelfFuncName(), "sha256 result", sign) + reqAuth := AuthReq{ + Sign: sign, + Timestamp: strconv.Itoa(int(timeStamp)), + Appkey: config.Config.Push.Getui.AppKey, + } + respAuth := AuthResp{} + err = g.request(AuthURL, reqAuth, "", &respAuth, operationID) + if err != nil { + return "", 0, err + } + log.NewInfo(operationID, utils.GetSelfFuncName(), "result: ", respAuth) + expire, err := strconv.Atoi(respAuth.ExpireTime) + return respAuth.Token, int64(expire), err +} + +func (g *Getui) request(url string, content interface{}, token string, returnStruct interface{}, operationID string) error { + con, err := json.Marshal(content) + if err != nil { + return err + } + client := &http.Client{} + log.Debug(operationID, utils.GetSelfFuncName(), "json:", string(con)) + req, err := http.NewRequest("POST", config.Config.Push.Getui.PushUrl+url, bytes.NewBuffer(con)) + if err != nil { + return err + } + if token != "" { + req.Header.Set("token", token) + } + req.Header.Set("content-type", "application/json") + resp, err := client.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + result, err := ioutil.ReadAll(resp.Body) + if err != nil { + return err + } + log.NewInfo(operationID, "getui", utils.GetSelfFuncName(), "resp, ", string(result)) + commonResp := GetuiCommonResp{} + commonResp.Data = returnStruct + if err := json.Unmarshal(result, &commonResp); err != nil { + return err + } + if commonResp.Code == 10001 { + return TokenExpireError + } + return nil +} + +func (g *Getui) getTokenAndSave2Redis(operationID string) (token string, err error) { + token, expireTime, err := g.Auth(operationID, time.Now().UnixNano()/1e6) + if err != nil { + return "", utils.Wrap(err, "Auth failed") + } + log.NewDebug(operationID, "getui", utils.GetSelfFuncName(), token, expireTime, err) + err = db.DB.SetGetuiToken(token, 60*60*23) + if err != nil { + return "", utils.Wrap(err, "Auth failed") + } + return token, nil +} 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..aaaee306d --- /dev/null +++ b/internal/push/jpush/push.go @@ -0,0 +1,74 @@ +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" +) + +var ( + JPushClient *JPush +) + +func init() { + JPushClient = newGetuiClient() +} + +type JPush struct{} + +func newGetuiClient() *JPush { + return &JPush{} +} + +func (j *JPush) Auth(apiKey, secretKey string, timeStamp int64) (token string, err error) { + return token, nil +} + +func (j *JPush) SetAlias(cid, alias string) (resp string, err error) { + return resp, nil +} + +func (j *JPush) Push(accounts []string, alert, detailContent, operationID string) (string, error) { + var pf requestBody.Platform + pf.SetAll() + var au requestBody.Audience + au.SetAlias(accounts) + var no requestBody.Notification + no.SetAlert(alert) + var me requestBody.Message + me.SetMsgContent(detailContent) + var o requestBody.Options + o.SetApnsProduction(false) + var po requestBody.PushObj + po.SetPlatform(&pf) + po.SetAudience(&au) + po.SetNotification(&no) + po.SetMessage(&me) + po.SetOptions(&o) + + con, err := json.Marshal(po) + if err != nil { + return "", err + } + client := &http.Client{} + req, err := http.NewRequest("POST", config.Config.Push.Jpns.PushUrl, bytes.NewBuffer(con)) + if err != nil { + return "", 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 "", err + } + defer resp.Body.Close() + result, err := ioutil.ReadAll(resp.Body) + if err != nil { + return "", err + } + return string(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..9ff49a439 --- /dev/null +++ b/internal/push/jpush/requestBody/notification.go @@ -0,0 +1,36 @@ +package requestBody + +import ( + "Open_IM/pkg/common/config" +) + +type Notification struct { + Alert string `json:"alert,omitempty"` + Android Android `json:"android,omitempty"` + IOS Ios `json:"ios,omitempty"` +} + +type Android struct { + Alert string `json:"alert,omitempty"` + Intent struct { + URL string `json:"url,omitempty"` + } `json:"intent,omitempty"` +} +type Ios struct { + Alert string `json:"alert,omitempty"` + Sound string `json:"sound,omitempty"` + Badge string `json:"badge,omitempty"` +} + +func (n *Notification) SetAlert(alert string) { + n.Alert = alert + n.Android.Alert = alert + n.SetAndroidIntent() + n.IOS.Alert = alert + n.IOS.Sound = "default" + n.IOS.Badge = "+1" + +} +func (n *Notification) SetAndroidIntent() { + n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent +} diff --git a/internal/push/jpush/requestBody/options.go b/internal/push/jpush/requestBody/options.go new file mode 100644 index 000000000..f82ebd035 --- /dev/null +++ b/internal/push/jpush/requestBody/options.go @@ -0,0 +1,9 @@ +package requestBody + +type Options struct { + ApnsProduction bool `json:"apns_production"` +} + +func (o *Options) SetApnsProduction(c bool) { + o.ApnsProduction = c +} diff --git a/internal/push/jpush/requestBody/platform.go b/internal/push/jpush/requestBody/platform.go new file mode 100644 index 000000000..0f9d243cf --- /dev/null +++ b/internal/push/jpush/requestBody/platform.go @@ -0,0 +1,83 @@ +package requestBody + +import ( + "Open_IM/pkg/common/constant" + "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 constant.AndroidPlatformStr: + return p.SetAndroid() + case constant.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..974161407 --- /dev/null +++ b/internal/push/jpush/requestBody/pushObj.go @@ -0,0 +1,28 @@ +package requestBody + +type PushObj struct { + Platform interface{} `json:"platform"` + Audience interface{} `json:"audience"` + Notification interface{} `json:"notification,omitempty"` + Message interface{} `json:"message,omitempty"` + Options interface{} `json:"options,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 +} +func (p *PushObj) SetOptions(o *Options) { + p.Options = o +} diff --git a/internal/push/logic/init.go b/internal/push/logic/init.go new file mode 100644 index 000000000..d2d127091 --- /dev/null +++ b/internal/push/logic/init.go @@ -0,0 +1,39 @@ +/* +** description(""). +** copyright('open-im,www.open-im.io'). +** author("fg,Gordon@open-im.io"). +** time(2021/3/22 15:33). + */ +package logic + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/kafka" + "Open_IM/pkg/statistics" + "fmt" +) + +var ( + rpcServer RPCServer + pushCh PushConsumerHandler + pushTerminal []int32 + producer *kafka.Producer + count uint64 +) + +func Init(rpcPort int) { + + rpcServer.Init(rpcPort) + pushCh.Init() + pushTerminal = []int32{constant.IOSPlatformID, constant.AndroidPlatformID} +} +func init() { + producer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic) + statistics.NewStatistics(&count, config.Config.ModuleName.PushName, fmt.Sprintf("%d second push to msg_gateway count", 300), 300) +} + +func Run() { + go rpcServer.run() + go pushCh.pushConsumerGroup.RegisterHandleAndConsumer(&pushCh) +} diff --git a/internal/push/logic/push_handler.go b/internal/push/logic/push_handler.go new file mode 100644 index 000000000..294c48f15 --- /dev/null +++ b/internal/push/logic/push_handler.go @@ -0,0 +1,52 @@ +/* +** description(""). +** copyright('Open_IM,www.Open_IM.io'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/5/13 10:33). + */ +package logic + +import ( + "Open_IM/pkg/common/config" + kfk "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + pbPush "Open_IM/pkg/proto/push" + "github.com/Shopify/sarama" + "github.com/golang/protobuf/proto" +) + +type fcb func(msg []byte) + +type PushConsumerHandler struct { + msgHandle map[string]fcb + pushConsumerGroup *kfk.MConsumerGroup +} + +func (ms *PushConsumerHandler) Init() { + ms.msgHandle = make(map[string]fcb) + ms.msgHandle[config.Config.Kafka.Ms2pschat.Topic] = ms.handleMs2PsChat + ms.pushConsumerGroup = kfk.NewMConsumerGroup(&kfk.MConsumerGroupConfig{KafkaVersion: sarama.V0_10_2_0, + OffsetsInitial: sarama.OffsetNewest, IsReturnErr: false}, []string{config.Config.Kafka.Ms2pschat.Topic}, config.Config.Kafka.Ms2pschat.Addr, + config.Config.Kafka.ConsumerGroupID.MsgToPush) +} +func (ms *PushConsumerHandler) handleMs2PsChat(msg []byte) { + log.InfoByKv("msg come from kafka And push!!!", "", "msg", string(msg)) + msgFromMQ := pbChat.PushMsgDataToMQ{} + if err := proto.Unmarshal(msg, &msgFromMQ); err != nil { + log.ErrorByKv("push Unmarshal msg err", "", "msg", string(msg), "err", err.Error()) + return + } + //Call push module to send message to the user + MsgToUser((*pbPush.PushMsgReq)(&msgFromMQ)) +} +func (PushConsumerHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (PushConsumerHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } +func (ms *PushConsumerHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, + claim sarama.ConsumerGroupClaim) error { + for msg := range claim.Messages() { + log.InfoByKv("kafka get info to mysql", "", "msgTopic", msg.Topic, "msgPartition", msg.Partition, "msg", string(msg.Value)) + ms.msgHandle[msg.Topic](msg.Value) + } + return nil +} diff --git a/internal/push/logic/push_rpc_server.go b/internal/push/logic/push_rpc_server.go new file mode 100644 index 000000000..b622ba721 --- /dev/null +++ b/internal/push/logic/push_rpc_server.go @@ -0,0 +1,57 @@ +package logic + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + "Open_IM/pkg/proto/push" + "Open_IM/pkg/utils" + "context" + "google.golang.org/grpc" + "net" + "strings" +) + +type RPCServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func (r *RPCServer) Init(rpcPort int) { + r.rpcPort = rpcPort + r.rpcRegisterName = config.Config.RpcRegisterName.OpenImPushName + r.etcdSchema = config.Config.Etcd.EtcdSchema + r.etcdAddr = config.Config.Etcd.EtcdAddr +} +func (r *RPCServer) run() { + ip := utils.ServerIP + registerAddress := ip + ":" + utils.IntToString(r.rpcPort) + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.ErrorByKv("push module rpc listening port err", "", "err", err.Error()) + return + } + defer listener.Close() + srv := grpc.NewServer() + defer srv.GracefulStop() + pbPush.RegisterPushMsgServiceServer(srv, r) + err = getcdv3.RegisterEtcd(r.etcdSchema, strings.Join(r.etcdAddr, ","), ip, r.rpcPort, r.rpcRegisterName, 10) + if err != nil { + log.ErrorByKv("register push module rpc to etcd err", "", "err", err.Error()) + } + err = srv.Serve(listener) + if err != nil { + log.ErrorByKv("push module rpc start err", "", "err", err.Error()) + return + } +} +func (r *RPCServer) PushMsg(_ context.Context, pbData *pbPush.PushMsgReq) (*pbPush.PushMsgResp, error) { + //Call push module to send message to the user + MsgToUser(pbData) + return &pbPush.PushMsgResp{ + ResultCode: 0, + }, nil + +} diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go new file mode 100644 index 000000000..607d36db0 --- /dev/null +++ b/internal/push/logic/push_to_client.go @@ -0,0 +1,167 @@ +/* +** description(""). +** copyright('open-im,www.open-im.io'). +** author("fg,Gordon@open-im.io"). +** time(2021/3/5 14:31). + */ +package logic + +import ( + pusher "Open_IM/internal/push" + "Open_IM/internal/push/getui" + jpush "Open_IM/internal/push/jpush" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbPush "Open_IM/pkg/proto/push" + pbRelay "Open_IM/pkg/proto/relay" + "Open_IM/pkg/utils" + "context" + "encoding/json" + "strings" +) + +type OpenIMContent struct { + SessionType int `json:"sessionType"` + From string `json:"from"` + To string `json:"to"` + Seq uint32 `json:"seq"` +} +type AtContent struct { + Text string `json:"text"` + AtUserList []string `json:"atUserList"` + IsAtSelf bool `json:"isAtSelf"` +} + +func MsgToUser(pushMsg *pbPush.PushMsgReq) { + var wsResult []*pbRelay.SingleMsgToUser + isOfflinePush := utils.GetSwitchFromOptions(pushMsg.MsgData.Options, constant.IsOfflinePush) + log.Debug("Get msg from msg_transfer And push msg", pushMsg.OperationID, "PushData", pushMsg.String()) + grpcCons := getcdv3.GetConn4Unique(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOnlineMessageRelayName) + //Online push message + log.Debug("test", pushMsg.OperationID, "len grpc", len(grpcCons), "data", pushMsg.String()) + for _, v := range grpcCons { + msgClient := pbRelay.NewOnlineMessageRelayServiceClient(v) + reply, err := msgClient.OnlinePushMsg(context.Background(), &pbRelay.OnlinePushMsgReq{OperationID: pushMsg.OperationID, MsgData: pushMsg.MsgData, PushToUserID: pushMsg.PushToUserID}) + if err != nil { + log.InfoByKv("push data to client rpc err", pushMsg.OperationID, "err", err) + continue + } + if reply != nil && reply.Resp != nil { + wsResult = append(wsResult, reply.Resp...) + } + } + log.InfoByKv("push_result", pushMsg.OperationID, "result", wsResult, "sendData", pushMsg.MsgData) + count++ + if isOfflinePush && pushMsg.PushToUserID != pushMsg.MsgData.SendID { + for _, v := range wsResult { + if v.ResultCode == 0 { + continue + } + if utils.IsContainInt32(v.RecvPlatFormID, pushTerminal) { + //Use offline push messaging + var UIDList []string + UIDList = append(UIDList, v.RecvID) + customContent := OpenIMContent{ + SessionType: int(pushMsg.MsgData.SessionType), + From: pushMsg.MsgData.SendID, + To: pushMsg.MsgData.RecvID, + Seq: pushMsg.MsgData.Seq, + } + bCustomContent, _ := json.Marshal(customContent) + jsonCustomContent := string(bCustomContent) + var content string + if pushMsg.MsgData.OfflinePushInfo != nil { + content = pushMsg.MsgData.OfflinePushInfo.Title + + } else { + switch pushMsg.MsgData.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(string(pushMsg.MsgData.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: + content = constant.ContentType2PushContent[constant.Common] + } + } + var offlinePusher pusher.OfflinePusher + if config.Config.Push.Getui.Enable { + log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), config.Config.Push.Getui) + offlinePusher = getui.GetuiClient + } + if config.Config.Push.Jpns.Enable { + offlinePusher = jpush.JPushClient + } + if offlinePusher == nil { + offlinePusher = jpush.JPushClient + } + pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, pushMsg.OperationID) + if err != nil { + log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) + } else { + log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData) + } + break + } + + } + + } +} + +//func SendMsgByWS(m *pbChat.WSToMsgSvrChatMsg) { +// m.MsgID = rpcChat.GetMsgID(m.SendID) +// m.ClientMsgID = m.MsgID +// switch m.SessionType { +// case constant.SingleChatType: +// 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) +// client := pbGroup.NewGroupClient(etcdConn) +// req := &pbGroup.Req{ +// GroupID: m.RecvID, +// Token: config.Config.Secret, +// OperationID: m.OperationID, +// } +// reply, err := client.(context.Background(), req) +// if err != nil { +// log.Error(m.Token, m.OperationID, "rpc getGroupInfo failed, err = %s", err.Error()) +// return +// } +// if reply.ErrorCode != 0 { +// log.Error(m.Token, m.OperationID, "rpc getGroupInfo failed, err = %s", reply.ErrorMsg) +// return +// } +// groupID := m.RecvID +// for i, v := range reply.MemberList { +// m.RecvID = v.UserId + " " + groupID +// sendMsgToKafka(m, utils.IntToString(i), "msgKey--recvID+\" \"+groupID") +// } +// default: +// +// } +//} +// +//func sendMsgToKafka(m *pbChat.WSToMsgSvrChatMsg, key string, flag string) { +// pid, offset, err := producer.SendMessage(m, key) +// if err != nil { +// log.ErrorByKv("kafka send failed", m.OperationID, "send data", m.String(), "pid", pid, "offset", offset, "err", err.Error(), flag, key) +// } +// +//} diff --git a/internal/push/logic/tpns.go b/internal/push/logic/tpns.go new file mode 100644 index 000000000..3d737f4a7 --- /dev/null +++ b/internal/push/logic/tpns.go @@ -0,0 +1,34 @@ +package logic + +import ( + tpns "Open_IM/internal/push/sdk/tpns-server-sdk-go/go" + "Open_IM/internal/push/sdk/tpns-server-sdk-go/go/auth" + "Open_IM/internal/push/sdk/tpns-server-sdk-go/go/common" + "Open_IM/internal/push/sdk/tpns-server-sdk-go/go/req" + "Open_IM/pkg/common/config" +) + +var badgeType = -2 +var iosAcceptId = auth.Auther{AccessID: config.Config.Push.Tpns.Ios.AccessID, SecretKey: config.Config.Push.Tpns.Ios.SecretKey} + +func IOSAccountListPush(accounts []string, title, content, jsonCustomContent string) { + var iosMessage = tpns.Message{ + Title: title, + Content: content, + IOS: &tpns.IOSParams{ + Aps: &tpns.Aps{ + BadgeType: &badgeType, + Sound: "default", + Category: "INVITE_CATEGORY", + }, + CustomContent: jsonCustomContent, + //CustomContent: `"{"key\":\"value\"}"`, + }, + } + pushReq, reqBody, err := req.NewListAccountPush(accounts, iosMessage) + if err != nil { + return + } + iosAcceptId.Auth(pushReq, auth.UseSignAuthored, iosAcceptId, reqBody) + common.PushAndGetResult(pushReq) +} diff --git a/internal/push/push_interface.go b/internal/push/push_interface.go new file mode 100644 index 000000000..59b4764b4 --- /dev/null +++ b/internal/push/push_interface.go @@ -0,0 +1,5 @@ +package push + +type OfflinePusher interface { + Push(userIDList []string, alert, detailContent, operationID string) (resp string, err error) +} diff --git a/internal/push/sdk/tpns-server-sdk-go/go/auth/auth.go b/internal/push/sdk/tpns-server-sdk-go/go/auth/auth.go new file mode 100644 index 000000000..5b8a486b0 --- /dev/null +++ b/internal/push/sdk/tpns-server-sdk-go/go/auth/auth.go @@ -0,0 +1,62 @@ +package auth + +import ( + "crypto/hmac" + "crypto/sha256" + "encoding/base64" + b64 "encoding/base64" + "encoding/hex" + "fmt" + "net/http" + "strconv" + "time" +) + +type Auther struct { + AccessID string + SecretKey string +} + +var UseSignAuthored = true + +func (a *Auther) Auth(req *http.Request, useSignAuthored bool, auth Auther, reqBody string) { + + if useSignAuthored { + now := time.Now() + timeStamp := now.Unix() + req.Header.Add("AccessId", auth.AccessID) + req.Header.Add("TimeStamp", strconv.Itoa(int(timeStamp))) + sign := GenSign(uint64(timeStamp), auth.AccessID, auth.SecretKey, reqBody) + req.Header.Add("Sign", sign) + } else { + author := makeAuthHeader(a.AccessID, a.SecretKey) + //log.Printf("author string:%v", author) + req.Header.Add("Authorization", author) + } + //req.Header.Add("Content-Type", "application/json") +} + +func makeAuthHeader(appID, secretKey string) string { + base64Str := base64.StdEncoding.EncodeToString( + []byte( + fmt.Sprintf("%s:%s", appID, secretKey), + ), + ) + return fmt.Sprintf("Basic %s", base64Str) +} + +func GenSign(timeStamp uint64, accessId string, secretKey, requestBody string) string { + signBody := strconv.Itoa(int(timeStamp)) + accessId + requestBody + // Create a new HMAC by defining the hash type and the key (as byte array) + h := hmac.New(sha256.New, []byte(secretKey)) + // Write Data to it + h.Write([]byte(signBody)) + + // Get result and encode as hexadecimal string + sha := hex.EncodeToString(h.Sum(nil)) + //fmt.Println() + //fmt.Println("timeStamp: " + strconv.Itoa(int(timeStamp)) + " accessID:" + accessId + " body:" + requestBody) + sEnc := b64.StdEncoding.EncodeToString([]byte(sha)) + //fmt.Println("final Result " + sEnc) + return sEnc +} diff --git a/internal/push/sdk/tpns-server-sdk-go/go/client/client.go b/internal/push/sdk/tpns-server-sdk-go/go/client/client.go new file mode 100644 index 000000000..848724402 --- /dev/null +++ b/internal/push/sdk/tpns-server-sdk-go/go/client/client.go @@ -0,0 +1,18 @@ +package client + +import ( + "net/http" + "time" +) + +func New() *http.Client { + return &http.Client{ + Transport: &http.Transport{ + MaxIdleConns: 100, + MaxIdleConnsPerHost: 100, + IdleConnTimeout: 30 * time.Second, + DisableCompression: false, + DisableKeepAlives: false, + }, + } +} diff --git a/internal/push/sdk/tpns-server-sdk-go/go/common/http_helper.go b/internal/push/sdk/tpns-server-sdk-go/go/common/http_helper.go new file mode 100644 index 000000000..6c010c4f4 --- /dev/null +++ b/internal/push/sdk/tpns-server-sdk-go/go/common/http_helper.go @@ -0,0 +1,62 @@ +package common + +import ( + tpns "Open_IM/internal/push/sdk/tpns-server-sdk-go/go" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" +) + +func PushAndGetResult(pushReq *http.Request) { + c := &http.Client{} + rsp, err := c.Do(pushReq) + fmt.Println() + if err != nil { + //fmt.Printf("http err:%v", err) + return + } + defer rsp.Body.Close() + body, err := ioutil.ReadAll(rsp.Body) + //fmt.Printf("http ReadAll err:%v, body:%v ", err, string(body)) + if err != nil { + return + } + r := &tpns.CommonRsp{} + json.Unmarshal(body, r) + //fmt.Printf("push result: %+v", r) +} + +func UploadFile(req *http.Request) (int, error) { + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return 0, err + } + + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return 0, err + } + + if resp.StatusCode != http.StatusOK { + return 0, fmt.Errorf("response error, status: %s, body: %s", resp.Status, string(body)) + } + + type uploadResponse struct { + RetCode int `json:"retCode"` + ErrMsg string `json:"errMsg"` + UploadId int `json:"uploadId"` + } + + var ur uploadResponse + if err := json.Unmarshal(body, &ur); err != nil { + return 0, err + } + + if ur.RetCode != 0 { + return 0, fmt.Errorf("response with %d:%s", ur.RetCode, ur.ErrMsg) + } + return ur.UploadId, nil +} diff --git a/internal/push/sdk/tpns-server-sdk-go/go/common/json_helper.go b/internal/push/sdk/tpns-server-sdk-go/go/common/json_helper.go new file mode 100644 index 000000000..368cfd843 --- /dev/null +++ b/internal/push/sdk/tpns-server-sdk-go/go/common/json_helper.go @@ -0,0 +1,8 @@ +package common + +import "encoding/json" + +func ToJson(v interface{}) string { + bs, _ := json.Marshal(v) + return string(bs) +} diff --git a/internal/push/sdk/tpns-server-sdk-go/go/def.go b/internal/push/sdk/tpns-server-sdk-go/go/def.go new file mode 100644 index 000000000..3e5d383e4 --- /dev/null +++ b/internal/push/sdk/tpns-server-sdk-go/go/def.go @@ -0,0 +1,256 @@ +package tpns + +type CommonRspEnv string + +const ( + // EnvProd + EnvProd CommonRspEnv = "product" + // EnvDev + EnvDev CommonRspEnv = "dev" +) + +type CommonRsp struct { + // TODO: doc this + Seq int64 `json:"seq"` + + PushID string `json:"push_id"` + + RetCode int `json:"ret_code"` + + Environment CommonRspEnv `json:"environment"` + + ErrMsg string `json:"err_msg,omitempty"` + + Result map[string]string `json:"result,omitempty"` +} + +type AudienceType string + +const ( + AdAll AudienceType = "all" + + AdTag AudienceType = "tag" + + AdToken AudienceType = "token" + + AdTokenList AudienceType = "token_list" + + AdAccount AudienceType = "account" + + AdAccountList AudienceType = "account_list" + + AdPackageAccount AudienceType = "package_account_push" + + AdPackageToken AudienceType = "package_token_push" +) + +// MessageType push API message_type +type MessageType string + +const ( + MsgTypeNotify MessageType = "notify" + + MsgTypeMessage MessageType = "message" +) + +type Request struct { + AudienceType AudienceType `json:"audience_type"` + + Message Message `json:"message"` + + MessageType MessageType `json:"message_type"` + + Tag []TagRule `json:"tag_rules,omitempty"` + + TokenList []string `json:"token_list,omitempty"` + + AccountList []string `json:"account_list,omitempty"` + + Environment CommonRspEnv `json:"environment,omitempty"` + + UploadId int `json:"upload_id,omitempty"` + + ExpireTime int `json:"expire_time,omitempty"` + + SendTime string `json:"send_time,omitempty"` + + MultiPkg bool `json:"multi_pkg,omitempty"` + + PlanId string `json:"plan_id,omitempty"` + + AccountPushType int `json:"account_push_type,omitempty"` + + PushSpeed int `json:"push_speed,omitempty"` + + CollapseId int `json:"collapse_id"` + + TPNSOnlinePushType int `json:"tpns_online_push_type"` + + ChannelRules []*ChannelDistributeRule `json:"channel_rules,omitempty"` + + LoopParam *PushLoopParam `json:"loop_param,omitempty"` + ForceCollapse bool `json:"force_collapse"` +} + +type TagListOperation string + +type ChannelDistributeRule struct { + ChannelName string `json:"channel"` + Disable bool `json:"disable"` +} + +type PushLoopParam struct { + StartDate string `json:"startDate"` + + EndDate string `json:"endDate"` + + LoopType PushLoopType `json:"loopType"` + + LoopDayIndexs []uint32 `json:"loopDayIndexs"` + + DayTimes []string `json:"dayTimes"` +} + +type PushLoopType int32 + +const ( + TagListOpAnd TagListOperation = "AND" + + TagListOpOr TagListOperation = "OR" +) + +type TagType string + +const ( + XGAutoProvince TagType = "xg_auto_province" + XGAutoActive TagType = "xg_auto_active" + XGUserDefine TagType = "xg_user_define" + XGAutoVersion TagType = "xg_auto_version" + XGAutoSdkversion TagType = "xg_auto_sdkversion" + XGAutoDevicebrand TagType = "xg_auto_devicebrand" + XGAutoDeviceversion TagType = "xg_auto_deviceversion" + XGAutoCountry TagType = "xg_auto_country" +) + +type TagRule struct { + TagItems []TagItem `json:"tag_items"` + + IsNot bool `json:"is_not"` + + Operator TagListOperation `json:"operator"` +} + +type TagItem struct { + // 标签 + Tags []string `json:"tags"` + IsNot bool `json:"is_not"` + TagsOperator TagListOperation `json:"tags_operator"` + ItemsOperator TagListOperation `json:"items_operator"` + TagType TagType `json:"tag_type"` +} + +type Message struct { + Title string `json:"title,omitempty"` + Content string `json:"content,omitempty"` + + AcceptTime []AcceptTimeItem `json:"accept_time,omitempty"` + + Android *AndroidParams `json:"android,omitempty"` + + IOS *IOSParams `json:"ios,omitempty"` + + ThreadId string `json:"thread_id,omitempty"` + + ThreadSumtext string `json:"thread_sumtext,omitempty"` + + XGMediaResources string `json:"xg_media_resources,omitempty"` + + XGMediaAudioResources string `json:"xg_media_audio_resources,omitempty"` +} + +type AcceptTimeItem struct { + Start HourAndMin `json:"start,omitempty"` + End HourAndMin `json:"end,omitempty"` +} + +type HourAndMin struct { + Hour string `json:"hour,omitempty"` + Min string `json:"min,omitempty"` +} + +type AndroidParams struct { + BuilderId *int `json:"builder_id,omitempty"` + + Ring *int `json:"ring,omitempty"` + + RingRaw string `json:"ring_raw,omitempty"` + + Vibrate *int `json:"vibrate,omitempty"` + + Lights *int `json:"lights,omitempty"` + + Clearable *int `json:"clearable,omitempty"` + + IconType *int `json:"icon_type"` + + IconRes string `json:"icon_res,omitempty"` + + StyleId *int `json:"style_id,omitempty"` + + SmallIcon string `json:"small_icon,omitempty"` + + Action *Action `json:"action,omitempty"` + + CustomContent string `json:"custom_content,omitempty"` + + ShowType *int `json:"show_type,omitempty"` + + NChId string `json:"n_ch_id,omitempty"` + + NChName string `json:"n_ch_name,omitempty"` + + HwChId string `json:"hw_ch_id,omitempty"` + + XmChId string `json:"xm_ch_id,omitempty"` + + OppoChId string `json:"oppo_ch_id,omitempty"` + + VivoChId string `json:"vivo_ch_id,omitempty"` + + BadgeType *int `json:"badge_type,omitempty"` + + IconColor *int `json:"icon_color,omitempty"` +} + +type Action struct { + ActionType *int `json:"action_type,omitempty"` + Activity string `json:"activity"` + AtyAttr AtyAttr `json:"aty_attr,omitempty"` + Intent string `json:"intent"` + Browser Browser `json:"browser,omitempty"` +} + +type Browser struct { + Url string `json:"url,omitempty"` + Confirm *int `json:"confirm,omitempty"` +} + +type AtyAttr struct { + AttrIf *int `json:"if,omitempty"` + Pf *int `json:"pf,omitempty"` +} + +type IOSParams struct { + Aps *Aps `json:"aps,omitempty"` + + CustomContent string `json:"custom_content,omitempty"` +} + +type Aps struct { + Alert map[string]string `json:"alert,omitempty"` + BadgeType *int `json:"badge_type,omitempty"` + Category string `json:"category,omitempty"` + ContentAvailableInt *int `json:"content-available,omitempty"` + MutableContent *int `json:"mutable-content,omitempty"` + Sound string `json:"sound,omitempty"` +} diff --git a/internal/push/sdk/tpns-server-sdk-go/go/req/req.go b/internal/push/sdk/tpns-server-sdk-go/go/req/req.go new file mode 100644 index 000000000..7afc07004 --- /dev/null +++ b/internal/push/sdk/tpns-server-sdk-go/go/req/req.go @@ -0,0 +1,403 @@ +package req + +import ( + tpns "Open_IM/internal/push/sdk/tpns-server-sdk-go/go" + "bytes" + "encoding/json" + "io" + "mime/multipart" + "net/http" + "os" + "path/filepath" +) + +var PushURL = "https://api.tpns.tencent.com/v3/push/app" + +//var PushURL = "https://test.api.tpns.tencent.com/v3/push/app" + +func URL(url string) { + PushURL = url +} + +type ReqOpt func(*tpns.Request) + +func NewPush(req *tpns.Request, opts ...ReqOpt) (*http.Request, string, error) { + return NewPushReq(req, opts...) +} + +func NewUploadFileRequest(host string, file string) (*http.Request, error) { + fp, err := os.Open(file) + if err != nil { + return nil, err + } + + defer fp.Close() + body := &bytes.Buffer{} + writer := multipart.NewWriter(body) + part, err := writer.CreateFormFile("file", filepath.Base(fp.Name())) + if err != nil { + return nil, err + } + + io.Copy(part, fp) + writer.Close() + url := host + "/v3/push/package/upload" + req, err := http.NewRequest("POST", url, body) + if err != nil { + return nil, err + } + req.Header.Add("Content-Type", writer.FormDataContentType()) + + return req, nil +} + +func NewSingleAccountPush( + message tpns.Message, + account string, + opts ...ReqOpt, +) (*http.Request, string, error) { + req := &tpns.Request{ + MessageType: tpns.MsgTypeNotify, + AudienceType: tpns.AdAccountList, + AccountList: []string{account}, + Message: message, + } + return NewPushReq(req, opts...) +} + +func NewListAccountPush( + accounts []string, message tpns.Message, + opts ...ReqOpt, +) (*http.Request, string, error) { + req := &tpns.Request{ + MessageType: tpns.MsgTypeNotify, + AudienceType: tpns.AdAccountList, + AccountList: accounts, + Message: message, + Environment: tpns.EnvDev, + } + return NewPushReq(req, opts...) +} + +func NewTokenPush( + tokens []string, message tpns.Message, + opts ...ReqOpt, +) (*http.Request, string, error) { + req := &tpns.Request{ + MessageType: tpns.MsgTypeNotify, + AudienceType: tpns.AdTokenList, + TokenList: tokens, + Message: message, + Environment: tpns.EnvProd, + } + //fmt.Printf("reqBody :%v", common.ToJson(req)) + //fmt.Println() + return NewPushReq(req, opts...) +} + +func NewTagsPush( + tagList []tpns.TagRule, message tpns.Message, + opts ...ReqOpt, +) (*http.Request, string, error) { + req := &tpns.Request{ + MessageType: tpns.MsgTypeNotify, + AudienceType: tpns.AdTag, + Tag: tagList, + Message: message, + } + //fmt.Printf("reqBody :%v", common.ToJson(req)) + //fmt.Println() + return NewPushReq(req, opts...) +} + +func NewAllPush( + message tpns.Message, + opts ...ReqOpt, +) (*http.Request, string, error) { + req := &tpns.Request{ + MessageType: tpns.MsgTypeNotify, + AudienceType: tpns.AdAll, + Message: message, + } + return NewPushReq(req, opts...) +} + +func NewAccountPackagePush( + message tpns.Message, + opts ...ReqOpt, +) (*http.Request, string, error) { + req := &tpns.Request{ + MessageType: tpns.MsgTypeNotify, + AudienceType: tpns.AdPackageAccount, + Message: message, + } + return NewPushReq(req, opts...) +} + +func NewTokenPackagePush( + message tpns.Message, + opts ...ReqOpt, +) (*http.Request, string, error) { + req := &tpns.Request{ + MessageType: tpns.MsgTypeNotify, + AudienceType: tpns.AdPackageToken, + Message: message, + } + return NewPushReq(req, opts...) +} + +func NewPushReq(req *tpns.Request, opts ...ReqOpt) (request *http.Request, reqBody string, err error) { + for _, opt := range opts { + opt(req) + } + bodyBytes, err := json.Marshal(req) + if err != nil { + return nil, "", err + } + reqBody = string(bodyBytes) + //fmt.Printf("NewPushReq req:%v", reqBody) + request, err = http.NewRequest("POST", PushURL, bytes.NewReader(bodyBytes)) + if err != nil { + return nil, "", err + } + request.Header.Add("Content-Type", "application/json") + return +} + +func EnvProd() ReqOpt { + return func(r *tpns.Request) { + r.Environment = tpns.EnvProd + } +} + +func EnvDev() ReqOpt { + return func(r *tpns.Request) { + r.Environment = tpns.EnvDev + } +} + +func Title(t string) ReqOpt { + return func(r *tpns.Request) { + r.Message.Title = t + if r.Message.IOS != nil { + if r.Message.IOS.Aps != nil { + r.Message.IOS.Aps.Alert["title"] = t + } else { + r.Message.IOS.Aps = &tpns.Aps{ + Alert: map[string]string{"title": t}, + } + } + } else { + r.Message.IOS = &tpns.IOSParams{ + Aps: &tpns.Aps{ + Alert: map[string]string{"title": t}, + }, + } + } + } +} + +func Content(c string) ReqOpt { + return func(r *tpns.Request) { + r.Message.Content = c + if r.Message.IOS != nil { + if r.Message.IOS.Aps != nil { + r.Message.IOS.Aps.Alert["body"] = c + } else { + r.Message.IOS.Aps = &tpns.Aps{ + Alert: map[string]string{"body": c}, + } + } + } else { + r.Message.IOS = &tpns.IOSParams{ + Aps: &tpns.Aps{ + Alert: map[string]string{"body": c}, + }, + } + } + } +} + +func Ring(ring *int) ReqOpt { + return func(r *tpns.Request) { + r.Message.Android.Ring = ring + } +} + +func RingRaw(rr string) ReqOpt { + return func(r *tpns.Request) { + r.Message.Android.RingRaw = rr + } +} + +func Vibrate(v *int) ReqOpt { + return func(r *tpns.Request) { + r.Message.Android.Vibrate = v + } +} + +func Lights(l *int) ReqOpt { + return func(r *tpns.Request) { + r.Message.Android.Lights = l + } +} + +func Clearable(c *int) ReqOpt { + return func(r *tpns.Request) { + r.Message.Android.Clearable = c + } +} + +func IconType(it *int) ReqOpt { + return func(r *tpns.Request) { + r.Message.Android.IconType = it + } +} + +func IconRes(ir string) ReqOpt { + return func(r *tpns.Request) { + r.Message.Android.IconRes = ir + } +} + +func AndroidCustomContent(ct string) ReqOpt { + return func(r *tpns.Request) { + r.Message.Android.CustomContent = ct + } +} + +func Aps(aps *tpns.Aps) ReqOpt { + return func(r *tpns.Request) { + r.Message.IOS.Aps = aps + } +} + +func AudienceType(at tpns.AudienceType) ReqOpt { + return func(r *tpns.Request) { + r.AudienceType = at + } +} + +func Message(m tpns.Message) ReqOpt { + return func(r *tpns.Request) { + r.Message = m + } +} + +func TokenList(tl []string) ReqOpt { + return func(r *tpns.Request) { + r.TokenList = tl + } +} + +func TokenListAdd(t string) ReqOpt { + return func(r *tpns.Request) { + if r.TokenList != nil { + r.TokenList = append(r.TokenList, t) + } else { + r.TokenList = []string{t} + } + } +} + +func AccountList(al []string) ReqOpt { + return func(r *tpns.Request) { + r.AccountList = al + } +} + +//ChannelDistributeRules +func AddChannelRules(ChannelRules []*tpns.ChannelDistributeRule) ReqOpt { + return func(r *tpns.Request) { + r.ChannelRules = ChannelRules + } +} + +//ChannelDistributeRules +func AddLoopParam(loopParam *tpns.PushLoopParam) ReqOpt { + return func(r *tpns.Request) { + r.LoopParam = loopParam + } +} + +func AccountListAdd(a string) ReqOpt { + return func(r *tpns.Request) { + if r.AccountList != nil { + r.AccountList = append(r.AccountList, a) + } else { + r.AccountList = []string{a} + } + } +} + +func MessageType(t tpns.MessageType) ReqOpt { + return func(r *tpns.Request) { + r.MessageType = t + } +} + +func AddMultiPkg(multipPkg bool) ReqOpt { + return func(r *tpns.Request) { + r.MultiPkg = multipPkg + } +} + +func AddForceCollapse(forceCollapse bool) ReqOpt { + return func(r *tpns.Request) { + r.ForceCollapse = forceCollapse + } +} + +func AddTPNSOnlinePushType(onlinePushType int) ReqOpt { + return func(r *tpns.Request) { + r.TPNSOnlinePushType = onlinePushType + } +} + +func AddCollapseId(collapseId int) ReqOpt { + return func(r *tpns.Request) { + r.CollapseId = collapseId + } +} + +func AddPushSpeed(pushSpeed int) ReqOpt { + return func(r *tpns.Request) { + r.PushSpeed = pushSpeed + } +} + +func AddAccountPushType(accountPushType int) ReqOpt { + return func(r *tpns.Request) { + r.AccountPushType = accountPushType + } +} + +func AddPlanId(planId string) ReqOpt { + return func(r *tpns.Request) { + r.PlanId = planId + } +} + +func AddSendTime(sendTime string) ReqOpt { + return func(r *tpns.Request) { + r.SendTime = sendTime + } +} + +func AddExpireTime(expireTime int) ReqOpt { + return func(r *tpns.Request) { + r.ExpireTime = expireTime + } +} + +func AddUploadId(UploadId int) ReqOpt { + return func(r *tpns.Request) { + r.UploadId = UploadId + } +} + +func AddEnvironment(Environment tpns.CommonRspEnv) ReqOpt { + return func(r *tpns.Request) { + r.Environment = Environment + } +} diff --git a/internal/rpc/admin_cms/admin_cms.go b/internal/rpc/admin_cms/admin_cms.go new file mode 100644 index 000000000..156748bbc --- /dev/null +++ b/internal/rpc/admin_cms/admin_cms.go @@ -0,0 +1,87 @@ +package admin_cms + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + openIMHttp "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbAdminCMS "Open_IM/pkg/proto/admin_cms" + "Open_IM/pkg/utils" + "context" + "google.golang.org/grpc" + "net" + "strconv" + "strings" +) + +type adminCMSServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewAdminCMSServer(port int) *adminCMSServer { + log.NewPrivateLog(constant.LogFileName) + return &adminCMSServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImAdminCMSName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *adminCMSServer) Run() { + log.NewInfo("0", "AdminCMS rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbAdminCMS.RegisterAdminCMSServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "message cms rpc success") +} + +func (s *adminCMSServer) AdminLogin(_ context.Context, req *pbAdminCMS.AdminLoginReq) (*pbAdminCMS.AdminLoginResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbAdminCMS.AdminLoginResp{} + for i, adminID := range config.Config.Manager.AppManagerUid { + if adminID == req.AdminID && config.Config.Manager.Secrets[i] == req.Secret { + token, expTime, err := token_verify.CreateToken(adminID, constant.SingleChatType) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "generate token success", "token: ", token, "expTime:", expTime) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "generate token failed", "adminID: ", adminID, err.Error()) + return resp, openIMHttp.WrapError(constant.ErrTokenUnknown) + } + resp.Token = token + break + } + } + + if resp.Token == "" { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "failed") + return resp, openIMHttp.WrapError(constant.ErrTokenMalformed) + } + return resp, nil +} diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go new file mode 100644 index 000000000..1aa0ec50b --- /dev/null +++ b/internal/rpc/auth/auth.go @@ -0,0 +1,104 @@ +package auth + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbAuth "Open_IM/pkg/proto/auth" + "Open_IM/pkg/utils" + "context" + "net" + "strconv" + "strings" + + "Open_IM/pkg/common/config" + + "google.golang.org/grpc" +) + +func (rpc *rpcAuth) UserRegister(_ context.Context, req *pbAuth.UserRegisterReq) (*pbAuth.UserRegisterResp, error) { + log.NewInfo(req.OperationID, "UserRegister args ", req.String()) + var user db.User + utils.CopyStructFields(&user, req.UserInfo) + if req.UserInfo.Birth != 0 { + user.Birth = utils.UnixSecondToTime(int64(req.UserInfo.Birth)) + } + err := imdb.UserRegister(user) + if err != nil { + log.NewError(req.OperationID, "UserRegister failed ", err.Error(), user) + return &pbAuth.UserRegisterResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + log.NewInfo(req.OperationID, "rpc UserRegister return") + return &pbAuth.UserRegisterResp{CommonResp: &pbAuth.CommonResp{}}, nil +} + +func (rpc *rpcAuth) UserToken(_ context.Context, req *pbAuth.UserTokenReq) (*pbAuth.UserTokenResp, error) { + log.NewInfo(req.OperationID, "UserToken args ", req.String()) + + _, err := imdb.GetUserByUserID(req.FromUserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.FromUserID) + return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + tokens, expTime, err := token_verify.CreateToken(req.FromUserID, req.Platform) + if err != nil { + log.NewError(req.OperationID, "CreateToken failed ", err.Error(), req.FromUserID, req.Platform) + return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + log.NewInfo(req.OperationID, "rpc UserToken return ", tokens, expTime) + return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}, Token: tokens, ExpiredTime: expTime}, nil +} + +type rpcAuth struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewRpcAuthServer(port int) *rpcAuth { + log.NewPrivateLog(constant.LogFileName) + return &rpcAuth{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImAuthName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (rpc *rpcAuth) Run() { + log.NewInfo("0", "rpc auth start...") + + address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort) + listener, err := net.Listen("tcp", address) + if err != nil { + log.NewError("0", "listen network failed ", err.Error(), address) + return + } + log.NewInfo("0", "listen network success, ", address, listener) + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + + //service registers with etcd + pbAuth.RegisterAuthServer(srv, rpc) + err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error(), + rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName) + return + } + log.NewInfo("0", "RegisterAuthServer ok ", rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName) + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "rpc auth ok") +} diff --git a/internal/rpc/auth/callback.go b/internal/rpc/auth/callback.go new file mode 100644 index 000000000..8832b06d1 --- /dev/null +++ b/internal/rpc/auth/callback.go @@ -0,0 +1 @@ +package auth diff --git a/internal/rpc/friend/callback.go b/internal/rpc/friend/callback.go new file mode 100644 index 000000000..cf8ea69c8 --- /dev/null +++ b/internal/rpc/friend/callback.go @@ -0,0 +1 @@ +package friend diff --git a/internal/rpc/friend/firend.go b/internal/rpc/friend/firend.go new file mode 100644 index 000000000..b570b8106 --- /dev/null +++ b/internal/rpc/friend/firend.go @@ -0,0 +1,519 @@ +package friend + +import ( + chat "Open_IM/internal/rpc/msg" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + cp "Open_IM/pkg/common/utils" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" + sdkws "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "google.golang.org/grpc" + "net" + "strconv" + "strings" + "time" +) + +type friendServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewFriendServer(port int) *friendServer { + log.NewPrivateLog(constant.LogFileName) + return &friendServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImFriendName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *friendServer) Run() { + log.NewInfo("0", "friendServer run...") + + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen ok ", registerAddress) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //User friend related services register to etcd + pbFriend.RegisterFriendServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error(), listener) + return + } +} + +func (s *friendServer) AddBlacklist(ctx context.Context, req *pbFriend.AddBlacklistReq) (*pbFriend.AddBlacklistResp, error) { + log.NewInfo(req.CommID.OperationID, "AddBlacklist args ", req.String()) + ok := token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) + if !ok { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.AddBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + black := db.Black{OwnerUserID: req.CommID.FromUserID, BlockUserID: req.CommID.ToUserID, OperatorUserID: req.CommID.OpUserID} + + err := imdb.InsertInToUserBlackList(black) + if err != nil { + log.NewError(req.CommID.OperationID, "InsertInToUserBlackList failed ", err.Error()) + return &pbFriend.AddBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + log.NewInfo(req.CommID.OperationID, "AddBlacklist rpc ok ", req.CommID.FromUserID, req.CommID.ToUserID) + chat.BlackAddedNotification(req) + return &pbFriend.AddBlacklistResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) AddFriend(ctx context.Context, req *pbFriend.AddFriendReq) (*pbFriend.AddFriendResp, error) { + log.NewInfo(req.CommID.OperationID, "AddFriend args ", req.String()) + ok := token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) + if !ok { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + //Cannot add non-existent users + if _, err := imdb.GetUserByUserID(req.CommID.ToUserID); err != nil { + log.NewError(req.CommID.OperationID, "GetUserByUserID failed ", err.Error(), req.CommID.ToUserID) + return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + //Establish a latest relationship in the friend request table + friendRequest := db.FriendRequest{ + HandleResult: 0, ReqMsg: req.ReqMsg, CreateTime: time.Now()} + utils.CopyStructFields(&friendRequest, req.CommID) + // {openIM001 openIM002 0 test add friend 0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC }] + log.NewDebug(req.CommID.OperationID, "UpdateFriendApplication args ", friendRequest) + //err := imdb.InsertFriendApplication(&friendRequest) + err := imdb.InsertFriendApplication(&friendRequest, + map[string]interface{}{"handle_result": 0, "req_msg": friendRequest.ReqMsg, "create_time": friendRequest.CreateTime, + "handler_user_id": "", "handle_msg": "", "handle_time": utils.UnixSecondToTime(0), "ex": ""}) + if err != nil { + log.NewError(req.CommID.OperationID, "UpdateFriendApplication failed ", err.Error(), friendRequest) + return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + chat.FriendApplicationNotification(req) + return &pbFriend.AddFriendResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) ImportFriend(ctx context.Context, req *pbFriend.ImportFriendReq) (*pbFriend.ImportFriendResp, error) { + log.NewInfo(req.OperationID, "ImportFriend args ", req.String()) + resp := pbFriend.ImportFriendResp{CommonResp: &pbFriend.CommonResp{}} + var c pbFriend.CommonResp + + if !utils.IsContain(req.OpUserID, config.Config.Manager.AppManagerUid) { + log.NewError(req.OperationID, "not authorized", req.OpUserID, config.Config.Manager.AppManagerUid) + c.ErrCode = constant.ErrAccess.ErrCode + c.ErrMsg = constant.ErrAccess.ErrMsg + for _, v := range req.FriendUserIDList { + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + } + resp.CommonResp = &c + return &resp, nil + } + if _, err := imdb.GetUserByUserID(req.FromUserID); err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.FromUserID) + c.ErrCode = constant.ErrDB.ErrCode + c.ErrMsg = "this user not exists,cant not add friend" + for _, v := range req.FriendUserIDList { + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + } + resp.CommonResp = &c + return &resp, nil + } + + for _, v := range req.FriendUserIDList { + log.NewDebug(req.OperationID, "FriendUserIDList ", v) + if _, fErr := imdb.GetUserByUserID(v); fErr != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", fErr.Error(), v) + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + } else { + if _, err := imdb.GetFriendRelationshipFromFriend(req.FromUserID, v); err != nil { + //Establish two single friendship + toInsertFollow := db.Friend{OwnerUserID: req.FromUserID, FriendUserID: v} + err1 := imdb.InsertToFriend(&toInsertFollow) + if err1 != nil { + log.NewError(req.OperationID, "InsertToFriend failed ", err1.Error(), toInsertFollow) + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + continue + } + toInsertFollow = db.Friend{OwnerUserID: v, FriendUserID: req.FromUserID} + err2 := imdb.InsertToFriend(&toInsertFollow) + if err2 != nil { + log.NewError(req.OperationID, "InsertToFriend failed ", err2.Error(), toInsertFollow) + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: -1}) + continue + } + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: 0}) + log.NewDebug(req.OperationID, "UserIDResultList ", resp.UserIDResultList) + chat.FriendAddedNotification(req.OperationID, req.OpUserID, req.FromUserID, v) + } else { + log.NewWarn(req.OperationID, "GetFriendRelationshipFromFriend ok", req.FromUserID, v) + resp.UserIDResultList = append(resp.UserIDResultList, &pbFriend.UserIDResult{UserID: v, Result: 0}) + } + } + } + resp.CommonResp.ErrCode = 0 + log.NewInfo(req.OperationID, "ImportFriend rpc ok ", resp.String()) + return &resp, nil +} + +//process Friend application +func (s *friendServer) AddFriendResponse(ctx context.Context, req *pbFriend.AddFriendResponseReq) (*pbFriend.AddFriendResponseResp, error) { + log.NewInfo(req.CommID.OperationID, "AddFriendResponse args ", req.String()) + + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + //Check there application before agreeing or refuse to a friend's application + //req.CommID.FromUserID process req.CommID.ToUserID + friendRequest, err := imdb.GetFriendApplicationByBothUserID(req.CommID.ToUserID, req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetFriendApplicationByBothUserID failed ", err.Error(), req.CommID.ToUserID, req.CommID.FromUserID) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + friendRequest.HandleResult = req.HandleResult + friendRequest.HandleTime = time.Now() + //friendRequest.HandleTime.Unix() + friendRequest.HandleMsg = req.HandleMsg + friendRequest.HandlerUserID = req.CommID.OpUserID + err = imdb.UpdateFriendApplication(friendRequest) + if err != nil { + log.NewError(req.CommID.OperationID, "UpdateFriendApplication failed ", err.Error(), friendRequest) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + //Change the status of the friend request form + if req.HandleResult == constant.FriendFlag { + //Establish friendship after find friend relationship not exists + _, err := imdb.GetFriendRelationshipFromFriend(req.CommID.FromUserID, req.CommID.ToUserID) + if err == nil { + log.NewWarn(req.CommID.OperationID, "GetFriendRelationshipFromFriend exist", req.CommID.FromUserID, req.CommID.ToUserID) + } else { + //Establish two single friendship + toInsertFollow := db.Friend{OwnerUserID: req.CommID.FromUserID, FriendUserID: req.CommID.ToUserID, OperatorUserID: req.CommID.OpUserID} + err = imdb.InsertToFriend(&toInsertFollow) + if err != nil { + log.NewError(req.CommID.OperationID, "InsertToFriend failed ", err.Error(), toInsertFollow) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + } + + _, err = imdb.GetFriendRelationshipFromFriend(req.CommID.ToUserID, req.CommID.FromUserID) + if err == nil { + log.NewWarn(req.CommID.OperationID, "GetFriendRelationshipFromFriend exist", req.CommID.ToUserID, req.CommID.FromUserID) + } else { + toInsertFollow := db.Friend{OwnerUserID: req.CommID.ToUserID, FriendUserID: req.CommID.FromUserID, OperatorUserID: req.CommID.OpUserID} + err = imdb.InsertToFriend(&toInsertFollow) + if err != nil { + log.NewError(req.CommID.OperationID, "InsertToFriend failed ", err.Error(), toInsertFollow) + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.FriendAddedNotification(req.CommID.OperationID, req.CommID.OpUserID, req.CommID.FromUserID, req.CommID.ToUserID) + } + } + if req.HandleResult == constant.FriendResponseAgree { + chat.FriendApplicationApprovedNotification(req) + } else if req.HandleResult == constant.FriendResponseRefuse { + chat.FriendApplicationRejectedNotification(req) + } else { + log.Error(req.CommID.OperationID, "HandleResult failed ", req.HandleResult) + } + log.NewInfo(req.CommID.OperationID, "rpc AddFriendResponse ok") + return &pbFriend.AddFriendResponseResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) DeleteFriend(ctx context.Context, req *pbFriend.DeleteFriendReq) (*pbFriend.DeleteFriendResp, error) { + log.NewInfo(req.CommID.OperationID, "DeleteFriend args ", req.String()) + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.DeleteFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + err := imdb.DeleteSingleFriendInfo(req.CommID.FromUserID, req.CommID.ToUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "DeleteSingleFriendInfo failed", err.Error(), req.CommID.FromUserID, req.CommID.ToUserID) + return &pbFriend.DeleteFriendResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + log.NewInfo(req.CommID.OperationID, "DeleteFriend rpc ok") + chat.FriendDeletedNotification(req) + return &pbFriend.DeleteFriendResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) GetBlacklist(ctx context.Context, req *pbFriend.GetBlacklistReq) (*pbFriend.GetBlacklistResp, error) { + log.NewInfo(req.CommID.OperationID, "GetBlacklist args ", req.String()) + + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.GetBlacklistResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + blackListInfo, err := imdb.GetBlackListByUserID(req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetBlackListByUID failed ", err.Error(), req.CommID.FromUserID) + return &pbFriend.GetBlacklistResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + + var ( + userInfoList []*sdkws.PublicUserInfo + ) + for _, blackUser := range blackListInfo { + var blackUserInfo sdkws.PublicUserInfo + //Find black user information + us, err := imdb.GetUserByUserID(blackUser.BlockUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetUserByUserID failed ", err.Error(), blackUser.BlockUserID) + continue + } + utils.CopyStructFields(&blackUserInfo, us) + userInfoList = append(userInfoList, &blackUserInfo) + } + log.NewInfo(req.CommID.OperationID, "rpc GetBlacklist ok ", pbFriend.GetBlacklistResp{BlackUserInfoList: userInfoList}) + return &pbFriend.GetBlacklistResp{BlackUserInfoList: userInfoList}, nil +} + +func (s *friendServer) SetFriendRemark(ctx context.Context, req *pbFriend.SetFriendRemarkReq) (*pbFriend.SetFriendRemarkResp, error) { + log.NewInfo(req.CommID.OperationID, "SetFriendComment args ", req.String()) + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.SetFriendRemarkResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + err := imdb.UpdateFriendComment(req.CommID.FromUserID, req.CommID.ToUserID, req.Remark) + if err != nil { + log.NewError(req.CommID.OperationID, "UpdateFriendComment failed ", req.CommID.FromUserID, req.CommID.ToUserID, req.Remark) + return &pbFriend.SetFriendRemarkResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + log.NewInfo(req.CommID.OperationID, "rpc SetFriendComment ok") + chat.FriendRemarkSetNotification(req.CommID.OperationID, req.CommID.OpUserID, req.CommID.FromUserID, req.CommID.ToUserID) + return &pbFriend.SetFriendRemarkResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) RemoveBlacklist(ctx context.Context, req *pbFriend.RemoveBlacklistReq) (*pbFriend.RemoveBlacklistResp, error) { + log.NewInfo(req.CommID.OperationID, "RemoveBlacklist args ", req.String()) + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.RemoveBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + err := imdb.RemoveBlackList(req.CommID.FromUserID, req.CommID.ToUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "RemoveBlackList failed", err.Error(), req.CommID.FromUserID, req.CommID.ToUserID) + return &pbFriend.RemoveBlacklistResp{CommonResp: &pbFriend.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + + } + log.NewInfo(req.CommID.OperationID, "rpc RemoveBlacklist ok ") + chat.BlackDeletedNotification(req) + return &pbFriend.RemoveBlacklistResp{CommonResp: &pbFriend.CommonResp{}}, nil +} + +func (s *friendServer) IsInBlackList(ctx context.Context, req *pbFriend.IsInBlackListReq) (*pbFriend.IsInBlackListResp, error) { + log.NewInfo("IsInBlackList args ", req.String()) + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.IsInBlackListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + var isInBlacklist = false + err := imdb.CheckBlack(req.CommID.FromUserID, req.CommID.ToUserID) + if err == nil { + isInBlacklist = true + } + log.NewInfo(req.CommID.OperationID, "IsInBlackList rpc ok ", pbFriend.IsInBlackListResp{Response: isInBlacklist}) + return &pbFriend.IsInBlackListResp{Response: isInBlacklist}, nil +} + +func (s *friendServer) IsFriend(ctx context.Context, req *pbFriend.IsFriendReq) (*pbFriend.IsFriendResp, error) { + log.NewInfo(req.CommID.OperationID, req.String()) + var isFriend bool + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.IsFriendResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + _, err := imdb.GetFriendRelationshipFromFriend(req.CommID.FromUserID, req.CommID.ToUserID) + if err == nil { + isFriend = true + } else { + isFriend = false + } + log.NewInfo(req.CommID.OperationID, pbFriend.IsFriendResp{Response: isFriend}) + return &pbFriend.IsFriendResp{Response: isFriend}, nil +} + +func (s *friendServer) GetFriendList(ctx context.Context, req *pbFriend.GetFriendListReq) (*pbFriend.GetFriendListResp, error) { + log.NewInfo("GetFriendList args ", req.String()) + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.GetFriendListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + friends, err := imdb.GetFriendListByUserID(req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "FindUserInfoFromFriend failed ", err.Error(), req.CommID.FromUserID) + return &pbFriend.GetFriendListResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + var userInfoList []*sdkws.FriendInfo + for _, friendUser := range friends { + friendUserInfo := sdkws.FriendInfo{FriendUser: &sdkws.UserInfo{}} + cp.FriendDBCopyOpenIM(&friendUserInfo, &friendUser) + log.NewDebug(req.CommID.OperationID, "friends : ", friendUser, "openim friends: ", friendUserInfo) + userInfoList = append(userInfoList, &friendUserInfo) + } + log.NewInfo(req.CommID.OperationID, "rpc GetFriendList ok", pbFriend.GetFriendListResp{FriendInfoList: userInfoList}) + return &pbFriend.GetFriendListResp{FriendInfoList: userInfoList}, nil +} + +//received +func (s *friendServer) GetFriendApplyList(ctx context.Context, req *pbFriend.GetFriendApplyListReq) (*pbFriend.GetFriendApplyListResp, error) { + log.NewInfo(req.CommID.OperationID, "GetFriendApplyList args ", req.String()) + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.GetFriendApplyListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + // Find the current user friend applications received + ApplyUsersInfo, err := imdb.GetReceivedFriendsApplicationListByUserID(req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetReceivedFriendsApplicationListByUserID ", err.Error(), req.CommID.FromUserID) + return &pbFriend.GetFriendApplyListResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + + var appleUserList []*sdkws.FriendRequest + for _, applyUserInfo := range ApplyUsersInfo { + var userInfo sdkws.FriendRequest + cp.FriendRequestDBCopyOpenIM(&userInfo, &applyUserInfo) + // utils.CopyStructFields(&userInfo, applyUserInfo) + // u, err := imdb.GetUserByUserID(userInfo.FromUserID) + // if err != nil { + // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.FromUserID) + // continue + // } + // userInfo.FromNickname = u.Nickname + // userInfo.FromFaceURL = u.FaceURL + // userInfo.FromGender = u.Gender + // + // u, err = imdb.GetUserByUserID(userInfo.ToUserID) + // if err != nil { + // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.ToUserID) + // continue + // } + // userInfo.ToNickname = u.Nickname + // userInfo.ToFaceURL = u.FaceURL + // userInfo.ToGender = u.Gender + appleUserList = append(appleUserList, &userInfo) + } + + log.NewInfo(req.CommID.OperationID, "rpc GetFriendApplyList ok", pbFriend.GetFriendApplyListResp{FriendRequestList: appleUserList}) + return &pbFriend.GetFriendApplyListResp{FriendRequestList: appleUserList}, nil +} + +func (s *friendServer) GetSelfApplyList(ctx context.Context, req *pbFriend.GetSelfApplyListReq) (*pbFriend.GetSelfApplyListResp, error) { + log.NewInfo(req.CommID.OperationID, "GetSelfApplyList args ", req.String()) + + //Parse token, to find current user information + if !token_verify.CheckAccess(req.CommID.OpUserID, req.CommID.FromUserID) { + log.NewError(req.CommID.OperationID, "CheckAccess false ", req.CommID.OpUserID, req.CommID.FromUserID) + return &pbFriend.GetSelfApplyListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + // Find the self add other userinfo + usersInfo, err := imdb.GetSendFriendApplicationListByUserID(req.CommID.FromUserID) + if err != nil { + log.NewError(req.CommID.OperationID, "GetSendFriendApplicationListByUserID failed ", err.Error(), req.CommID.FromUserID) + return &pbFriend.GetSelfApplyListResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + var selfApplyOtherUserList []*sdkws.FriendRequest + for _, selfApplyOtherUserInfo := range usersInfo { + var userInfo sdkws.FriendRequest // pbFriend.ApplyUserInfo + cp.FriendRequestDBCopyOpenIM(&userInfo, &selfApplyOtherUserInfo) + //u, err := imdb.GetUserByUserID(userInfo.FromUserID) + //if err != nil { + // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.FromUserID) + // continue + //} + //userInfo.FromNickname = u.Nickname + //userInfo.FromFaceURL = u.FaceURL + //userInfo.FromGender = u.Gender + // + //u, err = imdb.GetUserByUserID(userInfo.ToUserID) + //if err != nil { + // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.ToUserID) + // continue + //} + //userInfo.ToNickname = u.Nickname + //userInfo.ToFaceURL = u.FaceURL + //userInfo.ToGender = u.Gender + + selfApplyOtherUserList = append(selfApplyOtherUserList, &userInfo) + } + log.NewInfo(req.CommID.OperationID, "rpc GetSelfApplyList ok", pbFriend.GetSelfApplyListResp{FriendRequestList: selfApplyOtherUserList}) + return &pbFriend.GetSelfApplyListResp{FriendRequestList: selfApplyOtherUserList}, nil +} + +//// +//func (s *friendServer) GetFriendsInfo(ctx context.Context, req *pbFriend.GetFriendsInfoReq) (*pbFriend.GetFriendInfoResp, error) { +// return nil, nil +//// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo args ", req.String()) +//// var ( +//// isInBlackList int32 +//// // isFriend int32 +//// comment string +//// ) +//// +//// friendShip, err := imdb.FindFriendRelationshipFromFriend(req.CommID.FromUserID, req.CommID.ToUserID) +//// if err != nil { +//// log.NewError(req.CommID.OperationID, "FindFriendRelationshipFromFriend failed ", err.Error()) +//// return &pbFriend.GetFriendInfoResp{ErrCode: constant.ErrSearchUserInfo.ErrCode, ErrMsg: constant.ErrSearchUserInfo.ErrMsg}, nil +//// // isFriend = constant.FriendFlag +//// } +//// comment = friendShip.Remark +//// +//// friendUserInfo, err := imdb.FindUserByUID(req.CommID.ToUserID) +//// if err != nil { +//// log.NewError(req.CommID.OperationID, "FindUserByUID failed ", err.Error()) +//// return &pbFriend.GetFriendInfoResp{ErrCode: constant.ErrSearchUserInfo.ErrCode, ErrMsg: constant.ErrSearchUserInfo.ErrMsg}, nil +//// } +//// +//// err = imdb.FindRelationshipFromBlackList(req.CommID.FromUserID, req.CommID.ToUserID) +//// if err == nil { +//// isInBlackList = constant.BlackListFlag +//// } +//// +//// resp := pbFriend.GetFriendInfoResp{ErrCode: 0, ErrMsg: "",} +//// +//// utils.CopyStructFields(resp.FriendInfoList, friendUserInfo) +//// resp.Data.IsBlack = isInBlackList +//// resp.Data.OwnerUserID = req.CommID.FromUserID +//// resp.Data.Remark = comment +//// resp.Data.CreateTime = friendUserInfo.CreateTime +//// +//// log.NewInfo(req.CommID.OperationID, "GetFriendsInfo ok ", resp) +//// return &resp, nil +//// +//} diff --git a/internal/rpc/group/callback.go b/internal/rpc/group/callback.go new file mode 100644 index 000000000..1e9e612a6 --- /dev/null +++ b/internal/rpc/group/callback.go @@ -0,0 +1,13 @@ +package group + +import ( + pbGroup "Open_IM/pkg/proto/group" +) + +func callbackBeforeCreateGroup(req *pbGroup.CreateGroupReq) (bool, error) { + return true, nil +} + +func callbackAfterCreateGroup(req *pbGroup.CreateGroupReq) { + +} diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go new file mode 100644 index 000000000..e22ab18bf --- /dev/null +++ b/internal/rpc/group/group.go @@ -0,0 +1,1046 @@ +package group + +import ( + chat "Open_IM/internal/rpc/msg" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + cp "Open_IM/pkg/common/utils" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbGroup "Open_IM/pkg/proto/group" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "net" + "strconv" + "strings" + "time" + + "google.golang.org/grpc" +) + +type groupServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewGroupServer(port int) *groupServer { + log.NewPrivateLog(constant.LogFileName) + return &groupServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImGroupName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *groupServer) Run() { + log.NewInfo("", "group rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbGroup.RegisterGroupServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("", "Serve failed ", err.Error()) + return + } + log.NewInfo("", "group rpc success") +} + +func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupReq) (*pbGroup.CreateGroupResp, error) { + log.NewInfo(req.OperationID, "CreateGroup, args ", req.String()) + if !token_verify.CheckAccess(req.OpUserID, req.OwnerUserID) { + log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.OwnerUserID) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + canCreate, err := callbackBeforeCreateGroup(req) + if err != nil || !canCreate { + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "callbackBeforeCreateGroup failed") + } + } + //Time stamp + MD5 to generate group chat id + groupId := utils.Md5(strconv.FormatInt(time.Now().UnixNano(), 10)) + //to group + groupInfo := db.Group{} + utils.CopyStructFields(&groupInfo, req.GroupInfo) + groupInfo.CreatorUserID = req.OpUserID + groupInfo.GroupID = groupId + err = imdb.InsertIntoGroup(groupInfo) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroup failed, ", err.Error(), groupInfo) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) + } + + us, err := imdb.GetUserByUserID(req.OwnerUserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OwnerUserID) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) + } + + //to group member + groupMember := db.GroupMember{GroupID: groupId, RoleLevel: constant.GroupOwner, OperatorUserID: req.OpUserID} + utils.CopyStructFields(&groupMember, us) + err = imdb.InsertIntoGroupMember(groupMember) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroupMember failed ", err.Error(), groupMember) + return &pbGroup.CreateGroupResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, http.WrapError(constant.ErrDB) + } + + err = db.DB.AddGroupMember(groupId, req.OwnerUserID) + if err != nil { + log.NewError(req.OperationID, "AddGroupMember failed ", err.Error(), groupId, req.OwnerUserID) + } + var okUserIDList []string + //to group member + for _, user := range req.InitMemberList { + us, err := imdb.GetUserByUserID(user.UserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), user.UserID) + continue + } + if user.RoleLevel == constant.GroupOwner { + log.NewError(req.OperationID, "only one owner, failed ", user) + continue + } + groupMember.RoleLevel = user.RoleLevel + utils.CopyStructFields(&groupMember, us) + err = imdb.InsertIntoGroupMember(groupMember) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroupMember failed ", err.Error(), groupMember) + continue + } + + okUserIDList = append(okUserIDList, user.UserID) + err = db.DB.AddGroupMember(groupId, user.UserID) + if err != nil { + log.NewError(req.OperationID, "add mongo group member failed, db.DB.AddGroupMember failed ", err.Error()) + } + } + + resp := &pbGroup.CreateGroupResp{GroupInfo: &open_im_sdk.GroupInfo{}} + group, err := imdb.GetGroupInfoByGroupID(groupId) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupId) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + return resp, nil + } + utils.CopyStructFields(resp.GroupInfo, group) + resp.GroupInfo.MemberCount, err = imdb.GetGroupMemberNumByGroupID(groupId) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberNumByGroupID failed ", err.Error(), groupId) + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + return resp, nil + } + resp.GroupInfo.OwnerUserID = req.OwnerUserID + + log.NewInfo(req.OperationID, "rpc CreateGroup return ", resp.String()) + chat.GroupCreatedNotification(req.OperationID, req.OpUserID, groupId, okUserIDList) + return resp, nil +} + +func (s *groupServer) GetJoinedGroupList(ctx context.Context, req *pbGroup.GetJoinedGroupListReq) (*pbGroup.GetJoinedGroupListResp, error) { + log.NewInfo(req.OperationID, "GetJoinedGroupList, args ", req.String()) + if !token_verify.CheckAccess(req.OpUserID, req.FromUserID) { + log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.FromUserID) + return &pbGroup.GetJoinedGroupListResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + //group list + joinedGroupList, err := imdb.GetJoinedGroupIDListByUserID(req.FromUserID) + if err != nil { + log.NewError(req.OperationID, "GetJoinedGroupIDListByUserID failed ", err.Error(), req.FromUserID) + return &pbGroup.GetJoinedGroupListResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + + var resp pbGroup.GetJoinedGroupListResp + for _, v := range joinedGroupList { + var groupNode open_im_sdk.GroupInfo + num, err := imdb.GetGroupMemberNumByGroupID(v) + owner, err2 := imdb.GetGroupOwnerInfoByGroupID(v) + group, err := imdb.GetGroupInfoByGroupID(v) + if num > 0 && owner != nil && err2 == nil && group != nil && err == nil { + utils.CopyStructFields(&groupNode, group) + groupNode.CreateTime = uint32(group.CreateTime.Unix()) + groupNode.MemberCount = uint32(num) + groupNode.OwnerUserID = owner.UserID + resp.GroupList = append(resp.GroupList, &groupNode) + } else { + log.NewError(req.OperationID, "check nil ", num, owner, err, group) + continue + } + log.NewDebug(req.OperationID, "joinedGroup ", groupNode) + } + log.NewInfo(req.OperationID, "GetJoinedGroupList rpc return ", resp.String()) + return &resp, nil +} + +func (s *groupServer) InviteUserToGroup(ctx context.Context, req *pbGroup.InviteUserToGroupReq) (*pbGroup.InviteUserToGroupResp, error) { + log.NewInfo(req.OperationID, "InviteUserToGroup args ", req.String()) + + if !imdb.IsExistGroupMember(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { + log.NewError(req.OperationID, "no permission InviteUserToGroup ", req.GroupID, req.OpUserID) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + _, err := imdb.GetGroupInfoByGroupID(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", req.GroupID, err) + return &pbGroup.InviteUserToGroupResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + // + //from User: invite: applicant + //to user: invite: invited + var resp pbGroup.InviteUserToGroupResp + var okUserIDList []string + for _, v := range req.InvitedUserIDList { + var resultNode pbGroup.Id2Result + resultNode.UserID = v + resultNode.Result = 0 + toUserInfo, err := imdb.GetUserByUserID(v) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), v) + resultNode.Result = -1 + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + continue + } + + if imdb.IsExistGroupMember(req.GroupID, v) { + log.NewError(req.OperationID, "IsExistGroupMember ", req.GroupID, v) + resultNode.Result = -1 + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + continue + } + var toInsertInfo db.GroupMember + utils.CopyStructFields(&toInsertInfo, toUserInfo) + toInsertInfo.GroupID = req.GroupID + toInsertInfo.RoleLevel = constant.GroupOrdinaryUsers + toInsertInfo.OperatorUserID = req.OpUserID + err = imdb.InsertIntoGroupMember(toInsertInfo) + if err != nil { + log.NewError(req.OperationID, "InsertIntoGroupMember failed ", req.GroupID, toUserInfo.UserID, toUserInfo.Nickname, toUserInfo.FaceURL) + resultNode.Result = -1 + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + continue + } + okUserIDList = append(okUserIDList, v) + err = db.DB.AddGroupMember(req.GroupID, toUserInfo.UserID) + if err != nil { + log.NewError(req.OperationID, "AddGroupMember failed ", err.Error(), req.GroupID, toUserInfo.UserID) + } + resp.Id2ResultList = append(resp.Id2ResultList, &resultNode) + } + + chat.MemberInvitedNotification(req.OperationID, req.GroupID, req.OpUserID, req.Reason, okUserIDList) + resp.ErrCode = 0 + log.NewInfo(req.OperationID, "InviteUserToGroup rpc return ", resp.String()) + return &resp, nil +} + +func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGroupAllMemberReq) (*pbGroup.GetGroupAllMemberResp, error) { + log.NewInfo(req.OperationID, "GetGroupAllMember, args ", req.String()) + var resp pbGroup.GetGroupAllMemberResp + memberList, err := imdb.GetGroupMemberListByGroupID(req.GroupID) + if err != nil { + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + log.NewError(req.OperationID, "GetGroupMemberListByGroupID failed,", err.Error(), req.GroupID) + return &resp, nil + } + + for _, v := range memberList { + log.Debug(req.OperationID, v) + var node open_im_sdk.GroupMemberFullInfo + cp.GroupMemberDBCopyOpenIM(&node, &v) + log.Debug(req.OperationID, "db value:", v.MuteEndTime, "seconds: ", v.MuteEndTime.Unix()) + log.Debug(req.OperationID, "cp value: ", node) + resp.MemberList = append(resp.MemberList, &node) + } + log.NewInfo(req.OperationID, "GetGroupAllMember rpc return ", resp.String()) + return &resp, nil +} + +func (s *groupServer) GetGroupMemberList(ctx context.Context, req *pbGroup.GetGroupMemberListReq) (*pbGroup.GetGroupMemberListResp, error) { + log.NewInfo(req.OperationID, "GetGroupMemberList args ", req.String()) + var resp pbGroup.GetGroupMemberListResp + memberList, err := imdb.GetGroupMemberByGroupID(req.GroupID, req.Filter, req.NextSeq, 30) + if err != nil { + resp.ErrCode = constant.ErrDB.ErrCode + resp.ErrMsg = constant.ErrDB.ErrMsg + log.NewError(req.OperationID, "GetGroupMemberByGroupId failed,", req.GroupID, req.Filter, req.NextSeq, 30) + return &resp, nil + } + + for _, v := range memberList { + var node open_im_sdk.GroupMemberFullInfo + utils.CopyStructFields(&node, &v) + resp.MemberList = append(resp.MemberList, &node) + } + //db operate get db sorted by join time + if int32(len(memberList)) < 30 { + resp.NextSeq = 0 + } else { + resp.NextSeq = req.NextSeq + int32(len(memberList)) + } + + resp.ErrCode = 0 + log.NewInfo(req.OperationID, "GetGroupMemberList rpc return ", resp.String()) + return &resp, nil +} + +func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGroupMemberReq) (*pbGroup.KickGroupMemberResp, error) { + log.NewInfo(req.OperationID, "KickGroupMember args ", req.String()) + ownerList, err := imdb.GetOwnerManagerByGroupID(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "GetOwnerManagerByGroupId failed ", err.Error(), req.GroupID) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}, nil + } + //op is group owner? + var flag = 0 + for _, v := range ownerList { + if v.UserID == req.OpUserID { + flag = 1 + log.NewDebug(req.OperationID, "is group owner ", req.OpUserID, req.GroupID) + break + } + } + + //op is app manager + if flag != 1 { + if token_verify.IsManagerUserID(req.OpUserID) { + flag = 1 + log.NewDebug(req.OperationID, "is app manager ", req.OpUserID) + } + } + + if flag != 1 { + log.NewError(req.OperationID, "failed, no access kick ", req.OpUserID) + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + if len(req.KickedUserIDList) == 0 { + log.NewError(req.OperationID, "failed, kick list 0") + return &pbGroup.KickGroupMemberResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}, nil + } + + groupOwnerUserID := "" + for _, v := range ownerList { + if v.RoleLevel == constant.GroupOwner { + groupOwnerUserID = v.UserID + } + } + + var okUserIDList []string + //remove + var resp pbGroup.KickGroupMemberResp + for _, v := range req.KickedUserIDList { + //owner can‘t kicked + if v == groupOwnerUserID { + log.NewError(req.OperationID, "failed, can't kick owner ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + continue + } + err := imdb.RemoveGroupMember(req.GroupID, v) + if err != nil { + log.NewError(req.OperationID, "RemoveGroupMember failed ", err.Error(), req.GroupID, v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1}) + } else { + log.NewDebug(req.OperationID, "kicked ", v) + resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: 0}) + okUserIDList = append(okUserIDList, v) + } + + err = db.DB.DelGroupMember(req.GroupID, v) + if err != nil { + log.NewError(req.OperationID, "DelGroupMember failed ", err.Error(), req.GroupID, v) + } + } + chat.MemberKickedNotification(req, okUserIDList) + log.NewInfo(req.OperationID, "GetGroupMemberList rpc return ", resp.String()) + return &resp, nil +} + +func (s *groupServer) GetGroupMembersInfo(ctx context.Context, req *pbGroup.GetGroupMembersInfoReq) (*pbGroup.GetGroupMembersInfoResp, error) { + log.NewInfo(req.OperationID, "GetGroupMembersInfo args ", req.String()) + + var resp pbGroup.GetGroupMembersInfoResp + + for _, v := range req.MemberList { + var memberNode open_im_sdk.GroupMemberFullInfo + memberInfo, err := imdb.GetMemberInfoByID(req.GroupID, v) + memberNode.UserID = v + if err != nil { + log.NewError(req.OperationID, "GetMemberInfoById failed ", err.Error(), req.GroupID, v) + continue + } else { + utils.CopyStructFields(&memberNode, memberInfo) + memberNode.JoinTime = int32(memberInfo.JoinTime.Unix()) + resp.MemberList = append(resp.MemberList, &memberNode) + } + } + resp.ErrCode = 0 + log.NewInfo(req.OperationID, "GetGroupMembersInfo rpc return ", resp.String()) + return &resp, nil +} + +func (s *groupServer) GetGroupApplicationList(_ context.Context, req *pbGroup.GetGroupApplicationListReq) (*pbGroup.GetGroupApplicationListResp, error) { + log.NewInfo(req.OperationID, "GetGroupMembersInfo args ", req.String()) + reply, err := imdb.GetGroupApplicationList(req.FromUserID) + if err != nil { + log.NewError(req.OperationID, "GetGroupApplicationList failed ", err.Error(), req.FromUserID) + return &pbGroup.GetGroupApplicationListResp{ErrCode: 701, ErrMsg: "GetGroupApplicationList failed"}, nil + } + + log.NewDebug(req.OperationID, "GetGroupApplicationList reply ", reply) + resp := pbGroup.GetGroupApplicationListResp{} + for _, v := range reply { + node := open_im_sdk.GroupRequest{UserInfo: &open_im_sdk.PublicUserInfo{}, GroupInfo: &open_im_sdk.GroupInfo{}} + group, err := imdb.GetGroupInfoByGroupID(v.GroupID) + if err != nil { + log.Error(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), v.GroupID) + continue + } + user, err := imdb.GetUserByUserID(v.UserID) + if err != nil { + log.Error(req.OperationID, "GetUserByUserID failed ", err.Error(), v.UserID) + continue + } + + cp.GroupRequestDBCopyOpenIM(&node, &v) + cp.UserDBCopyOpenIMPublicUser(node.UserInfo, user) + cp.GroupDBCopyOpenIM(node.GroupInfo, group) + log.NewDebug(req.OperationID, "node ", node, "v ", v) + resp.GroupRequestList = append(resp.GroupRequestList, &node) + } + log.NewInfo(req.OperationID, "GetGroupMembersInfo rpc return ", resp) + return &resp, nil +} + +func (s *groupServer) GetGroupsInfo(ctx context.Context, req *pbGroup.GetGroupsInfoReq) (*pbGroup.GetGroupsInfoResp, error) { + log.NewInfo(req.OperationID, "GetGroupsInfo args ", req.String()) + groupsInfoList := make([]*open_im_sdk.GroupInfo, 0) + for _, groupID := range req.GroupIDList { + groupInfoFromMysql, err := imdb.GetGroupInfoByGroupID(groupID) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupID) + continue + } + var groupInfo open_im_sdk.GroupInfo + cp.GroupDBCopyOpenIM(&groupInfo, groupInfoFromMysql) + groupsInfoList = append(groupsInfoList, &groupInfo) + } + + resp := pbGroup.GetGroupsInfoResp{GroupInfoList: groupsInfoList} + log.NewInfo(req.OperationID, "GetGroupsInfo rpc return ", resp) + return &resp, nil +} + +func (s *groupServer) GroupApplicationResponse(_ context.Context, req *pbGroup.GroupApplicationResponseReq) (*pbGroup.GroupApplicationResponseResp, error) { + log.NewInfo(req.OperationID, "GroupApplicationResponse args ", req.String()) + + groupRequest := db.GroupRequest{} + utils.CopyStructFields(&groupRequest, req) + groupRequest.UserID = req.FromUserID + groupRequest.HandleUserID = req.OpUserID + groupRequest.HandledTime = time.Now() + if !token_verify.IsManagerUserID(req.OpUserID) && !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) { + log.NewError(req.OperationID, "IsManagerUserID IsGroupOwnerAdmin false ", req.GroupID, req.OpUserID) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + err := imdb.UpdateGroupRequest(groupRequest) + if err != nil { + //{openIM002 7836e478bc43ce1d3b8889cac983f59b 1 ok 0001-01-01 00:00:00 +0000 UTC openIM001 0001-01-01 00:00:00 +0000 UTC } + log.NewError(req.OperationID, "GroupApplicationResponse failed ", err.Error(), groupRequest) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + if req.HandleResult == constant.GroupResponseAgree { + user, err := imdb.GetUserByUserID(req.FromUserID) + if err != nil { + log.NewError(req.OperationID, "GroupApplicationResponse failed ", err.Error(), req.FromUserID) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + member := db.GroupMember{} + member.GroupID = req.GroupID + member.UserID = req.FromUserID + member.RoleLevel = constant.GroupOrdinaryUsers + member.OperatorUserID = req.OpUserID + member.FaceURL = user.FaceURL + member.Nickname = user.Nickname + + err = imdb.InsertIntoGroupMember(member) + if err != nil { + log.NewError(req.OperationID, "GroupApplicationResponse failed ", err.Error(), member) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupApplicationAcceptedNotification(req) + chat.MemberEnterNotification(req) + } else if req.HandleResult == constant.GroupResponseRefuse { + chat.GroupApplicationRejectedNotification(req) + } else { + log.Error(req.OperationID, "HandleResult failed ", req.HandleResult) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}}, nil + } + + log.NewInfo(req.OperationID, "rpc GroupApplicationResponse return ", pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{}}) + return &pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{}}, nil +} + +func (s *groupServer) JoinGroup(ctx context.Context, req *pbGroup.JoinGroupReq) (*pbGroup.JoinGroupResp, error) { + log.NewInfo(req.OperationID, "JoinGroup args ", req.String()) + _, err := imdb.GetUserByUserID(req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.OpUserID) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + var groupRequest db.GroupRequest + groupRequest.UserID = req.OpUserID + groupRequest.ReqMsg = req.ReqMessage + groupRequest.GroupID = req.GroupID + + err = imdb.InsertIntoGroupRequest(groupRequest) + if err != nil { + log.NewError(req.OperationID, "UpdateGroupRequest ", err.Error(), groupRequest) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + _, err = imdb.GetGroupMemberListByGroupIDAndRoleLevel(req.GroupID, constant.GroupOwner) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberListByGroupIDAndRoleLevel failed ", err.Error(), req.GroupID, constant.GroupOwner) + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil + } + + chat.JoinGroupApplicationNotification(req) + + log.NewInfo(req.OperationID, "ReceiveJoinApplicationNotification rpc return ") + return &pbGroup.JoinGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil +} + +func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq) (*pbGroup.QuitGroupResp, error) { + log.NewError(req.OperationID, "QuitGroup args ", req.String()) + _, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed ", err.Error(), req.GroupID, req.OpUserID) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + err = imdb.DeleteGroupMemberByGroupIDAndUserID(req.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "DeleteGroupMemberByGroupIdAndUserId failed ", err.Error(), req.GroupID, req.OpUserID) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + + err = db.DB.DelGroupMember(req.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "DelGroupMember failed ", req.GroupID, req.OpUserID) + // return &pbGroup.CommonResp{ErrorCode: constant.ErrQuitGroup.ErrCode, ErrorMsg: constant.ErrQuitGroup.ErrMsg}, nil + } + + chat.MemberQuitNotification(req) + log.NewInfo(req.OperationID, "rpc QuitGroup return ", pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}) + return &pbGroup.QuitGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil +} + +func hasAccess(req *pbGroup.SetGroupInfoReq) bool { + if utils.IsContain(req.OpUserID, config.Config.Manager.AppManagerUid) { + return true + } + groupUserInfo, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(req.GroupInfo.GroupID, req.OpUserID) + if err != nil { + log.NewError(req.OperationID, "GetGroupMemberInfoByGroupIDAndUserID failed, ", err.Error(), req.GroupInfo.GroupID, req.OpUserID) + return false + + } + if groupUserInfo.RoleLevel == constant.GroupOwner || groupUserInfo.RoleLevel == constant.GroupAdmin { + return true + } + return false +} + +func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInfoReq) (*pbGroup.SetGroupInfoResp, error) { + log.NewInfo(req.OperationID, "SetGroupInfo args ", req.String()) + if !hasAccess(req) { + log.NewError(req.OperationID, "no access ", req) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + group, err := imdb.GetGroupInfoByGroupID(req.GroupInfo.GroupID) + if err != nil { + log.NewError(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), req.GroupInfo.GroupID) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, http.WrapError(constant.ErrDB) + } + + ////bitwise operators: 0001:groupName; 0010:Notification 0100:Introduction; 1000:FaceUrl; 10000:owner + var changedType int32 + if group.GroupName != req.GroupInfo.GroupName && req.GroupInfo.GroupName != "" { + changedType = 1 + } + if group.Notification != req.GroupInfo.Notification && req.GroupInfo.Notification != "" { + changedType = changedType | (1 << 1) + } + if group.Introduction != req.GroupInfo.Introduction && req.GroupInfo.Introduction != "" { + changedType = changedType | (1 << 2) + } + if group.FaceURL != req.GroupInfo.FaceURL && req.GroupInfo.FaceURL != "" { + changedType = changedType | (1 << 3) + } + //only administrators can set group information + var groupInfo db.Group + utils.CopyStructFields(&groupInfo, req.GroupInfo) + err = imdb.SetGroupInfo(groupInfo) + if err != nil { + log.NewError(req.OperationID, "SetGroupInfo failed ", err.Error(), groupInfo) + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, http.WrapError(constant.ErrDB) + } + log.NewInfo(req.OperationID, "SetGroupInfo rpc return ", pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}) + if changedType != 0 { + chat.GroupInfoSetNotification(req.OperationID, req.OpUserID, req.GroupInfo.GroupID) + } + return &pbGroup.SetGroupInfoResp{CommonResp: &pbGroup.CommonResp{}}, nil +} + +func (s *groupServer) TransferGroupOwner(_ context.Context, req *pbGroup.TransferGroupOwnerReq) (*pbGroup.TransferGroupOwnerResp, error) { + log.NewInfo(req.OperationID, "TransferGroupOwner ", req.String()) + + if req.OldOwnerUserID == req.NewOwnerUserID { + log.NewError(req.OperationID, "same owner ", req.OldOwnerUserID, req.NewOwnerUserID) + return &pbGroup.TransferGroupOwnerResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}}, nil + } + groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.OldOwnerUserID, RoleLevel: constant.GroupOrdinaryUsers} + err := imdb.UpdateGroupMemberInfo(groupMemberInfo) + if err != nil { + log.NewError(req.OperationID, "UpdateGroupMemberInfo failed ", groupMemberInfo) + return &pbGroup.TransferGroupOwnerResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + groupMemberInfo = db.GroupMember{GroupID: req.GroupID, UserID: req.NewOwnerUserID, RoleLevel: constant.GroupOwner} + err = imdb.UpdateGroupMemberInfo(groupMemberInfo) + if err != nil { + log.NewError(req.OperationID, "UpdateGroupMemberInfo failed ", groupMemberInfo) + return &pbGroup.TransferGroupOwnerResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupOwnerTransferredNotification(req) + + return &pbGroup.TransferGroupOwnerResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil + +} + +func (s *groupServer) GetGroupById(_ context.Context, req *pbGroup.GetGroupByIdReq) (*pbGroup.GetGroupByIdResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbGroup.GetGroupByIdResp{CMSGroup: &pbGroup.CMSGroup{ + GroupInfo: &open_im_sdk.GroupInfo{}, + }} + group, err := imdb.GetGroupById(req.GroupId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupById error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + resp.CMSGroup.GroupInfo = &open_im_sdk.GroupInfo{ + GroupID: group.GroupID, + GroupName: group.GroupName, + FaceURL: group.FaceURL, + OwnerUserID: group.CreatorUserID, + MemberCount: 0, + Status: group.Status, + CreatorUserID: group.CreatorUserID, + GroupType: group.GroupType, + CreateTime: uint32(group.CreateTime.Unix()), + } + groupMember, err := imdb.GetGroupMaster(group.GroupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + resp.CMSGroup.GroupMasterName = groupMember.Nickname + resp.CMSGroup.GroupMasterId = groupMember.UserID + resp.CMSGroup.GroupInfo.CreatorUserID = group.CreatorUserID + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *groupServer) GetGroup(_ context.Context, req *pbGroup.GetGroupReq) (*pbGroup.GetGroupResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbGroup.GetGroupResp{ + CMSGroups: []*pbGroup.CMSGroup{}, + } + groups, err := imdb.GetGroupsByName(req.GroupName, req.Pagination.PageNumber, req.Pagination.ShowNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsByName error", req.String()) + return resp, http.WrapError(constant.ErrDB) + } + nums, err := imdb.GetGroupsCountNum(db.Group{GroupName: req.GroupName}) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsCountNum error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + resp.GroupNums = nums + resp.Pagination = &open_im_sdk.RequestPagination{ + PageNumber: req.Pagination.PageNumber, + ShowNumber: req.Pagination.ShowNumber, + } + for _, v := range groups { + groupMember, err := imdb.GetGroupMaster(v.GroupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster error", err.Error()) + continue + } + resp.CMSGroups = append(resp.CMSGroups, &pbGroup.CMSGroup{ + GroupInfo: &open_im_sdk.GroupInfo{ + GroupID: v.GroupID, + GroupName: v.GroupName, + FaceURL: v.FaceURL, + OwnerUserID: v.CreatorUserID, + Status: v.Status, + CreatorUserID: v.CreatorUserID, + CreateTime: uint32(v.CreateTime.Unix()), + }, + GroupMasterName: groupMember.Nickname, + GroupMasterId: groupMember.UserID, + }) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *groupServer) GetGroups(_ context.Context, req *pbGroup.GetGroupsReq) (*pbGroup.GetGroupsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetGroups ", req.String()) + resp := &pbGroup.GetGroupsResp{ + CMSGroups: []*pbGroup.CMSGroup{}, + Pagination: &open_im_sdk.RequestPagination{}, + } + groups, err := imdb.GetGroups(int(req.Pagination.PageNumber), int(req.Pagination.ShowNumber)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroups error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + groupsCountNum, err := imdb.GetGroupsCountNum(db.Group{}) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "groupsCountNum ", groupsCountNum) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupsCountNum", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + resp.GroupNum = int32(groupsCountNum) + resp.Pagination.PageNumber = req.Pagination.PageNumber + resp.Pagination.ShowNumber = req.Pagination.ShowNumber + for _, v := range groups { + groupMember, err := imdb.GetGroupMaster(v.GroupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + resp.CMSGroups = append(resp.CMSGroups, &pbGroup.CMSGroup{ + GroupInfo: &open_im_sdk.GroupInfo{ + GroupID: v.GroupID, + GroupName: v.GroupName, + FaceURL: v.FaceURL, + OwnerUserID: v.CreatorUserID, + Status: v.Status, + CreatorUserID: v.CreatorUserID, + CreateTime: uint32(v.CreateTime.Unix()), + }, + GroupMasterId: groupMember.UserID, + GroupMasterName: groupMember.Nickname, + }) + } + + return resp, nil +} + +func (s *groupServer) OperateGroupStatus(_ context.Context, req *pbGroup.OperateGroupStatusReq) (*pbGroup.OperateGroupStatusResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbGroup.OperateGroupStatusResp{} + if err := imdb.OperateGroupStatus(req.GroupId, req.Status); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "OperateGroupStatus", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *groupServer) DeleteGroup(_ context.Context, req *pbGroup.DeleteGroupReq) (*pbGroup.DeleteGroupResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbGroup.DeleteGroupResp{} + if err := imdb.DeleteGroup(req.GroupId); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DeleteGroup error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *groupServer) OperateUserRole(_ context.Context, req *pbGroup.OperateUserRoleReq) (*pbGroup.OperateUserRoleResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "args:", req.String()) + resp := &pbGroup.OperateUserRoleResp{} + oldOwnerUserID, err := imdb.GetGroupMaster(req.GroupId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMaster failed", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName) + client := pbGroup.NewGroupClient(etcdConn) + var reqPb pbGroup.TransferGroupOwnerReq + reqPb.OperationID = req.OperationID + reqPb.NewOwnerUserID = req.UserId + reqPb.GroupID = req.GroupId + reqPb.OpUserID = "cms admin" + reqPb.OldOwnerUserID = oldOwnerUserID.UserID + reply, err := client.TransferGroupOwner(context.Background(), &reqPb) + if reply.CommonResp.ErrCode != 0 || err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "TransferGroupOwner rpc failed") + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + } + return resp, nil +} + +func (s *groupServer) GetGroupMembersCMS(_ context.Context, req *pbGroup.GetGroupMembersCMSReq) (*pbGroup.GetGroupMembersCMSResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "args:", req.String()) + resp := &pbGroup.GetGroupMembersCMSResp{} + groupMembers, err := imdb.GetGroupMembersByGroupIdCMS(req.GroupId, req.UserName, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMembersByGroupIdCMS Error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + groupMembersCount, err := imdb.GetGroupMembersCount(req.GroupId, req.UserName) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMembersCMS Error", err.Error()) + return resp, http.WrapError(constant.ErrDB) + } + log.NewInfo(req.OperationID, groupMembersCount) + resp.MemberNums = groupMembersCount + for _, groupMember := range groupMembers { + resp.Members = append(resp.Members, &open_im_sdk.GroupMemberFullInfo{ + GroupID: req.GroupId, + UserID: groupMember.UserID, + RoleLevel: groupMember.RoleLevel, + JoinTime: int32(groupMember.JoinTime.Unix()), + Nickname: groupMember.Nickname, + FaceURL: groupMember.FaceURL, + JoinSource: groupMember.JoinSource, + }) + } + resp.Pagination = &open_im_sdk.ResponsePagination{ + CurrentPage: req.Pagination.PageNumber, + ShowNumber: req.Pagination.ShowNumber, + } + return resp, nil +} + +func (s *groupServer) RemoveGroupMembersCMS(_ context.Context, req *pbGroup.RemoveGroupMembersCMSReq) (*pbGroup.RemoveGroupMembersCMSResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "args:", req.String()) + resp := &pbGroup.RemoveGroupMembersCMSResp{} + for _, userId := range req.UserIds { + err := imdb.RemoveGroupMember(req.GroupId, userId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + resp.Failed = append(resp.Failed, userId) + } else { + resp.Success = append(resp.Success, userId) + } + } + reqKick := &pbGroup.KickGroupMemberReq{ + GroupID: req.GroupId, + KickedUserIDList: resp.Success, + Reason: "admin kick", + OperationID: req.OperationID, + OpUserID: req.OpUserId, + } + chat.MemberKickedNotification(reqKick, resp.Success) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "success: ", resp.Success) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "failed: ", resp.Failed) + return resp, nil +} + +func (s *groupServer) AddGroupMembersCMS(_ context.Context, req *pbGroup.AddGroupMembersCMSReq) (*pbGroup.AddGroupMembersCMSResp, error) { + log.NewInfo(req.OperationId, utils.GetSelfFuncName(), "args:", req.String()) + resp := &pbGroup.AddGroupMembersCMSResp{} + for _, userId := range req.UserIds { + if isExist := imdb.IsExistGroupMember(req.GroupId, userId); isExist { + log.NewError(req.OperationId, utils.GetSelfFuncName(), "user is exist in group", userId, req.GroupId) + resp.Failed = append(resp.Failed, userId) + continue + } + user, err := imdb.GetUserByUserID(userId) + if err != nil { + log.NewError(req.OperationId, utils.GetSelfFuncName(), "GetUserByUserID", err.Error()) + resp.Failed = append(resp.Failed, userId) + continue + } + groupMember := db.GroupMember{ + GroupID: req.GroupId, + UserID: userId, + Nickname: user.Nickname, + FaceURL: "", + RoleLevel: 1, + JoinTime: time.Time{}, + JoinSource: constant.JoinByAdmin, + OperatorUserID: "CmsAdmin", + Ex: "", + } + if err := imdb.InsertIntoGroupMember(groupMember); err != nil { + log.NewError(req.OperationId, utils.GetSelfFuncName(), "InsertIntoGroupMember failed", req.String()) + resp.Failed = append(resp.Failed, userId) + } else { + resp.Success = append(resp.Success, userId) + } + } + chat.MemberInvitedNotification(req.OperationId, req.GroupId, req.OpUserId, "admin add you to group", resp.Success) + return resp, nil +} + +func (s *groupServer) GetUserReqApplicationList(_ context.Context, req *pbGroup.GetUserReqApplicationListReq) (*pbGroup.GetUserReqApplicationListResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbGroup.GetUserReqApplicationListResp{} + groupRequests, err := imdb.GetUserReqGroupByUserID(req.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserReqGroupByUserID failed ", err.Error()) + resp.CommonResp = &pbGroup.CommonResp{ + ErrCode: constant.ErrDB.ErrCode, + ErrMsg: constant.ErrDB.ErrMsg, + } + return resp, nil + } + for _, groupReq := range groupRequests { + node := open_im_sdk.GroupRequest{UserInfo: &open_im_sdk.PublicUserInfo{}, GroupInfo: &open_im_sdk.GroupInfo{}} + group, err := imdb.GetGroupInfoByGroupID(groupReq.GroupID) + if err != nil { + log.Error(req.OperationID, "GetGroupInfoByGroupID failed ", err.Error(), groupReq.GroupID) + continue + } + user, err := imdb.GetUserByUserID(groupReq.UserID) + if err != nil { + log.Error(req.OperationID, "GetUserByUserID failed ", err.Error(), groupReq.UserID) + continue + } + cp.GroupRequestDBCopyOpenIM(&node, &groupReq) + cp.UserDBCopyOpenIMPublicUser(node.UserInfo, user) + cp.GroupDBCopyOpenIM(node.GroupInfo, group) + resp.GroupRequestList = append(resp.GroupRequestList, &node) + } + resp.CommonResp = &pbGroup.CommonResp{ + ErrCode: 0, + ErrMsg: "", + } + return resp, nil +} + +func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGroupReq) (*pbGroup.DismissGroupResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) && !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) { + log.NewError(req.OperationID, "verify failed ", req.OpUserID, req.GroupID) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + err := imdb.OperateGroupStatus(req.GroupID, constant.GroupStatusDismissed) + if err != nil { + log.NewError(req.OperationID, "OperateGroupStatus failed ", req.GroupID, constant.GroupStatusDismissed) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupDismissedNotification(req) + + err = imdb.DeleteGroupMemberByGroupID(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "DeleteGroupMemberByGroupID failed ", req.GroupID) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}) + return &pbGroup.DismissGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil +} + +// rpc MuteGroupMember(MuteGroupMemberReq) returns(MuteGroupMemberResp); +// rpc CancelMuteGroupMember(CancelMuteGroupMemberReq) returns(CancelMuteGroupMemberResp); +// rpc MuteGroup(MuteGroupReq) returns(MuteGroupResp); +// rpc CancelMuteGroup(CancelMuteGroupReq) returns(CancelMuteGroupResp); + +func (s *groupServer) MuteGroupMember(ctx context.Context, req *pbGroup.MuteGroupMemberReq) (*pbGroup.MuteGroupMemberResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) + if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { + log.Error(req.OperationID, "verify failed ", req.GroupID, req.UserID) + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.UserID} + + groupMemberInfo.MuteEndTime = time.Unix(int64(time.Now().Second())+int64(req.MutedSeconds), time.Now().UnixNano()) + err := imdb.UpdateGroupMemberInfo(groupMemberInfo) + if err != nil { + log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo) + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupMemberMutedNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, req.MutedSeconds) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}) + return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil +} + +func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.CancelMuteGroupMemberReq) (*pbGroup.CancelMuteGroupMemberResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) + if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { + log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID) + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.UserID} + groupMemberInfo.MuteEndTime = time.Unix(0, 0) + err := imdb.UpdateGroupMemberInfo(groupMemberInfo) + if err != nil { + log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo) + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupMemberCancelMutedNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}) + return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil +} + +func (s *groupServer) MuteGroup(ctx context.Context, req *pbGroup.MuteGroupReq) (*pbGroup.MuteGroupResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) + if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { + log.Error(req.OperationID, "verify failed ", req.GroupID, req.GroupID) + return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + err := imdb.OperateGroupStatus(req.GroupID, constant.GroupStatusMuted) + if err != nil { + log.Error(req.OperationID, "OperateGroupStatus failed ", err.Error(), req.GroupID, constant.GroupStatusMuted) + return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupMutedNotification(req.OperationID, req.OpUserID, req.GroupID) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}) + return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil +} + +func (s *groupServer) CancelMuteGroup(ctx context.Context, req *pbGroup.CancelMuteGroupReq) (*pbGroup.CancelMuteGroupResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String()) + if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsManagerUserID(req.OpUserID) { + log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID) + return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + err := imdb.UpdateGroupInfoDefaultZero(req.GroupID, map[string]interface{}{"status": constant.GroupOk}) + if err != nil { + log.Error(req.OperationID, "UpdateGroupInfoDefaultZero failed ", err.Error(), req.GroupID) + return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + chat.GroupCancelMutedNotification(req.OperationID, req.OpUserID, req.GroupID) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}) + return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil +} diff --git a/internal/rpc/message_cms/message_cms.go b/internal/rpc/message_cms/message_cms.go new file mode 100644 index 000000000..7f27e007a --- /dev/null +++ b/internal/rpc/message_cms/message_cms.go @@ -0,0 +1,167 @@ +package messageCMS + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + errors "Open_IM/pkg/common/http" + "context" + + "Open_IM/pkg/common/log" + + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbMessageCMS "Open_IM/pkg/proto/message_cms" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + + "Open_IM/pkg/utils" + + "net" + "strconv" + "strings" + + "google.golang.org/grpc" +) + +type messageCMSServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewMessageCMSServer(port int) *messageCMSServer { + log.NewPrivateLog(constant.LogFileName) + return &messageCMSServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImMessageCMSName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *messageCMSServer) Run() { + log.NewInfo("0", "messageCMS rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbMessageCMS.RegisterMessageCMSServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "message cms rpc success") +} + +func (s *messageCMSServer) BoradcastMessage(_ context.Context, req *pbMessageCMS.BoradcastMessageReq) (*pbMessageCMS.BoradcastMessageResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "BoradcastMessage", req.String()) + resp := &pbMessageCMS.BoradcastMessageResp{} + return resp, errors.WrapError(constant.ErrDB) +} + +func (s *messageCMSServer) GetChatLogs(_ context.Context, req *pbMessageCMS.GetChatLogsReq) (*pbMessageCMS.GetChatLogsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetChatLogs", req.String()) + resp := &pbMessageCMS.GetChatLogsResp{} + time, err := utils.TimeStringToTime(req.Date) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "time string parse error", err.Error()) + } + chatLog := db.ChatLog{ + Content: req.Content, + SendTime: time, + ContentType: req.ContentType, + SessionType: req.SessionType, + } + switch chatLog.SessionType { + case constant.SingleChatType: + chatLog.SendID = req.UserId + case constant.GroupChatType: + chatLog.RecvID = req.GroupId + chatLog.SendID = req.UserId + } + nums, err := imdb.GetChatLogCount(chatLog) + resp.ChatLogsNum = int32(nums) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLogCount", err.Error()) + } + chatLogs, err := imdb.GetChatLog(chatLog, req.Pagination.PageNumber, req.Pagination.ShowNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLog", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, chatLog := range chatLogs { + pbChatLog := &pbMessageCMS.ChatLogs{ + SessionType: chatLog.SessionType, + ContentType: chatLog.ContentType, + SearchContent: req.Content, + WholeContent: chatLog.Content, + Date: chatLog.CreateTime.String(), + SenderNickName: chatLog.SenderNickname, + SenderId: chatLog.SendID, + } + if chatLog.SenderNickname == "" { + sendUser, err := imdb.GetUserByUserID(chatLog.SendID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByUserID failed", err.Error()) + continue + } + pbChatLog.SenderNickName = sendUser.Nickname + } + switch chatLog.SessionType { + case constant.SingleChatType: + recvUser, err := imdb.GetUserByUserID(chatLog.RecvID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByUserID failed", err.Error()) + continue + } + pbChatLog.ReciverId = recvUser.UserID + pbChatLog.ReciverNickName = recvUser.Nickname + + case constant.GroupChatType: + group, err := imdb.GetGroupById(chatLog.RecvID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupById failed") + continue + } + pbChatLog.GroupId = group.GroupID + pbChatLog.GroupName = group.GroupName + } + resp.ChatLogs = append(resp.ChatLogs, pbChatLog) + } + resp.Pagination = &open_im_sdk.ResponsePagination{ + CurrentPage: req.Pagination.PageNumber, + ShowNumber: req.Pagination.ShowNumber, + } + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp output: ", resp.String()) + return resp, nil +} + +func (s *messageCMSServer) MassSendMessage(_ context.Context, req *pbMessageCMS.MassSendMessageReq) (*pbMessageCMS.MassSendMessageResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "MassSendMessage", req.String()) + resp := &pbMessageCMS.MassSendMessageResp{} + return resp, nil +} + +func (s *messageCMSServer) WithdrawMessage(_ context.Context, req *pbMessageCMS.WithdrawMessageReq) (*pbMessageCMS.WithdrawMessageResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "WithdrawMessage", req.String()) + resp := &pbMessageCMS.WithdrawMessageResp{} + return resp, nil +} diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go new file mode 100644 index 000000000..bb8ccd700 --- /dev/null +++ b/internal/rpc/msg/callback.go @@ -0,0 +1,159 @@ +package msg + +import ( + cbApi "Open_IM/pkg/call_back_struct" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/http" + "Open_IM/pkg/common/log" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" +) + +func copyCallbackCommonReqStruct(msg *pbChat.SendMsgReq) cbApi.CommonCallbackReq { + return cbApi.CommonCallbackReq{ + SendID: msg.MsgData.SendID, + ServerMsgID: msg.MsgData.ServerMsgID, + ClientMsgID: msg.MsgData.ClientMsgID, + OperationID: msg.OperationID, + SenderPlatformID: msg.MsgData.SenderPlatformID, + SenderNickname: msg.MsgData.SenderNickname, + SessionType: msg.MsgData.SessionType, + MsgFrom: msg.MsgData.MsgFrom, + ContentType: msg.MsgData.ContentType, + Status: msg.MsgData.Status, + CreateTime: msg.MsgData.CreateTime, + Content: string(msg.MsgData.Content), + } +} + +func callbackBeforeSendSingleMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) { + if !config.Config.Callback.CallbackBeforeSendSingleMsg.Enable { + return true, nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackBeforeSendSingleMsgCommand + req := cbApi.CallbackBeforeSendSingleMsgReq{ + CommonCallbackReq: commonCallbackReq, + RecvID: msg.MsgData.RecvID, + } + resp := &cbApi.CallbackBeforeSendSingleMsgResp{ + CommonCallbackResp: cbApi.CommonCallbackResp{}, + } + //utils.CopyStructFields(req, msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackTimeOut); err != nil { + if !config.Config.Callback.CallbackBeforeSendSingleMsg.CallbackFailedContinue { + return false, err + } else { + return true, err + } + } else { + if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { + return false, nil + } + } + return true, err +} + +func callbackAfterSendSingleMsg(msg *pbChat.SendMsgReq) error { + if !config.Config.Callback.CallbackAfterSendSingleMsg.Enable { + return nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackAfterSendSingleMsgCommand + req := cbApi.CallbackAfterSendSingleMsgReq{ + CommonCallbackReq: commonCallbackReq, + RecvID: msg.MsgData.RecvID, + } + resp := &cbApi.CallbackAfterSendSingleMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} + //utils.CopyStructFields(req, msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackAfterSendSingleMsg.CallbackTimeOut); err != nil { + return err + } + return nil +} + +func callbackBeforeSendGroupMsg(msg *pbChat.SendMsgReq) (canSend bool, err error) { + if !config.Config.Callback.CallbackBeforeSendGroupMsg.Enable { + return true, nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackBeforeSendGroupMsgCommand + req := cbApi.CallbackAfterSendGroupMsgReq{ + CommonCallbackReq: commonCallbackReq, + GroupID: msg.MsgData.GroupID, + } + resp := &cbApi.CallbackBeforeSendGroupMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} + //utils.CopyStructFields(req, msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackTimeOut); err != nil { + if !config.Config.Callback.CallbackBeforeSendGroupMsg.CallbackFailedContinue { + return false, err + } else { + return true, err + } + } else { + if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { + return false, nil + } + } + return true, err +} + +func callbackAfterSendGroupMsg(msg *pbChat.SendMsgReq) error { + if !config.Config.Callback.CallbackAfterSendGroupMsg.Enable { + return nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackAfterSendGroupMsgCommand + req := cbApi.CallbackAfterSendGroupMsgReq{ + CommonCallbackReq: commonCallbackReq, + GroupID: msg.MsgData.GroupID, + } + resp := &cbApi.CallbackAfterSendGroupMsgResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} + + //utils.CopyStructFields(req, msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackAfterSendGroupMsg.CallbackTimeOut); err != nil { + return err + } + return nil +} + +func callbackWordFilter(msg *pbChat.SendMsgReq) (canSend bool, err error) { + if !config.Config.Callback.CallbackWordFilter.Enable || msg.MsgData.ContentType != constant.Text { + return true, nil + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), msg) + commonCallbackReq := copyCallbackCommonReqStruct(msg) + commonCallbackReq.CallbackCommand = constant.CallbackWordFilterCommand + req := cbApi.CallbackWordFilterReq{ + CommonCallbackReq: commonCallbackReq, + } + resp := &cbApi.CallbackWordFilterResp{CommonCallbackResp: cbApi.CommonCallbackResp{}} + //utils.CopyStructFields(&req., msg.MsgData) + defer log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), req, *resp) + if err := http.PostReturn(config.Config.Callback.CallbackUrl, req, resp, config.Config.Callback.CallbackWordFilter.CallbackTimeOut); err != nil { + if !config.Config.Callback.CallbackWordFilter.CallbackFailedContinue { + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), "callback failed and config disable, stop this operation") + return false, err + } else { + return true, err + } + } else { + if resp.ActionCode == constant.ActionForbidden && resp.ErrCode == constant.CallbackHandleSuccess { + return false, nil + } + if resp.ErrCode == constant.CallbackHandleSuccess { + msg.MsgData.Content = []byte(resp.Content) + } + log.NewDebug(msg.OperationID, utils.GetSelfFuncName(), string(msg.MsgData.Content)) + } + return true, err +} diff --git a/internal/rpc/msg/conversation_notification.go b/internal/rpc/msg/conversation_notification.go new file mode 100644 index 000000000..5c39ea06a --- /dev/null +++ b/internal/rpc/msg/conversation_notification.go @@ -0,0 +1,76 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" +) + +func SetConversationNotification(operationID, sendID, recvID string, contentType int, m proto.Message, tips open_im_sdk.TipsComm) { + log.NewInfo(operationID, "args: ", sendID, recvID, contentType, m.String(), tips.String()) + var err error + tips.Detail, err = proto.Marshal(m) + if err != nil { + log.NewError(operationID, "Marshal failed ", err.Error(), m.String()) + return + } + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + tips.JsonDetail, _ = marshaler.MarshalToString(m) + var n NotificationMsg + n.SendID = sendID + n.RecvID = recvID + n.ContentType = int32(contentType) + n.SessionType = constant.SingleChatType + n.MsgFrom = constant.SysMsgType + n.OperationID = operationID + n.Content, err = proto.Marshal(&tips) + if err != nil { + log.Error(operationID, utils.GetSelfFuncName(), "Marshal failed ", err.Error(), tips.String()) + return + } + Notification(&n) +} + +// SetPrivate调用 +func ConversationSetPrivateNotification(operationID, sendID, recvID string, isPrivateChat bool) { + log.NewInfo(operationID, utils.GetSelfFuncName()) + conversationSetPrivateTips := &open_im_sdk.ConversationSetPrivateTips{ + RecvID: recvID, + SendID: sendID, + IsPrivate: isPrivateChat, + } + var tips open_im_sdk.TipsComm + var tipsMsg string + //var senderName string + //senderName, err := im_mysql_model.GetUserNameByUserID(sendID) + //if err != nil { + // log.NewError(operationID, utils.GetSelfFuncName(), err.Error()) + // senderName = sendID + //} + if isPrivateChat == true { + tipsMsg = config.Config.Notification.ConversationSetPrivate.DefaultTips.OpenTips + } else { + tipsMsg = config.Config.Notification.ConversationSetPrivate.DefaultTips.CloseTips + } + tips.DefaultTips = tipsMsg + SetConversationNotification(operationID, sendID, recvID, constant.ConversationPrivateChatNotification, conversationSetPrivateTips, tips) +} + +// 会话改变 +func ConversationChangeNotification(operationID, userID string) { + log.NewInfo(operationID, utils.GetSelfFuncName()) + ConversationChangedTips := &open_im_sdk.ConversationUpdateTips{ + UserID: userID, + } + var tips open_im_sdk.TipsComm + tips.DefaultTips = config.Config.Notification.ConversationOptUpdate.DefaultTips.Tips + SetConversationNotification(operationID, userID, userID, constant.ConversationOptChangeNotification, ConversationChangedTips, tips) +} diff --git a/internal/rpc/msg/del_msg.go b/internal/rpc/msg/del_msg.go new file mode 100644 index 000000000..daacb8533 --- /dev/null +++ b/internal/rpc/msg/del_msg.go @@ -0,0 +1,23 @@ +package msg + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + commonPb "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" +) + +func (rpc *rpcChat) DelMsgList(_ context.Context, req *commonPb.DelMsgListReq) (*commonPb.DelMsgListResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &commonPb.DelMsgListResp{} + if err := db.DB.DelMsgLogic(req.UserID, req.SeqList, req.OperationID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsg failed", err.Error()) + resp.ErrMsg = constant.ErrDB.ErrMsg + resp.ErrCode = constant.ErrDB.ErrCode + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} diff --git a/internal/rpc/msg/friend_notification.go b/internal/rpc/msg/friend_notification.go new file mode 100644 index 000000000..91d926bf9 --- /dev/null +++ b/internal/rpc/msg/friend_notification.go @@ -0,0 +1,165 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + utils2 "Open_IM/pkg/common/utils" + pbFriend "Open_IM/pkg/proto/friend" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" +) + +func getFromToUserNickname(fromUserID, toUserID string) (string, string, error) { + from, err := imdb.GetUserByUserID(fromUserID) + if err != nil { + return "", "", utils.Wrap(err, "") + } + to, err := imdb.GetUserByUserID(toUserID) + if err != nil { + return "", "", utils.Wrap(err, "") + } + return from.Nickname, to.Nickname, nil +} + +func friendNotification(commID *pbFriend.CommID, contentType int32, m proto.Message) { + log.Info(commID.OperationID, utils.GetSelfFuncName(), "args: ", commID, contentType) + var err error + var tips open_im_sdk.TipsComm + tips.Detail, err = proto.Marshal(m) + if err != nil { + log.Error(commID.OperationID, "Marshal failed ", err.Error(), m.String()) + return + } + + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + + tips.JsonDetail, _ = marshaler.MarshalToString(m) + + fromUserNickname, toUserNickname, err := getFromToUserNickname(commID.FromUserID, commID.ToUserID) + if err != nil { + log.Error(commID.OperationID, "getFromToUserNickname failed ", err.Error(), commID.FromUserID, commID.ToUserID) + return + } + cn := config.Config.Notification + switch contentType { + case constant.FriendApplicationNotification: + tips.DefaultTips = fromUserNickname + cn.FriendApplication.DefaultTips.Tips + case constant.FriendApplicationApprovedNotification: + tips.DefaultTips = fromUserNickname + cn.FriendApplicationApproved.DefaultTips.Tips + case constant.FriendApplicationRejectedNotification: + tips.DefaultTips = fromUserNickname + cn.FriendApplicationRejected.DefaultTips.Tips + case constant.FriendAddedNotification: + tips.DefaultTips = cn.FriendAdded.DefaultTips.Tips + case constant.FriendDeletedNotification: + tips.DefaultTips = cn.FriendDeleted.DefaultTips.Tips + toUserNickname + case constant.FriendRemarkSetNotification: + tips.DefaultTips = fromUserNickname + cn.FriendRemarkSet.DefaultTips.Tips + case constant.BlackAddedNotification: + tips.DefaultTips = cn.BlackAdded.DefaultTips.Tips + case constant.BlackDeletedNotification: + tips.DefaultTips = cn.BlackDeleted.DefaultTips.Tips + toUserNickname + case constant.UserInfoUpdatedNotification: + tips.DefaultTips = cn.UserInfoUpdated.DefaultTips.Tips + default: + log.Error(commID.OperationID, "contentType failed ", contentType) + return + } + + var n NotificationMsg + n.SendID = commID.FromUserID + n.RecvID = commID.ToUserID + n.ContentType = contentType + n.SessionType = constant.SingleChatType + n.MsgFrom = constant.SysMsgType + n.OperationID = commID.OperationID + n.Content, err = proto.Marshal(&tips) + if err != nil { + log.Error(commID.OperationID, "Marshal failed ", err.Error(), tips.String()) + return + } + Notification(&n) +} + +func FriendApplicationNotification(req *pbFriend.AddFriendReq) { + FriendApplicationTips := open_im_sdk.FriendApplicationTips{FromToUserID: &open_im_sdk.FromToUserID{}} + FriendApplicationTips.FromToUserID.FromUserID = req.CommID.FromUserID + FriendApplicationTips.FromToUserID.ToUserID = req.CommID.ToUserID + friendNotification(req.CommID, constant.FriendApplicationNotification, &FriendApplicationTips) +} + +func FriendApplicationApprovedNotification(req *pbFriend.AddFriendResponseReq) { + FriendApplicationApprovedTips := open_im_sdk.FriendApplicationApprovedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + FriendApplicationApprovedTips.FromToUserID.FromUserID = req.CommID.FromUserID + FriendApplicationApprovedTips.FromToUserID.ToUserID = req.CommID.ToUserID + FriendApplicationApprovedTips.HandleMsg = req.HandleMsg + friendNotification(req.CommID, constant.FriendApplicationApprovedNotification, &FriendApplicationApprovedTips) +} + +func FriendApplicationRejectedNotification(req *pbFriend.AddFriendResponseReq) { + FriendApplicationApprovedTips := open_im_sdk.FriendApplicationApprovedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + FriendApplicationApprovedTips.FromToUserID.FromUserID = req.CommID.FromUserID + FriendApplicationApprovedTips.FromToUserID.ToUserID = req.CommID.ToUserID + FriendApplicationApprovedTips.HandleMsg = req.HandleMsg + friendNotification(req.CommID, constant.FriendApplicationRejectedNotification, &FriendApplicationApprovedTips) +} + +func FriendAddedNotification(operationID, opUserID, fromUserID, toUserID string) { + friendAddedTips := open_im_sdk.FriendAddedTips{Friend: &open_im_sdk.FriendInfo{}, OpUser: &open_im_sdk.PublicUserInfo{}} + user, err := imdb.GetUserByUserID(opUserID) + if err != nil { + log.NewError(operationID, "GetUserByUserID failed ", err.Error(), opUserID) + return + } + utils2.UserDBCopyOpenIMPublicUser(friendAddedTips.OpUser, user) + friend, err := imdb.GetFriendRelationshipFromFriend(fromUserID, toUserID) + if err != nil { + log.NewError(operationID, "GetFriendRelationshipFromFriend failed ", err.Error(), fromUserID, toUserID) + return + } + utils2.FriendDBCopyOpenIM(friendAddedTips.Friend, friend) + commID := pbFriend.CommID{FromUserID: fromUserID, ToUserID: toUserID, OpUserID: opUserID, OperationID: operationID} + friendNotification(&commID, constant.FriendAddedNotification, &friendAddedTips) +} + +func FriendDeletedNotification(req *pbFriend.DeleteFriendReq) { + friendDeletedTips := open_im_sdk.FriendDeletedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + friendDeletedTips.FromToUserID.FromUserID = req.CommID.FromUserID + friendDeletedTips.FromToUserID.ToUserID = req.CommID.ToUserID + friendNotification(req.CommID, constant.FriendDeletedNotification, &friendDeletedTips) +} + +func FriendRemarkSetNotification(operationID, opUserID, fromUserID, toUserID string) { + friendInfoChangedTips := open_im_sdk.FriendInfoChangedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + friendInfoChangedTips.FromToUserID.FromUserID = fromUserID + friendInfoChangedTips.FromToUserID.ToUserID = toUserID + commID := pbFriend.CommID{FromUserID: fromUserID, ToUserID: toUserID, OpUserID: opUserID, OperationID: operationID} + friendNotification(&commID, constant.FriendRemarkSetNotification, &friendInfoChangedTips) +} + +func BlackAddedNotification(req *pbFriend.AddBlacklistReq) { + blackAddedTips := open_im_sdk.BlackAddedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + blackAddedTips.FromToUserID.FromUserID = req.CommID.FromUserID + blackAddedTips.FromToUserID.ToUserID = req.CommID.ToUserID + friendNotification(req.CommID, constant.BlackAddedNotification, &blackAddedTips) +} + +func BlackDeletedNotification(req *pbFriend.RemoveBlacklistReq) { + blackDeletedTips := open_im_sdk.BlackDeletedTips{FromToUserID: &open_im_sdk.FromToUserID{}} + blackDeletedTips.FromToUserID.FromUserID = req.CommID.FromUserID + blackDeletedTips.FromToUserID.ToUserID = req.CommID.ToUserID + friendNotification(req.CommID, constant.BlackDeletedNotification, &blackDeletedTips) +} + +func UserInfoUpdatedNotification(operationID, userID string, needNotifiedUserID string) { + selfInfoUpdatedTips := open_im_sdk.UserInfoUpdatedTips{UserID: userID} + commID := pbFriend.CommID{FromUserID: userID, ToUserID: needNotifiedUserID, OpUserID: userID, OperationID: operationID} + friendNotification(&commID, constant.UserInfoUpdatedNotification, &selfInfoUpdatedTips) +} diff --git a/internal/rpc/msg/group_notification.go b/internal/rpc/msg/group_notification.go new file mode 100644 index 000000000..56052573b --- /dev/null +++ b/internal/rpc/msg/group_notification.go @@ -0,0 +1,508 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + utils2 "Open_IM/pkg/common/utils" + pbGroup "Open_IM/pkg/proto/group" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" +) + +//message GroupCreatedTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo Creator = 2; +// repeated GroupMemberFullInfo MemberList = 3; +// uint64 OperationTime = 4; +//} creator->group + +func setOpUserInfo(opUserID, groupID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error { + if token_verify.IsManagerUserID(opUserID) { + u, err := imdb.GetUserByUserID(opUserID) + if err != nil { + return utils.Wrap(err, "GetUserByUserID failed") + } + utils.CopyStructFields(groupMemberInfo, u) + groupMemberInfo.GroupID = groupID + } else { + u, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, opUserID) + if err == nil { + if err = utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, u); err != nil { + return utils.Wrap(err, "") + } + } + + user, err := imdb.GetUserByUserID(opUserID) + if err != nil { + return utils.Wrap(err, "") + } + groupMemberInfo.GroupID = groupID + groupMemberInfo.UserID = user.UserID + groupMemberInfo.Nickname = user.Nickname + groupMemberInfo.AppMangerLevel = user.AppMangerLevel + groupMemberInfo.FaceURL = user.FaceURL + } + return nil +} + +func setGroupInfo(groupID string, groupInfo *open_im_sdk.GroupInfo) error { + group, err := imdb.GetGroupInfoByGroupID(groupID) + if err != nil { + return utils.Wrap(err, "GetGroupInfoByGroupID failed") + } + err = utils2.GroupDBCopyOpenIM(groupInfo, group) + if err != nil { + return utils.Wrap(err, "GetGroupMemberNumByGroupID failed") + } + return nil +} + +func setGroupMemberInfo(groupID, userID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error { + groupMember, err := imdb.GetGroupMemberInfoByGroupIDAndUserID(groupID, userID) + if err == nil { + return utils.Wrap(utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, groupMember), "") + } + + user, err := imdb.GetUserByUserID(userID) + if err != nil { + return utils.Wrap(err, "") + } + groupMemberInfo.GroupID = groupID + groupMemberInfo.UserID = user.UserID + groupMemberInfo.Nickname = user.Nickname + groupMemberInfo.AppMangerLevel = user.AppMangerLevel + groupMemberInfo.FaceURL = user.FaceURL + return nil +} + +func setGroupOwnerInfo(groupID string, groupMemberInfo *open_im_sdk.GroupMemberFullInfo) error { + groupMember, err := imdb.GetGroupOwnerInfoByGroupID(groupID) + if err != nil { + return utils.Wrap(err, "") + } + if err = utils2.GroupMemberDBCopyOpenIM(groupMemberInfo, groupMember); err != nil { + return utils.Wrap(err, "") + } + return nil +} + +func setPublicUserInfo(userID string, publicUserInfo *open_im_sdk.PublicUserInfo) error { + user, err := imdb.GetUserByUserID(userID) + if err != nil { + return utils.Wrap(err, "") + } + utils2.UserDBCopyOpenIMPublicUser(publicUserInfo, user) + return nil +} + +func groupNotification(contentType int32, m proto.Message, sendID, groupID, recvUserID, operationID string) { + log.Info(operationID, utils.GetSelfFuncName(), "args: ", contentType) + + var err error + var tips open_im_sdk.TipsComm + tips.Detail, err = proto.Marshal(m) + if err != nil { + log.Error(operationID, "Marshal failed ", err.Error(), m.String()) + return + } + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + + tips.JsonDetail, _ = marshaler.MarshalToString(m) + + from, err := imdb.GetUserByUserID(sendID) + if err != nil { + log.Error(operationID, "GetUserByUserID failed ", err.Error(), sendID) + } + nickname := "" + if from != nil { + nickname = from.Nickname + } + + to, err := imdb.GetUserByUserID(recvUserID) + if err != nil { + log.Error(operationID, "GetUserByUserID failed ", err.Error(), recvUserID) + } + toNickname := "" + if to != nil { + toNickname = to.Nickname + } + + cn := config.Config.Notification + switch contentType { + case constant.GroupCreatedNotification: + tips.DefaultTips = nickname + " " + cn.GroupCreated.DefaultTips.Tips + case constant.GroupInfoSetNotification: + tips.DefaultTips = nickname + " " + cn.GroupInfoSet.DefaultTips.Tips + case constant.JoinGroupApplicationNotification: + tips.DefaultTips = nickname + " " + cn.JoinGroupApplication.DefaultTips.Tips + case constant.MemberQuitNotification: + tips.DefaultTips = nickname + " " + cn.MemberQuit.DefaultTips.Tips + case constant.GroupApplicationAcceptedNotification: // + tips.DefaultTips = toNickname + " " + cn.GroupApplicationAccepted.DefaultTips.Tips + case constant.GroupApplicationRejectedNotification: // + tips.DefaultTips = toNickname + " " + cn.GroupApplicationRejected.DefaultTips.Tips + case constant.GroupOwnerTransferredNotification: // + tips.DefaultTips = toNickname + " " + cn.GroupOwnerTransferred.DefaultTips.Tips + case constant.MemberKickedNotification: // + tips.DefaultTips = toNickname + " " + cn.MemberKicked.DefaultTips.Tips + case constant.MemberInvitedNotification: // + tips.DefaultTips = toNickname + " " + cn.MemberInvited.DefaultTips.Tips + case constant.MemberEnterNotification: + tips.DefaultTips = toNickname + " " + cn.MemberEnter.DefaultTips.Tips + case constant.GroupDismissedNotification: + tips.DefaultTips = toNickname + "" + cn.GroupDismissed.DefaultTips.Tips + case constant.GroupMutedNotification: + tips.DefaultTips = toNickname + "" + cn.GroupMuted.DefaultTips.Tips + case constant.GroupCancelMutedNotification: + tips.DefaultTips = toNickname + "" + cn.GroupCancelMuted.DefaultTips.Tips + case constant.GroupMemberMutedNotification: + tips.DefaultTips = toNickname + "" + cn.GroupMemberMuted.DefaultTips.Tips + case constant.GroupMemberCancelMutedNotification: + tips.DefaultTips = toNickname + "" + cn.GroupMemberCancelMuted.DefaultTips.Tips + default: + log.Error(operationID, "contentType failed ", contentType) + return + } + + var n NotificationMsg + n.SendID = sendID + if groupID != "" { + n.RecvID = groupID + n.SessionType = constant.GroupChatType + } else { + n.RecvID = recvUserID + n.SessionType = constant.SingleChatType + } + n.ContentType = contentType + n.OperationID = operationID + n.Content, err = proto.Marshal(&tips) + if err != nil { + log.Error(operationID, "Marshal failed ", err.Error(), tips.String()) + return + } + Notification(&n) +} + +//创建群后调用 +func GroupCreatedNotification(operationID, opUserID, groupID string, initMemberList []string) { + GroupCreatedTips := open_im_sdk.GroupCreatedTips{Group: &open_im_sdk.GroupInfo{}, + OpUser: &open_im_sdk.GroupMemberFullInfo{}, GroupOwnerUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setOpUserInfo(opUserID, groupID, GroupCreatedTips.OpUser); err != nil { + log.NewError(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID, GroupCreatedTips.OpUser) + return + } + err := setGroupInfo(groupID, GroupCreatedTips.Group) + if err != nil { + log.Error(operationID, "setGroupInfo failed ", groupID, GroupCreatedTips.Group) + return + } + imdb.GetGroupOwnerInfoByGroupID(groupID) + if err := setGroupOwnerInfo(groupID, GroupCreatedTips.GroupOwnerUser); err != nil { + log.Error(operationID, "setGroupOwnerInfo failed", err.Error(), groupID) + return + } + for _, v := range initMemberList { + var groupMemberInfo open_im_sdk.GroupMemberFullInfo + if err := setGroupMemberInfo(groupID, v, &groupMemberInfo); err != nil { + log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, v) + continue + } + GroupCreatedTips.MemberList = append(GroupCreatedTips.MemberList, &groupMemberInfo) + } + groupNotification(constant.GroupCreatedNotification, &GroupCreatedTips, opUserID, groupID, "", operationID) +} + +//群信息改变后掉用 +func GroupInfoSetNotification(operationID, opUserID, groupID string) { + GroupInfoChangedTips := open_im_sdk.GroupInfoSetTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, GroupInfoChangedTips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, GroupInfoChangedTips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + groupNotification(constant.GroupInfoSetNotification, &GroupInfoChangedTips, opUserID, groupID, "", operationID) +} + +func GroupMutedNotification(operationID, opUserID, groupID string) { + tips := open_im_sdk.GroupMutedTips{Group: &open_im_sdk.GroupInfo{}, + OpUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, tips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + groupNotification(constant.GroupMutedNotification, &tips, opUserID, groupID, "", operationID) +} + +func GroupCancelMutedNotification(operationID, opUserID, groupID string) { + tips := open_im_sdk.GroupCancelMutedTips{Group: &open_im_sdk.GroupInfo{}, + OpUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, tips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + groupNotification(constant.GroupCancelMutedNotification, &tips, opUserID, groupID, "", operationID) +} + +func GroupMemberMutedNotification(operationID, opUserID, groupID, groupMemberUserID string, mutedSeconds uint32) { + tips := open_im_sdk.GroupMemberMutedTips{Group: &open_im_sdk.GroupInfo{}, + OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &open_im_sdk.GroupMemberFullInfo{}} + tips.MutedSeconds = mutedSeconds + if err := setGroupInfo(groupID, tips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.MutedUser); err != nil { + log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID) + return + } + groupNotification(constant.GroupMemberMutedNotification, &tips, opUserID, groupID, "", operationID) +} + +func GroupMemberCancelMutedNotification(operationID, opUserID, groupID, groupMemberUserID string) { + tips := open_im_sdk.GroupMemberCancelMutedTips{Group: &open_im_sdk.GroupInfo{}, + OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, tips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.MutedUser); err != nil { + log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID) + return + } + groupNotification(constant.GroupMemberCancelMutedNotification, &tips, opUserID, groupID, "", operationID) +} + +//message ReceiveJoinApplicationTips{ +// GroupInfo Group = 1; +// PublicUserInfo Applicant = 2; +// string Reason = 3; +//} apply->all managers GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` +// ReqMessage string `protobuf:"bytes,2,opt,name=ReqMessage" json:"ReqMessage,omitempty"` +// OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` +// OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` +//申请进群后调用 +func JoinGroupApplicationNotification(req *pbGroup.JoinGroupReq) { + JoinGroupApplicationTips := open_im_sdk.JoinGroupApplicationTips{Group: &open_im_sdk.GroupInfo{}, Applicant: &open_im_sdk.PublicUserInfo{}} + err := setGroupInfo(req.GroupID, JoinGroupApplicationTips.Group) + if err != nil { + log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID) + return + } + if err = setPublicUserInfo(req.OpUserID, JoinGroupApplicationTips.Applicant); err != nil { + log.Error(req.OperationID, "setPublicUserInfo failed ", err.Error(), req.OpUserID) + return + } + JoinGroupApplicationTips.ReqMsg = req.ReqMessage + + managerList, err := imdb.GetOwnerManagerByGroupID(req.GroupID) + if err != nil { + log.NewError(req.OperationID, "GetOwnerManagerByGroupId failed ", err.Error(), req.GroupID) + return + } + for _, v := range managerList { + groupNotification(constant.JoinGroupApplicationNotification, &JoinGroupApplicationTips, req.OpUserID, "", v.UserID, req.OperationID) + log.NewInfo(req.OperationID, "Notification ", v) + } +} + +func MemberQuitNotification(req *pbGroup.QuitGroupReq) { + MemberQuitTips := open_im_sdk.MemberQuitTips{Group: &open_im_sdk.GroupInfo{}, QuitUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(req.GroupID, MemberQuitTips.Group); err != nil { + log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, MemberQuitTips.QuitUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed ", err.Error(), req.OpUserID, req.GroupID) + return + } + + groupNotification(constant.MemberQuitNotification, &MemberQuitTips, req.OpUserID, req.GroupID, "", req.OperationID) + // groupNotification(constant.MemberQuitNotification, &MemberQuitTips, req.OpUserID, "", req.OpUserID, req.OperationID) + +} + +//message ApplicationProcessedTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo OpUser = 2; +// int32 Result = 3; +// string Reason = 4; +//} +//处理进群请求后调用 +func GroupApplicationAcceptedNotification(req *pbGroup.GroupApplicationResponseReq) { + GroupApplicationAcceptedTips := open_im_sdk.GroupApplicationAcceptedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}, HandleMsg: req.HandledMsg} + if err := setGroupInfo(req.GroupID, GroupApplicationAcceptedTips.Group); err != nil { + log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID, GroupApplicationAcceptedTips.Group) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, GroupApplicationAcceptedTips.OpUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID, GroupApplicationAcceptedTips.OpUser) + return + } + groupNotification(constant.GroupApplicationAcceptedNotification, &GroupApplicationAcceptedTips, req.OpUserID, "", req.FromUserID, req.OperationID) +} + +func GroupApplicationRejectedNotification(req *pbGroup.GroupApplicationResponseReq) { + GroupApplicationRejectedTips := open_im_sdk.GroupApplicationRejectedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}, HandleMsg: req.HandledMsg} + if err := setGroupInfo(req.GroupID, GroupApplicationRejectedTips.Group); err != nil { + log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID, GroupApplicationRejectedTips.Group) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, GroupApplicationRejectedTips.OpUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID, GroupApplicationRejectedTips.OpUser) + return + } + groupNotification(constant.GroupApplicationRejectedNotification, &GroupApplicationRejectedTips, req.OpUserID, "", req.FromUserID, req.OperationID) +} + +func GroupOwnerTransferredNotification(req *pbGroup.TransferGroupOwnerReq) { + GroupOwnerTransferredTips := open_im_sdk.GroupOwnerTransferredTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}, NewGroupOwner: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(req.GroupID, GroupOwnerTransferredTips.Group); err != nil { + log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, GroupOwnerTransferredTips.OpUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID) + return + } + if err := setGroupMemberInfo(req.GroupID, req.NewOwnerUserID, GroupOwnerTransferredTips.NewGroupOwner); err != nil { + log.Error(req.OperationID, "setGroupMemberInfo failed", req.GroupID, req.NewOwnerUserID) + return + } + groupNotification(constant.GroupOwnerTransferredNotification, &GroupOwnerTransferredTips, req.OpUserID, req.GroupID, "", req.OperationID) +} + +func GroupDismissedNotification(req *pbGroup.DismissGroupReq) { + tips := open_im_sdk.GroupDismissedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(req.GroupID, tips.Group); err != nil { + log.NewError(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, tips.OpUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed", req.OpUserID, req.GroupID) + return + } + groupNotification(constant.GroupDismissedNotification, &tips, req.OpUserID, req.GroupID, "", req.OperationID) +} + +//message MemberKickedTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo OpUser = 2; +// GroupMemberFullInfo KickedUser = 3; +// uint64 OperationTime = 4; +//} +//被踢后调用 +func MemberKickedNotification(req *pbGroup.KickGroupMemberReq, kickedUserIDList []string) { + MemberKickedTips := open_im_sdk.MemberKickedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(req.GroupID, MemberKickedTips.Group); err != nil { + log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID) + return + } + if err := setOpUserInfo(req.OpUserID, req.GroupID, MemberKickedTips.OpUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed ", err.Error(), req.OpUserID) + return + } + for _, v := range kickedUserIDList { + var groupMemberInfo open_im_sdk.GroupMemberFullInfo + if err := setGroupMemberInfo(req.GroupID, v, &groupMemberInfo); err != nil { + log.Error(req.OperationID, "setGroupMemberInfo failed ", err.Error(), req.GroupID, v) + continue + } + MemberKickedTips.KickedUserList = append(MemberKickedTips.KickedUserList, &groupMemberInfo) + } + groupNotification(constant.MemberKickedNotification, &MemberKickedTips, req.OpUserID, req.GroupID, "", req.OperationID) + // + //for _, v := range kickedUserIDList { + // groupNotification(constant.MemberKickedNotification, &MemberKickedTips, req.OpUserID, "", v, req.OperationID) + //} +} + +//message MemberInvitedTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo OpUser = 2; +// GroupMemberFullInfo InvitedUser = 3; +// uint64 OperationTime = 4; +//} +//被邀请进群后调用 +func MemberInvitedNotification(operationID, groupID, opUserID, reason string, invitedUserIDList []string) { + MemberInvitedTips := open_im_sdk.MemberInvitedTips{Group: &open_im_sdk.GroupInfo{}, OpUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(groupID, MemberInvitedTips.Group); err != nil { + log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID) + return + } + if err := setOpUserInfo(opUserID, groupID, MemberInvitedTips.OpUser); err != nil { + log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID) + return + } + for _, v := range invitedUserIDList { + var groupMemberInfo open_im_sdk.GroupMemberFullInfo + if err := setGroupMemberInfo(groupID, v, &groupMemberInfo); err != nil { + log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID) + continue + } + MemberInvitedTips.InvitedUserList = append(MemberInvitedTips.InvitedUserList, &groupMemberInfo) + } + + groupNotification(constant.MemberInvitedNotification, &MemberInvitedTips, opUserID, groupID, "", operationID) +} + +//message GroupInfoChangedTips{ +// int32 ChangedType = 1; //bitwise operators: 1:groupName; 10:Notification 100:Introduction; 1000:FaceUrl +// GroupInfo Group = 2; +// GroupMemberFullInfo OpUser = 3; +//} + +//message MemberLeaveTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo LeaverUser = 2; +// uint64 OperationTime = 3; +//} + +//群成员退群后调用 + +//message MemberEnterTips{ +// GroupInfo Group = 1; +// GroupMemberFullInfo EntrantUser = 2; +// uint64 OperationTime = 3; +//} +//群成员主动申请进群,管理员同意后调用, +func MemberEnterNotification(req *pbGroup.GroupApplicationResponseReq) { + MemberEnterTips := open_im_sdk.MemberEnterTips{Group: &open_im_sdk.GroupInfo{}, EntrantUser: &open_im_sdk.GroupMemberFullInfo{}} + if err := setGroupInfo(req.GroupID, MemberEnterTips.Group); err != nil { + log.Error(req.OperationID, "setGroupInfo failed ", err.Error(), req.GroupID, MemberEnterTips.Group) + return + } + if err := setGroupMemberInfo(req.GroupID, req.FromUserID, MemberEnterTips.EntrantUser); err != nil { + log.Error(req.OperationID, "setOpUserInfo failed ", err.Error(), req.OpUserID, req.GroupID, MemberEnterTips.EntrantUser) + return + } + groupNotification(constant.MemberEnterNotification, &MemberEnterTips, req.OpUserID, req.GroupID, "", req.OperationID) + +} diff --git a/internal/rpc/msg/pull_message.go b/internal/rpc/msg/pull_message.go new file mode 100644 index 000000000..10a0978aa --- /dev/null +++ b/internal/rpc/msg/pull_message.go @@ -0,0 +1,74 @@ +package msg + +import ( + "context" + "github.com/garyburd/redigo/redis" + + commonDB "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" +) + +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) + maxSeq, err1 := commonDB.DB.GetUserMaxSeq(in.UserID) + minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID) + resp := new(pbMsg.GetMaxAndMinSeqResp) + if err1 == nil { + resp.MaxSeq = uint32(maxSeq) + } else if err1 == redis.ErrNil { + resp.MaxSeq = 0 + } else { + log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err1.Error()) + resp.ErrCode = 200 + resp.ErrMsg = "redis get err" + } + if err2 == nil { + resp.MinSeq = uint32(minSeq) + } else if err2 == redis.ErrNil { + resp.MinSeq = 0 + } else { + log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err2.Error()) + resp.ErrCode = 201 + resp.ErrMsg = "redis get err" + } + return resp, nil +} +func (rpc *rpcChat) PullMessageBySeqList(_ context.Context, in *open_im_sdk.PullMessageBySeqListReq) (*open_im_sdk.PullMessageBySeqListResp, error) { + log.NewInfo(in.OperationID, "rpc PullMessageBySeqList is arriving", in.String()) + resp := new(open_im_sdk.PullMessageBySeqListResp) + //msgList, err := commonDB.DB.GetMsgBySeqList(in.UserID, in.SeqList, in.OperationID) + msgList, err := commonDB.DB.GetMsgBySeqListMongo2(in.UserID, in.SeqList, in.OperationID) + if err != nil { + log.ErrorByKv("PullMessageBySeqList data error", in.OperationID, in.String()) + resp.ErrCode = 201 + resp.ErrMsg = err.Error() + return resp, nil + } + //respSingleMsgFormat = singleMsgHandleByUser(SingleMsgFormat, in.UserID) + //respGroupMsgFormat = groupMsgHandleByUser(GroupMsgFormat) + resp.ErrCode = 0 + resp.ErrMsg = "" + resp.List = msgList + return resp, nil + +} + +type MsgFormats []*open_im_sdk.MsgData + +// Implement the sort.Interface interface to get the number of elements method +func (s MsgFormats) Len() int { + return len(s) +} + +//Implement the sort.Interface interface comparison element method +func (s MsgFormats) Less(i, j int) bool { + return s[i].SendTime < s[j].SendTime +} + +//Implement the sort.Interface interface exchange element method +func (s MsgFormats) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} diff --git a/internal/rpc/msg/rpcChat.go b/internal/rpc/msg/rpcChat.go new file mode 100644 index 000000000..82c4ad37b --- /dev/null +++ b/internal/rpc/msg/rpcChat.go @@ -0,0 +1,67 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/kafka" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + "Open_IM/pkg/utils" + "google.golang.org/grpc" + "net" + "strconv" + "strings" +) + +type rpcChat struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string + producer *kafka.Producer +} + +func NewRpcChatServer(port int) *rpcChat { + log.NewPrivateLog(constant.LogFileName) + rc := rpcChat{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImOfflineMessageName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } + rc.producer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic) + return &rc +} + +func (rpc *rpcChat) Run() { + log.Info("", "", "rpc get_token init...") + + address := utils.ServerIP + ":" + strconv.Itoa(rpc.rpcPort) + listener, err := net.Listen("tcp", address) + if err != nil { + log.Error("", "", "listen network failed, err = %s, address = %s", err.Error(), address) + return + } + log.Info("", "", "listen network success, address = ", address) + + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + + //service registers with etcd + + pbChat.RegisterChatServer(srv, rpc) + err = getcdv3.RegisterEtcd(rpc.etcdSchema, strings.Join(rpc.etcdAddr, ","), utils.ServerIP, rpc.rpcPort, rpc.rpcRegisterName, 10) + if err != nil { + log.Error("", "", "register rpc get_token to etcd failed, err = %s", err.Error()) + return + } + + err = srv.Serve(listener) + if err != nil { + log.Info("", "", "rpc get_token fail, err = %s", err.Error()) + return + } + log.Info("", "", "rpc get_token init success") +} diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go new file mode 100644 index 000000000..c84549f6c --- /dev/null +++ b/internal/rpc/msg/send_msg.go @@ -0,0 +1,593 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + rpc "Open_IM/pkg/proto/friend" + pbGroup "Open_IM/pkg/proto/group" + sdk_ws "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/garyburd/redigo/redis" + "github.com/golang/protobuf/proto" + "math/rand" + "strconv" + "strings" + "time" +) + +type MsgCallBackReq struct { + SendID string `json:"sendID"` + RecvID string `json:"recvID"` + Content string `json:"content"` + SendTime int64 `json:"sendTime"` + MsgFrom int32 `json:"msgFrom"` + ContentType int32 `json:"contentType"` + SessionType int32 `json:"sessionType"` + PlatformID int32 `json:"senderPlatformID"` + MsgID string `json:"msgID"` + IsOnlineOnly bool `json:"isOnlineOnly"` +} +type MsgCallBackResp struct { + ErrCode int32 `json:"errCode"` + ErrMsg string `json:"errMsg"` + ResponseErrCode int32 `json:"responseErrCode"` + ResponseResult struct { + ModifiedMsg string `json:"modifiedMsg"` + Ext string `json:"ext"` + } +} + +func userRelationshipVerification(data *pbChat.SendMsgReq) (bool, int32, string) { + if data.MsgData.SessionType == constant.GroupChatType { + return true, 0, "" + } + log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) + req := &rpc.IsInBlackListReq{CommID: &rpc.CommID{}} + req.CommID.OperationID = data.OperationID + req.CommID.OpUserID = data.MsgData.RecvID + req.CommID.FromUserID = data.MsgData.RecvID + req.CommID.ToUserID = data.MsgData.SendID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := rpc.NewFriendClient(etcdConn) + reply, err := client.IsInBlackList(context.Background(), req) + if err != nil { + log.NewDebug(data.OperationID, "IsInBlackListReq rpc failed, ", req.String(), err.Error()) + } else if reply.Response == true { + log.NewDebug(data.OperationID, "IsInBlackListReq ", req.String()) + return false, 600, "in black list" + } + log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify) + if config.Config.MessageVerify.FriendVerify { + friendReq := &rpc.IsFriendReq{CommID: &rpc.CommID{}} + friendReq.CommID.OperationID = data.OperationID + friendReq.CommID.OpUserID = data.MsgData.RecvID + friendReq.CommID.FromUserID = data.MsgData.RecvID + friendReq.CommID.ToUserID = data.MsgData.SendID + friendReply, err := client.IsFriend(context.Background(), friendReq) + if err != nil { + log.NewDebug(data.OperationID, "IsFriendReq rpc failed, ", req.String(), err.Error()) + return true, 0, "" + } else if friendReply.Response == false { + log.NewDebug(data.OperationID, "not friend ", req.String()) + return friendReply.Response, 601, "not friend" + } + log.NewDebug(data.OperationID, config.Config.MessageVerify.FriendVerify, friendReply.Response) + return true, 0, "" + } else { + return true, 0, "" + } +} +func (rpc *rpcChat) encapsulateMsgData(msg *sdk_ws.MsgData) { + msg.ServerMsgID = GetMsgID(msg.SendID) + msg.SendTime = utils.GetCurrentTimestampByMill() + switch msg.ContentType { + case constant.Text: + fallthrough + case constant.Picture: + fallthrough + case constant.Voice: + fallthrough + case constant.Video: + fallthrough + case constant.File: + fallthrough + case constant.AtText: + fallthrough + case constant.Merger: + fallthrough + case constant.Card: + fallthrough + case constant.Location: + fallthrough + case constant.Custom: + fallthrough + case constant.Quote: + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, true) + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, true) + utils.SetSwitchFromOptions(msg.Options, constant.IsSenderSync, true) + case constant.Revoke: + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false) + case constant.HasReadReceipt: + log.Info("", "this is a test start", msg, msg.Options) + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false) + log.Info("", "this is a test end", msg, msg.Options) + case constant.Typing: + utils.SetSwitchFromOptions(msg.Options, constant.IsHistory, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsPersistent, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsSenderSync, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, false) + + } +} +func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.SendMsgResp, error) { + replay := pbChat.SendMsgResp{} + log.NewDebug(pb.OperationID, "rpc sendMsg come here", pb.String()) + flag, errCode, errMsg := userRelationshipVerification(pb) + if !flag { + return returnMsg(&replay, pb, errCode, errMsg, "", 0) + } + //if !utils.VerifyToken(pb.Token, pb.SendID) { + // return returnMsg(&replay, pb, http.StatusUnauthorized, "token validate err,not authorized", "", 0) + rpc.encapsulateMsgData(pb.MsgData) + log.Info("", "this is a test MsgData ", pb.MsgData) + msgToMQ := pbChat.MsgDataToMQ{Token: pb.Token, OperationID: pb.OperationID, MsgData: pb.MsgData} + //options := utils.JsonStringToMap(pbData.Options) + isHistory := utils.GetSwitchFromOptions(pb.MsgData.Options, constant.IsHistory) + mReq := MsgCallBackReq{ + SendID: pb.MsgData.SendID, + RecvID: pb.MsgData.RecvID, + Content: string(pb.MsgData.Content), + SendTime: pb.MsgData.SendTime, + MsgFrom: pb.MsgData.MsgFrom, + ContentType: pb.MsgData.ContentType, + SessionType: pb.MsgData.SessionType, + PlatformID: pb.MsgData.SenderPlatformID, + MsgID: pb.MsgData.ClientMsgID, + } + if !isHistory { + mReq.IsOnlineOnly = true + } + + // callback + canSend, err := callbackWordFilter(pb) + if err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter failed", err.Error(), pb.MsgData) + } + if !canSend { + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackWordFilter result", canSend, "end rpc and return", pb.MsgData) + return returnMsg(&replay, pb, 201, "callbackWordFilter result stop rpc and return", "", 0) + } + switch pb.MsgData.SessionType { + case constant.SingleChatType: + // callback + canSend, err := callbackBeforeSendSingleMsg(pb) + if err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg failed", err.Error()) + } + if !canSend { + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendSingleMsg result", canSend, "end rpc and return") + return returnMsg(&replay, pb, 201, "callbackBeforeSendSingleMsg result stop rpc and return", "", 0) + } + isSend := modifyMessageByUserMessageReceiveOpt(pb.MsgData.RecvID, pb.MsgData.SendID, constant.SingleChatType, pb) + if isSend { + msgToMQ.MsgData = pb.MsgData + log.NewInfo(msgToMQ.OperationID, msgToMQ) + err1 := rpc.sendMsgToKafka(&msgToMQ, msgToMQ.MsgData.RecvID) + if err1 != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:RecvID", msgToMQ.MsgData.RecvID, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + if msgToMQ.MsgData.SendID != msgToMQ.MsgData.RecvID { //Filter messages sent to yourself + err2 := rpc.sendMsgToKafka(&msgToMQ, msgToMQ.MsgData.SendID) + if err2 != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:SendID", msgToMQ.MsgData.SendID, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + // callback + if err := callbackAfterSendSingleMsg(pb); err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendSingleMsg failed", err.Error()) + } + return returnMsg(&replay, pb, 0, "", msgToMQ.MsgData.ServerMsgID, msgToMQ.MsgData.SendTime) + case constant.GroupChatType: + // callback + canSend, err := callbackBeforeSendGroupMsg(pb) + if err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg failed", err.Error()) + } + if !canSend { + log.NewDebug(pb.OperationID, utils.GetSelfFuncName(), "callbackBeforeSendGroupMsg result", canSend, "end rpc and return") + return returnMsg(&replay, pb, 201, "callbackBeforeSendGroupMsg result stop rpc and return", "", 0) + } + 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: pb.MsgData.GroupID, + OperationID: pb.OperationID, + } + reply, err := client.GetGroupAllMember(context.Background(), req) + if err != nil { + log.Error(pb.Token, pb.OperationID, "rpc send_msg getGroupInfo failed, err = %s", err.Error()) + return returnMsg(&replay, pb, 201, err.Error(), "", 0) + } + if reply.ErrCode != 0 { + log.Error(pb.Token, pb.OperationID, "rpc send_msg getGroupInfo failed, err = %s", reply.ErrMsg) + return returnMsg(&replay, pb, reply.ErrCode, reply.ErrMsg, "", 0) + } + var addUidList []string + switch pb.MsgData.ContentType { + case constant.MemberKickedNotification: + var tips sdk_ws.TipsComm + var memberKickedTips sdk_ws.MemberKickedTips + err := proto.Unmarshal(pb.MsgData.Content, &tips) + if err != nil { + log.Error(pb.OperationID, "Unmarshal err", err.Error()) + } + err = proto.Unmarshal(tips.Detail, &memberKickedTips) + if err != nil { + log.Error(pb.OperationID, "Unmarshal err", err.Error()) + } + log.Info(pb.OperationID, "data is ", memberKickedTips) + for _, v := range memberKickedTips.KickedUserList { + addUidList = append(addUidList, v.UserID) + } + case constant.MemberQuitNotification: + addUidList = append(addUidList, pb.MsgData.SendID) + default: + } + groupID := pb.MsgData.GroupID + for _, v := range reply.MemberList { + pb.MsgData.RecvID = v.UserID + isSend := modifyMessageByUserMessageReceiveOpt(v.UserID, groupID, constant.GroupChatType, pb) + if isSend { + msgToMQ.MsgData = pb.MsgData + err := rpc.sendMsgToKafka(&msgToMQ, v.UserID) + if err != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:UserId", v.UserID, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + + } + log.Info(msgToMQ.OperationID, "addUidList", addUidList) + for _, v := range addUidList { + pb.MsgData.RecvID = v + isSend := modifyMessageByUserMessageReceiveOpt(v, groupID, constant.GroupChatType, pb) + log.Info(msgToMQ.OperationID, "isSend", isSend) + if isSend { + msgToMQ.MsgData = pb.MsgData + err := rpc.sendMsgToKafka(&msgToMQ, v) + if err != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:UserId", v, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + } + // callback + if err := callbackAfterSendGroupMsg(pb); err != nil { + log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendGroupMsg failed", err.Error()) + } + return returnMsg(&replay, pb, 0, "", msgToMQ.MsgData.ServerMsgID, msgToMQ.MsgData.SendTime) + case constant.NotificationChatType: + msgToMQ.MsgData = pb.MsgData + log.NewInfo(msgToMQ.OperationID, msgToMQ) + err1 := rpc.sendMsgToKafka(&msgToMQ, msgToMQ.MsgData.RecvID) + if err1 != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:RecvID", msgToMQ.MsgData.RecvID, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + + if msgToMQ.MsgData.SendID != msgToMQ.MsgData.RecvID { //Filter messages sent to yourself + err2 := rpc.sendMsgToKafka(&msgToMQ, msgToMQ.MsgData.SendID) + if err2 != nil { + log.NewError(msgToMQ.OperationID, "kafka send msg err:SendID", msgToMQ.MsgData.SendID, msgToMQ.String()) + return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0) + } + } + return returnMsg(&replay, pb, 0, "", msgToMQ.MsgData.ServerMsgID, msgToMQ.MsgData.SendTime) + default: + return returnMsg(&replay, pb, 203, "unkonwn sessionType", "", 0) + } +} + +func (rpc *rpcChat) sendMsgToKafka(m *pbChat.MsgDataToMQ, key string) error { + pid, offset, err := rpc.producer.SendMessage(m, key) + if err != nil { + log.ErrorByKv("kafka send failed", m.OperationID, "send data", m.String(), "pid", pid, "offset", offset, "err", err.Error(), "key", key) + } + return err +} +func GetMsgID(sendID string) string { + t := time.Now().Format("2006-01-02 15:04:05") + return utils.Md5(t + "-" + sendID + "-" + strconv.Itoa(rand.Int())) +} + +func returnMsg(replay *pbChat.SendMsgResp, pb *pbChat.SendMsgReq, errCode int32, errMsg, serverMsgID string, sendTime int64) (*pbChat.SendMsgResp, error) { + replay.ErrCode = errCode + replay.ErrMsg = errMsg + replay.ServerMsgID = serverMsgID + replay.ClientMsgID = pb.MsgData.ClientMsgID + replay.SendTime = sendTime + return replay, nil +} + +func modifyMessageByUserMessageReceiveOpt(userID, sourceID string, sessionType int, pb *pbChat.SendMsgReq) bool { + conversationID := utils.GetConversationIDBySessionType(sourceID, sessionType) + opt, err := db.DB.GetSingleConversationRecvMsgOpt(userID, conversationID) + if err != nil && err != redis.ErrNil { + log.NewError(pb.OperationID, "GetSingleConversationMsgOpt from redis err", conversationID, pb.String(), err.Error()) + return true + } + switch opt { + case constant.ReceiveMessage: + return true + case constant.NotReceiveMessage: + return false + case constant.ReceiveNotNotifyMessage: + if pb.MsgData.Options == nil { + pb.MsgData.Options = make(map[string]bool, 10) + } + utils.SetSwitchFromOptions(pb.MsgData.Options, constant.IsOfflinePush, false) + return true + } + + return true +} + +type NotificationMsg struct { + SendID string + RecvID string + Content []byte // open_im_sdk.TipsComm + MsgFrom int32 + ContentType int32 + SessionType int32 + OperationID string +} + +func Notification(n *NotificationMsg) { + var req pbChat.SendMsgReq + var msg sdk_ws.MsgData + var offlineInfo sdk_ws.OfflinePushInfo + var title, desc, ex string + var pushSwitch, unReadCount bool + var reliabilityLevel int + req.OperationID = n.OperationID + msg.SendID = n.SendID + msg.RecvID = n.RecvID + msg.Content = n.Content + msg.MsgFrom = n.MsgFrom + msg.ContentType = n.ContentType + msg.SessionType = n.SessionType + msg.CreateTime = utils.GetCurrentTimestampByMill() + msg.ClientMsgID = utils.GetMsgID(n.SendID) + msg.Options = make(map[string]bool, 7) + switch n.SessionType { + case constant.GroupChatType: + msg.RecvID = "" + msg.GroupID = n.RecvID + } + offlineInfo.IOSBadgeCount = config.Config.IOSPush.BadgeCount + offlineInfo.IOSPushSound = config.Config.IOSPush.PushSound + switch msg.ContentType { + case constant.GroupCreatedNotification: + pushSwitch = config.Config.Notification.GroupCreated.OfflinePush.PushSwitch + title = config.Config.Notification.GroupCreated.OfflinePush.Title + desc = config.Config.Notification.GroupCreated.OfflinePush.Desc + ex = config.Config.Notification.GroupCreated.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupCreated.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupCreated.Conversation.UnreadCount + case constant.GroupInfoSetNotification: + pushSwitch = config.Config.Notification.GroupInfoSet.OfflinePush.PushSwitch + title = config.Config.Notification.GroupInfoSet.OfflinePush.Title + desc = config.Config.Notification.GroupInfoSet.OfflinePush.Desc + ex = config.Config.Notification.GroupInfoSet.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupInfoSet.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupInfoSet.Conversation.UnreadCount + case constant.JoinGroupApplicationNotification: + pushSwitch = config.Config.Notification.JoinGroupApplication.OfflinePush.PushSwitch + title = config.Config.Notification.JoinGroupApplication.OfflinePush.Title + desc = config.Config.Notification.JoinGroupApplication.OfflinePush.Desc + ex = config.Config.Notification.JoinGroupApplication.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.JoinGroupApplication.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.JoinGroupApplication.Conversation.UnreadCount + case constant.MemberQuitNotification: + pushSwitch = config.Config.Notification.MemberQuit.OfflinePush.PushSwitch + title = config.Config.Notification.MemberQuit.OfflinePush.Title + desc = config.Config.Notification.MemberQuit.OfflinePush.Desc + ex = config.Config.Notification.MemberQuit.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.MemberQuit.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.MemberQuit.Conversation.UnreadCount + case constant.GroupApplicationAcceptedNotification: + pushSwitch = config.Config.Notification.GroupApplicationAccepted.OfflinePush.PushSwitch + title = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Title + desc = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Desc + ex = config.Config.Notification.GroupApplicationAccepted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupApplicationAccepted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupApplicationAccepted.Conversation.UnreadCount + case constant.GroupApplicationRejectedNotification: + pushSwitch = config.Config.Notification.GroupApplicationRejected.OfflinePush.PushSwitch + title = config.Config.Notification.GroupApplicationRejected.OfflinePush.Title + desc = config.Config.Notification.GroupApplicationRejected.OfflinePush.Desc + ex = config.Config.Notification.GroupApplicationRejected.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupApplicationRejected.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupApplicationRejected.Conversation.UnreadCount + case constant.GroupOwnerTransferredNotification: + pushSwitch = config.Config.Notification.GroupOwnerTransferred.OfflinePush.PushSwitch + title = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Title + desc = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Desc + ex = config.Config.Notification.GroupOwnerTransferred.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupOwnerTransferred.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupOwnerTransferred.Conversation.UnreadCount + case constant.MemberKickedNotification: + pushSwitch = config.Config.Notification.MemberKicked.OfflinePush.PushSwitch + title = config.Config.Notification.MemberKicked.OfflinePush.Title + desc = config.Config.Notification.MemberKicked.OfflinePush.Desc + ex = config.Config.Notification.MemberKicked.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.MemberKicked.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.MemberKicked.Conversation.UnreadCount + case constant.MemberInvitedNotification: + pushSwitch = config.Config.Notification.MemberInvited.OfflinePush.PushSwitch + title = config.Config.Notification.MemberInvited.OfflinePush.Title + desc = config.Config.Notification.MemberInvited.OfflinePush.Desc + ex = config.Config.Notification.MemberInvited.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.MemberInvited.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.MemberInvited.Conversation.UnreadCount + case constant.MemberEnterNotification: + pushSwitch = config.Config.Notification.MemberEnter.OfflinePush.PushSwitch + title = config.Config.Notification.MemberEnter.OfflinePush.Title + desc = config.Config.Notification.MemberEnter.OfflinePush.Desc + ex = config.Config.Notification.MemberEnter.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.MemberEnter.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.MemberEnter.Conversation.UnreadCount + case constant.UserInfoUpdatedNotification: + pushSwitch = config.Config.Notification.UserInfoUpdated.OfflinePush.PushSwitch + title = config.Config.Notification.UserInfoUpdated.OfflinePush.Title + desc = config.Config.Notification.UserInfoUpdated.OfflinePush.Desc + ex = config.Config.Notification.UserInfoUpdated.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.UserInfoUpdated.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.UserInfoUpdated.Conversation.UnreadCount + case constant.FriendApplicationNotification: + pushSwitch = config.Config.Notification.FriendApplication.OfflinePush.PushSwitch + title = config.Config.Notification.FriendApplication.OfflinePush.Title + desc = config.Config.Notification.FriendApplication.OfflinePush.Desc + ex = config.Config.Notification.FriendApplication.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendApplication.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendApplication.Conversation.UnreadCount + case constant.FriendApplicationApprovedNotification: + pushSwitch = config.Config.Notification.FriendApplicationApproved.OfflinePush.PushSwitch + title = config.Config.Notification.FriendApplicationApproved.OfflinePush.Title + desc = config.Config.Notification.FriendApplicationApproved.OfflinePush.Desc + ex = config.Config.Notification.FriendApplicationApproved.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendApplicationApproved.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendApplicationApproved.Conversation.UnreadCount + case constant.FriendApplicationRejectedNotification: + pushSwitch = config.Config.Notification.FriendApplicationRejected.OfflinePush.PushSwitch + title = config.Config.Notification.FriendApplicationRejected.OfflinePush.Title + desc = config.Config.Notification.FriendApplicationRejected.OfflinePush.Desc + ex = config.Config.Notification.FriendApplicationRejected.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendApplicationRejected.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendApplicationRejected.Conversation.UnreadCount + case constant.FriendAddedNotification: + pushSwitch = config.Config.Notification.FriendAdded.OfflinePush.PushSwitch + title = config.Config.Notification.FriendAdded.OfflinePush.Title + desc = config.Config.Notification.FriendAdded.OfflinePush.Desc + ex = config.Config.Notification.FriendAdded.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendAdded.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendAdded.Conversation.UnreadCount + case constant.FriendDeletedNotification: + pushSwitch = config.Config.Notification.FriendDeleted.OfflinePush.PushSwitch + title = config.Config.Notification.FriendDeleted.OfflinePush.Title + desc = config.Config.Notification.FriendDeleted.OfflinePush.Desc + ex = config.Config.Notification.FriendDeleted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendDeleted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendDeleted.Conversation.UnreadCount + case constant.FriendRemarkSetNotification: + pushSwitch = config.Config.Notification.FriendRemarkSet.OfflinePush.PushSwitch + title = config.Config.Notification.FriendRemarkSet.OfflinePush.Title + desc = config.Config.Notification.FriendRemarkSet.OfflinePush.Desc + ex = config.Config.Notification.FriendRemarkSet.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.FriendRemarkSet.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.FriendRemarkSet.Conversation.UnreadCount + case constant.BlackAddedNotification: + pushSwitch = config.Config.Notification.BlackAdded.OfflinePush.PushSwitch + title = config.Config.Notification.BlackAdded.OfflinePush.Title + desc = config.Config.Notification.BlackAdded.OfflinePush.Desc + ex = config.Config.Notification.BlackAdded.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.BlackAdded.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.BlackAdded.Conversation.UnreadCount + case constant.BlackDeletedNotification: + pushSwitch = config.Config.Notification.BlackDeleted.OfflinePush.PushSwitch + title = config.Config.Notification.BlackDeleted.OfflinePush.Title + desc = config.Config.Notification.BlackDeleted.OfflinePush.Desc + ex = config.Config.Notification.BlackDeleted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.BlackDeleted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.BlackDeleted.Conversation.UnreadCount + case constant.ConversationOptChangeNotification: + pushSwitch = config.Config.Notification.ConversationOptUpdate.OfflinePush.PushSwitch + title = config.Config.Notification.ConversationOptUpdate.OfflinePush.Title + desc = config.Config.Notification.ConversationOptUpdate.OfflinePush.Desc + ex = config.Config.Notification.ConversationOptUpdate.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.ConversationOptUpdate.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.ConversationOptUpdate.Conversation.UnreadCount + + case constant.GroupDismissedNotification: + pushSwitch = config.Config.Notification.GroupDismissed.OfflinePush.PushSwitch + title = config.Config.Notification.GroupDismissed.OfflinePush.Title + desc = config.Config.Notification.GroupDismissed.OfflinePush.Desc + ex = config.Config.Notification.GroupDismissed.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupDismissed.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupDismissed.Conversation.UnreadCount + + case constant.GroupMutedNotification: + pushSwitch = config.Config.Notification.GroupMuted.OfflinePush.PushSwitch + title = config.Config.Notification.GroupMuted.OfflinePush.Title + desc = config.Config.Notification.GroupMuted.OfflinePush.Desc + ex = config.Config.Notification.GroupMuted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupMuted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupMuted.Conversation.UnreadCount + + case constant.GroupCancelMutedNotification: + pushSwitch = config.Config.Notification.GroupCancelMuted.OfflinePush.PushSwitch + title = config.Config.Notification.GroupCancelMuted.OfflinePush.Title + desc = config.Config.Notification.GroupCancelMuted.OfflinePush.Desc + ex = config.Config.Notification.GroupCancelMuted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupCancelMuted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupCancelMuted.Conversation.UnreadCount + + case constant.GroupMemberMutedNotification: + pushSwitch = config.Config.Notification.GroupMemberMuted.OfflinePush.PushSwitch + title = config.Config.Notification.GroupMemberMuted.OfflinePush.Title + desc = config.Config.Notification.GroupMemberMuted.OfflinePush.Desc + ex = config.Config.Notification.GroupMemberMuted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupMemberMuted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupMemberMuted.Conversation.UnreadCount + + case constant.GroupMemberCancelMutedNotification: + pushSwitch = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.PushSwitch + title = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Title + desc = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Desc + ex = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Ext + reliabilityLevel = config.Config.Notification.GroupMemberCancelMuted.Conversation.ReliabilityLevel + unReadCount = config.Config.Notification.GroupMemberCancelMuted.Conversation.UnreadCount + } + switch reliabilityLevel { + case constant.UnreliableNotification: + utils.SetSwitchFromOptions(msg.Options, constant.IsHistory, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsPersistent, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, false) + case constant.ReliableNotificationNoMsg: + utils.SetSwitchFromOptions(msg.Options, constant.IsConversationUpdate, false) + utils.SetSwitchFromOptions(msg.Options, constant.IsSenderConversationUpdate, false) + case constant.ReliableNotificationMsg: + + } + utils.SetSwitchFromOptions(msg.Options, constant.IsUnreadCount, unReadCount) + utils.SetSwitchFromOptions(msg.Options, constant.IsOfflinePush, pushSwitch) + offlineInfo.Title = title + offlineInfo.Desc = desc + offlineInfo.Ex = ex + msg.OfflinePushInfo = &offlineInfo + req.MsgData = &msg + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + client := pbChat.NewChatClient(etcdConn) + reply, err := client.SendMsg(context.Background(), &req) + if err != nil { + log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), err.Error()) + } else if reply.ErrCode != 0 { + log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), reply.ErrCode, reply.ErrMsg) + } +} diff --git a/internal/rpc/msg/tag_send_msg.go b/internal/rpc/msg/tag_send_msg.go new file mode 100644 index 000000000..195640498 --- /dev/null +++ b/internal/rpc/msg/tag_send_msg.go @@ -0,0 +1,45 @@ +package msg + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbChat "Open_IM/pkg/proto/chat" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "strings" +) + +func TagSendMessage(operationID string, user *db.User, recvID, content string, senderPlatformID int32) { + log.NewInfo(operationID, utils.GetSelfFuncName(), "args: ", user.UserID, recvID, content) + var req pbChat.SendMsgReq + var msgData pbCommon.MsgData + msgData.SendID = user.UserID + msgData.RecvID = recvID + msgData.ContentType = constant.Custom + msgData.SessionType = constant.SingleChatType + msgData.MsgFrom = constant.UserMsgType + msgData.Content = []byte(content) + msgData.SenderFaceURL = user.FaceURL + msgData.SenderNickname = user.Nickname + msgData.Options = map[string]bool{} + msgData.Options[constant.IsSenderConversationUpdate] = false + msgData.CreateTime = utils.GetCurrentTimestampByMill() + msgData.ClientMsgID = utils.GetMsgID(user.UserID) + msgData.SenderPlatformID = senderPlatformID + req.MsgData = &msgData + req.OperationID = operationID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName) + client := pbChat.NewChatClient(etcdConn) + respPb, err := client.SendMsg(context.Background(), &req) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "send msg failed", err.Error()) + return + } + if respPb.ErrCode != 0 { + log.NewError(operationID, utils.GetSelfFuncName(), "send tag msg failed ", respPb) + } +} diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go new file mode 100644 index 000000000..53e58f223 --- /dev/null +++ b/internal/rpc/office/office.go @@ -0,0 +1,445 @@ +package office + +import ( + "Open_IM/internal/rpc/msg" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbOffice "Open_IM/pkg/proto/office" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "google.golang.org/grpc" + "net" + "strconv" + "strings" + "time" +) + +type officeServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewOfficeServer(port int) *officeServer { + log.NewPrivateLog(constant.LogFileName) + return &officeServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImOfficeName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *officeServer) Run() { + log.NewInfo("0", "officeServer rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbOffice.RegisterOfficeServiceServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "message cms rpc success") +} + +func (s *officeServer) GetUserTags(_ context.Context, req *pbOffice.GetUserTagsReq) (resp *pbOffice.GetUserTagsResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req ", req.String()) + resp = &pbOffice.GetUserTagsResp{ + CommonResp: &pbOffice.CommonResp{}, + Tags: []*pbOffice.Tag{}, + } + tags, err := db.DB.GetUserTags(req.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + return resp, nil + } + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "tags: ", tags) + for _, v := range tags { + tag := &pbOffice.Tag{ + TagID: v.TagID, + TagName: v.TagName, + } + for _, userID := range v.UserList { + UserName, err := im_mysql_model.GetUserNameByUserID(userID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID failed", err.Error()) + continue + } + tag.UserList = append(tag.UserList, &pbOffice.TagUser{ + UserID: userID, + UserName: UserName, + }) + } + resp.Tags = append(resp.Tags, tag) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp ", resp.String()) + return resp, nil +} + +func (s *officeServer) CreateTag(_ context.Context, req *pbOffice.CreateTagReq) (resp *pbOffice.CreateTagResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "CreateTag req", req.String()) + userIDList := utils.RemoveRepeatedStringInList(req.UserIDList) + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "userIDList: ", userIDList) + resp = &pbOffice.CreateTagResp{CommonResp: &pbOffice.CommonResp{}} + if err := db.DB.CreateTag(req.UserID, req.TagName, userIDList); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp", resp.String()) + return resp, nil +} + +func (s *officeServer) DeleteTag(_ context.Context, req *pbOffice.DeleteTagReq) (resp *pbOffice.DeleteTagResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.DeleteTagResp{CommonResp: &pbOffice.CommonResp{}} + if err := db.DB.DeleteTag(req.UserID, req.TagID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DeleteTag failed", err.Error()) + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) SetTag(_ context.Context, req *pbOffice.SetTagReq) (resp *pbOffice.SetTagResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.SetTagResp{CommonResp: &pbOffice.CommonResp{}} + IncreaseUserIDList := utils.RemoveRepeatedStringInList(req.IncreaseUserIDList) + reduceUserIDList := utils.RemoveRepeatedStringInList(req.ReduceUserIDList) + if err := db.DB.SetTag(req.UserID, req.TagID, req.NewName, IncreaseUserIDList, reduceUserIDList); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetTag failed", err.Error()) + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagReq) (resp *pbOffice.SendMsg2TagResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.SendMsg2TagResp{CommonResp: &pbOffice.CommonResp{}} + var tagUserIDList []string + for _, tagID := range req.TagList { + userIDList, err := db.DB.GetUserIDListByTagID(req.SendID, tagID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserIDListByTagID failed", err.Error()) + continue + } + tagUserIDList = append(tagUserIDList, userIDList...) + } + var groupUserIDList []string + for _, groupID := range req.GroupList { + userIDList, err := im_mysql_model.GetGroupMemberIDListByGroupID(groupID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMemberIDListByGroupID failed", err.Error()) + continue + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), userIDList) + groupUserIDList = append(groupUserIDList, userIDList...) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), groupUserIDList, req.GroupList) + var userIDList []string + userIDList = append(userIDList, tagUserIDList...) + userIDList = append(userIDList, groupUserIDList...) + userIDList = append(userIDList, req.UserList...) + userIDList = utils.RemoveRepeatedStringInList(userIDList) + for i, userID := range userIDList { + if userID == req.SendID || userID == "" { + userIDList = append(userIDList[:i], userIDList[i+1:]...) + } + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "total userIDList result: ", userIDList) + us, err := imdb.GetUserByUserID(req.SendID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), req.SendID) + } + for _, userID := range userIDList { + msg.TagSendMessage(req.OperationID, us, userID, req.Content, req.SenderPlatformID) + } + var tagSendLogs db.TagSendLog + for _, userID := range userIDList { + userName, err := im_mysql_model.GetUserNameByUserID(userID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID failed", err.Error()) + continue + } + tagSendLogs.UserList = append(tagSendLogs.UserList, db.TagUser{ + UserID: userID, + UserName: userName, + }) + } + tagSendLogs.SendID = req.SendID + tagSendLogs.Content = req.Content + tagSendLogs.SenderPlatformID = req.SenderPlatformID + tagSendLogs.SendTime = time.Now().Unix() + if err := db.DB.SaveTagSendLog(&tagSendLogs); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SaveTagSendLog failed", err.Error()) + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) GetTagSendLogs(_ context.Context, req *pbOffice.GetTagSendLogsReq) (resp *pbOffice.GetTagSendLogsResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.GetTagSendLogsResp{ + CommonResp: &pbOffice.CommonResp{}, + Pagination: &pbCommon.ResponsePagination{ + CurrentPage: req.Pagination.PageNumber, + ShowNumber: req.Pagination.ShowNumber, + }, + TagSendLogs: []*pbOffice.TagSendLog{}, + } + tagSendLogs, err := db.DB.GetTagSendLogs(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTagSendLogs", err.Error()) + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + return resp, nil + } + if err := utils.CopyStructFields(&resp.TagSendLogs, tagSendLogs); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) GetUserTagByID(_ context.Context, req *pbOffice.GetUserTagByIDReq) (resp *pbOffice.GetUserTagByIDResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.GetUserTagByIDResp{ + CommonResp: &pbOffice.CommonResp{}, + Tag: &pbOffice.Tag{}, + } + tag, err := db.DB.GetTagByID(req.UserID, req.TagID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTagByID failed", err.Error()) + resp.CommonResp.ErrCode = constant.ErrDB.ErrCode + resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg + return resp, nil + } + for _, userID := range tag.UserList { + userName, err := im_mysql_model.GetUserNameByUserID(userID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID failed", err.Error()) + continue + } + resp.Tag.UserList = append(resp.Tag.UserList, &pbOffice.TagUser{ + UserID: userID, + UserName: userName, + }) + } + resp.Tag.TagID = tag.TagID + resp.Tag.TagName = tag.TagName + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) CreateOneWorkMoment(_ context.Context, req *pbOffice.CreateOneWorkMomentReq) (resp *pbOffice.CreateOneWorkMomentResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.CreateOneWorkMomentResp{} + workMoment := db.WorkMoment{} + if err := utils.CopyStructFields(&workMoment, req.WorkMoment); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + err = db.DB.CreateOneWorkMoment(&workMoment) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CreateOneWorkMoment", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) DeleteOneWorkMoment(_ context.Context, req *pbOffice.DeleteOneWorkMomentReq) (resp *pbOffice.DeleteOneWorkMomentResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.DeleteOneWorkMomentResp{} + err = db.DB.DeleteOneWorkMoment(req.WorkMomentID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DeleteOneWorkMoment", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) LikeOneWorkMoment(_ context.Context, req *pbOffice.LikeOneWorkMomentReq) (resp *pbOffice.LikeOneWorkMomentResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.LikeOneWorkMomentResp{} + workMoment, err := db.DB.GetWorkMomentByID(req.WorkMomentID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetWorkMomentByID failed", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if workMoment.UserID != req.WorkMomentID { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "workMoment.UserID != req.WorkMomentID ", workMoment, req.WorkMomentID) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg} + return resp, nil + } + if err = db.DB.LikeOneWorkMoment(req.UserID, req.WorkMomentID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "LikeOneWorkMoment failed ", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.CommentOneWorkMomentReq) (resp *pbOffice.CommentOneWorkMomentResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.CommentOneWorkMomentResp{} + commentUserName, err := imdb.GetUserNameByUserID(req.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID commentUserName failed", req.UserID, err.Error()) + } + var replyUserName string + if req.ReplyUserID != "" { + replyUserName, err = imdb.GetUserNameByUserID(req.ReplyUserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID get replyUserName failed", req.ReplyUserID, err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + } + comment := db.Comment{ + UserID: req.UserID, + UserName: commentUserName, + ReplyUserID: req.ReplyUserID, + ReplyUserName: replyUserName, + ContentID: "", + Content: req.Content, + CreateTime: int32(time.Now().Unix()), + } + if err = db.DB.CommentOneWorkMoment(comment, req.WorkMomentID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CommentOneWorkMoment failed", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) GetUserWorkMoments(_ context.Context, req *pbOffice.GetUserWorkMomentsReq) (resp *pbOffice.GetUserWorkMomentsResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.GetUserWorkMomentsResp{} + workMoments, err := db.DB.GetUserWorkMoments(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if err := utils.CopyStructFields(resp.WorkMoments, workMoments); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) GetUserFriendWorkMoments(_ context.Context, req *pbOffice.GetUserFriendWorkMomentsReq) (resp *pbOffice.GetUserFriendWorkMomentsResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.GetUserFriendWorkMomentsResp{} + friendIDList, err := imdb.GetFriendIDListByUserID(req.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetFriendIDListByUserID", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "friendIDList: ", friendIDList) + workMoments, err := db.DB.GetUserFriendWorkMoments(friendIDList, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserFriendWorkMoments", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if err := utils.CopyStructFields(resp.WorkMoments, workMoments); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) GetUserWorkMomentsCommentsMsg(_ context.Context, req *pbOffice.GetUserWorkMomentsCommentsMsgReq) (resp *pbOffice.GetUserWorkMomentsCommentsMsgResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.GetUserWorkMomentsCommentsMsgResp{CommentsMsgs: []*pbOffice.CommentsMsg{}} + workMomentsCommentMsgs, err := db.DB.GetUserWorkMomentsCommentsMsg(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMomentsCommentsMsg", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + for _, commentMsg := range workMomentsCommentMsgs { + comment := pbOffice.Comment{} + if err := utils.CopyStructFields(&comment, commentMsg); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + resp.CommentsMsgs = append(resp.CommentsMsgs, &pbOffice.CommentsMsg{ + Comment: &comment, + WorkMomentID: commentMsg.WorkMomentID, + Content: commentMsg.Content, + }) + } + resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) SetUserWorkMomentsLevel(_ context.Context, req *pbOffice.SetUserWorkMomentsLevelReq) (resp *pbOffice.SetUserWorkMomentsLevelResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.SetUserWorkMomentsLevelResp{} + if err := db.DB.SetUserWorkMomentsLevel(req.UserID, req.Level); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetUserWorkMomentsLevel failed", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) ClearUserWorkMomentsCommentsMsg(_ context.Context, req *pbOffice.ClearUserWorkMomentsCommentsMsgReq) (resp *pbOffice.ClearUserWorkMomentsCommentsMsgResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.ClearUserWorkMomentsCommentsMsgResp{} + if err := db.DB.ClearUserWorkMomentsCommentsMsg(req.UserID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ClearUserWorkMomentsCommentsMsg", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} diff --git a/internal/rpc/organization/organization.go b/internal/rpc/organization/organization.go new file mode 100644 index 000000000..894fa643d --- /dev/null +++ b/internal/rpc/organization/organization.go @@ -0,0 +1,349 @@ +package organization + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + rpc "Open_IM/pkg/proto/organization" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "time" + + "context" + "google.golang.org/grpc" + "net" + "strconv" + "strings" +) + +type organizationServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewServer(port int) *organizationServer { + log.NewPrivateLog(constant.LogFileName) + return &organizationServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImOrganizationName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *organizationServer) Run() { + log.NewInfo("", "organization rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + rpc.RegisterOrganizationServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("", "RegisterEtcd failed ", err.Error()) + return + } + log.NewInfo("", "organization rpc RegisterEtcd success", ip, s.rpcPort, s.rpcRegisterName, 10) + err = srv.Serve(listener) + if err != nil { + log.NewError("", "Serve failed ", err.Error()) + return + } + log.NewInfo("", "organization rpc success") +} + +func (s *organizationServer) CreateDepartment(ctx context.Context, req *rpc.CreateDepartmentReq) (*rpc.CreateDepartmentResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + "" + req.OpUserID + " is not app manager" + log.Error(req.OperationID, errMsg) + return &rpc.CreateDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + department := db.Department{} + utils.CopyStructFields(&department, req.DepartmentInfo) + if department.DepartmentID == "" { + department.DepartmentID = utils.Md5(strconv.FormatInt(time.Now().UnixNano(), 10)) + } + log.Debug(req.OperationID, "dst ", department, "src ", req.DepartmentInfo) + if err := imdb.CreateDepartment(&department); err != nil { + errMsg := req.OperationID + " " + "CreateDepartment failed " + err.Error() + log.Error(req.OperationID, errMsg) + return &rpc.CreateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + err, createdDepartment := imdb.GetDepartment(department.DepartmentID) + if err != nil { + errMsg := req.OperationID + " " + "GetDepartment failed " + err.Error() + department.DepartmentID + log.Error(req.OperationID, errMsg) + return &rpc.CreateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "GetDepartment ", department.DepartmentID, *createdDepartment) + resp := &rpc.CreateDepartmentResp{DepartmentInfo: &open_im_sdk.Department{}} + utils.CopyStructFields(resp.DepartmentInfo, createdDepartment) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) + return resp, nil +} + +func (s *organizationServer) UpdateDepartment(ctx context.Context, req *rpc.UpdateDepartmentReq) (*rpc.UpdateDepartmentResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + "" + req.OpUserID + " is not app manager" + log.Error(req.OperationID, errMsg) + return &rpc.UpdateDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + department := db.Department{} + utils.CopyStructFields(&department, req.DepartmentInfo) + + log.Debug(req.OperationID, "dst ", department, "src ", req.DepartmentInfo) + if err := imdb.UpdateDepartment(&department, nil); err != nil { + errMsg := req.OperationID + " " + "UpdateDepartment failed " + err.Error() + log.Error(req.OperationID, errMsg) + return &rpc.UpdateDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + + resp := &rpc.UpdateDepartmentResp{} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) + return resp, nil +} + +func (s *organizationServer) GetSubDepartment(ctx context.Context, req *rpc.GetSubDepartmentReq) (*rpc.GetSubDepartmentResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + err, departmentList := imdb.GetSubDepartmentList(req.DepartmentID) + if err != nil { + errMsg := req.OperationID + " " + "GetDepartment failed " + err.Error() + log.Error(req.OperationID, errMsg) + return &rpc.GetSubDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "GetSubDepartmentList ", req.DepartmentID, departmentList) + resp := &rpc.GetSubDepartmentResp{} + for _, v := range departmentList { + v1 := open_im_sdk.Department{} + utils.CopyStructFields(&v1, v) + log.Debug(req.OperationID, "src ", v, "dst ", v1) + resp.DepartmentList = append(resp.DepartmentList, &v1) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) + return resp, nil +} + +func (s *organizationServer) DeleteDepartment(ctx context.Context, req *rpc.DeleteDepartmentReq) (*rpc.DeleteDepartmentResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + "" + req.OpUserID + " is not app manager" + log.Error(req.OperationID, errMsg) + return &rpc.DeleteDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + err := imdb.DeleteDepartment(req.DepartmentID) + if err != nil { + errMsg := req.OperationID + " " + "DeleteDepartment failed " + err.Error() + log.Error(req.OperationID, errMsg, req.DepartmentID) + return &rpc.DeleteDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "DeleteDepartment ", req.DepartmentID) + resp := &rpc.DeleteDepartmentResp{} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp) + return resp, nil +} + +func (s *organizationServer) CreateOrganizationUser(ctx context.Context, req *rpc.CreateOrganizationUserReq) (*rpc.CreateOrganizationUserResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + "" + req.OpUserID + " is not app manager" + log.Error(req.OperationID, errMsg) + return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + organizationUser := db.OrganizationUser{} + utils.CopyStructFields(&organizationUser, req.OrganizationUser) + organizationUser.Birth = utils.UnixSecondToTime(int64(req.OrganizationUser.Birth)) + log.Debug(req.OperationID, "src ", *req.OrganizationUser, "dst ", organizationUser) + err := imdb.CreateOrganizationUser(&organizationUser) + if err != nil { + errMsg := req.OperationID + " " + "CreateOrganizationUser failed " + err.Error() + log.Error(req.OperationID, errMsg, organizationUser) + return &rpc.CreateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "CreateOrganizationUser ", organizationUser) + resp := &rpc.CreateOrganizationUserResp{} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) + return resp, nil +} + +func (s *organizationServer) UpdateOrganizationUser(ctx context.Context, req *rpc.UpdateOrganizationUserReq) (*rpc.UpdateOrganizationUserResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + "" + req.OpUserID + " is not app manager" + log.Error(req.OperationID, errMsg) + return &rpc.UpdateOrganizationUserResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + organizationUser := db.OrganizationUser{} + utils.CopyStructFields(&organizationUser, req.OrganizationUser) + log.Debug(req.OperationID, "src ", *req.OrganizationUser, "dst ", organizationUser) + err := imdb.UpdateOrganizationUser(&organizationUser, nil) + if err != nil { + errMsg := req.OperationID + " " + "CreateOrganizationUser failed " + err.Error() + log.Error(req.OperationID, errMsg, organizationUser) + return &rpc.UpdateOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "UpdateOrganizationUser ", organizationUser) + resp := &rpc.UpdateOrganizationUserResp{} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp) + return resp, nil +} + +func (s *organizationServer) CreateDepartmentMember(ctx context.Context, req *rpc.CreateDepartmentMemberReq) (*rpc.CreateDepartmentMemberResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + "" + req.OpUserID + " is not app manager" + log.Error(req.OperationID, errMsg) + return &rpc.CreateDepartmentMemberResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + departmentMember := db.DepartmentMember{} + utils.CopyStructFields(&departmentMember, req.UserInDepartment) + log.Debug(req.OperationID, "src ", *req.UserInDepartment, "dst ", departmentMember) + err := imdb.CreateDepartmentMember(&departmentMember) + if err != nil { + errMsg := req.OperationID + " " + "CreateDepartmentMember failed " + err.Error() + log.Error(req.OperationID, errMsg, departmentMember) + return &rpc.CreateDepartmentMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "UpdateOrganizationUser ", departmentMember) + resp := &rpc.CreateDepartmentMemberResp{} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) + return resp, nil +} + +func (s *organizationServer) GetUserInDepartmentByUserID(userID string) (*open_im_sdk.UserInDepartment, error) { + err, organizationUser := imdb.GetOrganizationUser(userID) + if err != nil { + return nil, utils.Wrap(err, "GetOrganizationUser failed") + } + err, departmentMemberList := imdb.GetUserInDepartment(userID) + if err != nil { + return nil, utils.Wrap(err, "GetUserInDepartment failed") + } + resp := &open_im_sdk.UserInDepartment{OrganizationUser: &open_im_sdk.OrganizationUser{}} + utils.CopyStructFields(resp.OrganizationUser, organizationUser) + for _, v := range departmentMemberList { + v1 := open_im_sdk.DepartmentMember{} + utils.CopyStructFields(&v1, v) + resp.DepartmentMemberList = append(resp.DepartmentMemberList, &v1) + } + return resp, nil +} + +func (s *organizationServer) GetUserInDepartment(ctx context.Context, req *rpc.GetUserInDepartmentReq) (*rpc.GetUserInDepartmentResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + r, err := s.GetUserInDepartmentByUserID(req.UserID) + if err != nil { + errMsg := req.OperationID + " " + "GetUserInDepartmentByUserID failed " + err.Error() + log.Error(req.OperationID, errMsg, req.UserID) + return &rpc.GetUserInDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "GetUserInDepartmentByUserID success ", req.UserID, r) + resp := rpc.GetUserInDepartmentResp{UserInDepartment: &open_im_sdk.UserInDepartment{OrganizationUser: &open_im_sdk.OrganizationUser{}}} + resp.UserInDepartment.DepartmentMemberList = r.DepartmentMemberList + resp.UserInDepartment.OrganizationUser = r.OrganizationUser + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp) + return &resp, nil +} + +func (s *organizationServer) UpdateUserInDepartment(ctx context.Context, req *rpc.UpdateUserInDepartmentReq) (*rpc.UpdateUserInDepartmentResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + "" + req.OpUserID + " is not app manager" + log.Error(req.OperationID, errMsg) + return &rpc.UpdateUserInDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + departmentMember := &db.DepartmentMember{} + utils.CopyStructFields(departmentMember, req.DepartmentMember) + log.Debug(req.OperationID, "dst ", departmentMember, "src ", req.DepartmentMember) + err := imdb.UpdateUserInDepartment(departmentMember, nil) + if err != nil { + errMsg := req.OperationID + " " + "UpdateUserInDepartment failed " + err.Error() + log.Error(req.OperationID, errMsg, *departmentMember) + return &rpc.UpdateUserInDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + resp := &rpc.UpdateUserInDepartmentResp{} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) + return resp, nil +} + +func (s *organizationServer) DeleteUserInDepartment(ctx context.Context, req *rpc.DeleteUserInDepartmentReq) (*rpc.DeleteUserInDepartmentResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + "" + req.OpUserID + " is not app manager" + log.Error(req.OperationID, errMsg) + return &rpc.DeleteUserInDepartmentResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + + err := imdb.DeleteUserInDepartment(req.DepartmentID, req.UserID) + if err != nil { + errMsg := req.OperationID + " " + "DeleteUserInDepartment failed " + err.Error() + log.Error(req.OperationID, errMsg, req.DepartmentID, req.UserID) + return &rpc.DeleteUserInDepartmentResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "DeleteUserInDepartment success ", req.DepartmentID, req.UserID) + resp := &rpc.DeleteUserInDepartmentResp{} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) + return resp, nil +} + +func (s *organizationServer) DeleteOrganizationUser(ctx context.Context, req *rpc.DeleteOrganizationUserReq) (*rpc.DeleteOrganizationUserResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + errMsg := req.OperationID + "" + req.OpUserID + " is not app manager" + log.Error(req.OperationID, errMsg) + return &rpc.DeleteOrganizationUserResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, nil + } + err := imdb.DeleteOrganizationUser(req.UserID) + if err != nil { + errMsg := req.OperationID + " " + "DeleteOrganizationUser failed " + err.Error() + log.Error(req.OperationID, errMsg, req.UserID) + return &rpc.DeleteOrganizationUserResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + log.Debug(req.OperationID, "DeleteOrganizationUser success ", req.UserID) + resp := &rpc.DeleteOrganizationUserResp{} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", *resp) + return resp, nil +} + +func (s *organizationServer) GetDepartmentMember(ctx context.Context, req *rpc.GetDepartmentMemberReq) (*rpc.GetDepartmentMemberResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + err, departmentMemberUserIDList := imdb.GetDepartmentMemberUserIDList(req.DepartmentID) + if err != nil { + errMsg := req.OperationID + " " + "GetDepartmentMemberUserIDList failed " + err.Error() + log.Error(req.OperationID, errMsg, req.DepartmentID) + return &rpc.GetDepartmentMemberResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: errMsg}, nil + } + + resp := rpc.GetDepartmentMemberResp{} + for _, v := range departmentMemberUserIDList { + r, err := s.GetUserInDepartmentByUserID(v) + if err != nil { + log.Error(req.OperationID, "GetUserInDepartmentByUserID failed ", err.Error()) + continue + } + log.Debug(req.OperationID, "GetUserInDepartmentByUserID success ", *r) + resp.UserInDepartmentList = append(resp.UserInDepartmentList, r) + } + + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp) + return &resp, nil +} diff --git a/internal/rpc/statistics/statistics.go b/internal/rpc/statistics/statistics.go new file mode 100644 index 000000000..cda164332 --- /dev/null +++ b/internal/rpc/statistics/statistics.go @@ -0,0 +1,378 @@ +package statistics + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "context" + "sync" + "time" + + //"Open_IM/pkg/common/constant" + //"Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/log" + + //cp "Open_IM/pkg/common/utils" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbStatistics "Open_IM/pkg/proto/statistics" + + //open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + //"context" + errors "Open_IM/pkg/common/http" + "net" + "strconv" + "strings" + + "google.golang.org/grpc" +) + +type statisticsServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewStatisticsServer(port int) *statisticsServer { + log.NewPrivateLog(constant.LogFileName) + return &statisticsServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImStatisticsName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *statisticsServer) Run() { + log.NewInfo("0", "Statistics rpc start ") + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "Listen failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbStatistics.RegisterUserServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error()) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "statistics rpc success") +} + +func (s *statisticsServer) GetActiveGroup(_ context.Context, req *pbStatistics.GetActiveGroupReq) (*pbStatistics.GetActiveGroupResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetActiveGroupResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error()) + return resp, errors.WrapError(constant.ErrArgs) + } + activeGroups, err := imdb.GetActiveGroups(fromTime, toTime, 12) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetActiveGroups failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, activeGroup := range activeGroups { + resp.Groups = append(resp.Groups, + &pbStatistics.GroupResp{ + GroupName: activeGroup.Name, + GroupId: activeGroup.Id, + MessageNum: int32(activeGroup.MessageNum), + }) + } + return resp, nil +} + +func (s *statisticsServer) GetActiveUser(_ context.Context, req *pbStatistics.GetActiveUserReq) (*pbStatistics.GetActiveUserResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetActiveUserResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + activeUsers, err := imdb.GetActiveUsers(fromTime, toTime, 12) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetActiveUsers failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, activeUser := range activeUsers { + resp.Users = append(resp.Users, + &pbStatistics.UserResp{ + UserId: activeUser.Id, + NickName: activeUser.Name, + MessageNum: int32(activeUser.MessageNum), + }, + ) + } + return resp, nil +} + +func ParseTimeFromTo(from, to string) (time.Time, time.Time, error) { + var fromTime time.Time + var toTime time.Time + fromTime, err := utils.TimeStringToTime(from) + if err != nil { + return fromTime, toTime, err + } + toTime, err = utils.TimeStringToTime(to) + if err != nil { + return fromTime, toTime, err + } + return fromTime, toTime, nil +} + +func isInOneMonth(from, to time.Time) bool { + return from.Month() == to.Month() && from.Year() == to.Year() +} + +func GetRangeDate(from, to time.Time) [][2]time.Time { + interval := to.Sub(from) + var times [][2]time.Time + switch { + // today + case interval == 0: + times = append(times, [2]time.Time{ + from, from.Add(time.Hour * 24), + }) + // days + case isInOneMonth(from, to): + for i := 0; ; i++ { + fromTime := from.Add(time.Hour * 24 * time.Duration(i)) + toTime := from.Add(time.Hour * 24 * time.Duration(i+1)) + if toTime.After(to.Add(time.Hour * 24)) { + break + } + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + } + // month + case !isInOneMonth(from, to): + if to.Sub(from) < time.Hour*24*30 { + for i := 0; ; i++ { + fromTime := from.Add(time.Hour * 24 * time.Duration(i)) + toTime := from.Add(time.Hour * 24 * time.Duration(i+1)) + if toTime.After(to.Add(time.Hour * 24)) { + break + } + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + } + } else { + for i := 0; ; i++ { + if i == 0 { + fromTime := from + toTime := getFirstDateOfNextNMonth(fromTime, 1) + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + } else { + fromTime := getFirstDateOfNextNMonth(from, i) + toTime := getFirstDateOfNextNMonth(fromTime, 1) + if toTime.After(to) { + toTime = to + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + break + } + times = append(times, [2]time.Time{ + fromTime, toTime, + }) + } + + } + } + } + return times +} + +func getFirstDateOfNextNMonth(currentTime time.Time, n int) time.Time { + lastOfMonth := time.Date(currentTime.Year(), currentTime.Month(), 1, 0, 0, 0, 0, currentTime.Location()).AddDate(0, n, 0) + return lastOfMonth +} + +func (s *statisticsServer) GetGroupStatistics(_ context.Context, req *pbStatistics.GetGroupStatisticsReq) (*pbStatistics.GetGroupStatisticsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetGroupStatisticsResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupStatistics failed", err.Error()) + return resp, errors.WrapError(constant.ErrArgs) + } + increaseGroupNum, err := imdb.GetIncreaseGroupNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + totalGroupNum, err := imdb.GetTotalGroupNum() + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.IncreaseGroupNum = increaseGroupNum + resp.TotalGroupNum = totalGroupNum + times := GetRangeDate(fromTime, toTime) + log.NewInfo(req.OperationID, "times:", times) + wg := &sync.WaitGroup{} + resp.IncreaseGroupNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + resp.TotalGroupNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + wg.Add(len(times)) + for i, v := range times { + go func(wg *sync.WaitGroup, index int, v [2]time.Time) { + defer wg.Done() + num, err := imdb.GetIncreaseGroupNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.IncreaseGroupNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + num, err = imdb.GetGroupNum(v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.TotalGroupNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + }(wg, i, v) + } + wg.Wait() + return resp, nil +} + +func (s *statisticsServer) GetMessageStatistics(_ context.Context, req *pbStatistics.GetMessageStatisticsReq) (*pbStatistics.GetMessageStatisticsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetMessageStatisticsResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error()) + return resp, errors.WrapError(constant.ErrArgs) + } + privateMessageNum, err := imdb.GetPrivateMessageNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetPrivateMessageNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + groupMessageNum, err := imdb.GetGroupMessageNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMessageNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.PrivateMessageNum = privateMessageNum + resp.GroupMessageNum = groupMessageNum + times := GetRangeDate(fromTime, toTime) + resp.GroupMessageNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + resp.PrivateMessageNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + wg := &sync.WaitGroup{} + wg.Add(len(times)) + for i, v := range times { + go func(wg *sync.WaitGroup, index int, v [2]time.Time) { + defer wg.Done() + + num, err := imdb.GetPrivateMessageNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.PrivateMessageNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + num, err = imdb.GetGroupMessageNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.GroupMessageNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + }(wg, i, v) + } + wg.Wait() + return resp, nil +} + +func (s *statisticsServer) GetUserStatistics(_ context.Context, req *pbStatistics.GetUserStatisticsReq) (*pbStatistics.GetUserStatisticsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbStatistics.GetUserStatisticsResp{} + fromTime, toTime, err := ParseTimeFromTo(req.StatisticsReq.From, req.StatisticsReq.To) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ParseTimeFromTo failed", err.Error()) + return resp, errors.WrapError(constant.ErrArgs) + } + activeUserNum, err := imdb.GetActiveUserNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetActiveUserNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + increaseUserNum, err := imdb.GetIncreaseUserNum(fromTime, toTime.Add(time.Hour*24)) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseUserNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + totalUserNum, err := imdb.GetTotalUserNum() + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTotalUserNum failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.ActiveUserNum = activeUserNum + resp.TotalUserNum = totalUserNum + resp.IncreaseUserNum = increaseUserNum + times := GetRangeDate(fromTime, toTime) + resp.TotalUserNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + resp.ActiveUserNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + resp.IncreaseUserNumList = make([]*pbStatistics.DateNumList, len(times), len(times)) + wg := &sync.WaitGroup{} + wg.Add(len(times)) + for i, v := range times { + go func(wg *sync.WaitGroup, index int, v [2]time.Time) { + defer wg.Done() + num, err := imdb.GetActiveUserNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error()) + } + resp.ActiveUserNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + + num, err = imdb.GetTotalUserNumByDate(v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTotalUserNumByDate", v, err.Error()) + } + resp.TotalUserNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + num, err = imdb.GetIncreaseUserNum(v[0], v[1]) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseUserNum", v, err.Error()) + } + resp.IncreaseUserNumList[index] = &pbStatistics.DateNumList{ + Date: v[0].String(), + Num: num, + } + }(wg, i, v) + } + wg.Wait() + return resp, nil +} diff --git a/internal/rpc/user/callback.go b/internal/rpc/user/callback.go new file mode 100644 index 000000000..a00006b65 --- /dev/null +++ b/internal/rpc/user/callback.go @@ -0,0 +1 @@ +package user diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go new file mode 100644 index 000000000..1234b2be9 --- /dev/null +++ b/internal/rpc/user/user.go @@ -0,0 +1,590 @@ +package user + +import ( + chat "Open_IM/internal/rpc/msg" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + errors "Open_IM/pkg/common/http" + + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbFriend "Open_IM/pkg/proto/friend" + sdkws "Open_IM/pkg/proto/sdk_ws" + pbUser "Open_IM/pkg/proto/user" + "Open_IM/pkg/utils" + "context" + "fmt" + "net" + "strconv" + "strings" + + "google.golang.org/grpc" +) + +type userServer struct { + rpcPort int + rpcRegisterName string + etcdSchema string + etcdAddr []string +} + +func NewUserServer(port int) *userServer { + log.NewPrivateLog(constant.LogFileName) + return &userServer{ + rpcPort: port, + rpcRegisterName: config.Config.RpcRegisterName.OpenImUserName, + etcdSchema: config.Config.Etcd.EtcdSchema, + etcdAddr: config.Config.Etcd.EtcdAddr, + } +} + +func (s *userServer) Run() { + log.NewInfo("0", "", "rpc user start...") + + ip := utils.ServerIP + registerAddress := ip + ":" + strconv.Itoa(s.rpcPort) + //listener network + listener, err := net.Listen("tcp", registerAddress) + if err != nil { + log.NewError("0", "listen network failed ", err.Error(), registerAddress) + return + } + log.NewInfo("0", "listen network success, address ", registerAddress, listener) + defer listener.Close() + //grpc server + srv := grpc.NewServer() + defer srv.GracefulStop() + //Service registers with etcd + pbUser.RegisterUserServer(srv, s) + err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10) + if err != nil { + log.NewError("0", "RegisterEtcd failed ", err.Error(), s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName) + return + } + err = srv.Serve(listener) + if err != nil { + log.NewError("0", "Serve failed ", err.Error()) + return + } + log.NewInfo("0", "rpc user success") +} + +func syncPeerUserConversation(conversation *pbUser.Conversation, operationID string) error { + peerUserConversation := db.Conversation{ + OwnerUserID: conversation.UserID, + ConversationID: "single_" + conversation.OwnerUserID, + ConversationType: constant.SingleChatType, + UserID: conversation.OwnerUserID, + GroupID: "", + RecvMsgOpt: 0, + UnreadCount: 0, + DraftTextTime: 0, + IsPinned: false, + IsPrivateChat: conversation.IsPrivateChat, + AttachedInfo: "", + Ex: "", + } + err := imdb.PeerUserSetConversation(peerUserConversation) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) + return err + } + chat.ConversationSetPrivateNotification(operationID, conversation.OwnerUserID, conversation.UserID, conversation.IsPrivateChat) + return nil +} + +func (s *userServer) GetUserInfo(ctx context.Context, req *pbUser.GetUserInfoReq) (*pbUser.GetUserInfoResp, error) { + log.NewInfo(req.OperationID, "GetUserInfo args ", req.String()) + var userInfoList []*sdkws.UserInfo + if len(req.UserIDList) > 0 { + for _, userID := range req.UserIDList { + var userInfo sdkws.UserInfo + user, err := imdb.GetUserByUserID(userID) + if err != nil { + log.NewError(req.OperationID, "GetUserByUserID failed ", err.Error(), userID) + continue + } + utils.CopyStructFields(&userInfo, user) + userInfo.Birth = uint32(user.Birth.Unix()) + userInfoList = append(userInfoList, &userInfo) + } + } else { + return &pbUser.GetUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrArgs.ErrCode, ErrMsg: constant.ErrArgs.ErrMsg}}, nil + } + log.NewInfo(req.OperationID, "GetUserInfo rpc return ", pbUser.GetUserInfoResp{CommonResp: &pbUser.CommonResp{}, UserInfoList: userInfoList}) + return &pbUser.GetUserInfoResp{CommonResp: &pbUser.CommonResp{}, UserInfoList: userInfoList}, nil +} + +func (s *userServer) BatchSetConversations(ctx context.Context, req *pbUser.BatchSetConversationsReq) (*pbUser.BatchSetConversationsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + if req.NotificationType == 0 { + req.NotificationType = constant.ConversationOptChangeNotification + } + resp := &pbUser.BatchSetConversationsResp{} + for _, v := range req.Conversations { + conversation := db.Conversation{} + if err := utils.CopyStructFields(&conversation, v); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), v.String(), "CopyStructFields failed", err.Error()) + } + if err := db.DB.SetSingleConversationRecvMsgOpt(req.OwnerUserID, v.ConversationID, v.RecvMsgOpt); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error()) + resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if err := imdb.SetConversation(conversation); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) + resp.Failed = append(resp.Failed, v.ConversationID) + continue + } + resp.Success = append(resp.Success, v.ConversationID) + // if is set private chat operation,then peer user need to sync and set tips\ + if v.ConversationType == constant.SingleChatType && req.NotificationType == constant.ConversationPrivateChatNotification { + if err := syncPeerUserConversation(v, req.OperationID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error()) + } + } + } + chat.ConversationChangeNotification(req.OperationID, req.OwnerUserID) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String()) + resp.CommonResp = &pbUser.CommonResp{} + return resp, nil +} + +func (s *userServer) GetAllConversations(ctx context.Context, req *pbUser.GetAllConversationsReq) (*pbUser.GetAllConversationsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbUser.GetAllConversationsResp{Conversations: []*pbUser.Conversation{}} + conversations, err := imdb.GetUserAllConversations(req.OwnerUserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetConversations error", err.Error()) + resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if err = utils.CopyStructFields(&resp.Conversations, conversations); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields error", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String()) + resp.CommonResp = &pbUser.CommonResp{} + return resp, nil +} + +func (s *userServer) GetConversation(ctx context.Context, req *pbUser.GetConversationReq) (*pbUser.GetConversationResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbUser.GetConversationResp{Conversation: &pbUser.Conversation{}} + conversation, err := imdb.GetConversation(req.OwnerUserID, req.ConversationID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetConversation error", err.Error()) + resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if err := utils.CopyStructFields(resp.Conversation, &conversation); err != nil { + log.Debug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields error", conversation, err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + resp.CommonResp = &pbUser.CommonResp{} + return resp, nil +} + +func (s *userServer) GetConversations(ctx context.Context, req *pbUser.GetConversationsReq) (*pbUser.GetConversationsResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbUser.GetConversationsResp{Conversations: []*pbUser.Conversation{}} + conversations, err := imdb.GetConversations(req.OwnerUserID, req.ConversationIDs) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetConversations error", err.Error()) + resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if err := utils.CopyStructFields(&resp.Conversations, conversations); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", conversations, err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + resp.CommonResp = &pbUser.CommonResp{} + return resp, nil +} + +func (s *userServer) SetConversation(ctx context.Context, req *pbUser.SetConversationReq) (*pbUser.SetConversationResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + if req.NotificationType == 0 { + req.NotificationType = constant.ConversationOptChangeNotification + } + resp := &pbUser.SetConversationResp{} + var conversation db.Conversation + if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", *req.Conversation, err.Error()) + } + if err := db.DB.SetSingleConversationRecvMsgOpt(req.Conversation.OwnerUserID, req.Conversation.ConversationID, req.Conversation.RecvMsgOpt); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error()) + resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + err := imdb.SetConversation(conversation) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) + resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + // notification + if req.Conversation.ConversationType == constant.SingleChatType && req.NotificationType == constant.ConversationPrivateChatNotification { + //sync peer user conversation if conversation is singleChatType + if err := syncPeerUserConversation(req.Conversation, req.OperationID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error()) + resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + } else { + chat.ConversationChangeNotification(req.OperationID, req.Conversation.OwnerUserID) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String()) + resp.CommonResp = &pbUser.CommonResp{} + return resp, nil +} + +func (s *userServer) SetRecvMsgOpt(ctx context.Context, req *pbUser.SetRecvMsgOptReq) (*pbUser.SetRecvMsgOptResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbUser.SetRecvMsgOptResp{} + var conversation db.Conversation + if err := utils.CopyStructFields(&conversation, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", *req, err.Error()) + } + if err := db.DB.SetSingleConversationRecvMsgOpt(req.OwnerUserID, req.ConversationID, req.RecvMsgOpt); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "cache failed, rpc return", err.Error()) + resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + stringList := strings.Split(req.ConversationID, "_") + if len(stringList) > 1 { + switch stringList[0] { + case "single_": + conversation.UserID = stringList[1] + conversation.ConversationType = constant.SingleChatType + case "group": + conversation.GroupID = stringList[1] + conversation.ConversationType = constant.GroupChatType + } + } + err := imdb.SetRecvMsgOpt(conversation) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) + resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + chat.ConversationChangeNotification(req.OperationID, req.OwnerUserID) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + resp.CommonResp = &pbUser.CommonResp{} + return resp, nil +} + +func (s *userServer) DeleteUsers(_ context.Context, req *pbUser.DeleteUsersReq) (*pbUser.DeleteUsersResp, error) { + log.NewInfo(req.OperationID, "DeleteUsers args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + log.NewError(req.OperationID, "IsManagerUserID false ", req.OpUserID) + return &pbUser.DeleteUsersResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}, FailedUserIDList: req.DeleteUserIDList}, nil + } + var common pbUser.CommonResp + resp := pbUser.DeleteUsersResp{CommonResp: &common} + for _, userID := range req.DeleteUserIDList { + i := imdb.DeleteUser(userID) + if i == 0 { + log.NewError(req.OperationID, "delete user error", userID) + common.ErrCode = 201 + common.ErrMsg = "some uid deleted failed" + resp.FailedUserIDList = append(resp.FailedUserIDList, userID) + } + } + log.NewInfo(req.OperationID, "DeleteUsers rpc return ", resp.String()) + return &resp, nil +} + +func (s *userServer) GetAllUserID(_ context.Context, req *pbUser.GetAllUserIDReq) (*pbUser.GetAllUserIDResp, error) { + log.NewInfo(req.OperationID, "GetAllUserID args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + log.NewError(req.OperationID, "IsManagerUserID false ", req.OpUserID) + return &pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + uidList, err := imdb.SelectAllUserID() + if err != nil { + log.NewError(req.OperationID, "SelectAllUserID false ", err.Error()) + return &pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } else { + log.NewInfo(req.OperationID, "GetAllUserID rpc return ", pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{}, UserIDList: uidList}) + return &pbUser.GetAllUserIDResp{CommonResp: &pbUser.CommonResp{}, UserIDList: uidList}, nil + } +} + +func (s *userServer) AccountCheck(_ context.Context, req *pbUser.AccountCheckReq) (*pbUser.AccountCheckResp, error) { + log.NewInfo(req.OperationID, "AccountCheck args ", req.String()) + if !token_verify.IsManagerUserID(req.OpUserID) { + log.NewError(req.OperationID, "IsManagerUserID false ", req.OpUserID) + return &pbUser.AccountCheckResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + uidList, err := imdb.SelectSomeUserID(req.CheckUserIDList) + log.NewDebug(req.OperationID, "from db uid list is:", uidList) + if err != nil { + log.NewError(req.OperationID, "SelectSomeUserID failed ", err.Error(), req.CheckUserIDList) + return &pbUser.AccountCheckResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } else { + var r []*pbUser.AccountCheckResp_SingleUserStatus + for _, v := range req.CheckUserIDList { + temp := new(pbUser.AccountCheckResp_SingleUserStatus) + temp.UserID = v + if utils.IsContain(v, uidList) { + temp.AccountStatus = constant.Registered + } else { + temp.AccountStatus = constant.UnRegistered + } + r = append(r, temp) + } + resp := pbUser.AccountCheckResp{CommonResp: &pbUser.CommonResp{ErrCode: 0, ErrMsg: ""}, ResultList: r} + log.NewInfo(req.OperationID, "AccountCheck rpc return ", resp.String()) + return &resp, nil + } + +} + +func (s *userServer) UpdateUserInfo(ctx context.Context, req *pbUser.UpdateUserInfoReq) (*pbUser.UpdateUserInfoResp, error) { + log.NewInfo(req.OperationID, "UpdateUserInfo args ", req.String()) + if !token_verify.CheckAccess(req.OpUserID, req.UserInfo.UserID) { + log.NewError(req.OperationID, "CheckAccess false ", req.OpUserID, req.UserInfo.UserID) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil + } + + var user db.User + utils.CopyStructFields(&user, req.UserInfo) + if req.UserInfo.Birth != 0 { + user.Birth = utils.UnixSecondToTime(int64(req.UserInfo.Birth)) + } + err := imdb.UpdateUserInfo(user) + if err != nil { + log.NewError(req.OperationID, "UpdateUserInfo failed ", err.Error(), user) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil + } + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImFriendName) + client := pbFriend.NewFriendClient(etcdConn) + newReq := &pbFriend.GetFriendListReq{ + CommID: &pbFriend.CommID{OperationID: req.OperationID, FromUserID: req.UserInfo.UserID, OpUserID: req.OpUserID}, + } + + RpcResp, err := client.GetFriendList(context.Background(), newReq) + if err != nil { + log.NewError(req.OperationID, "GetFriendList failed ", err.Error(), newReq) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{}}, nil + } + for _, v := range RpcResp.FriendInfoList { + log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, v.FriendUser.UserID) + chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, v.FriendUser.UserID) + } + chat.UserInfoUpdatedNotification(req.OperationID, req.UserInfo.UserID, req.OpUserID) + log.Info(req.OperationID, "UserInfoUpdatedNotification ", req.UserInfo.UserID, req.OpUserID) + return &pbUser.UpdateUserInfoResp{CommonResp: &pbUser.CommonResp{}}, nil +} + +func (s *userServer) GetUsersByName(ctx context.Context, req *pbUser.GetUsersByNameReq) (*pbUser.GetUsersByNameResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req.String()) + resp := &pbUser.GetUsersByNameResp{} + users, err := imdb.GetUserByName(req.UserName, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByName failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, user := range users { + isBlock, err := imdb.UserIsBlock(user.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error()) + continue + } + resp.Users = append(resp.Users, &pbUser.User{ + ProfilePhoto: user.FaceURL, + Nickname: user.Nickname, + UserId: user.UserID, + CreateTime: user.CreateTime.String(), + IsBlock: isBlock, + }) + } + user := db.User{Nickname: req.UserName} + userNums, err := imdb.GetUsersCount(user) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.UserNums = userNums + resp.Pagination = &sdkws.ResponsePagination{ + CurrentPage: req.Pagination.PageNumber, + ShowNumber: req.Pagination.ShowNumber, + } + return resp, nil +} + +func (s *userServer) GetUserById(ctx context.Context, req *pbUser.GetUserByIdReq) (*pbUser.GetUserByIdResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req:", req.String()) + resp := &pbUser.GetUserByIdResp{User: &pbUser.User{}} + user, err := imdb.GetUserByUserID(req.UserId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + return resp, errors.WrapError(constant.ErrDB) + } + isBlock, err := imdb.UserIsBlock(req.UserId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "req:", req.String()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.User = &pbUser.User{ + ProfilePhoto: user.FaceURL, + Nickname: user.Nickname, + UserId: user.UserID, + CreateTime: user.CreateTime.String(), + IsBlock: isBlock, + } + return resp, nil +} + +func (s *userServer) GetUsers(ctx context.Context, req *pbUser.GetUsersReq) (*pbUser.GetUsersResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp := &pbUser.GetUsersResp{User: []*pbUser.User{}} + users, err := imdb.GetUsers(req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + return resp, errors.WrapError(constant.ErrDB) + } + for _, v := range users { + isBlock, err := imdb.UserIsBlock(v.UserID) + if err == nil { + user := &pbUser.User{ + ProfilePhoto: v.FaceURL, + UserId: v.UserID, + CreateTime: v.CreateTime.String(), + Nickname: v.Nickname, + IsBlock: isBlock, + } + resp.User = append(resp.User, user) + } + } + user := db.User{} + nums, err := imdb.GetUsersCount(user) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUsersCount failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.UserNums = nums + resp.Pagination = &sdkws.ResponsePagination{ShowNumber: req.Pagination.ShowNumber, CurrentPage: req.Pagination.PageNumber} + return resp, nil +} + +func (s *userServer) ResignUser(ctx context.Context, req *pbUser.ResignUserReq) (*pbUser.ResignUserResp, error) { + log.NewInfo(req.OperationID, "ResignUser args ", req.String()) + return &pbUser.ResignUserResp{}, nil +} + +func (s *userServer) AlterUser(ctx context.Context, req *pbUser.AlterUserReq) (*pbUser.AlterUserResp, error) { + log.NewInfo(req.OperationID, "AlterUser args ", req.String()) + resp := &pbUser.AlterUserResp{} + user := db.User{ + PhoneNumber: strconv.FormatInt(req.PhoneNumber, 10), + Nickname: req.Nickname, + Email: req.Email, + UserID: req.UserId, + } + if err := imdb.UpdateUserInfo(user); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "UpdateUserInfo", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + chat.UserInfoUpdatedNotification(req.OperationID, req.UserId, req.OpUserId) + return resp, nil +} + +func (s *userServer) AddUser(ctx context.Context, req *pbUser.AddUserReq) (*pbUser.AddUserResp, error) { + log.NewInfo(req.OperationID, "AddUser args ", req.String()) + resp := &pbUser.AddUserResp{} + err := imdb.AddUser(req.UserId, req.PhoneNumber, req.Name) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "AddUser", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *userServer) BlockUser(ctx context.Context, req *pbUser.BlockUserReq) (*pbUser.BlockUserResp, error) { + log.NewInfo(req.OperationID, "BlockUser args ", req.String()) + fmt.Println("BlockUser args ", req.String()) + resp := &pbUser.BlockUserResp{} + err := imdb.BlockUser(req.UserId, req.EndDisableTime) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "BlockUser", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *userServer) UnBlockUser(ctx context.Context, req *pbUser.UnBlockUserReq) (*pbUser.UnBlockUserResp, error) { + log.NewInfo(req.OperationID, "UnBlockUser args ", req.String()) + resp := &pbUser.UnBlockUserResp{} + err := imdb.UnBlockUser(req.UserId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "unBlockUser", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + return resp, nil +} + +func (s *userServer) GetBlockUsers(ctx context.Context, req *pbUser.GetBlockUsersReq) (*pbUser.GetBlockUsersResp, error) { + log.NewInfo(req.OperationID, "GetBlockUsers args ", req.String()) + resp := &pbUser.GetBlockUsersResp{} + blockUsers, err := imdb.GetBlockUsers(req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.Error(req.OperationID, utils.GetSelfFuncName(), "GetBlockUsers", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + for _, v := range blockUsers { + resp.BlockUsers = append(resp.BlockUsers, &pbUser.BlockUser{ + User: &pbUser.User{ + ProfilePhoto: v.User.FaceURL, + Nickname: v.User.Nickname, + UserId: v.User.UserID, + IsBlock: true, + }, + BeginDisableTime: (v.BeginDisableTime).String(), + EndDisableTime: (v.EndDisableTime).String(), + }) + } + resp.Pagination = &sdkws.ResponsePagination{} + resp.Pagination.ShowNumber = req.Pagination.ShowNumber + resp.Pagination.CurrentPage = req.Pagination.PageNumber + nums, err := imdb.GetBlockUsersNumCount() + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetBlockUsersNumCount failed", err.Error()) + return resp, errors.WrapError(constant.ErrDB) + } + resp.UserNums = nums + return resp, nil +} + +func (s *userServer) GetBlockUserById(_ context.Context, req *pbUser.GetBlockUserByIdReq) (*pbUser.GetBlockUserByIdResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "GetBlockUserById args ", req.String()) + resp := &pbUser.GetBlockUserByIdResp{} + user, err := imdb.GetBlockUserById(req.UserId) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetBlockUserById", err) + return resp, errors.WrapError(constant.ErrDB) + } + resp.BlockUser = &pbUser.BlockUser{ + User: &pbUser.User{ + ProfilePhoto: user.User.FaceURL, + Nickname: user.User.Nickname, + UserId: user.User.UserID, + IsBlock: true, + }, + BeginDisableTime: (user.BeginDisableTime).String(), + EndDisableTime: (user.EndDisableTime).String(), + } + return resp, nil +} + +func (s *userServer) DeleteUser(_ context.Context, req *pbUser.DeleteUserReq) (*pbUser.DeleteUserResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), req.String()) + resp := &pbUser.DeleteUserResp{} + if row := imdb.DeleteUser(req.UserId); row == 0 { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "delete failed", "delete rows:", row) + return resp, errors.WrapError(constant.ErrDB) + } + return resp, nil +} diff --git a/internal/timed_task/init.go b/internal/timed_task/init.go new file mode 100644 index 000000000..8ee5d9452 --- /dev/null +++ b/internal/timed_task/init.go @@ -0,0 +1,26 @@ +package timed_task + +type TimeTask struct { + delMgoChatChan chan bool +} + +var timeTask TimeTask + +func GetInstance() *TimeTask { + if timeTask.delMgoChatChan == nil { + timeTask.delMgoChatChan = make(chan bool) + go func() { + timeTask.delMgoChatChan <- true + }() + } + return &timeTask +} + +func (t *TimeTask) Run() { + for { + select { + case <-t.delMgoChatChan: + t.timedDeleteUserChat() + } + } +} diff --git a/internal/timed_task/timed_task.go b/internal/timed_task/timed_task.go new file mode 100644 index 000000000..5b0264123 --- /dev/null +++ b/internal/timed_task/timed_task.go @@ -0,0 +1,26 @@ +package timed_task + +import ( + "Open_IM/pkg/common/db" + "time" +) + +func (t *TimeTask) timedDeleteUserChat() { + now := time.Now() + next := now.Add(time.Hour * 24) + next = time.Date(next.Year(), next.Month(), next.Day(), 0, 0, 0, 0, next.Location()) + tm := time.NewTimer(next.Sub(now)) + + <-tm.C + + count, _ := db.DB.MgoUserCount() + for i := 0; i < count; i++ { + time.Sleep(10 * time.Millisecond) + uid, _ := db.DB.MgoSkipUID(i) + db.DB.DelUserChatMongo2(uid) + } + + go func() { + t.delMgoChatChan <- true + }() +} diff --git a/internal/utils/callback.go b/internal/utils/callback.go new file mode 100644 index 000000000..d4b585bf7 --- /dev/null +++ b/internal/utils/callback.go @@ -0,0 +1 @@ +package utils 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..da53a2a36 --- /dev/null +++ b/internal/utils/jwt_token_test.go @@ -0,0 +1,89 @@ +package utils + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/token_verify" + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +func Test_BuildClaims(t *testing.T) { + uid := "1" + platform := "PC" + ttl := int64(-1) + claim := token_verify.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 = token_verify.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 := token_verify.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, _, _ := token_verify.CreateToken(uid, platform) + result, _ := token_verify.VerifyToken(tokenString, uid) + assert.True(t, result) + result, _ = token_verify.VerifyToken(tokenString, "2") + assert.False(t, result) +} + +func Test_ParseRedisInterfaceToken(t *testing.T) { + uid := "1" + platform := int32(1) + tokenString, _, _ := token_verify.CreateToken(uid, platform) + + claims, err := token_verify.ParseRedisInterfaceToken([]uint8(tokenString)) + assert.Nil(t, err) + assert.Equal(t, claims.UID, uid) + + // timeout + config.Config.TokenPolicy.AccessExpire = -80 + tokenString, _, _ = token_verify.CreateToken(uid, platform) + claims, err = token_verify.ParseRedisInterfaceToken([]uint8(tokenString)) + assert.Equal(t, err, constant.ExpiredToken) + assert.Nil(t, claims) +} + +func Test_ParseToken(t *testing.T) { + uid := "1" + platform := int32(1) + tokenString, _, _ := token_verify.CreateToken(uid, platform) + claims, err := token_verify.ParseToken(tokenString, "") + if err == nil { + assert.Equal(t, claims.UID, uid) + } +} +func Test_GetClaimFromToken(t *testing.T) { + token := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVSUQiOiJvcGVuSU0xMjM0NTYiLCJQbGF0Zm9ybSI6IiIsImV4cCI6MTYzODg0NjQ3NiwibmJmIjoxNjM4MjQxNjc2LCJpYXQiOjE2MzgyNDE2NzZ9.W8RZB7ec5ySFj-rGE2Aho2z32g3MprQMdCyPiQu_C2I" + c, err := token_verify.GetClaimFromToken(token) + assert.Nil(t, c) + assert.Nil(t, err) +} 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..8a956bfac --- /dev/null +++ b/internal/utils/platform_number_id_to_name_test.go @@ -0,0 +1,46 @@ +package utils + +import ( + "Open_IM/pkg/common/constant" + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_PlatformIDToName(t *testing.T) { + assert.Equal(t, constant.PlatformIDToName(1), "IOS") + assert.Equal(t, constant.PlatformIDToName(2), "Android") + assert.Equal(t, constant.PlatformIDToName(3), "Windows") + assert.Equal(t, constant.PlatformIDToName(4), "OSX") + assert.Equal(t, constant.PlatformIDToName(5), "Web") + assert.Equal(t, constant.PlatformIDToName(6), "MiniWeb") + assert.Equal(t, constant.PlatformIDToName(7), "Linux") + + assert.Equal(t, constant.PlatformIDToName(0), "") +} + +func Test_PlatformNameToID(t *testing.T) { + assert.Equal(t, constant.PlatformNameToID("IOS"), int32(1)) + assert.Equal(t, constant.PlatformNameToID("Android"), int32(2)) + assert.Equal(t, constant.PlatformNameToID("Windows"), int32(3)) + assert.Equal(t, constant.PlatformNameToID("OSX"), int32(4)) + assert.Equal(t, constant.PlatformNameToID("Web"), int32(5)) + assert.Equal(t, constant.PlatformNameToID("MiniWeb"), int32(6)) + assert.Equal(t, constant.PlatformNameToID("Linux"), int32(7)) + + assert.Equal(t, constant.PlatformNameToID("UnknownDevice"), int32(0)) + assert.Equal(t, constant.PlatformNameToID(""), int32(0)) +} + +func Test_PlatformNameToClass(t *testing.T) { + assert.Equal(t, constant.PlatformNameToClass("IOS"), "Mobile") + assert.Equal(t, constant.PlatformNameToClass("Android"), "Mobile") + assert.Equal(t, constant.PlatformNameToClass("OSX"), "PC") + assert.Equal(t, constant.PlatformNameToClass("Windows"), "PC") + assert.Equal(t, constant.PlatformNameToClass("Web"), "PC") + assert.Equal(t, constant.PlatformNameToClass("MiniWeb"), "Mobile") + assert.Equal(t, constant.PlatformNameToClass("Linux"), "PC") + + assert.Equal(t, constant.PlatformNameToClass("UnknownDevice"), "") + assert.Equal(t, constant.PlatformNameToClass(""), "") +} diff --git a/internal/utils/utils.go b/internal/utils/utils.go new file mode 100644 index 000000000..73ebbf127 --- /dev/null +++ b/internal/utils/utils.go @@ -0,0 +1,49 @@ +package utils + +import ( + "encoding/json" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" + "reflect" +) + +func JsonDataList(resp interface{}) []map[string]interface{} { + var list []proto.Message + if reflect.TypeOf(resp).Kind() == reflect.Slice { + s := reflect.ValueOf(resp) + for i := 0; i < s.Len(); i++ { + ele := s.Index(i) + list = append(list, ele.Interface().(proto.Message)) + } + } + + result := make([]map[string]interface{}, 0) + for _, v := range list { + m := ProtoToMap(v, false) + result = append(result, m) + } + return result +} + +func JsonDataOne(pb proto.Message) map[string]interface{} { + return ProtoToMap(pb, false) +} + +func ProtoToMap(pb proto.Message, idFix bool) map[string]interface{} { + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + + s, _ := marshaler.MarshalToString(pb) + out := make(map[string]interface{}) + json.Unmarshal([]byte(s), &out) + if idFix { + if _, ok := out["id"]; ok { + out["_id"] = out["id"] + delete(out, "id") + } + } + return out +} diff --git a/pkg/base_info/auth_api_struct.go b/pkg/base_info/auth_api_struct.go new file mode 100644 index 000000000..13d6e140b --- /dev/null +++ b/pkg/base_info/auth_api_struct.go @@ -0,0 +1,39 @@ +package base_info + +//UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` +// Nickname string `protobuf:"bytes,2,opt,name=Nickname" json:"Nickname,omitempty"` +// FaceUrl string `protobuf:"bytes,3,opt,name=FaceUrl" json:"FaceUrl,omitempty"` +// Gender int32 `protobuf:"varint,4,opt,name=Gender" json:"Gender,omitempty"` +// PhoneNumber string `protobuf:"bytes,5,opt,name=PhoneNumber" json:"PhoneNumber,omitempty"` +// Birth string `protobuf:"bytes,6,opt,name=Birth" json:"Birth,omitempty"` +// Email string `protobuf:"bytes,7,opt,name=Email" json:"Email,omitempty"` +// Ex string `protobuf:"bytes,8,opt,name=Ex" json:"Ex,omitempty"` + +type UserRegisterReq struct { + Secret string `json:"secret" binding:"required,max=32"` + Platform int32 `json:"platform" binding:"required,min=1,max=7"` + ApiUserInfo + OperationID string `json:"operationID" binding:"required"` +} + +type UserTokenInfo struct { + UserID string `json:"userID"` + Token string `json:"token"` + ExpiredTime int64 `json:"expiredTime"` +} +type UserRegisterResp struct { + CommResp + UserToken UserTokenInfo `json:"data"` +} + +type UserTokenReq struct { + Secret string `json:"secret" binding:"required,max=32"` + Platform int32 `json:"platform" binding:"required,min=1,max=8"` + UserID string `json:"userID" binding:"required,min=1,max=64"` + OperationID string `json:"operationID" binding:"required"` +} + +type UserTokenResp struct { + CommResp + UserToken UserTokenInfo `json:"data"` +} diff --git a/pkg/base_info/conversation_api_struct.go b/pkg/base_info/conversation_api_struct.go new file mode 100644 index 000000000..10b46f547 --- /dev/null +++ b/pkg/base_info/conversation_api_struct.go @@ -0,0 +1,117 @@ +package base_info + +type OptResult struct { + ConversationID string `json:"conversationID"` + Result *int32 `json:"result"` +} +type GetAllConversationMessageOptReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetAllConversationMessageOptResp struct { + CommResp + ConversationOptResultList []*OptResult `json:"data"` +} +type GetReceiveMessageOptReq struct { + ConversationIDList []string `json:"conversationIDList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetReceiveMessageOptResp struct { + CommResp + ConversationOptResultList []*OptResult `json:"data"` +} +type SetReceiveMessageOptReq struct { + FromUserID string `json:"fromUserID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + Opt *int32 `json:"opt" binding:"required"` + ConversationIDList []string `json:"conversationIDList" binding:"required"` +} +type SetReceiveMessageOptResp struct { + CommResp + ConversationOptResultList []*OptResult `json:"data"` +} + +type Conversation struct { + OwnerUserID string `json:"ownerUserID" binding:"required"` + ConversationID string `json:"conversationID" binding:"required"` + ConversationType int32 `json:"conversationType" binding:"required"` + UserID string `json:"userID"` + GroupID string `json:"groupID"` + RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"` + UnreadCount int32 `json:"unreadCount" binding:"omitempty"` + DraftTextTime int64 `json:"draftTextTime"` + IsPinned bool `json:"isPinned" binding:"omitempty"` + IsPrivateChat bool `json:"isPrivateChat"` + AttachedInfo string `json:"attachedInfo"` + Ex string `json:"ex"` +} + +type SetConversationReq struct { + Conversation + NotificationType int32 `json:"notificationType"` + OperationID string `json:"operationID" binding:"required"` +} + +type SetConversationResp struct { + CommResp +} + +type BatchSetConversationsReq struct { + Conversations []Conversation `json:"conversations" binding:"required"` + NotificationType int32 `json:"notificationType"` + OwnerUserID string `json:"ownerUserID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type BatchSetConversationsResp struct { + CommResp + Data struct { + Success []string `json:"success"` + Failed []string `json:"failed"` + } `json:"data"` +} + +type GetConversationReq struct { + ConversationID string `json:"conversationID" binding:"required"` + OwnerUserID string `json:"ownerUserID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type GetConversationResp struct { + CommResp + Conversation Conversation `json:"data"` +} + +type GetAllConversationsReq struct { + OwnerUserID string `json:"ownerUserID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type GetAllConversationsResp struct { + CommResp + Conversations []Conversation `json:"data"` +} + +type GetConversationsReq struct { + ConversationIDs []string `json:"conversationIDs" binding:"required"` + OwnerUserID string `json:"ownerUserID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type GetConversationsResp struct { + CommResp + Conversations []Conversation `json:"data"` +} + +type SetRecvMsgOptReq struct { + OwnerUserID string `json:"ownerUserID" binding:"required"` + ConversationID string `json:"conversationID"` + RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"` + OperationID string `json:"operationID" binding:"required"` + NotificationType int32 `json:"notificationType"` +} + +type SetRecvMsgOptResp struct { + CommResp +} diff --git a/pkg/base_info/cos_api_struct.go b/pkg/base_info/cos_api_struct.go new file mode 100644 index 000000000..e35931ad9 --- /dev/null +++ b/pkg/base_info/cos_api_struct.go @@ -0,0 +1,20 @@ +package base_info + +import sts "github.com/tencentyun/qcloud-cos-sts-sdk/go" + +type TencentCloudStorageCredentialReq struct { + OperationID string `json:"operationID"` +} + +type TencentCloudStorageCredentialRespData struct { + *sts.CredentialResult + Region string `json:"region"` + Bucket string `json:"bucket"` +} + +type TencentCloudStorageCredentialResp struct { + CommResp + CosData TencentCloudStorageCredentialRespData `json:"-"` + + Data map[string]interface{} `json:"data"` +} diff --git a/pkg/base_info/friend_api_struct.go b/pkg/base_info/friend_api_struct.go new file mode 100644 index 000000000..3c45c393e --- /dev/null +++ b/pkg/base_info/friend_api_struct.go @@ -0,0 +1,136 @@ +package base_info + +import open_im_sdk "Open_IM/pkg/proto/sdk_ws" + +type ParamsCommFriend struct { + OperationID string `json:"operationID" binding:"required"` + ToUserID string `json:"toUserID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} + +type AddBlacklistReq struct { + ParamsCommFriend +} +type AddBlacklistResp struct { + CommResp +} + +type ImportFriendReq struct { + FriendUserIDList []string `json:"friendUserIDList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type UserIDResult struct { + UserID string `json:"userID"` + Result int32 `json:"result"` +} +type ImportFriendResp struct { + CommResp + UserIDResultList []UserIDResult `json:"data"` +} + +type AddFriendReq struct { + ParamsCommFriend + ReqMsg string `json:"reqMsg"` +} +type AddFriendResp struct { + CommResp +} + +type AddFriendResponseReq struct { + ParamsCommFriend + Flag int32 `json:"flag" binding:"required,oneof=-1 0 1"` + HandleMsg string `json:"handleMsg"` +} +type AddFriendResponseResp struct { + CommResp +} + +type DeleteFriendReq struct { + ParamsCommFriend +} +type DeleteFriendResp struct { + CommResp +} + +type GetBlackListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetBlackListResp struct { + CommResp + BlackUserInfoList []*open_im_sdk.PublicUserInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +//type PublicUserInfo struct { +// UserID string `json:"userID"` +// Nickname string `json:"nickname"` +// FaceUrl string `json:"faceUrl"` +// Gender int32 `json:"gender"` +//} + +type SetFriendRemarkReq struct { + ParamsCommFriend + Remark string `json:"remark" binding:"required"` +} +type SetFriendRemarkResp struct { + CommResp +} + +type RemoveBlackListReq struct { + ParamsCommFriend +} +type RemoveBlackListResp struct { + CommResp +} + +type IsFriendReq struct { + ParamsCommFriend +} +type Response struct { + Friend bool `json:"isFriend"` +} +type IsFriendResp struct { + CommResp + Response Response `json:"data"` +} + +type GetFriendsInfoReq struct { + ParamsCommFriend +} +type GetFriendsInfoResp struct { + CommResp + FriendInfoList []*open_im_sdk.FriendInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetFriendListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetFriendListResp struct { + CommResp + FriendInfoList []*open_im_sdk.FriendInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetFriendApplyListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetFriendApplyListResp struct { + CommResp + FriendRequestList []*open_im_sdk.FriendRequest `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetSelfApplyListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetSelfApplyListResp struct { + CommResp + FriendRequestList []*open_im_sdk.FriendRequest `json:"-"` + Data []map[string]interface{} `json:"data"` +} diff --git a/pkg/base_info/group_api_struct.go b/pkg/base_info/group_api_struct.go new file mode 100644 index 000000000..47b6a6c67 --- /dev/null +++ b/pkg/base_info/group_api_struct.go @@ -0,0 +1,222 @@ +package base_info + +import ( + open_im_sdk "Open_IM/pkg/proto/sdk_ws" +) + +type CommResp struct { + ErrCode int32 `json:"errCode"` + ErrMsg string `json:"errMsg"` +} + +type CommDataResp struct { + CommResp + Data []map[string]interface{} `json:"data"` +} + +type KickGroupMemberReq struct { + GroupID string `json:"groupID" binding:"required"` + KickedUserIDList []string `json:"kickedUserIDList" binding:"required"` + Reason string `json:"reason"` + OperationID string `json:"operationID" binding:"required"` +} +type KickGroupMemberResp struct { + CommResp + UserIDResultList []*UserIDResult `json:"data"` +} + +type GetGroupMembersInfoReq struct { + GroupID string `json:"groupID" binding:"required"` + MemberList []string `json:"memberList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type GetGroupMembersInfoResp struct { + CommResp + MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type InviteUserToGroupReq struct { + GroupID string `json:"groupID" binding:"required"` + InvitedUserIDList []string `json:"invitedUserIDList" binding:"required"` + Reason string `json:"reason"` + OperationID string `json:"operationID" binding:"required"` +} +type InviteUserToGroupResp struct { + CommResp + UserIDResultList []*UserIDResult `json:"data"` +} + +type GetJoinedGroupListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` +} +type GetJoinedGroupListResp struct { + CommResp + GroupInfoList []*open_im_sdk.GroupInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetGroupMemberListReq struct { + GroupID string `json:"groupID"` + Filter int32 `json:"filter"` + NextSeq int32 `json:"nextSeq"` + OperationID string `json:"operationID"` +} +type GetGroupMemberListResp struct { + CommResp + NextSeq int32 `json:"nextSeq"` + MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetGroupAllMemberReq struct { + GroupID string `json:"groupID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type GetGroupAllMemberResp struct { + CommResp + MemberList []*open_im_sdk.GroupMemberFullInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type CreateGroupReq struct { + MemberList []*GroupAddMemberInfo `json:"memberList" binding:"required"` + OwnerUserID string `json:"ownerUserID" binding:"required"` + GroupType int32 `json:"groupType"` + GroupName string `json:"groupName"` + Notification string `json:"notification"` + Introduction string `json:"introduction"` + FaceURL string `json:"faceURL"` + Ex string `json:"ex"` + OperationID string `json:"operationID" binding:"required"` +} +type CreateGroupResp struct { + CommResp + GroupInfo open_im_sdk.GroupInfo `json:"-"` + Data map[string]interface{} `json:"data"` +} + +type GetGroupApplicationListReq struct { + OperationID string `json:"operationID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` //作为管理员或群主收到的 进群申请 +} +type GetGroupApplicationListResp struct { + CommResp + GroupRequestList []*open_im_sdk.GroupRequest `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type GetUserReqGroupApplicationListReq struct { + OperationID string `json:"operationID" binding:"required"` + UserID string `json:"userID" binding:"required"` +} + +type GetUserRespGroupApplicationResp struct { + CommResp + GroupRequestList []*open_im_sdk.GroupRequest `json:"-"` +} + +type GetGroupInfoReq struct { + GroupIDList []string `json:"groupIDList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type GetGroupInfoResp struct { + CommResp + GroupInfoList []*open_im_sdk.GroupInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type ApplicationGroupResponseReq struct { + OperationID string `json:"operationID" binding:"required"` + GroupID string `json:"groupID" binding:"required"` + FromUserID string `json:"fromUserID" binding:"required"` //application from FromUserID + HandledMsg string `json:"handledMsg"` + HandleResult int32 `json:"handleResult" binding:"required,oneof=-1 1"` +} +type ApplicationGroupResponseResp struct { + CommResp +} + +type JoinGroupReq struct { + GroupID string `json:"groupID" binding:"required"` + ReqMessage string `json:"reqMessage"` + OperationID string `json:"operationID" binding:"required"` +} +type JoinGroupResp struct { + CommResp +} + +type QuitGroupReq struct { + GroupID string `json:"groupID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type QuitGroupResp struct { + CommResp +} + +type SetGroupInfoReq struct { + GroupID string `json:"groupID" binding:"required"` + GroupName string `json:"groupName"` + Notification string `json:"notification"` + Introduction string `json:"introduction"` + FaceURL string `json:"faceURL"` + Ex string `json:"ex"` + OperationID string `json:"operationID" binding:"required"` +} +type SetGroupInfoResp struct { + CommResp +} + +type TransferGroupOwnerReq struct { + GroupID string `json:"groupID" binding:"required"` + OldOwnerUserID string `json:"oldOwnerUserID" binding:"required"` + NewOwnerUserID string `json:"newOwnerUserID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type TransferGroupOwnerResp struct { + CommResp +} + +type DismissGroupReq struct { + GroupID string `json:"groupID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type DismissGroupResp struct { + CommResp +} + +type MuteGroupMemberReq struct { + OperationID string `json:"operationID" binding:"required"` + GroupID string `json:"groupID" binding:"required"` + UserID string `json:"userID" binding:"required"` + MutedSeconds uint32 `json:"mutedSeconds" binding:"required"` +} +type MuteGroupMemberResp struct { + CommResp +} + +type CancelMuteGroupMemberReq struct { + OperationID string `json:"operationID" binding:"required"` + GroupID string `json:"groupID" binding:"required"` + UserID string `json:"userID" binding:"required"` +} +type CancelMuteGroupMemberResp struct { + CommResp +} + +type MuteGroupReq struct { + OperationID string `json:"operationID" binding:"required"` + GroupID string `json:"groupID" binding:"required"` +} +type MuteGroupResp struct { + CommResp +} + +type CancelMuteGroupReq struct { + OperationID string `json:"operationID" binding:"required"` + GroupID string `json:"groupID" binding:"required"` +} +type CancelMuteGroupResp struct { + CommResp +} diff --git a/pkg/base_info/manage_api_struct.go b/pkg/base_info/manage_api_struct.go new file mode 100644 index 000000000..4b2061b57 --- /dev/null +++ b/pkg/base_info/manage_api_struct.go @@ -0,0 +1,44 @@ +package base_info + +import ( + pbRelay "Open_IM/pkg/proto/relay" + "Open_IM/pkg/proto/sdk_ws" + pbUser "Open_IM/pkg/proto/user" +) + +type DeleteUsersReq struct { + OperationID string `json:"operationID" binding:"required"` + DeleteUserIDList []string `json:"deleteUserIDList" binding:"required"` +} +type DeleteUsersResp struct { + CommResp + FailedUserIDList []string `json:"data"` +} +type GetAllUsersUidReq struct { + OperationID string `json:"operationID" binding:"required"` +} +type GetAllUsersUidResp struct { + CommResp + UserIDList []string `json:"data"` +} +type GetUsersOnlineStatusReq struct { + OperationID string `json:"operationID" binding:"required"` + UserIDList []string `json:"userIDList" binding:"required,lte=200"` +} +type GetUsersOnlineStatusResp struct { + CommResp + SuccessResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult `json:"data"` +} +type AccountCheckReq struct { + OperationID string `json:"operationID" binding:"required"` + CheckUserIDList []string `json:"checkUserIDList" binding:"required,lte=100"` +} +type AccountCheckResp struct { + CommResp + ResultList []*pbUser.AccountCheckResp_SingleUserStatus `json:"data"` +} + +type ManagementSendMsgResp struct { + CommResp + ResultList server_api_params.UserSendMsgResp `json:"data"` +} diff --git a/pkg/base_info/minio_api_struct.go b/pkg/base_info/minio_api_struct.go new file mode 100644 index 000000000..6d3b0ecac --- /dev/null +++ b/pkg/base_info/minio_api_struct.go @@ -0,0 +1,25 @@ +package base_info + +type MinioStorageCredentialReq struct { + OperationID string `json:"operationID"` +} + +type MiniostorageCredentialResp struct { + SecretAccessKey string `json:"secretAccessKey"` + AccessKeyID string `json:"accessKeyID"` + SessionToken string `json:"sessionToken"` + BucketName string `json:"bucketName"` + StsEndpointURL string `json:"stsEndpointURL"` +} + +type MinioUploadFileReq struct { + OperationID string `form:"operationID" binding:"required"` + FileType int `form:"fileType" binding:"required"` +} + +type MinioUploadFileResp struct { + URL string `json:"URL"` + NewName string `json:"newName"` + SnapshotURL string `json:"snapshotURL,omitempty"` + SnapshotNewName string `json:"snapshotName,omitempty"` +} diff --git a/pkg/base_info/msg.go b/pkg/base_info/msg.go new file mode 100644 index 000000000..bc80cf304 --- /dev/null +++ b/pkg/base_info/msg.go @@ -0,0 +1,12 @@ +package base_info + +type DelMsgReq struct { + OpUserID string `json:"opUserID,omitempty"` + UserID string `json:"userID,omitempty"` + SeqList []uint32 `json:"seqList,omitempty"` + OperationID string `json:"operationID,omitempty"` +} + +type DelMsgResp struct { + CommResp +} diff --git a/pkg/base_info/office_struct.go b/pkg/base_info/office_struct.go new file mode 100644 index 000000000..e4dca230d --- /dev/null +++ b/pkg/base_info/office_struct.go @@ -0,0 +1,88 @@ +package base_info + +import ( + pbOffice "Open_IM/pkg/proto/office" +) + +type GetUserTagsReq struct { + OperationID string `json:"operationID" binding:"required"` +} + +type GetUserTagsResp struct { + CommResp + Data struct { + Tags []*pbOffice.Tag `json:"tags"` + } `json:"data"` +} + +type CreateTagReq struct { + TagName string `json:"tagName" binding:"required"` + UserIDList []string `json:"userIDList" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type CreateTagResp struct { + CommResp +} + +type DeleteTagReq struct { + TagID string `json:"tagID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type DeleteTagResp struct { + CommResp +} + +type SetTagReq struct { + TagID string `json:"tagID" binding:"required"` + NewName string `json:"newName"` + IncreaseUserIDList []string `json:"increaseUserIDList"` + ReduceUserIDList []string `json:"reduceUserIDList"` + OperationID string `json:"operationID" binding:"required"` +} + +type SetTagResp struct { + CommResp +} + +type SendMsg2TagReq struct { + TagList []string `json:"tagList"` + UserList []string `json:"userList"` + GroupList []string `json:"groupList"` + + SenderPlatformID int32 `json:"senderPlatformID" binding:"required"` + Content string `json:"content" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type SendMsg2TagResp struct { + CommResp +} + +type GetTagSendLogsReq struct { + PageNumber int32 `json:"pageNumber" binding:"required"` + ShowNumber int32 `json:"showNumber" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type GetTagSendLogsResp struct { + CommResp + Data struct { + Logs []*pbOffice.TagSendLog `json:"logs"` + CurrentPage int32 `json:"currentPage"` + ShowNumber int32 `json:"showNumber"` + } `json:"data"` +} + +type GetUserTagByIDReq struct { + TagID string `json:"tagID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} + +type GetUserTagByIDResp struct { + CommResp + Data struct { + Tag *pbOffice.Tag `json:"tag"` + } `json:"data"` +} diff --git a/pkg/base_info/organization_api_struct.go b/pkg/base_info/organization_api_struct.go new file mode 100644 index 000000000..c8c6babe8 --- /dev/null +++ b/pkg/base_info/organization_api_struct.go @@ -0,0 +1,110 @@ +package base_info + +import open_im_sdk "Open_IM/pkg/proto/sdk_ws" + +type CreateDepartmentReq struct { + *open_im_sdk.Department + OperationID string `json:"operationID" binding:"required"` +} +type CreateDepartmentResp struct { + CommResp + Department *open_im_sdk.Department `json:"-"` + Data map[string]interface{} `json:"data"` +} + +type UpdateDepartmentReq struct { + *open_im_sdk.Department + DepartmentID string `json:"departmentID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type UpdateDepartmentResp struct { + CommResp +} + +type GetSubDepartmentReq struct { + OperationID string `json:"operationID" binding:"required"` + DepartmentID string `json:"departmentID" binding:"required"` +} +type GetSubDepartmentResp struct { + CommResp + DepartmentList []*open_im_sdk.Department `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type DeleteDepartmentReq struct { + OperationID string `json:"operationID" binding:"required"` + DepartmentID string `json:"departmentID" binding:"required"` +} +type DeleteDepartmentResp struct { + CommResp +} + +type CreateOrganizationUserReq struct { + OperationID string `json:"operationID" binding:"required"` + OrganizationUser *open_im_sdk.OrganizationUser +} +type CreateOrganizationUserResp struct { + CommResp +} + +type UpdateOrganizationUserReq struct { + OperationID string `json:"operationID" binding:"required"` + OrganizationUser *open_im_sdk.OrganizationUser +} +type UpdateOrganizationUserResp struct { + CommResp +} + +type CreateDepartmentMemberReq struct { + OperationID string `json:"operationID" binding:"required"` + UserInDepartment *open_im_sdk.UserInDepartment +} + +type CreateDepartmentMemberResp struct { + CommResp +} + +type GetUserInDepartmentReq struct { + UserID string + OperationID string `json:"operationID" binding:"required"` +} +type GetUserInDepartmentResp struct { + CommResp + UserInDepartment *open_im_sdk.UserInDepartment `json:"-"` + Data map[string]interface{} `json:"data"` +} + +type UpdateUserInDepartmentReq struct { + OperationID string `json:"operationID" binding:"required"` + *open_im_sdk.DepartmentMember +} +type UpdateUserInDepartmentResp struct { + CommResp +} + +type DeleteOrganizationUserReq struct { + UserID string + OperationID string `json:"operationID" binding:"required"` +} +type DeleteOrganizationUserResp struct { + CommResp +} + +type GetDepartmentMemberReq struct { + DepartmentID string + OperationID string `json:"operationID" binding:"required"` +} +type GetDepartmentMemberResp struct { + CommResp + UserInDepartmentList []*open_im_sdk.UserInDepartment `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type DeleteUserInDepartmentReq struct { + DepartmentID string `json:"departmentID" binding:"required"` + UserID string `json:"userID" binding:"required"` + OperationID string `json:"operationID" binding:"required"` +} +type DeleteUserInDepartmentResp struct { + CommResp +} diff --git a/pkg/base_info/oss_api_struct.go b/pkg/base_info/oss_api_struct.go new file mode 100644 index 000000000..621d18820 --- /dev/null +++ b/pkg/base_info/oss_api_struct.go @@ -0,0 +1,22 @@ +package base_info + +type OSSCredentialReq struct { + OperationID string `json:"operationID"` + Filename string `json:"filename"` + FileType string `json:"file_type"` +} + +type OSSCredentialRespData struct { + Endpoint string `json:"endpoint"` + AccessKeyId string `json:"access_key_id"` + AccessKeySecret string `json:"access_key_secret"` + Token string `json:"token"` + Bucket string `json:"bucket"` + FinalHost string `json:"final_host"` +} + +type OSSCredentialResp struct { + CommResp + OssData OSSCredentialRespData `json:"-"` + Data map[string]interface{} `json:"data"` +} diff --git a/pkg/base_info/public_struct.go b/pkg/base_info/public_struct.go new file mode 100644 index 000000000..2950dbea8 --- /dev/null +++ b/pkg/base_info/public_struct.go @@ -0,0 +1,139 @@ +package base_info + +import ( + "github.com/gin-gonic/gin" + "net/http" +) + +type ApiUserInfo struct { + UserID string `json:"userID" binding:"required,min=1,max=64"` + Nickname string `json:"nickname" binding:"omitempty,min=1,max=64"` + FaceURL string `json:"faceURL" binding:"omitempty,max=1024"` + Gender int32 `json:"gender" binding:"omitempty,oneof=0 1 2"` + PhoneNumber string `json:"phoneNumber" binding:"omitempty,max=32"` + Birth uint32 `json:"birth" binding:"omitempty"` + Email string `json:"email" binding:"omitempty,max=64"` + Ex string `json:"ex" binding:"omitempty,max=1024"` +} + +//type Conversation struct { +// OwnerUserID string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"` +// ConversationID string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"` +// ConversationType int32 `gorm:"column:conversation_type" json:"conversationType"` +// UserID string `gorm:"column:user_id;type:char(64)" json:"userID"` +// GroupID string `gorm:"column:group_id;type:char(128)" json:"groupID"` +// RecvMsgOpt int32 `gorm:"column:recv_msg_opt" json:"recvMsgOpt"` +// UnreadCount int32 `gorm:"column:unread_count" json:"unreadCount"` +// DraftTextTime int64 `gorm:"column:draft_text_time" json:"draftTextTime"` +// IsPinned bool `gorm:"column:is_pinned" json:"isPinned"` +// AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"` +// Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` +//} + +type GroupAddMemberInfo struct { + UserID string `json:"userID" binding:"required"` + RoleLevel int32 `json:"roleLevel" binding:"required"` +} + +func SetErrCodeMsg(c *gin.Context, status int) *CommResp { + resp := CommResp{ErrCode: int32(status), ErrMsg: http.StatusText(status)} + c.JSON(status, resp) + return &resp +} + +//GroupName string `json:"groupName"` +// Introduction string `json:"introduction"` +// Notification string `json:"notification"` +// FaceUrl string `json:"faceUrl"` +// OperationID string `json:"operationID" binding:"required"` +// GroupType int32 `json:"groupType"` +// Ex string `json:"ex"` + +//type GroupInfo struct { +// GroupID string `json:"groupID"` +// GroupName string `json:"groupName"` +// Notification string `json:"notification"` +// Introduction string `json:"introduction"` +// FaceUrl string `json:"faceUrl"` +// OwnerUserID string `json:"ownerUserID"` +// Ex string `json:"ex"` +// GroupType int32 `json:"groupType"` +//} + +//type GroupMemberFullInfo struct { +// GroupID string `json:"groupID"` +// UserID string `json:"userID"` +// RoleLevel int32 `json:"roleLevel"` +// JoinTime uint64 `json:"joinTime"` +// Nickname string `json:"nickname"` +// FaceUrl string `json:"faceUrl"` +// FriendRemark string `json:"friendRemark"` +// AppMangerLevel int32 `json:"appMangerLevel"` +// JoinSource int32 `json:"joinSource"` +// OperatorUserID string `json:"operatorUserID"` +// Ex string `json:"ex"` +//} +// +//type PublicUserInfo struct { +// UserID string `json:"userID"` +// Nickname string `json:"nickname"` +// FaceUrl string `json:"faceUrl"` +// Gender int32 `json:"gender"` +//} +// +//type UserInfo struct { +// UserID string `json:"userID"` +// Nickname string `json:"nickname"` +// FaceUrl string `json:"faceUrl"` +// Gender int32 `json:"gender"` +// Mobile string `json:"mobile"` +// Birth string `json:"birth"` +// Email string `json:"email"` +// Ex string `json:"ex"` +//} +// +//type FriendInfo struct { +// OwnerUserID string `json:"ownerUserID"` +// Remark string `json:"remark"` +// CreateTime int64 `json:"createTime"` +// FriendUser UserInfo `json:"friendUser"` +// AddSource int32 `json:"addSource"` +// OperatorUserID string `json:"operatorUserID"` +// Ex string `json:"ex"` +//} +// +//type BlackInfo struct { +// OwnerUserID string `json:"ownerUserID"` +// CreateTime int64 `json:"createTime"` +// BlackUser PublicUserInfo `json:"friendUser"` +// AddSource int32 `json:"addSource"` +// OperatorUserID string `json:"operatorUserID"` +// Ex string `json:"ex"` +//} +// +//type GroupRequest struct { +// UserID string `json:"userID"` +// GroupID string `json:"groupID"` +// HandleResult string `json:"handleResult"` +// ReqMsg string `json:"reqMsg"` +// HandleMsg string `json:"handleMsg"` +// ReqTime int64 `json:"reqTime"` +// HandleUserID string `json:"handleUserID"` +// HandleTime int64 `json:"handleTime"` +// Ex string `json:"ex"` +//} +// +//type FriendRequest struct { +// FromUserID string `json:"fromUserID"` +// ToUserID string `json:"toUserID"` +// HandleResult int32 `json:"handleResult"` +// ReqMessage string `json:"reqMessage"` +// CreateTime int64 `json:"createTime"` +// HandlerUserID string `json:"handlerUserID"` +// HandleMsg string `json:"handleMsg"` +// HandleTime int64 `json:"handleTime"` +// Ex string `json:"ex"` +//} +// +// +// diff --git a/pkg/base_info/user_api_struct.go b/pkg/base_info/user_api_struct.go new file mode 100644 index 000000000..10f20376c --- /dev/null +++ b/pkg/base_info/user_api_struct.go @@ -0,0 +1,34 @@ +package base_info + +import ( + open_im_sdk "Open_IM/pkg/proto/sdk_ws" +) + +type GetUsersInfoReq struct { + OperationID string `json:"operationID" binding:"required"` + UserIDList []string `json:"userIDList" binding:"required"` +} +type GetUsersInfoResp struct { + CommResp + UserInfoList []*open_im_sdk.PublicUserInfo `json:"-"` + Data []map[string]interface{} `json:"data"` +} + +type UpdateSelfUserInfoReq struct { + ApiUserInfo + OperationID string `json:"operationID" binding:"required"` +} + +type UpdateUserInfoResp struct { + CommResp +} + +type GetSelfUserInfoReq struct { + OperationID string `json:"operationID" binding:"required"` + UserID string `json:"userID" binding:"required"` +} +type GetSelfUserInfoResp struct { + CommResp + UserInfo *open_im_sdk.UserInfo `json:"-"` + Data map[string]interface{} `json:"data"` +} diff --git a/pkg/base_info/work_moments_struct.go b/pkg/base_info/work_moments_struct.go new file mode 100644 index 000000000..22d38df37 --- /dev/null +++ b/pkg/base_info/work_moments_struct.go @@ -0,0 +1,97 @@ +package base_info + +import "Open_IM/pkg/proto/office" + +type CreateOneWorkMomentReq struct { + office.CreateOneWorkMomentReq +} + +type CreateOneWorkMomentResp struct { + CommResp +} + +type DeleteOneWorkMomentReq struct { + office.DeleteOneWorkMomentReq +} + +type DeleteOneWorkMomentResp struct { + CommResp +} + +type LikeOneWorkMomentReq struct { + office.LikeOneWorkMomentReq +} + +type LikeOneWorkMomentResp struct { + CommResp +} + +type CommentOneWorkMomentReq struct { + office.CommentOneWorkMomentReq +} + +type CommentOneWorkMomentResp struct { + CommResp +} + +type WorkMomentsUserCommonReq struct { + PageNumber int32 `json:"pageNumber" binding:"required"` + ShowNumber int32 `json:"showNumber" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + UserID string `json:"UserID" binding:"required"` +} + +type GetUserWorkMomentsReq struct { + WorkMomentsUserCommonReq +} + +type GetUserWorkMomentsResp struct { + CommResp + Data struct { + WorkMoments []*office.WorkMoment `json:"workMoments"` + CurrentPage int32 `json:"currentPage"` + ShowNumber int32 `json:"showNumber"` + } `json:"data"` +} + +type GetUserFriendWorkMomentsReq struct { + WorkMomentsUserCommonReq +} + +type GetUserFriendWorkMomentsResp struct { + CommResp + Data struct { + WorkMoments []*office.WorkMoment `json:"workMoments"` + CurrentPage int32 `json:"currentPage"` + ShowNumber int32 `json:"showNumber"` + } `json:"data"` +} + +type GetUserWorkMomentsCommentsMsgReq struct { + WorkMomentsUserCommonReq +} + +type GetUserWorkMomentsCommentsMsgResp struct { + CommResp + Data struct { + CommentMsgs []*office.CommentsMsg `json:"comments"` + CurrentPage int32 `json:"currentPage"` + ShowNumber int32 `json:"showNumber"` + } `json:"data"` +} + +type SetUserWorkMomentsLevelReq struct { + office.SetUserWorkMomentsLevelReq +} + +type SetUserWorkMomentsLevelResp struct { + CommResp +} + +type ClearUserWorkMomentsCommentsMsgReq struct { + office.ClearUserWorkMomentsCommentsMsgReq +} + +type ClearUserWorkMomentsCommentsMsgResp struct { + CommResp +} diff --git a/pkg/call_back_struct/common.go b/pkg/call_back_struct/common.go new file mode 100644 index 000000000..bc9ad5dac --- /dev/null +++ b/pkg/call_back_struct/common.go @@ -0,0 +1,24 @@ +package call_back_struct + +type CommonCallbackReq struct { + SendID string `json:"sendID"` + CallbackCommand string `json:"callbackCommand"` + ServerMsgID string `json:"serverMsgID"` + ClientMsgID string `json:"clientMsgID"` + OperationID string `json:"operationID"` + SenderPlatformID int32 `json:"senderPlatformID"` + SenderNickname string `json:"senderNickname"` + SessionType int32 `json:"sessionType"` + MsgFrom int32 `json:"msgFrom"` + ContentType int32 `json:"contentType"` + Status int32 `json:"status"` + CreateTime int64 `json:"createTime"` + Content string `json:"content"` +} + +type CommonCallbackResp struct { + ActionCode int `json:"actionCode"` + ErrCode int `json:"errCode"` + ErrMsg string `json:"errMsg"` + OperationID string `json:"operationID"` +} diff --git a/pkg/call_back_struct/group.go b/pkg/call_back_struct/group.go new file mode 100644 index 000000000..3681dddcc --- /dev/null +++ b/pkg/call_back_struct/group.go @@ -0,0 +1,9 @@ +package call_back_struct + +type CallbackBeforeCreateGroupReq struct { + CommonCallbackReq +} + +type CallbackAfterCreateGroupResp struct { + CommonCallbackResp +} \ No newline at end of file diff --git a/pkg/call_back_struct/message.go b/pkg/call_back_struct/message.go new file mode 100644 index 000000000..31c215ea2 --- /dev/null +++ b/pkg/call_back_struct/message.go @@ -0,0 +1,47 @@ +package call_back_struct + + +type CallbackBeforeSendSingleMsgReq struct { + CommonCallbackReq + RecvID string `json:"recvID"` +} + +type CallbackBeforeSendSingleMsgResp struct { + CommonCallbackResp +} + +type CallbackAfterSendSingleMsgReq struct { + CommonCallbackReq + RecvID string `json:"recvID"` +} + +type CallbackAfterSendSingleMsgResp struct { + CommonCallbackResp +} + +type CallbackBeforeSendGroupMsgReq struct { + CommonCallbackReq + GroupID string `json:"groupID"` +} + +type CallbackBeforeSendGroupMsgResp struct { + CommonCallbackResp +} + +type CallbackAfterSendGroupMsgReq struct { + CommonCallbackReq + GroupID string `json:"groupID"` +} + +type CallbackAfterSendGroupMsgResp struct { + CommonCallbackResp +} + +type CallbackWordFilterReq struct { + CommonCallbackReq +} + +type CallbackWordFilterResp struct { + CommonCallbackResp + Content string `json:"content"` +} diff --git a/pkg/cms_api_struct/admin.go b/pkg/cms_api_struct/admin.go new file mode 100644 index 000000000..54674662e --- /dev/null +++ b/pkg/cms_api_struct/admin.go @@ -0,0 +1,10 @@ +package cms_api_struct + +type AdminLoginRequest struct { + AdminName string `json:"admin_name" binding:"required"` + Secret string `json:"secret" binding:"required"` +} + +type AdminLoginResponse struct { + Token string `json:"token"` +} \ No newline at end of file diff --git a/pkg/cms_api_struct/common.go b/pkg/cms_api_struct/common.go new file mode 100644 index 000000000..7d160f543 --- /dev/null +++ b/pkg/cms_api_struct/common.go @@ -0,0 +1,11 @@ +package cms_api_struct + +type RequestPagination struct { + PageNumber int `form:"page_number" binding:"required"` + ShowNumber int `form:"show_number" binding:"required"` +} + +type ResponsePagination struct { + CurrentPage int `json:"current_number" binding:"required"` + ShowNumber int `json:"show_number" binding:"required"` +} \ No newline at end of file diff --git a/pkg/cms_api_struct/group.go b/pkg/cms_api_struct/group.go new file mode 100644 index 000000000..7d3333127 --- /dev/null +++ b/pkg/cms_api_struct/group.go @@ -0,0 +1,144 @@ +package cms_api_struct + +type GroupResponse struct { + GroupName string `json:"group_name"` + GroupID string `json:"group_id"` + GroupMasterName string `json:"group_master_name"` + GroupMasterId string `json:"group_master_id"` + CreateTime string `json:"create_time"` + IsBanChat bool `json:"is_ban_chat"` + IsBanPrivateChat bool `json:"is_ban_private_chat"` + ProfilePhoto string `json:"profile_photo"` +} + +type GetGroupByIdRequest struct { + GroupId string `form:"group_id" binding:"required"` +} + +type GetGroupByIdResponse struct { + GroupResponse +} + +type GetGroupRequest struct { + GroupName string `form:"group_name" binding:"required"` + RequestPagination +} + +type GetGroupResponse struct { + Groups []GroupResponse `json:"groups"` + GroupNums int `json:"group_nums"` + ResponsePagination +} + +type GetGroupsRequest struct { + RequestPagination +} + +type GetGroupsResponse struct { + Groups []GroupResponse `json:"groups"` + GroupNums int `json:"group_nums"` + ResponsePagination +} + +type CreateGroupRequest struct { + GroupName string `json:"group_name" binding:"required"` + GroupMasterId string `json:"group_master_id" binding:"required"` + GroupMembers []string `json:"group_members" binding:"required"` +} + +type CreateGroupResponse struct { +} + +type SetGroupMasterRequest struct { + GroupId string `json:"group_id" binding:"required"` + UserId string `json:"user_id" binding:"required"` +} + +type SetGroupMasterResponse struct { +} + +type SetGroupMemberRequest struct { + GroupId string `json:"group_id" binding:"required"` + UserId string `json:"user_id" binding:"required"` +} + +type SetGroupMemberRespones struct { +} + +type BanGroupChatRequest struct { + GroupId string `json:"group_id" binding:"required"` +} + +type BanGroupChatResponse struct { +} + +type BanPrivateChatRequest struct { + GroupId string `json:"group_id" binding:"required"` +} + +type BanPrivateChatResponse struct { +} + +type DeleteGroupRequest struct { + GroupId string `json:"group_id" binding:"required"` +} + +type DeleteGroupResponse struct { +} + +type GetGroupMembersRequest struct { + GroupId string `form:"group_id" binding:"required"` + UserName string `form:"user_name"` + RequestPagination +} + +type GroupMemberResponse struct { + MemberPosition int `json:"member_position"` + MemberNickName string `json:"member_nick_name"` + MemberId string `json:"member_id"` + JoinTime string `json:"join_time"` +} + +type GetGroupMembersResponse struct { + GroupMembers []GroupMemberResponse `json:"group_members"` + ResponsePagination + MemberNums int `json:"member_nums"` +} + +type GroupMemberRequest struct { + GroupId string `json:"group_id" binding:"required"` + Members []string `json:"members" binding:"required"` +} + +type GroupMemberOperateResponse struct { + Success []string `json:"success"` + Failed []string `json:"failed"` +} + +type AddGroupMembersRequest struct { + GroupMemberRequest +} + +type AddGroupMembersResponse struct { + GroupMemberOperateResponse +} + +type RemoveGroupMembersRequest struct { + GroupMemberRequest +} + +type RemoveGroupMembersResponse struct { + GroupMemberOperateResponse +} + +type AlterGroupInfoRequest struct { + GroupID string `json:"group_id"` + GroupName string `json:"group_name"` + Notification string `json:"notification"` + Introduction string `json:"introduction"` + ProfilePhoto string `json:"profile_photo"` + GroupType int `json:"group_type"` +} + +type AlterGroupInfoResponse struct { +} diff --git a/pkg/cms_api_struct/message_cms.go b/pkg/cms_api_struct/message_cms.go new file mode 100644 index 000000000..164c75011 --- /dev/null +++ b/pkg/cms_api_struct/message_cms.go @@ -0,0 +1,50 @@ +package cms_api_struct + +type BroadcastRequest struct { + Message string `json:"message"` +} + +type BroadcastResponse struct { +} + +type MassSendMassageRequest struct { + Message string `json:"message"` + Users []string `json:"users"` +} + +type MassSendMassageResponse struct { +} + +type GetChatLogsRequest struct { + SessionType int `form:"session_type"` + ContentType int `form:"content_type"` + Content string `form:"content"` + UserId string `form:"user_id"` + GroupId string `form:"group_id"` + Date string `form:"date"` + + RequestPagination +} + +type ChatLog struct { + SessionType int `json:"session_type"` + ContentType int `json:"content_type"` + SenderNickName string `json:"sender_nick_name"` + SenderId string `json:"sender_id"` + SearchContent string `json:"search_content"` + WholeContent string `json:"whole_content"` + + ReceiverNickName string `json:"receiver_nick_name,omitempty"` + ReceiverID string `json:"receiver_id,omitempty"` + + GroupName string `json:"group_name,omitempty"` + GroupId string `json:"group_id,omitempty"` + + Date string `json:"date"` +} + +type GetChatLogsResponse struct { + ChatLogs []ChatLog `json:"chat_logs"` + ChatLogsNum int `json:"log_nums"` + ResponsePagination +} diff --git a/pkg/cms_api_struct/organization.go b/pkg/cms_api_struct/organization.go new file mode 100644 index 000000000..825d41aa1 --- /dev/null +++ b/pkg/cms_api_struct/organization.go @@ -0,0 +1,25 @@ +package cms_api_struct + +type GetStaffsResponse struct { + StaffsList []struct { + ProfilePhoto string `json:"profile_photo"` + NickName string `json:"nick_name"` + StaffId int `json:"staff_id"` + Position string `json:"position"` + EntryTime string `json:"entry_time"` + } `json:"staffs_list"` +} + +type GetOrganizationsResponse struct { + OrganizationList []struct { + OrganizationId int `json:"organization_id"` + OrganizationName string `json:"organization_name"` + } `json:"organization_list"` +} + +type SquadResponse struct { + SquadList []struct { + SquadId int `json:"squad_id"` + SquadName string `json:"squad_name"` + } `json:"squad_list"` +} diff --git a/pkg/cms_api_struct/statistics.go b/pkg/cms_api_struct/statistics.go new file mode 100644 index 000000000..2ff1efffa --- /dev/null +++ b/pkg/cms_api_struct/statistics.go @@ -0,0 +1,89 @@ +package cms_api_struct + +type GetStatisticsRequest struct { + From string `form:"from" binding:"required"` + To string `form:"to" binding:"required"` +} + +type GetMessageStatisticsRequest struct { + GetStatisticsRequest +} + +type GetMessageStatisticsResponse struct { + PrivateMessageNum int `json:"private_message_num"` + GroupMessageNum int `json:"group_message_num"` + PrivateMessageNumList []struct { + Date string `json:"date"` + MessageNum int `json:"message_num"` + } `json:"private_message_num_list"` + GroupMessageNumList []struct { + Date string `json:"date"` + MessageNum int `json:"message_num"` + } `json:"group_message_num_list"` +} + +type GetUserStatisticsRequest struct { + GetStatisticsRequest +} + +type GetUserStatisticsResponse struct { + IncreaseUserNum int `json:"increase_user_num"` + ActiveUserNum int `json:"active_user_num"` + TotalUserNum int `json:"total_user_num"` + IncreaseUserNumList []struct { + Date string `json:"date"` + IncreaseUserNum int `json:"increase_user_num"` + } `json:"increase_user_num_list"` + ActiveUserNumList []struct { + Date string `json:"date"` + ActiveUserNum int `json:"active_user_num"` + } `json:"active_user_num_list"` + TotalUserNumList []struct { + Date string `json:"date"` + TotalUserNum int `json:"total_user_num"` + } `json:"total_user_num_list"` +} + +type GetGroupStatisticsRequest struct { + GetStatisticsRequest +} + +// 群聊统计 +type GetGroupStatisticsResponse struct { + IncreaseGroupNum int `json:"increase_group_num"` + TotalGroupNum int `json:"total_group_num"` + IncreaseGroupNumList []struct { + Date string `json:"date"` + IncreaseGroupNum int `json:"increase_group_num"` + } `json:"increase_group_num_list"` + TotalGroupNumList []struct { + Date string `json:"date"` + TotalGroupNum int `json:"total_group_num"` + } `json:"total_group_num_list"` +} + +type GetActiveUserRequest struct { + GetStatisticsRequest + // RequestPagination +} + +type GetActiveUserResponse struct { + ActiveUserList []struct { + NickName string `json:"nick_name"` + UserId string `json:"user_id"` + MessageNum int `json:"message_num"` + } `json:"active_user_list"` +} + +type GetActiveGroupRequest struct { + GetStatisticsRequest + // RequestPagination +} + +type GetActiveGroupResponse struct { + ActiveGroupList []struct { + GroupName string `json:"group_name"` + GroupId string `json:"group_id"` + MessageNum int `json:"message_num"` + } `json:"active_group_list"` +} diff --git a/pkg/cms_api_struct/user.go b/pkg/cms_api_struct/user.go new file mode 100644 index 000000000..2c0b004b0 --- /dev/null +++ b/pkg/cms_api_struct/user.go @@ -0,0 +1,110 @@ +package cms_api_struct + +type UserResponse struct { + ProfilePhoto string `json:"profile_photo"` + Nickname string `json:"nick_name"` + UserId string `json:"user_id"` + CreateTime string `json:"create_time,omitempty"` + IsBlock bool `json:"is_block"` +} + +type GetUserRequest struct { + UserId string `form:"user_id" binding:"required"` +} + +type GetUserResponse struct { + UserResponse +} + +type GetUsersRequest struct { + RequestPagination +} + +type GetUsersResponse struct { + Users []*UserResponse `json:"users"` + ResponsePagination + UserNums int32 `json:"user_nums"` +} + +type GetUsersByNameRequest struct { + UserName string `form:"user_name" binding:"required"` + RequestPagination +} + +type GetUsersByNameResponse struct { + Users []*UserResponse `json:"users"` + ResponsePagination + UserNums int32 `json:"user_nums"` +} + +type ResignUserRequest struct { + UserId string `json:"user_id"` +} + +type ResignUserResponse struct { +} + +type AlterUserRequest struct { + UserId string `json:"user_id" binding:"required"` + Nickname string `json:"nickname"` + PhoneNumber int `json:"phone_number" validate:"len=11"` + Email string `json:"email"` +} + +type AlterUserResponse struct { +} + +type AddUserRequest struct { + PhoneNumber string `json:"phone_number" binding:"required"` + UserId string `json:"user_id" binding:"required"` + Name string `json:"name" binding:"required"` +} + +type AddUserResponse struct { +} + +type BlockUser struct { + UserResponse + BeginDisableTime string `json:"begin_disable_time"` + EndDisableTime string `json:"end_disable_time"` +} + +type BlockUserRequest struct { + UserId string `json:"user_id" binding:"required"` + EndDisableTime string `json:"end_disable_time" binding:"required"` +} + +type BlockUserResponse struct { +} + +type UnblockUserRequest struct { + UserId string `json:"user_id" binding:"required"` +} + +type UnBlockUserResponse struct { +} + +type GetBlockUsersRequest struct { + RequestPagination +} + +type GetBlockUsersResponse struct { + BlockUsers []BlockUser `json:"block_users"` + ResponsePagination + UserNums int32 `json:"user_nums"` +} + +type GetBlockUserRequest struct { + UserId string `form:"user_id" binding:"required"` +} + +type GetBlockUserResponse struct { + BlockUser +} + +type DeleteUserRequest struct { + UserId string `json:"user_id" binding:"required"` +} + +type DeleteUserResponse struct { +} diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go new file mode 100644 index 000000000..9e1bd54b6 --- /dev/null +++ b/pkg/common/config/config.go @@ -0,0 +1,434 @@ +package config + +import ( + "io/ioutil" + "os" + "path/filepath" + "runtime" + + "github.com/spf13/viper" + "gopkg.in/yaml.v3" +) + +var ( + _, b, _, _ = runtime.Caller(0) + // Root folder of this project + Root = filepath.Join(filepath.Dir(b), "../../..") +) + +var Config config + +type callBackConfig struct { + Enable bool `yaml:"enable"` + CallbackTimeOut int `yaml:"callbackTimeOut"` + CallbackFailedContinue bool `yaml:"callbackFailedContinue"` +} + +type config struct { + ServerIP string `yaml:"serverip"` + ServerVersion string `yaml:"serverversion"` + Api struct { + GinPort []int `yaml:"openImApiPort"` + } + CmsApi struct { + GinPort []int `yaml:"openImCmsApiPort"` + } + Sdk struct { + WsPort []int `yaml:"openImSdkWsPort"` + } + Credential struct { + Tencent struct { + AppID string `yaml:"appID"` + Region string `yaml:"region"` + Bucket string `yaml:"bucket"` + SecretID string `yaml:"secretID"` + SecretKey string `yaml:"secretKey"` + } + Ali struct { + RegionID string `yaml:"regionID"` + AccessKeyID string `yaml:"accessKeyID"` + AccessKeySecret string `yaml:"accessKeySecret"` + StsEndpoint string `yaml:"stsEndpoint"` + OssEndpoint string `yaml:"ossEndpoint"` + Bucket string `yaml:"bucket"` + FinalHost string `yaml:"finalHost"` + StsDurationSeconds int64 `yaml:"stsDurationSeconds"` + OssRoleArn string `yaml:"OssRoleArn"` + } + Minio struct { + Bucket string `yaml:"bucket"` + Location string `yaml:"location"` + Endpoint string `yaml:"endpoint"` + AccessKeyID string `yaml:"accessKeyID"` + SecretAccessKey string `yaml:"secretAccessKey"` + EndpointInner string `yaml:"endpointInner"` + EndpointInnerEnable bool `yaml:"endpointInnerEnable"` + } `yaml:"minio"` + } + + Mysql struct { + DBAddress []string `yaml:"dbMysqlAddress"` + DBUserName string `yaml:"dbMysqlUserName"` + DBPassword string `yaml:"dbMysqlPassword"` + DBDatabaseName string `yaml:"dbMysqlDatabaseName"` + DBTableName string `yaml:"DBTableName"` + DBMsgTableNum int `yaml:"dbMsgTableNum"` + DBMaxOpenConns int `yaml:"dbMaxOpenConns"` + DBMaxIdleConns int `yaml:"dbMaxIdleConns"` + DBMaxLifeTime int `yaml:"dbMaxLifeTime"` + } + Mongo struct { + DBUri string `yaml:"dbUri"` // 当dbUri值不为空则直接使用该值 + DBAddress []string `yaml:"dbAddress"` + DBDirect bool `yaml:"dbDirect"` + DBTimeout int `yaml:"dbTimeout"` + DBDatabase string `yaml:"dbDatabase"` + DBSource string `yaml:"dbSource"` + DBUserName string `yaml:"dbUserName"` + DBPassword string `yaml:"dbPassword"` + DBMaxPoolSize int `yaml:"dbMaxPoolSize"` + DBRetainChatRecords int `yaml:"dbRetainChatRecords"` + } + Redis struct { + DBAddress string `yaml:"dbAddress"` + DBMaxIdle int `yaml:"dbMaxIdle"` + DBMaxActive int `yaml:"dbMaxActive"` + DBIdleTimeout int `yaml:"dbIdleTimeout"` + DBPassWord string `yaml:"dbPassWord"` + } + RpcPort struct { + OpenImUserPort []int `yaml:"openImUserPort"` + openImFriendPort []int `yaml:"openImFriendPort"` + RpcMessagePort []int `yaml:"rpcMessagePort"` + RpcPushMessagePort []int `yaml:"rpcPushMessagePort"` + OpenImGroupPort []int `yaml:"openImGroupPort"` + RpcModifyUserInfoPort []int `yaml:"rpcModifyUserInfoPort"` + RpcGetTokenPort []int `yaml:"rpcGetTokenPort"` + } + RpcRegisterName struct { + OpenImStatisticsName string `yaml:"OpenImStatisticsName"` + OpenImUserName string `yaml:"openImUserName"` + OpenImFriendName string `yaml:"openImFriendName"` + OpenImOfflineMessageName string `yaml:"openImOfflineMessageName"` + OpenImPushName string `yaml:"openImPushName"` + OpenImOnlineMessageRelayName string `yaml:"openImOnlineMessageRelayName"` + OpenImGroupName string `yaml:"openImGroupName"` + OpenImAuthName string `yaml:"openImAuthName"` + OpenImMessageCMSName string `yaml:"openImMessageCMSName"` + OpenImAdminCMSName string `yaml:"openImAdminCMSName"` + OpenImOfficeName string `yaml:"openImOfficeName"` + OpenImOrganizationName string `yaml:"openImOrganizationName"` + } + Etcd struct { + EtcdSchema string `yaml:"etcdSchema"` + EtcdAddr []string `yaml:"etcdAddr"` + } + Log struct { + StorageLocation string `yaml:"storageLocation"` + RotationTime int `yaml:"rotationTime"` + RemainRotationCount uint `yaml:"remainRotationCount"` + RemainLogLevel uint `yaml:"remainLogLevel"` + ElasticSearchSwitch bool `yaml:"elasticSearchSwitch"` + ElasticSearchAddr []string `yaml:"elasticSearchAddr"` + ElasticSearchUser string `yaml:"elasticSearchUser"` + ElasticSearchPassword string `yaml:"elasticSearchPassword"` + } + ModuleName struct { + LongConnSvrName string `yaml:"longConnSvrName"` + MsgTransferName string `yaml:"msgTransferName"` + PushName string `yaml:"pushName"` + } + LongConnSvr struct { + WebsocketPort []int `yaml:"openImWsPort"` + WebsocketMaxConnNum int `yaml:"websocketMaxConnNum"` + WebsocketMaxMsgLen int `yaml:"websocketMaxMsgLen"` + WebsocketTimeOut int `yaml:"websocketTimeOut"` + } + + Push struct { + Tpns struct { + Ios struct { + AccessID string `yaml:"accessID"` + SecretKey string `yaml:"secretKey"` + } + Android struct { + AccessID string `yaml:"accessID"` + SecretKey string `yaml:"secretKey"` + } + Enable bool `yaml:"enable"` + } + Jpns struct { + AppKey string `yaml:"appKey"` + MasterSecret string `yaml:"masterSecret"` + PushUrl string `yaml:"pushUrl"` + PushIntent string `yaml:"pushIntent"` + Enable bool `yaml:"enable"` + } + Getui struct { + PushUrl string `yaml:"pushUrl"` + AppKey string `yaml:"appKey"` + Enable bool `yaml:"enable"` + Intent string `yaml:"intent"` + MasterSecret string `yaml:"masterSecret"` + } + } + Manager struct { + AppManagerUid []string `yaml:"appManagerUid"` + Secrets []string `yaml:"secrets"` + } + Kafka struct { + Ws2mschat struct { + Addr []string `yaml:"addr"` + Topic string `yaml:"topic"` + } + Ms2pschat struct { + Addr []string `yaml:"addr"` + Topic string `yaml:"topic"` + } + ConsumerGroupID struct { + MsgToMongo string `yaml:"msgToMongo"` + MsgToMySql string `yaml:"msgToMySql"` + MsgToPush string `yaml:"msgToPush"` + } + } + Secret string `yaml:"secret"` + MultiLoginPolicy int `yaml:"multiloginpolicy"` + TokenPolicy struct { + AccessSecret string `yaml:"accessSecret"` + AccessExpire int64 `yaml:"accessExpire"` + } + MessageVerify struct { + FriendVerify bool `yaml:"friendVerify"` + } + IOSPush struct { + PushSound string `yaml:"pushSound"` + BadgeCount bool `yaml:"badgeCount"` + } + + Callback struct { + CallbackUrl string `yaml:"callbackUrl"` + CallbackBeforeSendSingleMsg callBackConfig `yaml:"callbackbeforeSendSingleMsg"` + CallbackAfterSendSingleMsg callBackConfig `yaml:"callbackAfterSendSingleMsg"` + CallbackBeforeSendGroupMsg callBackConfig `yaml:"callbackBeforeSendGroupMsg"` + CallbackAfterSendGroupMsg callBackConfig `yaml:"callbackAfterSendGroupMsg"` + CallbackWordFilter callBackConfig `yaml:"callbackWordFilter"` + } `yaml:"callback"` + Notification struct { + ///////////////////////group///////////////////////////// + GroupCreated struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupCreated"` + + GroupInfoSet struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupInfoSet"` + + JoinGroupApplication struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"joinGroupApplication"` + + MemberQuit struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"memberQuit"` + + GroupApplicationAccepted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupApplicationAccepted"` + + GroupApplicationRejected struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupApplicationRejected"` + + GroupOwnerTransferred struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupOwnerTransferred"` + + MemberKicked struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"memberKicked"` + + MemberInvited struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"memberInvited"` + + MemberEnter struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"memberEnter"` + + GroupDismissed struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupDismissed"` + + GroupMuted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupMuted"` + + GroupCancelMuted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupCancelMuted"` + + GroupMemberMuted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupMemberMuted"` + + GroupMemberCancelMuted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"groupMemberCancelMuted"` + + ////////////////////////user/////////////////////// + UserInfoUpdated struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"userInfoUpdated"` + + //////////////////////friend/////////////////////// + FriendApplication struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendApplicationAdded"` + FriendApplicationApproved struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendApplicationApproved"` + + FriendApplicationRejected struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendApplicationRejected"` + + FriendAdded struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendAdded"` + + FriendDeleted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendDeleted"` + FriendRemarkSet struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"friendRemarkSet"` + BlackAdded struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"blackAdded"` + BlackDeleted struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"blackDeleted"` + ConversationOptUpdate struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips PDefaultTips `yaml:"defaultTips"` + } `yaml:"conversationOptUpdate"` + ConversationSetPrivate struct { + Conversation PConversation `yaml:"conversation"` + OfflinePush POfflinePush `yaml:"offlinePush"` + DefaultTips struct { + OpenTips string `yaml:"openTips"` + CloseTips string `yaml:"closeTips"` + } `yaml:"defaultTips"` + } `yaml:"conversationSetPrivate"` + } + Demo struct { + Port []int `yaml:"openImDemoPort"` + AliSMSVerify struct { + AccessKeyID string `yaml:"accessKeyId"` + AccessKeySecret string `yaml:"accessKeySecret"` + SignName string `yaml:"signName"` + VerificationCodeTemplateCode string `yaml:"verificationCodeTemplateCode"` + } + SuperCode string `yaml:"superCode"` + CodeTTL int `yaml:"codeTTL"` + Mail struct { + Title string `yaml:"title"` + SenderMail string `yaml:"senderMail"` + SenderAuthorizationCode string `yaml:"senderAuthorizationCode"` + SmtpAddr string `yaml:"smtpAddr"` + SmtpPort int `yaml:"smtpPort"` + } + } + Rtc struct { + Port int `yaml:"port"` + Address string `yaml:"address"` + } `yaml:"rtc"` +} +type PConversation struct { + ReliabilityLevel int `yaml:"reliabilityLevel"` + UnreadCount bool `yaml:"unreadCount"` +} + +type POfflinePush struct { + PushSwitch bool `yaml:"switch"` + Title string `yaml:"title"` + Desc string `yaml:"desc"` + Ext string `yaml:"ext"` +} +type PDefaultTips struct { + Tips string `yaml:"tips"` +} + +func init() { + //path, _ := os.Getwd() + //bytes, err := ioutil.ReadFile(path + "/config/config.yaml") + // if we cd Open-IM-Server/src/utils and run go test + // it will panic cannot find config/config.yaml + + cfgName := os.Getenv("CONFIG_NAME") + if len(cfgName) == 0 { + cfgName = Root + "/config/config.yaml" + } + + viper.SetConfigFile(cfgName) + err := viper.ReadInConfig() + if err != nil { + panic(err.Error()) + } + bytes, err := ioutil.ReadFile(cfgName) + if err != nil { + panic(err.Error()) + } + if err = yaml.Unmarshal(bytes, &Config); err != nil { + panic(err.Error()) + } +} diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go new file mode 100644 index 000000000..fdee4f2b7 --- /dev/null +++ b/pkg/common/constant/constant.go @@ -0,0 +1,235 @@ +package constant + +const ( + + //group admin + // OrdinaryMember = 0 + // GroupOwner = 1 + // Administrator = 2 + //group application + // Application = 0 + // AgreeApplication = 1 + + //friend related + BlackListFlag = 1 + ApplicationFriendFlag = 0 + FriendFlag = 1 + RefuseFriendFlag = -1 + + //Websocket Protocol + WSGetNewestSeq = 1001 + WSPullMsgBySeqList = 1002 + WSSendMsg = 1003 + WSSendSignalMsg = 1004 + WSPushMsg = 2001 + WSKickOnlineMsg = 2002 + WsLogoutMsg = 2003 + WSDataError = 3001 + + ///ContentType + //UserRelated + Text = 101 + Picture = 102 + Voice = 103 + Video = 104 + File = 105 + AtText = 106 + Merger = 107 + Card = 108 + Location = 109 + Custom = 110 + Revoke = 111 + HasReadReceipt = 112 + Typing = 113 + Quote = 114 + Common = 200 + GroupMsg = 201 + + //SysRelated + NotificationBegin = 1000 + + FriendApplicationApprovedNotification = 1201 //add_friend_response + FriendApplicationRejectedNotification = 1202 //add_friend_response + FriendApplicationNotification = 1203 //add_friend + FriendAddedNotification = 1204 + FriendDeletedNotification = 1205 //delete_friend + FriendRemarkSetNotification = 1206 //set_friend_remark? + BlackAddedNotification = 1207 //add_black + BlackDeletedNotification = 1208 //remove_black + + ConversationOptChangeNotification = 1300 // change conversation opt + + UserNotificationBegin = 1301 + UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204 + UserNotificationEnd = 1399 + OANotification = 1400 + + GroupNotificationBegin = 1500 + + GroupCreatedNotification = 1501 + GroupInfoSetNotification = 1502 + JoinGroupApplicationNotification = 1503 + MemberQuitNotification = 1504 + GroupApplicationAcceptedNotification = 1505 + GroupApplicationRejectedNotification = 1506 + GroupOwnerTransferredNotification = 1507 + MemberKickedNotification = 1508 + MemberInvitedNotification = 1509 + MemberEnterNotification = 1510 + GroupDismissedNotification = 1511 + GroupMemberMutedNotification = 1512 + GroupMemberCancelMutedNotification = 1513 + GroupMutedNotification = 1514 + GroupCancelMutedNotification = 1515 + + SignalingNotificationBegin = 1600 + SignalingNotification = 1601 + SignalingNotificationEnd = 1699 + + ConversationPrivateChatNotification = 1701 + + NotificationEnd = 2000 + + //status + MsgNormal = 1 + MsgDeleted = 4 + + //MsgFrom + UserMsgType = 100 + SysMsgType = 200 + + //SessionType + SingleChatType = 1 + GroupChatType = 2 + + NotificationChatType = 4 + //token + NormalToken = 0 + InValidToken = 1 + KickedToken = 2 + ExpiredToken = 3 + + //MultiTerminalLogin + //Full-end login, but the same end is mutually exclusive + AllLoginButSameTermKick = 1 + //Only one of the endpoints can log in + SingleTerminalLogin = 2 + //The web side can be online at the same time, and the other side can only log in at one end + WebAndOther = 3 + //The PC side is mutually exclusive, and the mobile side is mutually exclusive, but the web side can be online at the same time + PcMobileAndWeb = 4 + + OnlineStatus = "online" + OfflineStatus = "offline" + Registered = "registered" + UnRegistered = "unregistered" + + //MsgReceiveOpt + ReceiveMessage = 0 + NotReceiveMessage = 1 + ReceiveNotNotifyMessage = 2 + + //OptionsKey + IsHistory = "history" + IsPersistent = "persistent" + IsOfflinePush = "offlinePush" + IsUnreadCount = "unreadCount" + IsConversationUpdate = "conversationUpdate" + IsSenderSync = "senderSync" + IsNotPrivate = "notPrivate" + IsSenderConversationUpdate = "senderConversationUpdate" + + //GroupStatus + GroupOk = 0 + GroupBanChat = 1 + GroupStatusDismissed = 2 + GroupStatusMuted = 3 + + GroupBaned = 3 + GroupBanPrivateChat = 4 + + //UserJoinGroupSource + JoinByAdmin = 1 + + //Minio + MinioDurationTimes = 3600 + + // verificationCode used for + VerificationCodeForRegister = 1 + VerificationCodeForReset = 2 + VerificationCodeForRegisterSuffix = "_forRegister" + VerificationCodeForResetSuffix = "_forReset" + + //callbackCommand + CallbackBeforeSendSingleMsgCommand = "callbackBeforeSendSingleMsgCommand" + CallbackAfterSendSingleMsgCommand = "callbackAfterSendSingleMsgCommand" + CallbackBeforeSendGroupMsgCommand = "callbackBeforeSendGroupMsgCommand" + CallbackAfterSendGroupMsgCommand = "callbackAfterSendGroupMsgCommand" + CallbackWordFilterCommand = "callbackWordFilterCommand" + //callback actionCode + ActionAllow = 0 + ActionForbidden = 1 + //callback callbackHandleCode + CallbackHandleSuccess = 0 + CallbackHandleFailed = 1 + + // minioUpload + OtherType = 1 + VideoType = 2 + ImageType = 3 +) + +var ContentType2PushContent = map[int64]string{ + Picture: "[图片]", + Voice: "[语音]", + Video: "[视频]", + File: "[文件]", + Text: "你收到了一条文本消息", + AtText: "[有人@你]", + GroupMsg: "你收到一条群聊消息", + Common: "你收到一条新消息", +} + +const ( + AppOrdinaryUsers = 1 + AppAdmin = 2 + + GroupOrdinaryUsers = 1 + GroupOwner = 2 + GroupAdmin = 3 + + GroupResponseAgree = 1 + GroupResponseRefuse = -1 + + FriendResponseAgree = 1 + FriendResponseRefuse = -1 + + Male = 1 + Female = 2 +) + +const ( + UnreliableNotification = 1 + ReliableNotificationNoMsg = 2 + ReliableNotificationMsg = 3 +) + +const FriendAcceptTip = "You have successfully become friends, so start chatting" + +func GroupIsBanChat(status int32) bool { + if status != GroupStatusMuted { + return false + } + return true +} + +func GroupIsBanPrivateChat(status int32) bool { + if status != GroupBanPrivateChat { + return false + } + return true +} + +const BigVersion = "v3" + +const LogFileName = "OpenIM.log" diff --git a/pkg/common/constant/error.go b/pkg/common/constant/error.go new file mode 100644 index 000000000..00a11fd49 --- /dev/null +++ b/pkg/common/constant/error.go @@ -0,0 +1,100 @@ +package constant + +import "errors" + +// key = errCode, string = errMsg +type ErrInfo struct { + ErrCode int32 + ErrMsg string +} + +var ( + OK = ErrInfo{0, ""} + ErrServer = ErrInfo{500, "server error"} + + // ErrMysql = ErrInfo{100, ""} + // ErrMongo = ErrInfo{110, ""} + // ErrRedis = ErrInfo{120, ""} + ErrParseToken = ErrInfo{700, ParseTokenMsg.Error()} + // ErrCreateToken = ErrInfo{201, "Create token failed"} + // ErrAppServerKey = ErrInfo{300, "key error"} + ErrTencentCredential = ErrInfo{400, ThirdPartyMsg.Error()} + + // ErrorUserRegister = ErrInfo{600, "User registration failed"} + // ErrAccountExists = ErrInfo{601, "The account is already registered and cannot be registered again"} + // ErrUserPassword = ErrInfo{602, "User password error"} + // ErrRefreshToken = ErrInfo{605, "Failed to refresh token"} + // ErrAddFriend = ErrInfo{606, "Failed to add friends"} + // ErrAgreeToAddFriend = ErrInfo{607, "Failed to agree application"} + // ErrAddFriendToBlack = ErrInfo{608, "Failed to add friends to the blacklist"} + // ErrGetBlackList = ErrInfo{609, "Failed to get blacklist"} + // ErrDeleteFriend = ErrInfo{610, "Failed to delete friend"} + // ErrGetFriendApplyList = ErrInfo{611, "Failed to get friend application list"} + // ErrGetFriendList = ErrInfo{612, "Failed to get friend list"} + // ErrRemoveBlackList = ErrInfo{613, "Failed to remove blacklist"} + // ErrSearchUserInfo = ErrInfo{614, "Can't find the user information"} + // ErrDelAppleDeviceToken = ErrInfo{615, ""} + // ErrModifyUserInfo = ErrInfo{616, "update user some attribute failed"} + // ErrSetFriendComment = ErrInfo{617, "set friend comment failed"} + // ErrSearchUserInfoFromTheGroup = ErrInfo{618, "There is no such group or the user not in the group"} + // ErrCreateGroup = ErrInfo{619, "create group chat failed"} + // ErrJoinGroupApplication = ErrInfo{620, "Failed to apply to join the group"} + // ErrQuitGroup = ErrInfo{621, "Failed to quit the group"} + // ErrSetGroupInfo = ErrInfo{622, "Failed to set group info"} + // ErrParam = ErrInfo{700, "param failed"} + ErrTokenExpired = ErrInfo{701, TokenExpiredMsg.Error()} + ErrTokenInvalid = ErrInfo{702, TokenInvalidMsg.Error()} + ErrTokenMalformed = ErrInfo{703, TokenMalformedMsg.Error()} + ErrTokenNotValidYet = ErrInfo{704, TokenNotValidYetMsg.Error()} + ErrTokenUnknown = ErrInfo{705, TokenUnknownMsg.Error()} + ErrTokenKicked = ErrInfo{706, TokenUserKickedMsg.Error()} + + ErrAccess = ErrInfo{ErrCode: 801, ErrMsg: AccessMsg.Error()} + ErrDB = ErrInfo{ErrCode: 802, ErrMsg: DBMsg.Error()} + ErrArgs = ErrInfo{ErrCode: 8003, ErrMsg: ArgsMsg.Error()} + ErrCallback = ErrInfo{ErrCode: 809, ErrMsg: CallBackMsg.Error()} +) + +var ( + ParseTokenMsg = errors.New("parse token failed") + TokenExpiredMsg = errors.New("token is timed out, please log in again") + TokenInvalidMsg = errors.New("token has been invalidated") + TokenNotValidYetMsg = errors.New("token not active yet") + TokenMalformedMsg = errors.New("that's not even a token") + TokenUnknownMsg = errors.New("couldn't handle this token") + TokenUserKickedMsg = errors.New("user has been kicked") + AccessMsg = errors.New("no permission") + DBMsg = errors.New("db failed") + ArgsMsg = errors.New("args failed") + CallBackMsg = errors.New("callback failed") + + ThirdPartyMsg = errors.New("third party error") +) + +const ( + NoError = 0 + FormattingError = 10001 + HasRegistered = 10002 + NotRegistered = 10003 + PasswordErr = 10004 + GetIMTokenErr = 10005 + RepeatSendCode = 10006 + MailSendCodeErr = 10007 + SmsSendCodeErr = 10008 + CodeInvalidOrExpired = 10009 + RegisterFailed = 10010 + ResetPasswordFailed = 10011 + DatabaseError = 10002 + ServerError = 10004 + HttpError = 10005 + IoError = 10006 + IntentionalError = 10007 +) + +func (e ErrInfo) Error() string { + return e.ErrMsg +} + +func (e *ErrInfo) Code() int32 { + return e.ErrCode +} diff --git a/pkg/common/constant/platform_number_id_to_name.go b/pkg/common/constant/platform_number_id_to_name.go new file mode 100644 index 000000000..c3a970b69 --- /dev/null +++ b/pkg/common/constant/platform_number_id_to_name.go @@ -0,0 +1,66 @@ +package constant + +// fixme 1<--->IOS 2<--->Android 3<--->Windows +//fixme 4<--->OSX 5<--->Web 6<--->MiniWeb 7<--->Linux + +const ( + //Platform ID + IOSPlatformID = 1 + AndroidPlatformID = 2 + WindowsPlatformID = 3 + OSXPlatformID = 4 + WebPlatformID = 5 + MiniWebPlatformID = 6 + LinuxPlatformID = 7 + + //Platform string match to Platform ID + IOSPlatformStr = "IOS" + AndroidPlatformStr = "Android" + WindowsPlatformStr = "Windows" + OSXPlatformStr = "OSX" + WebPlatformStr = "Web" + MiniWebPlatformStr = "MiniWeb" + LinuxPlatformStr = "Linux" + + //terminal types + TerminalPC = "PC" + TerminalMobile = "Mobile" +) + +var PlatformID2Name = map[int32]string{ + IOSPlatformID: IOSPlatformStr, + AndroidPlatformID: AndroidPlatformStr, + WindowsPlatformID: WindowsPlatformStr, + OSXPlatformID: OSXPlatformStr, + WebPlatformID: WebPlatformStr, + MiniWebPlatformID: MiniWebPlatformStr, + LinuxPlatformID: LinuxPlatformStr, +} +var PlatformName2ID = map[string]int32{ + IOSPlatformStr: IOSPlatformID, + AndroidPlatformStr: AndroidPlatformID, + WindowsPlatformStr: WindowsPlatformID, + OSXPlatformStr: OSXPlatformID, + WebPlatformStr: WebPlatformID, + MiniWebPlatformStr: MiniWebPlatformID, + LinuxPlatformStr: LinuxPlatformID, +} +var Platform2class = map[string]string{ + IOSPlatformStr: TerminalMobile, + AndroidPlatformStr: TerminalMobile, + MiniWebPlatformStr: WebPlatformStr, + WebPlatformStr: WebPlatformStr, + WindowsPlatformStr: TerminalPC, + OSXPlatformStr: TerminalPC, + LinuxPlatformStr: TerminalPC, +} + +func PlatformIDToName(num int32) string { + return PlatformID2Name[num] +} +func PlatformNameToID(name string) int32 { + return PlatformName2ID[name] +} +func PlatformNameToClass(name string) string { + return Platform2class[name] +} diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go new file mode 100644 index 000000000..bd465d6ff --- /dev/null +++ b/pkg/common/db/model.go @@ -0,0 +1,119 @@ +package db + +import ( + "Open_IM/pkg/common/config" + //"Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "fmt" + "go.mongodb.org/mongo-driver/mongo/options" + + // "context" + // "fmt" + "github.com/garyburd/redigo/redis" + "gopkg.in/mgo.v2" + "time" + + "context" + //"go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + // "go.mongodb.org/mongo-driver/mongo/options" +) + +var DB DataBases + +type DataBases struct { + MysqlDB mysqlDB + mgoSession *mgo.Session + redisPool *redis.Pool + mongoClient *mongo.Client +} + +func key(dbAddress, dbName string) string { + return dbAddress + "_" + dbName +} + +func init() { + //log.NewPrivateLog(constant.LogFileName) + //var mgoSession *mgo.Session + var mongoClient *mongo.Client + var err1 error + //mysql init + initMysqlDB() + // mongo init + // "mongodb://sysop:moon@localhost/records" + uri := "mongodb://sample.host:27017/?maxPoolSize=20&w=majority" + if config.Config.Mongo.DBUri != "" { + // example: mongodb://$user:$password@mongo1.mongo:27017,mongo2.mongo:27017,mongo3.mongo:27017/$DBDatabase/?replicaSet=rs0&readPreference=secondary&authSource=admin&maxPoolSize=$DBMaxPoolSize + uri = config.Config.Mongo.DBUri + } else { + if config.Config.Mongo.DBPassword != "" && config.Config.Mongo.DBUserName != "" { + uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress[0], + config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) + } else { + uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", + config.Config.Mongo.DBAddress[0], config.Config.Mongo.DBDatabase, + config.Config.Mongo.DBMaxPoolSize) + } + } + mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) + if err != nil { + fmt.Println(" mongo.Connect failed, try ", utils.GetSelfFuncName(), err.Error(), uri) + time.Sleep(time.Duration(30) * time.Second) + mongoClient, err1 = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) + if err1 != nil { + fmt.Println(" mongo.Connect retry failed, panic", err.Error(), uri) + panic(err1.Error()) + } + } + fmt.Println("0", utils.GetSelfFuncName(), "mongo driver client init success: ", uri) + + DB.mongoClient = mongoClient + + //mgoDailInfo := &mgo.DialInfo{ + // Addrs: config.Config.Mongo.DBAddress, + // Direct: config.Config.Mongo.DBDirect, + // Timeout: time.Second * time.Duration(config.Config.Mongo.DBTimeout), + // Database: config.Config.Mongo.DBDatabase, + // Source: config.Config.Mongo.DBSource, + // Username: config.Config.Mongo.DBUserName, + // Password: config.Config.Mongo.DBPassword, + // PoolLimit: config.Config.Mongo.DBMaxPoolSize, + //} + //mgoSession, err = mgo.DialWithInfo(mgoDailInfo) + // + //if err != nil { + // + // mgoSession, err1 = mgo.DialWithInfo(mgoDailInfo) + // if err1 != nil { + // log.NewError(" mongo.Connect failed, panic", err.Error()) + // panic(err1.Error()) + // } + //} + + //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.Error()) + //} + // + + // redis pool init + DB.redisPool = &redis.Pool{ + MaxIdle: config.Config.Redis.DBMaxIdle, + MaxActive: config.Config.Redis.DBMaxActive, + IdleTimeout: time.Duration(config.Config.Redis.DBIdleTimeout) * time.Second, + Dial: func() (redis.Conn, error) { + return redis.Dial( + "tcp", + config.Config.Redis.DBAddress, + redis.DialReadTimeout(time.Duration(1000)*time.Millisecond), + redis.DialWriteTimeout(time.Duration(1000)*time.Millisecond), + redis.DialConnectTimeout(time.Duration(1000)*time.Millisecond), + redis.DialDatabase(0), + redis.DialPassword(config.Config.Redis.DBPassWord), + ) + }, + } +} diff --git a/pkg/common/db/model_struct.go b/pkg/common/db/model_struct.go new file mode 100644 index 000000000..9591050e0 --- /dev/null +++ b/pkg/common/db/model_struct.go @@ -0,0 +1,272 @@ +package db + +import "time" + +type Register struct { + Account string `gorm:"column:account;primary_key;type:char(255)" json:"account"` + Password string `gorm:"column:password;type:varchar(255)" json:"password"` + Ex string `gorm:"column:ex;size:1024" json:"ex"` +} + +// +//message FriendInfo{ +//string OwnerUserID = 1; +//string Remark = 2; +//int64 CreateTime = 3; +//UserInfo FriendUser = 4; +//int32 AddSource = 5; +//string OperatorUserID = 6; +//string Ex = 7; +//} +//open_im_sdk.FriendInfo(FriendUser) != imdb.Friend(FriendUserID) +type Friend struct { + OwnerUserID string `gorm:"column:owner_user_id;primary_key;size:64"` + FriendUserID string `gorm:"column:friend_user_id;primary_key;size:64"` + Remark string `gorm:"column:remark;size:255"` + CreateTime time.Time `gorm:"column:create_time"` + AddSource int32 `gorm:"column:add_source"` + OperatorUserID string `gorm:"column:operator_user_id;size:64"` + Ex string `gorm:"column:ex;size:1024"` +} + +//message FriendRequest{ +//string FromUserID = 1; +//string ToUserID = 2; +//int32 HandleResult = 3; +//string ReqMsg = 4; +//int64 CreateTime = 5; +//string HandlerUserID = 6; +//string HandleMsg = 7; +//int64 HandleTime = 8; +//string Ex = 9; +//} +//open_im_sdk.FriendRequest(nickname, farce url ...) != imdb.FriendRequest +type FriendRequest struct { + FromUserID string `gorm:"column:from_user_id;primary_key;size:64"` + ToUserID string `gorm:"column:to_user_id;primary_key;size:64"` + HandleResult int32 `gorm:"column:handle_result"` + ReqMsg string `gorm:"column:req_msg;size:255"` + CreateTime time.Time `gorm:"column:create_time"` + HandlerUserID string `gorm:"column:handler_user_id;size:64"` + HandleMsg string `gorm:"column:handle_msg;size:255"` + HandleTime time.Time `gorm:"column:handle_time"` + Ex string `gorm:"column:ex;size:1024"` +} + +func (FriendRequest) TableName() string { + return "friend_requests" +} + +//message GroupInfo{ +// string GroupID = 1; +// string GroupName = 2; +// string Notification = 3; +// string Introduction = 4; +// string FaceUrl = 5; +// string OwnerUserID = 6; +// uint32 MemberCount = 8; +// int64 CreateTime = 7; +// string Ex = 9; +// int32 Status = 10; +// string CreatorUserID = 11; +// int32 GroupType = 12; +//} +// open_im_sdk.GroupInfo (OwnerUserID , MemberCount )> imdb.Group +type Group struct { + //`json:"operationID" binding:"required"` + //`protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` `json:"operationID" binding:"required"` + GroupID string `gorm:"column:group_id;primary_key;size:64" json:"groupID" binding:"required"` + GroupName string `gorm:"column:name;size:255" json:"groupName"` + Notification string `gorm:"column:notification;size:255" json:"notification"` + Introduction string `gorm:"column:introduction;size:255" json:"introduction"` + FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"` + CreateTime time.Time `gorm:"column:create_time"` + Ex string `gorm:"column:ex" json:"ex;size:1024" json:"ex"` + Status int32 `gorm:"column:status"` + CreatorUserID string `gorm:"column:creator_user_id;size:64"` + GroupType int32 `gorm:"column:group_type"` +} + +//message GroupMemberFullInfo { +//string GroupID = 1 ; +//string UserID = 2 ; +//int32 roleLevel = 3; +//int64 JoinTime = 4; +//string NickName = 5; +//string FaceUrl = 6; +//int32 JoinSource = 8; +//string OperatorUserID = 9; +//string Ex = 10; +//int32 AppMangerLevel = 7; //if >0 +//} open_im_sdk.GroupMemberFullInfo(AppMangerLevel) > imdb.GroupMember +type GroupMember struct { + GroupID string `gorm:"column:group_id;primary_key;size:64"` + UserID string `gorm:"column:user_id;primary_key;size:64"` + Nickname string `gorm:"column:nickname;size:255"` + FaceURL string `gorm:"column:user_group_face_url;size:255"` + RoleLevel int32 `gorm:"column:role_level"` + JoinTime time.Time `gorm:"column:join_time"` + JoinSource int32 `gorm:"column:join_source"` + OperatorUserID string `gorm:"column:operator_user_id;size:64"` + MuteEndTime time.Time `gorm:"column:mute_end_time"` + Ex string `gorm:"column:ex;size:1024"` +} + +//message GroupRequest{ +//string UserID = 1; +//string GroupID = 2; +//string HandleResult = 3; +//string ReqMsg = 4; +//string HandleMsg = 5; +//int64 ReqTime = 6; +//string HandleUserID = 7; +//int64 HandleTime = 8; +//string Ex = 9; +//}open_im_sdk.GroupRequest == imdb.GroupRequest +type GroupRequest struct { + UserID string `gorm:"column:user_id;primary_key;size:64"` + GroupID string `gorm:"column:group_id;primary_key;size:64"` + HandleResult int32 `gorm:"column:handle_result"` + ReqMsg string `gorm:"column:req_msg;size:1024"` + HandledMsg string `gorm:"column:handle_msg;size:1024"` + ReqTime time.Time `gorm:"column:req_time"` + HandleUserID string `gorm:"column:handle_user_id;size:64"` + HandledTime time.Time `gorm:"column:handle_time"` + Ex string `gorm:"column:ex;size:1024"` +} + +//string UserID = 1; +//string Nickname = 2; +//string FaceUrl = 3; +//int32 Gender = 4; +//string PhoneNumber = 5; +//string Birth = 6; +//string Email = 7; +//string Ex = 8; +//int64 CreateTime = 9; +//int32 AppMangerLevel = 10; +//open_im_sdk.User == imdb.User +type User struct { + UserID string `gorm:"column:user_id;primary_key;size:64"` + Nickname string `gorm:"column:name;size:255"` + FaceURL string `gorm:"column:face_url;size:255"` + Gender int32 `gorm:"column:gender"` + PhoneNumber string `gorm:"column:phone_number;size:32"` + Birth time.Time `gorm:"column:birth"` + Email string `gorm:"column:email;size:64"` + Ex string `gorm:"column:ex;size:1024"` + CreateTime time.Time `gorm:"column:create_time"` + AppMangerLevel int32 `gorm:"column:app_manger_level"` +} + +//message BlackInfo{ +//string OwnerUserID = 1; +//int64 CreateTime = 2; +//PublicUserInfo BlackUserInfo = 4; +//int32 AddSource = 5; +//string OperatorUserID = 6; +//string Ex = 7; +//} +// open_im_sdk.BlackInfo(BlackUserInfo) != imdb.Black (BlockUserID) +type Black struct { + OwnerUserID string `gorm:"column:owner_user_id;primary_key;size:64"` + BlockUserID string `gorm:"column:block_user_id;primary_key;size:64"` + CreateTime time.Time `gorm:"column:create_time"` + AddSource int32 `gorm:"column:add_source"` + OperatorUserID string `gorm:"column:operator_user_id;size:64"` + Ex string `gorm:"column:ex;size:1024"` +} + +type ChatLog struct { + ServerMsgID string `gorm:"column:server_msg_id;primary_key;type:char(64)" json:"serverMsgID"` + ClientMsgID string `gorm:"column:client_msg_id;type:char(64)" json:"clientMsgID"` + SendID string `gorm:"column:send_id;type:char(64)" json:"sendID"` + RecvID string `gorm:"column:recv_id;type:char(64)" json:"recvID"` + SenderPlatformID int32 `gorm:"column:sender_platform_id" json:"senderPlatformID"` + SenderNickname string `gorm:"column:sender_nick_name;type:varchar(255)" json:"senderNickname"` + SenderFaceURL string `gorm:"column:sender_face_url;type:varchar(255)" json:"senderFaceURL"` + SessionType int32 `gorm:"column:session_type" json:"sessionType"` + MsgFrom int32 `gorm:"column:msg_from" json:"msgFrom"` + ContentType int32 `gorm:"column:content_type" json:"contentType"` + Content string `gorm:"column:content;type:varchar(3000)" json:"content"` + Status int32 `gorm:"column:status" json:"status"` + SendTime time.Time `gorm:"column:send_time" json:"sendTime"` + CreateTime time.Time `gorm:"column:create_time" json:"createTime"` + Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` +} + +func (ChatLog) TableName() string { + return "chat_logs" +} + +type BlackList struct { + UserId string `gorm:"column:uid"` + BeginDisableTime time.Time `gorm:"column:begin_disable_time"` + EndDisableTime time.Time `gorm:"column:end_disable_time"` +} +type Conversation struct { + OwnerUserID string `gorm:"column:owner_user_id;primary_key;type:char(128)" json:"OwnerUserID"` + ConversationID string `gorm:"column:conversation_id;primary_key;type:char(128)" json:"conversationID"` + ConversationType int32 `gorm:"column:conversation_type" json:"conversationType"` + UserID string `gorm:"column:user_id;type:char(64)" json:"userID"` + GroupID string `gorm:"column:group_id;type:char(128)" json:"groupID"` + RecvMsgOpt int32 `gorm:"column:recv_msg_opt" json:"recvMsgOpt"` + UnreadCount int32 `gorm:"column:unread_count" json:"unreadCount"` + DraftTextTime int64 `gorm:"column:draft_text_time" json:"draftTextTime"` + IsPinned bool `gorm:"column:is_pinned" json:"isPinned"` + IsPrivateChat bool `gorm:"column:is_private_chat" json:"isPrivateChat"` + AttachedInfo string `gorm:"column:attached_info;type:varchar(1024)" json:"attachedInfo"` + Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` +} + +func (Conversation) TableName() string { + return "conversations" +} + +type Department struct { + DepartmentID string `gorm:"column:department_id;primary_key;size:64" json:"departmentID"` + FaceURL string `gorm:"column:face_url;size:255" json:"faceURL"` + Name string `gorm:"column:name;size:256" json:"name" binding:"required"` + ParentID string `gorm:"column:parent_id;size:64" json:"parentID" binding:"required"` // "0" or Real parent id + Order int32 `gorm:"column:order" json:"order" ` // 1, 2, ... + DepartmentType int32 `gorm:"column:department_type" json:"departmentType"` //1, 2... + CreateTime time.Time `gorm:"column:create_time" json:"createTime"` + Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` +} + +func (Department) TableName() string { + return "departments" +} + +type OrganizationUser struct { + UserID string `gorm:"column:user_id;primary_key;size:64"` + Nickname string `gorm:"column:nickname;size:256"` + EnglishName string `gorm:"column:english_name;size:256"` + FaceURL string `gorm:"column:face_url;size:256"` + Gender int32 `gorm:"column:gender"` //1 ,2 + Mobile string `gorm:"column:mobile;size:32"` + Telephone string `gorm:"column:telephone;size:32"` + Birth time.Time `gorm:"column:birth"` + Email string `gorm:"column:email;size:64"` + CreateTime time.Time `gorm:"column:create_time"` + Ex string `gorm:"column:ex;size:1024"` +} + +func (OrganizationUser) TableName() string { + return "organization_users" +} + +type DepartmentMember struct { + UserID string `gorm:"column:user_id;primary_key;size:64"` + DepartmentID string `gorm:"column:department_id;primary_key;size:64"` + Order int32 `gorm:"column:order" json:"order"` //1,2 + Position string `gorm:"column:position;size:256" json:"position"` + Leader int32 `gorm:"column:leader" json:"leader"` //-1, 1 + Status int32 `gorm:"column:status" json:"status"` //-1, 1 + CreateTime time.Time `gorm:"column:create_time"` + Ex string `gorm:"column:ex;type:varchar(1024)" json:"ex"` +} + +func (DepartmentMember) TableName() string { + return "department_members" +} diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go new file mode 100644 index 000000000..6d7ff3f7c --- /dev/null +++ b/pkg/common/db/mongoModel.go @@ -0,0 +1,681 @@ +package db + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "errors" + "fmt" + "github.com/gogo/protobuf/sortkeys" + "go.mongodb.org/mongo-driver/mongo/options" + "math/rand" + + //"github.com/garyburd/redigo/redis" + "github.com/golang/protobuf/proto" + "gopkg.in/mgo.v2/bson" + + "strconv" + "time" +) + +const cChat = "msg" +const cGroup = "group" +const cTag = "tag" +const cSendLog = "send_log" +const singleGocMsgNum = 5000 + +type MsgInfo struct { + SendTime int64 + Msg []byte +} + +type UserChat struct { + UID string + Msg []MsgInfo +} + +type GroupMember_x struct { + GroupID string + UIDList []string +} + +func (d *DataBases) GetMinSeqFromMongo(uid string) (MinSeq uint32, err error) { + return 1, nil + //var i, NB uint32 + //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 = uint32(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 = uint32(i * singleGocMsgNum) + // } + // break + // } + //} + //return MinSeq, nil +} + +func (d *DataBases) GetMinSeqFromMongo2(uid string) (MinSeq uint32, err error) { + return 1, nil +} + +// deleteMsgByLogic +func (d *DataBases) DelMsgLogic(uid string, seqList []uint32, operationID string) error { + sortkeys.Uint32s(seqList) + seqMsgs, err := d.GetMsgBySeqListMongo2(uid, seqList, operationID) + if err != nil { + return utils.Wrap(err, "") + } + for _, seqMsg := range seqMsgs { + log.NewDebug(operationID, utils.GetSelfFuncName(), *seqMsg) + seqMsg.Status = constant.MsgDeleted + if err = d.ReplaceMsgBySeq(uid, seqMsg, operationID); err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "ReplaceMsgListBySeq error", err.Error()) + } + } + return nil +} + +func (d *DataBases) ReplaceMsgBySeq(uid string, msg *open_im_sdk.MsgData, operationID string) error { + log.NewInfo(operationID, utils.GetSelfFuncName(), uid, *msg) + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + uid = getSeqUid(uid, msg.Seq) + seqIndex := getMsgIndex(msg.Seq) + s := fmt.Sprintf("msg.%d.msg", seqIndex) + log.NewDebug(operationID, utils.GetSelfFuncName(), seqIndex, s) + bytes, err := proto.Marshal(msg) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "proto marshal", err.Error()) + return utils.Wrap(err, "") + } + updateResult, err := c.UpdateOne( + ctx, bson.M{"uid": uid}, + bson.M{"$set": bson.M{s: bytes}}) + log.NewInfo(operationID, utils.GetSelfFuncName(), updateResult) + if err != nil { + log.NewError(operationID, utils.GetSelfFuncName(), "UpdateOne", err.Error()) + return utils.Wrap(err, "") + } + return nil +} + +func (d *DataBases) GetMsgBySeqList(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) { + log.NewInfo(operationID, utils.GetSelfFuncName(), uid, seqList) + var hasSeqList []uint32 + singleCount := 0 + session := d.mgoSession.Clone() + if session == nil { + return nil, errors.New("session == nil") + } + defer session.Close() + c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + m := func(uid string, seqList []uint32) map[string][]uint32 { + t := make(map[string][]uint32) + for i := 0; i < len(seqList); i++ { + seqUid := getSeqUid(uid, seqList[i]) + if value, ok := t[seqUid]; !ok { + var temp []uint32 + t[seqUid] = append(temp, seqList[i]) + } else { + t[seqUid] = append(value, seqList[i]) + } + } + return t + }(uid, seqList) + sChat := UserChat{} + for seqUid, value := range m { + if err = c.Find(bson.M{"uid": seqUid}).One(&sChat); err != nil { + log.NewError(operationID, "not find seqUid", seqUid, value, uid, seqList, err.Error()) + continue + } + singleCount = 0 + for i := 0; i < len(sChat.Msg); i++ { + msg := new(open_im_sdk.MsgData) + if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil { + log.NewError(operationID, "Unmarshal err", seqUid, value, uid, seqList, err.Error()) + return nil, err + } + if isContainInt32(msg.Seq, value) { + seqMsg = append(seqMsg, msg) + hasSeqList = append(hasSeqList, msg.Seq) + singleCount++ + if singleCount == len(value) { + break + } + } + } + } + if len(hasSeqList) != len(seqList) { + var diff []uint32 + diff = utils.Difference(hasSeqList, seqList) + exceptionMSg := genExceptionMessageBySeqList(diff) + seqMsg = append(seqMsg, exceptionMSg...) + + } + return seqMsg, nil +} + +func (d *DataBases) GetMsgBySeqListMongo2(uid string, seqList []uint32, operationID string) (seqMsg []*open_im_sdk.MsgData, err error) { + var hasSeqList []uint32 + singleCount := 0 + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + + m := func(uid string, seqList []uint32) map[string][]uint32 { + t := make(map[string][]uint32) + for i := 0; i < len(seqList); i++ { + seqUid := getSeqUid(uid, seqList[i]) + if value, ok := t[seqUid]; !ok { + var temp []uint32 + t[seqUid] = append(temp, seqList[i]) + } else { + t[seqUid] = append(value, seqList[i]) + } + } + return t + }(uid, seqList) + sChat := UserChat{} + for seqUid, value := range m { + if err = c.FindOne(ctx, bson.M{"uid": seqUid}).Decode(&sChat); err != nil { + log.NewError(operationID, "not find seqUid", seqUid, value, uid, seqList, err.Error()) + continue + } + singleCount = 0 + for i := 0; i < len(sChat.Msg); i++ { + msg := new(open_im_sdk.MsgData) + if err = proto.Unmarshal(sChat.Msg[i].Msg, msg); err != nil { + log.NewError(operationID, "Unmarshal err", seqUid, value, uid, seqList, err.Error()) + return nil, err + } + if isContainInt32(msg.Seq, value) { + seqMsg = append(seqMsg, msg) + hasSeqList = append(hasSeqList, msg.Seq) + singleCount++ + if singleCount == len(value) { + break + } + } + } + } + if len(hasSeqList) != len(seqList) { + var diff []uint32 + diff = utils.Difference(hasSeqList, seqList) + exceptionMSg := genExceptionMessageBySeqList(diff) + seqMsg = append(seqMsg, exceptionMSg...) + + } + return seqMsg, nil +} + +func genExceptionMessageBySeqList(seqList []uint32) (exceptionMsg []*open_im_sdk.MsgData) { + for _, v := range seqList { + msg := new(open_im_sdk.MsgData) + msg.Seq = v + exceptionMsg = append(exceptionMsg, msg) + } + return exceptionMsg +} + +func (d *DataBases) SaveUserChatMongo2(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + newTime := getCurrentTimestampByMill() + operationID := "" + seqUid := getSeqUid(uid, m.MsgData.Seq) + filter := bson.M{"uid": seqUid} + var err error + sMsg := MsgInfo{} + sMsg.SendTime = sendTime + if sMsg.Msg, err = proto.Marshal(m.MsgData); err != nil { + return utils.Wrap(err, "") + } + err = c.FindOneAndUpdate(ctx, filter, bson.M{"$push": bson.M{"msg": sMsg}}).Err() + log.NewDebug(operationID, "get mgoSession cost time", getCurrentTimestampByMill()-newTime) + if err != nil { + sChat := UserChat{} + sChat.UID = seqUid + sChat.Msg = append(sChat.Msg, sMsg) + if _, err = c.InsertOne(ctx, &sChat); err != nil { + log.NewDebug(operationID, "InsertOne failed", filter) + return utils.Wrap(err, "") + } + } else { + log.NewDebug(operationID, "FindOneAndUpdate ok", filter) + } + + log.NewDebug(operationID, "find mgo uid cost time", getCurrentTimestampByMill()-newTime) + return nil +} + +func (d *DataBases) SaveUserChat(uid string, sendTime int64, m *pbMsg.MsgDataToDB) error { + var seqUid string + newTime := getCurrentTimestampByMill() + session := d.mgoSession.Clone() + if session == nil { + return errors.New("session == nil") + } + defer session.Close() + log.NewDebug("", "get mgoSession cost time", getCurrentTimestampByMill()-newTime) + c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + seqUid = getSeqUid(uid, m.MsgData.Seq) + n, err := c.Find(bson.M{"uid": seqUid}).Count() + if err != nil { + return err + } + log.NewDebug("", "find mgo uid cost time", getCurrentTimestampByMill()-newTime) + sMsg := MsgInfo{} + sMsg.SendTime = sendTime + if sMsg.Msg, err = proto.Marshal(m.MsgData); err != nil { + return err + } + if n == 0 { + sChat := UserChat{} + 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": seqUid}, bson.M{"$push": bson.M{"msg": sMsg}}) + if err != nil { + return err + } + } + log.NewDebug("", "insert mgo data cost time", getCurrentTimestampByMill()-newTime) + return nil +} + +func (d *DataBases) DelUserChat(uid string) error { + return nil + //session := d.mgoSession.Clone() + //if session == nil { + // return errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + // + //delTime := time.Now().Unix() - int64(config.Config.Mongo.DBRetainChatRecords)*24*3600 + //if err := c.Update(bson.M{"uid": uid}, bson.M{"$pull": bson.M{"msg": bson.M{"sendtime": bson.M{"$lte": delTime}}}}); err != nil { + // return err + //} + // + //return nil +} + +func (d *DataBases) DelUserChatMongo2(uid string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cChat) + filter := bson.M{"uid": uid} + + delTime := time.Now().Unix() - int64(config.Config.Mongo.DBRetainChatRecords)*24*3600 + if _, err := c.UpdateOne(ctx, filter, bson.M{"$pull": bson.M{"msg": bson.M{"sendtime": bson.M{"$lte": delTime}}}}); err != nil { + return utils.Wrap(err, "") + } + return nil +} + +func (d *DataBases) MgoUserCount() (int, error) { + return 0, nil + //session := d.mgoSession.Clone() + //if session == nil { + // return 0, errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + // + //return c.Find(nil).Count() +} + +func (d *DataBases) MgoSkipUID(count int) (string, error) { + return "", nil + //session := d.mgoSession.Clone() + //if session == nil { + // return "", errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cChat) + // + //sChat := UserChat{} + //c.Find(nil).Skip(count).Limit(1).One(&sChat) + //return sChat.UID, nil +} + +func (d *DataBases) GetGroupMember(groupID string) []string { + return nil + //groupInfo := GroupMember_x{} + //groupInfo.GroupID = groupID + //groupInfo.UIDList = make([]string, 0) + // + //session := d.mgoSession.Clone() + //if session == nil { + // return groupInfo.UIDList + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cGroup) + // + //if err := c.Find(bson.M{"groupid": groupInfo.GroupID}).One(&groupInfo); err != nil { + // return groupInfo.UIDList + //} + // + //return groupInfo.UIDList +} + +func (d *DataBases) AddGroupMember(groupID, uid string) error { + return nil + //session := d.mgoSession.Clone() + //if session == nil { + // return errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cGroup) + // + //n, err := c.Find(bson.M{"groupid": groupID}).Count() + //if err != nil { + // return err + //} + // + //if n == 0 { + // groupInfo := GroupMember_x{} + // groupInfo.GroupID = groupID + // groupInfo.UIDList = append(groupInfo.UIDList, uid) + // err = c.Insert(&groupInfo) + // if err != nil { + // return err + // } + //} else { + // err = c.Update(bson.M{"groupid": groupID}, bson.M{"$addToSet": bson.M{"uidlist": uid}}) + // if err != nil { + // return err + // } + //} + // + //return nil +} + +func (d *DataBases) DelGroupMember(groupID, uid string) error { + return nil + //session := d.mgoSession.Clone() + //if session == nil { + // return errors.New("session == nil") + //} + //defer session.Close() + // + //c := session.DB(config.Config.Mongo.DBDatabase).C(cGroup) + // + //if err := c.Update(bson.M{"groupid": groupID}, bson.M{"$pull": bson.M{"uidlist": uid}}); err != nil { + // return err + //} + // + //return nil +} + +type Tag struct { + UserID string `bson:"user_id"` + TagID string `bson:"tag_id"` + TagName string `bson:"tag_name"` + UserList []string `bson:"user_list"` +} + +func (d *DataBases) GetUserTags(userID string) ([]Tag, error) { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag) + var tags []Tag + cursor, err := c.Find(ctx, bson.M{"user_id": userID}) + if err != nil { + return tags, err + } + if err = cursor.All(ctx, &tags); err != nil { + return tags, err + } + return tags, nil +} + +func (d *DataBases) CreateTag(userID, tagName string, userList []string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag) + tagID := generateTagID(tagName, userID) + tag := Tag{ + UserID: userID, + TagID: tagID, + TagName: tagName, + UserList: userList, + } + _, err := c.InsertOne(ctx, tag) + return err +} + +func (d *DataBases) GetTagByID(userID, tagID string) (Tag, error) { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag) + var tag Tag + err := c.FindOne(ctx, bson.M{"user_id": userID, "tag_id": tagID}).Decode(&tag) + return tag, err +} + +func (d *DataBases) DeleteTag(userID, tagID string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag) + _, err := c.DeleteOne(ctx, bson.M{"user_id": userID, "tag_id": tagID}) + return err +} + +func (d *DataBases) SetTag(userID, tagID, newName string, increaseUserIDList []string, reduceUserIDList []string) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag) + var tag Tag + if err := c.FindOne(ctx, bson.M{"tag_id": tagID, "user_id": userID}).Decode(&tag); err != nil { + return err + } + if newName != "" { + _, err := c.UpdateOne(ctx, bson.M{"user_id": userID, "tag_id": tagID}, bson.M{"$set": bson.M{"tag_name": newName}}) + if err != nil { + return err + } + } + tag.UserList = append(tag.UserList, increaseUserIDList...) + tag.UserList = utils.RemoveRepeatedStringInList(tag.UserList) + for _, v := range reduceUserIDList { + for i2, v2 := range tag.UserList { + if v == v2 { + tag.UserList[i2] = "" + } + } + } + var newUserList []string + for _, v := range tag.UserList { + if v != "" { + newUserList = append(newUserList, v) + } + } + _, err := c.UpdateOne(ctx, bson.M{"user_id": userID, "tag_id": tagID}, bson.M{"$set": bson.M{"user_list": newUserList}}) + if err != nil { + return err + } + return nil +} + +func (d *DataBases) GetUserIDListByTagID(userID, tagID string) ([]string, error) { + var tag Tag + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag) + _ = c.FindOne(ctx, bson.M{"user_id": userID, "tag_id": tagID}).Decode(&tag) + return tag.UserList, nil +} + +type TagUser struct { + UserID string `bson:"user_id"` + UserName string `bson:"user_name"` +} + +type TagSendLog struct { + UserList []TagUser `bson:"tag_list"` + SendID string `bson:"send_id"` + SenderPlatformID int32 `bson:"sender_platform_id"` + Content string `bson:"content"` + SendTime int64 `bson:"send_time"` +} + +func (d *DataBases) SaveTagSendLog(tagSendLog *TagSendLog) error { + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSendLog) + _, err := c.InsertOne(ctx, tagSendLog) + return err +} + +func (d *DataBases) GetTagSendLogs(userID string, showNumber, pageNumber int32) ([]TagSendLog, error) { + var tagSendLogs []TagSendLog + ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second) + c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSendLog) + findOpts := options.Find().SetLimit(int64(showNumber)).SetSkip(int64(showNumber) * (int64(pageNumber) - 1)).SetSort(bson.M{"send_time": -1}) + cursor, err := c.Find(ctx, bson.M{"send_id": userID}, findOpts) + if err != nil { + return tagSendLogs, err + } + err = cursor.All(ctx, &tagSendLogs) + if err != nil { + return tagSendLogs, err + } + return tagSendLogs, nil +} + +type WorkMoment struct { + WorkMomentID string `bson:"work_moment_id"` + UserID string `bson:"user_id"` + Content string `bson:"content"` + LikeUsers []*LikeUser `bson:"like_users"` + Comments []*Comment `bson:"comments"` + WhoCanSeeUserIDList []string `bson:"who_can_see_user_id_list"` + WhoCantSeeUserIDList []string `bson:"who_cant_see_user_id_list"` + IsPrivate bool + IsPublic bool + CreateTime int32 +} + +type LikeUser struct { + UserID string + UserName string +} + +type Comment struct { + UserID string + UserName string + ReplyUserID string + ReplyUserName string + ContentID string + Content string + CreateTime int32 +} + +func (d *DataBases) CreateOneWorkMoment(workMoment *WorkMoment) error { + return nil +} + +func (d *DataBases) DeleteOneWorkMoment(workMomentID string) error { + return nil +} + +func (d *DataBases) GetWorkMomentByID(workMomentID string) (*WorkMoment, error) { + return nil, nil +} + +func (d *DataBases) LikeOneWorkMoment(likeUserID, workMomentID string) error { + return nil +} + +func (d *DataBases) SetUserWorkMomentsLevel(userID string, level int32) error { + return nil +} + +func (d *DataBases) ClearUserWorkMomentsCommentsMsg(userID string) error { + return nil +} + +type CommentMsg struct { + WorkMomentID string `bson:"workMoment"` + CommentContent string `bson:"content"` + Comment +} + +func (d *DataBases) GetUserWorkMomentsCommentsMsg(userID string, showNumber, pageNumber int32) ([]CommentMsg, error) { + return nil, nil +} + +func (d *DataBases) CommentOneWorkMoment(comment Comment, workMomentID string) error { + return nil +} + +func (d *DataBases) GetUserWorkMoments(userID string, showNumber, pageNumber int32) ([]WorkMoment, error) { + return nil, nil +} + +func (d *DataBases) GetUserFriendWorkMoments(friendIDList []string, showNumber, pageNumber int32) ([]WorkMoment, error) { + return nil, nil +} + +func generateTagID(tagName, userID string) string { + return utils.Md5(tagName + userID + strconv.Itoa(rand.Int()) + time.Now().String()) +} + +func generateWorkMomentID(userID string) string { + return utils.Md5(userID + strconv.Itoa(rand.Int()) + time.Now().String()) +} + +func getCurrentTimestampByMill() int64 { + return time.Now().UnixNano() / 1e6 +} + +func getSeqUid(uid string, seq uint32) string { + seqSuffix := seq / singleGocMsgNum + return indexGen(uid, seqSuffix) +} + +func getMsgIndex(seq uint32) int { + seqSuffix := seq / singleGocMsgNum + var index uint32 + if seqSuffix == 0 { + index = (seq - seqSuffix*5000) - 1 + } else { + index = seq - seqSuffix*singleGocMsgNum + } + return int(index) +} + +func isContainInt32(target uint32, List []uint32) bool { + + for _, element := range List { + + if target == element { + return true + } + } + return false + +} +func indexGen(uid string, seqSuffix uint32) string { + return uid + ":" + strconv.FormatInt(int64(seqSuffix), 10) +} diff --git a/pkg/common/db/mysql.go b/pkg/common/db/mysql.go new file mode 100644 index 000000000..cfef4dfee --- /dev/null +++ b/pkg/common/db/mysql.go @@ -0,0 +1,162 @@ +package db + +import ( + "Open_IM/pkg/common/config" + + "fmt" + "sync" + "time" + + "github.com/jinzhu/gorm" + _ "github.com/jinzhu/gorm/dialects/mysql" +) + +type mysqlDB struct { + sync.RWMutex + dbMap map[string]*gorm.DB +} + +func initMysqlDB() { + //When there is no open IM database, connect to the mysql built-in database to create openIM database + dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local", + config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], "mysql") + var db *gorm.DB + var err1 error + db, err := gorm.Open("mysql", dsn) + if err != nil { + fmt.Println("0", "Open failed ", err.Error(), dsn) + } + if err != nil { + time.Sleep(time.Duration(30) * time.Second) + db, err1 = gorm.Open("mysql", dsn) + if err1 != nil { + fmt.Println("0", "Open failed ", err1.Error(), dsn) + panic(err1.Error()) + } + } + + //Check the database and table during initialization + sql := fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s default charset utf8 COLLATE utf8_general_ci;", config.Config.Mysql.DBDatabaseName) + err = db.Exec(sql).Error + if err != nil { + fmt.Println("0", "Exec failed ", err.Error(), sql) + panic(err.Error()) + } + db.Close() + + dsn = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local", + config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], config.Config.Mysql.DBDatabaseName) + db, err = gorm.Open("mysql", dsn) + if err != nil { + fmt.Println("0", "Open failed ", err.Error(), dsn) + panic(err.Error()) + } + + fmt.Println("open db ok ", dsn) + db.AutoMigrate(&Friend{}, + &FriendRequest{}, + &Group{}, + &GroupMember{}, + &GroupRequest{}, + &User{}, + &Black{}, &ChatLog{}, &Register{}, &Conversation{}) + db.Set("gorm:table_options", "CHARSET=utf8") + db.Set("gorm:table_options", "collation=utf8_unicode_ci") + + if !db.HasTable(&Friend{}) { + fmt.Println("CreateTable Friend") + db.CreateTable(&Friend{}) + } + + if !db.HasTable(&FriendRequest{}) { + fmt.Println("CreateTable FriendRequest") + db.CreateTable(&FriendRequest{}) + } + + if !db.HasTable(&Group{}) { + fmt.Println("CreateTable Group") + db.CreateTable(&Group{}) + } + + if !db.HasTable(&GroupMember{}) { + fmt.Println("CreateTable GroupMember") + db.CreateTable(&GroupMember{}) + } + if !db.HasTable(&GroupRequest{}) { + fmt.Println("CreateTable GroupRequest") + db.CreateTable(&GroupRequest{}) + } + if !db.HasTable(&User{}) { + fmt.Println("CreateTable User") + db.CreateTable(&User{}) + } + if !db.HasTable(&Black{}) { + fmt.Println("CreateTable Black") + db.CreateTable(&Black{}) + } + if !db.HasTable(&ChatLog{}) { + fmt.Println("CreateTable ChatLog") + db.CreateTable(&ChatLog{}) + } + if !db.HasTable(&Register{}) { + fmt.Println("CreateTable Register") + db.CreateTable(&Register{}) + } + if !db.HasTable(&Conversation{}) { + fmt.Println("CreateTable Conversation") + db.CreateTable(&Conversation{}) + } + + if !db.HasTable(&Department{}) { + fmt.Println("CreateTable Department") + db.CreateTable(&Department{}) + } + if !db.HasTable(&OrganizationUser{}) { + fmt.Println("CreateTable OrganizationUser") + db.CreateTable(&OrganizationUser{}) + } + if !db.HasTable(&DepartmentMember{}) { + fmt.Println("CreateTable DepartmentMember") + db.CreateTable(&DepartmentMember{}) + } + + return +} + +func (m *mysqlDB) DefaultGormDB() (*gorm.DB, error) { + return m.GormDB(config.Config.Mysql.DBAddress[0], config.Config.Mysql.DBDatabaseName) +} + +func (m *mysqlDB) GormDB(dbAddress, dbName string) (*gorm.DB, error) { + m.Lock() + defer m.Unlock() + + k := key(dbAddress, dbName) + if _, ok := m.dbMap[k]; !ok { + if err := m.open(dbAddress, dbName); err != nil { + return nil, err + } + } + return m.dbMap[k], nil +} + +func (m *mysqlDB) open(dbAddress, dbName string) error { + dsn := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local", + config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, dbAddress, dbName) + db, err := gorm.Open("mysql", dsn) + if err != nil { + return err + } + + db.SingularTable(true) + db.DB().SetMaxOpenConns(config.Config.Mysql.DBMaxOpenConns) + db.DB().SetMaxIdleConns(config.Config.Mysql.DBMaxIdleConns) + db.DB().SetConnMaxLifetime(time.Duration(config.Config.Mysql.DBMaxLifeTime) * time.Second) + + if m.dbMap == nil { + m.dbMap = make(map[string]*gorm.DB) + } + k := key(dbAddress, dbName) + m.dbMap[k] = db + return nil +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/demo_model.go b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go new file mode 100644 index 000000000..eff3050be --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/demo_model.go @@ -0,0 +1,41 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + _ "github.com/jinzhu/gorm" +) + +func GetRegister(account string) (*db.Register, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var r db.Register + return &r, dbConn.Table("registers").Where("account = ?", + account).Take(&r).Error +} + +func SetPassword(account, password, ex string) error { + r := db.Register{ + Account: account, + Password: password, + Ex: ex, + } + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + return dbConn.Table("registers").Create(&r).Error +} + +func ResetPassword(account, password string) error { + r := db.Register{ + Password: password, + } + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + dbConn.LogMode(false) + if err != nil { + return err + } + return dbConn.Table("registers").Where("account = ?", account).Update(&r).Error +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/friend_model.go b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go new file mode 100644 index 000000000..a7b14f198 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go @@ -0,0 +1,91 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + _ "github.com/jinzhu/gorm/dialects/mysql" + "time" +) + +func InsertToFriend(toInsertFollow *db.Friend) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + toInsertFollow.CreateTime = time.Now() + + err = dbConn.Table("friends").Create(toInsertFollow).Error + if err != nil { + return err + } + return nil +} + +func GetFriendRelationshipFromFriend(OwnerUserID, FriendUserID string) (*db.Friend, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var friend db.Friend + err = dbConn.Table("friends").Where("owner_user_id=? and friend_user_id=?", OwnerUserID, FriendUserID).Take(&friend).Error + if err != nil { + return nil, err + } + return &friend, err +} + +func GetFriendListByUserID(OwnerUserID string) ([]db.Friend, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var friends []db.Friend + var x db.Friend + x.OwnerUserID = OwnerUserID + err = dbConn.Table("friends").Where("owner_user_id=?", OwnerUserID).Find(&friends).Error + + if err != nil { + return nil, err + } + return friends, nil +} + +func GetFriendIDListByUserID(OwnerUserID string) ([]string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var friendIDList []string + err = dbConn.Table("friends").Select("friend_user_id").Where("owner_user_id=?", OwnerUserID).Find(&friendIDList).Error + if err != nil { + return nil, err + } + return friendIDList, nil +} + +func UpdateFriendComment(OwnerUserID, FriendUserID, Remark string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Exec("update friends set remark=? where owner_user_id=? and friend_user_id=?", Remark, OwnerUserID, FriendUserID).Error + return err +} + +func DeleteSingleFriendInfo(OwnerUserID, FriendUserID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Table("friends").Where("owner_user_id=? and friend_user_id=?", OwnerUserID, FriendUserID).Delete(db.Friend{}).Error + return err +} + +//type Friend struct { +// OwnerUserID string `gorm:"column:owner_user_id;primaryKey;"` +// FriendUserID string `gorm:"column:friend_user_id;primaryKey;"` +// Remark string `gorm:"column:remark"` +// CreateTime time.Time `gorm:"column:create_time"` +// AddSource int32 `gorm:"column:add_source"` +// OperatorUserID string `gorm:"column:operator_user_id"` +// Ex string `gorm:"column:ex"` +//} diff --git a/pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go b/pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go new file mode 100644 index 000000000..171a6aedf --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/friend_request_model.go @@ -0,0 +1,112 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + "Open_IM/pkg/utils" + "time" +) + +//type FriendRequest struct { +// FromUserID string `gorm:"column:from_user_id;primaryKey;"` +// ToUserID string `gorm:"column:to_user_id;primaryKey;"` +// HandleResult int32 `gorm:"column:handle_result"` +// ReqMessage string `gorm:"column:req_message"` +// CreateTime time.Time `gorm:"column:create_time"` +// HandlerUserID string `gorm:"column:handler_user_id"` +// HandleMsg string `gorm:"column:handle_msg"` +// HandleTime time.Time `gorm:"column:handle_time"` +// Ex string `gorm:"column:ex"` +//} + +// who apply to add me +func GetReceivedFriendsApplicationListByUserID(ToUserID string) ([]db.FriendRequest, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var usersInfo []db.FriendRequest + err = dbConn.Table("friend_requests").Where("to_user_id=?", ToUserID).Find(&usersInfo).Error + if err != nil { + return nil, err + } + return usersInfo, nil +} + +//I apply to add somebody +func GetSendFriendApplicationListByUserID(FromUserID string) ([]db.FriendRequest, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var usersInfo []db.FriendRequest + err = dbConn.Table("friend_requests").Where("from_user_id=?", FromUserID).Find(&usersInfo).Error + if err != nil { + return nil, err + } + return usersInfo, nil +} + +//FromUserId apply to add ToUserID +func GetFriendApplicationByBothUserID(FromUserID, ToUserID string) (*db.FriendRequest, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var friendRequest db.FriendRequest + err = dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", FromUserID, ToUserID).Take(&friendRequest).Error + if err != nil { + return nil, err + } + return &friendRequest, nil +} + +func UpdateFriendApplication(friendRequest *db.FriendRequest) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + friendRequest.CreateTime = time.Now() + + return dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", + friendRequest.FromUserID, friendRequest.ToUserID).Update(&friendRequest).Error +} + +func InsertFriendApplication(friendRequest *db.FriendRequest, args map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + + if err = dbConn.Table("friend_requests").Create(friendRequest).Error; err == nil { + return nil + } + + //t := dbConn.Debug().Table("friend_requests").Where("from_user_id = ? and to_user_id = ?", friendRequest.FromUserID, friendRequest.ToUserID).Select("*").Updates(*friendRequest) + //if t.RowsAffected == 0 { + // return utils.Wrap(errors.New("RowsAffected == 0"), "no update") + //} + //return utils.Wrap(t.Error, "") + + friendRequest.CreateTime = time.Now() + args["create_time"] = friendRequest.CreateTime + u := dbConn.Model(friendRequest).Updates(args) + //u := dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", + // friendRequest.FromUserID, friendRequest.ToUserID).Update(&friendRequest) + //u := dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", + // friendRequest.FromUserID, friendRequest.ToUserID).Update(&friendRequest) + if u.RowsAffected != 0 { + return nil + } + + if friendRequest.CreateTime.Unix() < 0 { + friendRequest.CreateTime = time.Now() + } + if friendRequest.HandleTime.Unix() < 0 { + friendRequest.HandleTime = utils.UnixSecondToTime(0) + } + err = dbConn.Table("friend_requests").Create(friendRequest).Error + if err != nil { + return err + } + return nil +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go new file mode 100644 index 000000000..289a157fc --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go @@ -0,0 +1,316 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/utils" + "errors" + "fmt" + "time" +) + +//type GroupMember struct { +// GroupID string `gorm:"column:group_id;primaryKey;"` +// UserID string `gorm:"column:user_id;primaryKey;"` +// NickName string `gorm:"column:nickname"` +// FaceUrl string `gorm:"user_group_face_url"` +// RoleLevel int32 `gorm:"column:role_level"` +// JoinTime time.Time `gorm:"column:join_time"` +// JoinSource int32 `gorm:"column:join_source"` +// OperatorUserID string `gorm:"column:operator_user_id"` +// Ex string `gorm:"column:ex"` +//} + +func InsertIntoGroupMember(toInsertInfo db.GroupMember) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + toInsertInfo.JoinTime = time.Now() + if toInsertInfo.RoleLevel == 0 { + toInsertInfo.RoleLevel = constant.GroupOrdinaryUsers + } + toInsertInfo.MuteEndTime = time.Unix(int64(time.Now().Second()), 0) + err = dbConn.Table("group_members").Create(toInsertInfo).Error + if err != nil { + return err + } + return nil +} + +func GetGroupMemberListByUserID(userID string) ([]db.GroupMember, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var groupMemberList []db.GroupMember + err = dbConn.Table("group_members").Where("user_id=?", userID).Find(&groupMemberList).Error + //err = dbConn.Table("group_members").Where("user_id=?", userID).Take(&groupMemberList).Error + if err != nil { + return nil, err + } + return groupMemberList, nil +} + +func GetGroupMemberListByGroupID(groupID string) ([]db.GroupMember, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var groupMemberList []db.GroupMember + err = dbConn.Table("group_members").Where("group_id=?", groupID).Find(&groupMemberList).Error + + if err != nil { + return nil, err + } + return groupMemberList, nil +} + +func GetGroupMemberIDListByGroupID(groupID string) ([]string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + dbConn.LogMode(false) + var groupMembers []db.GroupMember + err = dbConn.Table("group_members").Select("user_id").Where("group_id=?", groupID).Find(&groupMembers).Error + if err != nil { + return nil, err + } + var groupMemberIDList []string + for _, v := range groupMembers { + groupMemberIDList = append(groupMemberIDList, v.UserID) + } + return groupMemberIDList, nil +} + +func GetGroupMemberListByGroupIDAndRoleLevel(groupID string, roleLevel int32) ([]db.GroupMember, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var groupMemberList []db.GroupMember + err = dbConn.Table("group_members").Where("group_id=? and role_level=?", groupID, roleLevel).Find(&groupMemberList).Error + if err != nil { + return nil, err + } + return groupMemberList, nil +} + +func GetGroupMemberInfoByGroupIDAndUserID(groupID, userID string) (*db.GroupMember, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var groupMember db.GroupMember + err = dbConn.Table("group_members").Where("group_id=? and user_id=? ", groupID, userID).Limit(1).Take(&groupMember).Error + if err != nil { + return nil, err + } + return &groupMember, nil +} + +func DeleteGroupMemberByGroupIDAndUserID(groupID, userID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Table("group_members").Where("group_id=? and user_id=? ", groupID, userID).Delete(db.GroupMember{}).Error + if err != nil { + return err + } + return nil +} + +func DeleteGroupMemberByGroupID(groupID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Table("group_members").Where("group_id=? ", groupID).Delete(db.GroupMember{}).Error + if err != nil { + return err + } + return nil +} + +func UpdateGroupMemberInfo(groupMemberInfo db.GroupMember) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Table("group_members").Where("group_id=? and user_id=?", groupMemberInfo.GroupID, groupMemberInfo.UserID).Update(&groupMemberInfo).Error + if err != nil { + return err + } + return nil +} + +func GetOwnerManagerByGroupID(groupID string) ([]db.GroupMember, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var groupMemberList []db.GroupMember + err = dbConn.Table("group_members").Where("group_id=? and role_level>?", groupID, constant.GroupOrdinaryUsers).Find(&groupMemberList).Error + if err != nil { + return nil, err + } + return groupMemberList, nil +} + +func GetGroupMemberNumByGroupID(groupID string) (uint32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, utils.Wrap(err, "DefaultGormDB failed") + } + var number uint32 + err = dbConn.Table("group_members").Where("group_id=?", groupID).Count(&number).Error + if err != nil { + return 0, utils.Wrap(err, "") + } + return number, nil +} + +func GetGroupOwnerInfoByGroupID(groupID string) (*db.GroupMember, error) { + omList, err := GetOwnerManagerByGroupID(groupID) + if err != nil { + return nil, err + } + for _, v := range omList { + if v.RoleLevel == constant.GroupOwner { + return &v, nil + } + } + + return nil, utils.Wrap(errors.New("no owner"), "") +} + +func IsExistGroupMember(groupID, userID string) bool { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return false + } + var number int32 + err = dbConn.Table("group_members").Where("group_id = ? and user_id = ?", groupID, userID).Count(&number).Error + if err != nil { + return false + } + if number != 1 { + return false + } + return true +} + +func RemoveGroupMember(groupID string, UserID string) error { + return DeleteGroupMemberByGroupIDAndUserID(groupID, UserID) +} + +func GetMemberInfoByID(groupID string, userID string) (*db.GroupMember, error) { + return GetGroupMemberInfoByGroupIDAndUserID(groupID, userID) +} + +func GetGroupMemberByGroupID(groupID string, filter int32, begin int32, maxNumber int32) ([]db.GroupMember, error) { + var memberList []db.GroupMember + var err error + if filter >= 0 { + memberList, err = GetGroupMemberListByGroupIDAndRoleLevel(groupID, filter) //sorted by join time + } else { + memberList, err = GetGroupMemberListByGroupID(groupID) + } + + if err != nil { + return nil, err + } + if begin >= int32(len(memberList)) { + return nil, nil + } + + var end int32 + if begin+int32(maxNumber) < int32(len(memberList)) { + end = begin + maxNumber + } else { + end = int32(len(memberList)) + } + return memberList[begin:end], nil +} + +func GetJoinedGroupIDListByUserID(userID string) ([]string, error) { + memberList, err := GetGroupMemberListByUserID(userID) + if err != nil { + return nil, err + } + var groupIDList []string = make([]string, len(memberList)) + for _, v := range memberList { + groupIDList = append(groupIDList, v.GroupID) + } + return groupIDList, nil +} + +func IsGroupOwnerAdmin(groupID, UserID string) bool { + groupMemberList, err := GetOwnerManagerByGroupID(groupID) + if err != nil { + return false + } + for _, v := range groupMemberList { + if v.UserID == UserID && v.RoleLevel > constant.GroupOrdinaryUsers { + return true + } + } + return false +} + +func GetGroupMembersByGroupIdCMS(groupId string, userName string, showNumber, pageNumber int32) ([]db.GroupMember, error) { + var groupMembers []db.GroupMember + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return groupMembers, err + } + err = dbConn.Table("group_members").Where("group_id=?", groupId).Where(fmt.Sprintf(" nickname like '%%%s%%' ", userName)).Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&groupMembers).Error + if err != nil { + return nil, err + } + return groupMembers, nil +} + +func GetGroupMembersCount(groupId, userName string) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var count int32 + if err != nil { + return count, err + } + dbConn.LogMode(false) + if err := dbConn.Table("group_members").Where("group_id=?", groupId).Where(fmt.Sprintf(" nickname like '%%%s%%' ", userName)).Count(&count).Error; err != nil { + return count, err + } + return count, nil +} + +func UpdateGroupMemberInfoDefaultZero(groupMemberInfo db.GroupMember, args map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + return dbConn.Model(groupMemberInfo).Updates(args).Error +} + +// +//func SelectGroupList(groupID string) ([]string, error) { +// var groupUserID string +// var groupList []string +// dbConn, err := db.DB.MysqlDB.DefaultGormDB() +// if err != nil { +// return groupList, err +// } +// +// rows, err := dbConn.Model(&GroupMember{}).Where("group_id = ?", groupID).Select("user_id").Rows() +// if err != nil { +// return groupList, err +// } +// defer rows.Close() +// for rows.Next() { +// rows.Scan(&groupUserID) +// groupList = append(groupList, groupUserID) +// } +// return groupList, nil +//} 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 new file mode 100644 index 000000000..9056bfb00 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/group_model.go @@ -0,0 +1,225 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/utils" + "errors" + "fmt" + "github.com/jinzhu/gorm" + "time" +) + +//type Group struct { +// GroupID string `gorm:"column:group_id;primaryKey;"` +// GroupName string `gorm:"column:name"` +// Introduction string `gorm:"column:introduction"` +// Notification string `gorm:"column:notification"` +// FaceUrl string `gorm:"column:face_url"` +// CreateTime time.Time `gorm:"column:create_time"` +// Status int32 `gorm:"column:status"` +// CreatorUserID string `gorm:"column:creator_user_id"` +// GroupType int32 `gorm:"column:group_type"` +// Ex string `gorm:"column:ex"` +//} + +func InsertIntoGroup(groupInfo db.Group) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + if groupInfo.GroupName == "" { + groupInfo.GroupName = "Group Chat" + } + groupInfo.CreateTime = time.Now() + err = dbConn.Table("groups").Create(groupInfo).Error + if err != nil { + return err + } + return nil +} + +func GetGroupInfoByGroupID(groupId string) (*db.Group, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, utils.Wrap(err, "") + } + var groupInfo db.Group + err = dbConn.Table("groups").Where("group_id=?", groupId).Take(&groupInfo).Error + if err != nil { + return nil, err + } + return &groupInfo, nil +} + +func SetGroupInfo(groupInfo db.Group) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Table("groups").Where("group_id=?", groupInfo.GroupID).Update(&groupInfo).Error + return err +} + +func GetGroupsByName(groupName string, pageNumber, showNumber int32) ([]db.Group, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var groups []db.Group + if err != nil { + return groups, err + } + + err = dbConn.Table("groups").Where(fmt.Sprintf(" name like '%%%s%%' ", groupName)).Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&groups).Error + return groups, err +} + +func GetGroups(pageNumber, showNumber int) ([]db.Group, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var groups []db.Group + if err != nil { + return groups, err + } + + if err = dbConn.Table("groups").Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&groups).Error; err != nil { + return groups, err + } + return groups, nil +} + +func OperateGroupStatus(groupId string, groupStatus int32) error { + group := db.Group{ + GroupID: groupId, + Status: groupStatus, + } + if err := SetGroupInfo(group); err != nil { + return err + } + return nil +} + +func DeleteGroup(groupId string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + + var group db.Group + var groupMembers []db.GroupMember + if err := dbConn.Table("groups").Where("group_id=?", groupId).Delete(&group).Error; err != nil { + return err + } + if err := dbConn.Table("group_members").Where("group_id=?", groupId).Delete(groupMembers).Error; err != nil { + return err + } + return nil +} + +func OperateGroupRole(userId, groupId string, roleLevel int32) (string, string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return "", "", err + } + groupMember := db.GroupMember{ + UserID: userId, + GroupID: groupId, + } + updateInfo := db.GroupMember{ + RoleLevel: roleLevel, + } + groupMaster := db.GroupMember{} + switch roleLevel { + case constant.GroupOwner: + err = dbConn.Transaction(func(tx *gorm.DB) error { + result := dbConn.Table("group_members").Where("group_id = ? and role_level = ?", groupId, constant.GroupOwner).First(&groupMaster).Update(&db.GroupMember{ + RoleLevel: constant.GroupOrdinaryUsers, + }) + if result.Error != nil { + return result.Error + } + if result.RowsAffected == 0 { + return errors.New(fmt.Sprintf("user %s not exist in group %s or already operate", userId, groupId)) + } + + result = dbConn.Table("group_members").First(&groupMember).Update(updateInfo) + if result.Error != nil { + return result.Error + } + if result.RowsAffected == 0 { + return errors.New(fmt.Sprintf("user %s not exist in group %s or already operate", userId, groupId)) + } + return nil + }) + + case constant.GroupOrdinaryUsers: + err = dbConn.Transaction(func(tx *gorm.DB) error { + result := dbConn.Table("group_members").Where("group_id = ? and role_level = ?", groupId, constant.GroupOwner).First(&groupMaster) + if result.Error != nil { + return result.Error + } + if result.RowsAffected == 0 { + return errors.New(fmt.Sprintf("user %s not exist in group %s or already operate", userId, groupId)) + } + if groupMaster.UserID == userId { + return errors.New(fmt.Sprintf("user %s is master of %s, cant set to ordinary user", userId, groupId)) + } else { + result = dbConn.Table("group_members").Find(&groupMember).Update(updateInfo) + if result.Error != nil { + return result.Error + } + if result.RowsAffected == 0 { + return errors.New(fmt.Sprintf("user %s not exist in group %s or already operate", userId, groupId)) + } + } + return nil + }) + } + return "", "", nil +} + +func GetGroupsCountNum(group db.Group) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + + var count int32 + if err := dbConn.Table("groups").Where(fmt.Sprintf(" name like '%%%s%%' ", group.GroupName)).Count(&count).Error; err != nil { + return 0, err + } + return count, nil +} + +func GetGroupById(groupId string) (db.Group, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + group := db.Group{ + GroupID: groupId, + } + if err != nil { + return group, err + } + + if err := dbConn.Table("groups").Find(&group).Error; err != nil { + return group, err + } + return group, nil +} + +func GetGroupMaster(groupId string) (db.GroupMember, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + groupMember := db.GroupMember{} + if err != nil { + return groupMember, err + } + + if err := dbConn.Table("group_members").Where("role_level=? and group_id=?", constant.GroupOwner, groupId).Find(&groupMember).Error; err != nil { + return groupMember, err + } + return groupMember, nil +} + +func UpdateGroupInfoDefaultZero(groupID string, args map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + return dbConn.Table("groups").Where("group_id = ? ", groupID).Update(args).Error +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go new file mode 100644 index 000000000..5e27cc3d2 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go @@ -0,0 +1,209 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/utils" + "time" +) + +//type GroupRequest struct { +// UserID string `gorm:"column:user_id;primaryKey;"` +// GroupID string `gorm:"column:group_id;primaryKey;"` +// HandleResult int32 `gorm:"column:handle_result"` +// ReqMsg string `gorm:"column:req_msg"` +// HandledMsg string `gorm:"column:handled_msg"` +// ReqTime time.Time `gorm:"column:req_time"` +// HandleUserID string `gorm:"column:handle_user_id"` +// HandledTime time.Time `gorm:"column:handle_time"` +// Ex string `gorm:"column:ex"` +//} + +func UpdateGroupRequest(groupRequest db.GroupRequest) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + if groupRequest.HandledTime.Unix() < 0 { + groupRequest.HandledTime = utils.UnixSecondToTime(0) + } + return dbConn.Table("group_requests").Where("group_id=? and user_id=?", groupRequest.GroupID, groupRequest.UserID).Update(&groupRequest).Error +} + +func InsertIntoGroupRequest(toInsertInfo db.GroupRequest) error { + DelGroupRequestByGroupIDAndUserID(toInsertInfo.GroupID, toInsertInfo.UserID) + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + + if toInsertInfo.HandledTime.Unix() < 0 { + toInsertInfo.HandledTime = utils.UnixSecondToTime(0) + } + u := dbConn.Table("group_requests").Where("group_id=? and user_id=?", toInsertInfo.GroupID, toInsertInfo.UserID).Update(&toInsertInfo) + if u.RowsAffected != 0 { + return nil + } + + toInsertInfo.ReqTime = time.Now() + if toInsertInfo.HandledTime.Unix() < 0 { + toInsertInfo.HandledTime = utils.UnixSecondToTime(0) + } + + err = dbConn.Table("group_requests").Create(&toInsertInfo).Error + if err != nil { + return err + } + return nil +} + +func GetGroupRequestByGroupIDAndUserID(groupID, userID string) (*db.GroupRequest, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var groupRequest db.GroupRequest + err = dbConn.Table("group_requests").Where("user_id=? and group_id=?", userID, groupID).Take(&groupRequest).Error + if err != nil { + return nil, err + } + return &groupRequest, nil +} + +func DelGroupRequestByGroupIDAndUserID(groupID, userID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Table("group_requests").Where("group_id=? and user_id=?", groupID, userID).Delete(db.GroupRequest{}).Error + if err != nil { + return err + } + return nil +} + +func GetGroupRequestByGroupID(groupID string) ([]db.GroupRequest, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var groupRequestList []db.GroupRequest + err = dbConn.Table("group_requests").Where("group_id=?", groupID).Find(&groupRequestList).Error + if err != nil { + return nil, err + } + return groupRequestList, nil +} + +//received +func GetGroupApplicationList(userID string) ([]db.GroupRequest, error) { + var groupRequestList []db.GroupRequest + memberList, err := GetGroupMemberListByUserID(userID) + if err != nil { + return nil, err + } + for _, v := range memberList { + if v.RoleLevel > constant.GroupOrdinaryUsers { + list, err := GetGroupRequestByGroupID(v.GroupID) + if err != nil { + // fmt.Println("111 GetGroupRequestByGroupID failed ", err.Error()) + continue + } + // fmt.Println("222 GetGroupRequestByGroupID ok ", list) + groupRequestList = append(groupRequestList, list...) + // fmt.Println("333 GetGroupRequestByGroupID ok ", groupRequestList) + } + } + return groupRequestList, nil +} + +func GetUserReqGroupByUserID(userID string) ([]db.GroupRequest, error) { + var groupRequestList []db.GroupRequest + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + dbConn.LogMode(false) + err = dbConn.Table("group_requests").Where("user_id=?", userID).Find(&groupRequestList).Error + return groupRequestList, err +} + +// +//func GroupApplicationResponse(pb *group.GroupApplicationResponseReq) (*group.CommonResp, error) { +// +// ownerUser, err := FindGroupMemberInfoByGroupIdAndUserId(pb.GroupID, pb.OwnerID) +// if err != nil { +// log.ErrorByKv("FindGroupMemberInfoByGroupIdAndUserId failed", pb.OperationID, "groupId", pb.GroupID, "ownerID", pb.OwnerID) +// return nil, err +// } +// if ownerUser.AdministratorLevel <= 0 { +// return nil, errors.New("insufficient permissions") +// } +// +// dbConn, err := db.DB.MysqlDB.DefaultGormDB() +// if err != nil { +// return nil, err +// } +// var groupRequest GroupRequest +// err = dbConn.Raw("select * from `group_request` where handled_user = ? and group_id = ? and from_user_id = ? and to_user_id = ?", +// "", pb.GroupID, pb.FromUserID, pb.ToUserID).Scan(&groupRequest).Error +// if err != nil { +// log.ErrorByKv("find group_request info failed", pb.OperationID, "groupId", pb.GroupID, "fromUserId", pb.FromUserID, "toUserId", pb.OwnerID) +// return nil, err +// } +// +// if groupRequest.Flag != 0 { +// return nil, errors.New("application has already handle") +// } +// +// var saveFlag int +// if pb.HandleResult == 0 { +// saveFlag = -1 +// } else if pb.HandleResult == 1 { +// saveFlag = 1 +// } else { +// return nil, errors.New("parma HandleResult error") +// } +// err = dbConn.Exec("update `group_request` set flag = ?, handled_msg = ?, handled_user = ? where group_id = ? and from_user_id = ? and to_user_id = ?", +// saveFlag, pb.HandledMsg, pb.OwnerID, groupRequest.GroupID, groupRequest.FromUserID, groupRequest.ToUserID).Error +// if err != nil { +// log.ErrorByKv("update group request failed", pb.OperationID, "groupID", pb.GroupID, "flag", saveFlag, "ownerId", pb.OwnerID, "fromUserId", pb.FromUserID, "toUserID", pb.ToUserID) +// return nil, err +// } +// +// if saveFlag == 1 { +// if groupRequest.ToUserID == "0" { +// err = InsertIntoGroupMember(pb.GroupID, pb.FromUserID, groupRequest.FromUserNickname, groupRequest.FromUserFaceUrl, 0) +// if err != nil { +// log.ErrorByKv("InsertIntoGroupMember failed", pb.OperationID, "groupID", pb.GroupID, "fromUserId", pb.FromUserID) +// return nil, err +// } +// } else { +// err = InsertIntoGroupMember(pb.GroupID, pb.ToUserID, groupRequest.ToUserNickname, groupRequest.ToUserFaceUrl, 0) +// if err != nil { +// log.ErrorByKv("InsertIntoGroupMember failed", pb.OperationID, "groupID", pb.GroupID, "fromUserId", pb.FromUserID) +// return nil, err +// } +// } +// } +// +// return &group.GroupApplicationResponseResp{}, nil +//} + +//func FindGroupBeInvitedRequestInfoByUidAndGroupID(groupId, uid string) (*GroupRequest, error) { +// dbConn, err := db.DB.MysqlDB.DefaultGormDB() +// if err != nil { +// return nil, err +// } +// var beInvitedRequestUserInfo GroupRequest +// err = dbConn.Table("group_request").Where("to_user_id=? and group_id=?", uid, groupId).Find(&beInvitedRequestUserInfo).Error +// if err != nil { +// return nil, err +// } +// return &beInvitedRequestUserInfo, nil +// +//} + +//func InsertGroupRequest(groupId, fromUser, fromUserNickName, fromUserFaceUrl, toUser, requestMsg, handledMsg string, handleStatus int) error { +// return nil +//} diff --git a/pkg/common/db/mysql_model/im_mysql_model/message_cms.go b/pkg/common/db/mysql_model/im_mysql_model/message_cms.go new file mode 100644 index 000000000..29fb650cf --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/message_cms.go @@ -0,0 +1,68 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "fmt" +) + +func GetChatLog(chatLog db.ChatLog, pageNumber, showNumber int32) ([]db.ChatLog, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var chatLogs []db.ChatLog + if err != nil { + return chatLogs, err + } + dbConn.LogMode(false) + db := dbConn.Table("chat_logs"). + Where(fmt.Sprintf(" content like '%%%s%%'", chatLog.Content)). + Limit(showNumber).Offset(showNumber * (pageNumber - 1)) + if chatLog.SessionType != 0 { + db = db.Where("session_type = ?", chatLog.SessionType) + } + if chatLog.ContentType != 0 { + db = db.Where("content_type = ?", chatLog.ContentType) + } + if chatLog.SendID != "" { + db = db.Where("send_id = ?", chatLog.SendID) + } + if chatLog.RecvID != "" { + db = db.Where("recv_id = ?", chatLog.RecvID) + } + if chatLog.SendTime.Unix() > 0 { + db = db.Where("send_time > ? and send_time < ?", chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1)) + } + err = db.Find(&chatLogs).Error + return chatLogs, err +} + +func GetChatLogCount(chatLog db.ChatLog) (int64, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var chatLogs []db.ChatLog + var count int64 + if err != nil { + return count, err + } + dbConn.LogMode(false) + db := dbConn.Table("chat_logs"). + Where(fmt.Sprintf(" content like '%%%s%%'", chatLog.Content)) + if chatLog.SessionType != 0 { + db = db.Where("session_type = ?", chatLog.SessionType) + } + if chatLog.ContentType != 0 { + db = db.Where("content_type = ?", chatLog.ContentType) + } + if chatLog.SendID != "" { + db = db.Where("send_id = ?", chatLog.SendID) + } + if chatLog.RecvID != "" { + db = db.Where("recv_id = ?", chatLog.RecvID) + } + if chatLog.SendTime.Unix() > 0 { + log.NewDebug("", utils.GetSelfFuncName(), chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1)) + db = db.Where("send_time > ? and send_time < ?", chatLog.SendTime, chatLog.SendTime.AddDate(0, 0, 1)) + } + + err = db.Find(&chatLogs).Count(&count).Error + return count, err +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/organization_model.go b/pkg/common/db/mysql_model/im_mysql_model/organization_model.go new file mode 100644 index 000000000..0b7f1621e --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/organization_model.go @@ -0,0 +1,182 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + "time" +) + +func CreateDepartment(department *db.Department) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + department.CreateTime = time.Now() + return dbConn.Table("departments").Create(department).Error +} + +func GetDepartment(departmentID string) (error, *db.Department) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err, nil + } + var department db.Department + err = dbConn.Table("departments").Where("department_id=?", departmentID).Find(&department).Error + return err, &department +} + +func UpdateDepartment(department *db.Department, args map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + if err = dbConn.Table("departments").Where("department_id=?", department.DepartmentID).Updates(department).Error; err != nil { + return err + } + if args != nil { + return dbConn.Table("departments").Where("department_id=?", department.DepartmentID).Updates(args).Error + } + return nil +} + +func GetSubDepartmentList(departmentID string) (error, []db.Department) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err, nil + } + var departmentList []db.Department + err = dbConn.Table("departments").Where("parent_id=?", departmentID).Find(&departmentList).Error + return err, departmentList +} + +func DeleteDepartment(departmentID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + if err = dbConn.Table("departments").Where("department_id=?", departmentID).Delete(db.Department{}).Error; err != nil { + return err + } + if err = dbConn.Table("department_members").Where("department_id=?", departmentID).Delete(db.DepartmentMember{}).Error; err != nil { + return err + } + return nil +} + +func CreateOrganizationUser(organizationUser *db.OrganizationUser) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + organizationUser.CreateTime = time.Now() + + return dbConn.Table("organization_users").Create(organizationUser).Error +} + +func GetOrganizationUser(userID string) (error, *db.OrganizationUser) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err, nil + } + organizationUser := db.OrganizationUser{} + err = dbConn.Table("organization_users").Where("user_id=?", userID).Take(&organizationUser).Error + return err, &organizationUser +} + +func UpdateOrganizationUser(organizationUser *db.OrganizationUser, args map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + if err = dbConn.Table("organization_users").Where("user_id=?", organizationUser.UserID).Updates(organizationUser).Error; err != nil { + return err + } + if args != nil { + return dbConn.Table("organization_users").Where("user_id=?", organizationUser.UserID).Updates(args).Error + } + return nil +} + +func CreateDepartmentMember(departmentMember *db.DepartmentMember) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + departmentMember.CreateTime = time.Now() + return dbConn.Table("department_members").Create(departmentMember).Error +} + +func GetUserInDepartment(userID string) (error, []db.DepartmentMember) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err, nil + } + var departmentMemberList []db.DepartmentMember + err = dbConn.Table("department_members").Where("user_id=?", userID).Take(&departmentMemberList).Error + return err, departmentMemberList +} + +func UpdateUserInDepartment(departmentMember *db.DepartmentMember, args map[string]interface{}) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + if err = dbConn.Table("department_members").Where("department_id=? ADN user_id=?", departmentMember.DepartmentID, departmentMember.UserID). + Updates(departmentMember).Error; err != nil { + return err + } + if args != nil { + return dbConn.Table("department_members").Where("department_id=? ADN user_id=?", departmentMember.DepartmentID, departmentMember.UserID). + Updates(args).Error + } + return nil +} + +func DeleteUserInDepartment(departmentID, userID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + return dbConn.Table("department_members").Where("department_id=? ADN user_id=?", departmentID, userID).Delete(db.DepartmentMember{}).Error +} + +func DeleteUserInAllDepartment(userID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + return dbConn.Table("department_members").Where("user_id=?", userID).Delete(db.DepartmentMember{}).Error +} + +func DeleteOrganizationUser(OrganizationUserID string) error { + if err := DeleteUserInAllDepartment(OrganizationUserID); err != nil { + return err + } + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + return dbConn.Table("organization_users").Where("user_id=?", OrganizationUserID).Delete(db.OrganizationUser{}).Error +} + +func GetDepartmentMemberUserIDList(departmentID string) (error, []string) { + //dbConn, err := db.DB.MysqlDB.DefaultGormDB() + //if err != nil { + // return err + //} + //return dbConn.Table("department_members").Where("user_id=?", userID).Delete(db.DepartmentMember{}).Error + + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err, nil + } + var departmentMemberList []db.DepartmentMember + err = dbConn.Table("department_members").Where("department_id=?", departmentID).Take(&departmentMemberList).Error + if err != nil { + return err, nil + } + var userIDList []string = make([]string, 0) + for _, v := range departmentMemberList { + userIDList = append(userIDList, v.UserID) + } + return err, userIDList +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/statistics_model.go b/pkg/common/db/mysql_model/im_mysql_model/statistics_model.go new file mode 100644 index 000000000..aa07c1688 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/statistics_model.go @@ -0,0 +1,153 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + "time" +) + +func GetActiveUserNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var num int32 + err = dbConn.Table("chat_logs").Select("count(distinct(send_id))").Where("create_time >= ? and create_time <= ?", from, to).Count(&num).Error + return num, err +} + +func GetIncreaseUserNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var num int32 + err = dbConn.Table("users").Where("create_time >= ? and create_time <= ?", from, to).Count(&num).Error + return num, err +} + +func GetTotalUserNum() (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var num int32 + err = dbConn.Table("users").Count(&num).Error + return num, err +} + +func GetTotalUserNumByDate(to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var num int32 + err = dbConn.Table("users").Where("create_time <= ?", to).Count(&num).Error + return num, err +} + +func GetPrivateMessageNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var num int32 + err = dbConn.Table("chat_logs").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 1).Count(&num).Error + return num, err +} + +func GetGroupMessageNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var num int32 + err = dbConn.Table("chat_logs").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 2).Count(&num).Error + return num, err +} + +func GetIncreaseGroupNum(from, to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var num int32 + err = dbConn.Table("groups").Where("create_time >= ? and create_time <= ?", from, to).Count(&num).Error + return num, err +} + +func GetTotalGroupNum() (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var num int32 + err = dbConn.Table("groups").Count(&num).Error + return num, err +} + +func GetGroupNum(to time.Time) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var num int32 + err = dbConn.Table("groups").Where("create_time <= ?", to).Count(&num).Error + return num, err +} + +type activeGroup struct { + Name string + Id string `gorm:"column:recv_id"` + MessageNum int `gorm:"column:message_num"` +} + +func GetActiveGroups(from, to time.Time, limit int) ([]*activeGroup, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var activeGroups []*activeGroup + if err != nil { + return activeGroups, err + } + dbConn.LogMode(false) + err = dbConn.Table("chat_logs").Select("recv_id, count(*) as message_num").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 2).Group("recv_id").Limit(limit).Order("message_num DESC").Find(&activeGroups).Error + for _, activeGroup := range activeGroups { + group := db.Group{ + GroupID: activeGroup.Id, + } + dbConn.Table("groups").Where("group_id= ? ", group.GroupID).Find(&group) + activeGroup.Name = group.GroupName + } + return activeGroups, err +} + +type activeUser struct { + Name string + Id string `gorm:"column:send_id"` + MessageNum int `gorm:"column:message_num"` +} + +func GetActiveUsers(from, to time.Time, limit int) ([]*activeUser, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var activeUsers []*activeUser + if err != nil { + return activeUsers, err + } + dbConn.LogMode(false) + err = dbConn.Table("chat_logs").Select("send_id, count(*) as message_num").Where("create_time >= ? and create_time <= ? and session_type = ?", from, to, 1).Group("send_id").Limit(limit).Order("message_num DESC").Find(&activeUsers).Error + for _, activeUser := range activeUsers { + user := db.User{ + UserID: activeUser.Id, + } + dbConn.Table("users").Select("user_id, name").Find(&user) + activeUser.Name = user.Nickname + } + return activeUsers, err +} diff --git a/pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go new file mode 100644 index 000000000..7a60287a6 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/user_black_list_model.go @@ -0,0 +1,58 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/db" + "Open_IM/pkg/utils" + "time" +) + +func InsertInToUserBlackList(black db.Black) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + black.CreateTime = time.Now() + err = dbConn.Table("blacks").Create(black).Error + return err +} + +//type Black struct { +// OwnerUserID string `gorm:"column:owner_user_id;primaryKey;"` +// BlockUserID string `gorm:"column:block_user_id;primaryKey;"` +// CreateTime time.Time `gorm:"column:create_time"` +// AddSource int32 `gorm:"column:add_source"` +// OperatorUserID int32 `gorm:"column:operator_user_id"` +// Ex string `gorm:"column:ex"` +//} + +func CheckBlack(ownerUserID, blockUserID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + var black db.Black + err = dbConn.Table("blacks").Where("owner_user_id=? and block_user_id=?", ownerUserID, blockUserID).Find(&black).Error + return err +} + +func RemoveBlackList(ownerUserID, blockUserID string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Table("blacks").Where("owner_user_id=? and block_user_id=?", ownerUserID, blockUserID).Delete(db.Black{}).Error + return utils.Wrap(err, "RemoveBlackList failed") +} + +func GetBlackListByUserID(ownerUserID string) ([]db.Black, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var blackListUsersInfo []db.Black + err = dbConn.Table("blacks").Where("owner_user_id=?", ownerUserID).Find(&blackListUsersInfo).Error + if err != nil { + return nil, err + } + return blackListUsersInfo, nil +} 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 new file mode 100644 index 000000000..003b7afa7 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_model/user_model.go @@ -0,0 +1,398 @@ +package im_mysql_model + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "fmt" + "time" + + _ "github.com/jinzhu/gorm/dialects/mysql" +) + +func init() { + //init managers + for k, v := range config.Config.Manager.AppManagerUid { + user, err := GetUserByUserID(v) + if err != nil { + fmt.Println("GetUserByUserID failed ", err.Error(), v, user) + } else { + continue + } + var appMgr db.User + appMgr.UserID = v + appMgr.Nickname = "AppManager" + utils.IntToString(k+1) + appMgr.AppMangerLevel = constant.AppAdmin + err = UserRegister(appMgr) + if err != nil { + fmt.Println("AppManager insert error", err.Error(), appMgr, "time: ", appMgr.Birth.Unix()) + } + + } +} + +func UserRegister(user db.User) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + user.CreateTime = time.Now() + if user.AppMangerLevel == 0 { + user.AppMangerLevel = constant.AppOrdinaryUsers + } + if user.Birth.Unix() < 0 { + user.Birth = utils.UnixSecondToTime(0) + } + err = dbConn.Table("users").Create(&user).Error + if err != nil { + return err + } + return nil +} + +func DeleteUser(userID string) (i int64) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0 + } + i = dbConn.Table("users").Where("user_id=?", userID).Delete(db.User{}).RowsAffected + return i +} + +func GetUserByUserID(userID string) (*db.User, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var user db.User + err = dbConn.Table("users").Where("user_id=?", userID).Take(&user).Error + if err != nil { + return nil, err + } + return &user, nil +} + +func GetUserNameByUserID(userID string) (string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return "", err + } + var user db.User + err = dbConn.Table("users").Select("name").Where("user_id=?", userID).First(&user).Error + if err != nil { + return "", err + } + return user.Nickname, nil +} + +func UpdateUserInfo(user db.User) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + err = dbConn.Table("users").Where("user_id=?", user.UserID).Update(&user).Error + return err +} + +func SelectAllUserID() ([]string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var resultArr []string + err = dbConn.Table("users").Pluck("user_id", &resultArr).Error + if err != nil { + return nil, err + } + return resultArr, nil +} + +func SelectSomeUserID(userIDList []string) ([]string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + dbConn.LogMode(false) + if err != nil { + return nil, err + } + var resultArr []string + err = dbConn.Table("users").Where("user_id IN (?) ", userIDList).Pluck("user_id", &resultArr).Error + + if err != nil { + return nil, err + } + return resultArr, nil +} + +func GetUsers(showNumber, pageNumber int32) ([]db.User, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var users []db.User + if err != nil { + return users, err + } + dbConn.LogMode(false) + err = dbConn.Table("users").Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&users).Error + if err != nil { + return users, err + } + return users, err +} + +func AddUser(userId, phoneNumber, name string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + user := db.User{ + PhoneNumber: phoneNumber, + Birth: time.Now(), + CreateTime: time.Now(), + UserID: userId, + Nickname: name, + } + result := dbConn.Table("users").Create(&user) + return result.Error +} + +func UserIsBlock(userId string) (bool, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return false, err + } + var user db.BlackList + rows := dbConn.Table("black_lists").Where("uid=?", userId).First(&user).RowsAffected + if rows >= 1 { + return true, nil + } + return false, nil +} + +func BlockUser(userId, endDisableTime string) error { + user, err := GetUserByUserID(userId) + if err != nil || user.UserID == "" { + return err + } + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + end, err := time.Parse("2006-01-02 15:04:05", endDisableTime) + if err != nil { + return err + } + if end.Before(time.Now()) { + return constant.ErrDB + } + var blockUser db.BlackList + dbConn.Table("black_lists").Where("uid=?", userId).First(&blockUser) + if blockUser.UserId != "" { + dbConn.Model(&blockUser).Where("uid=?", blockUser.UserId).Update("end_disable_time", end) + return nil + } + blockUser = db.BlackList{ + UserId: userId, + BeginDisableTime: time.Now(), + EndDisableTime: end, + } + result := dbConn.Create(&blockUser) + return result.Error +} + +func UnBlockUser(userId string) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + result := dbConn.Where("uid=?", userId).Delete(&db.BlackList{}) + return result.Error +} + +type BlockUserInfo struct { + User db.User + BeginDisableTime time.Time + EndDisableTime time.Time +} + +func GetBlockUserById(userId string) (BlockUserInfo, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var blockUserInfo BlockUserInfo + blockUser := db.BlackList{ + UserId: userId, + } + if err != nil { + return blockUserInfo, err + } + if err = dbConn.Table("black_lists").Where("uid=?", userId).Find(&blockUser).Error; err != nil { + return blockUserInfo, err + } + user := db.User{ + UserID: blockUser.UserId, + } + if err := dbConn.Find(&user).Error; err != nil { + return blockUserInfo, err + } + blockUserInfo.User.UserID = user.UserID + blockUserInfo.User.FaceURL = user.UserID + blockUserInfo.User.Nickname = user.Nickname + blockUserInfo.BeginDisableTime = blockUser.BeginDisableTime + blockUserInfo.EndDisableTime = blockUser.EndDisableTime + return blockUserInfo, nil +} + +func GetBlockUsers(showNumber, pageNumber int32) ([]BlockUserInfo, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var blockUserInfos []BlockUserInfo + var blockUsers []db.BlackList + if err != nil { + return blockUserInfos, err + } + dbConn.LogMode(false) + if err = dbConn.Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&blockUsers).Error; err != nil { + return blockUserInfos, err + } + for _, blockUser := range blockUsers { + var user db.User + if err := dbConn.Table("users").Where("user_id=?", blockUser.UserId).First(&user).Error; err == nil { + blockUserInfos = append(blockUserInfos, BlockUserInfo{ + User: db.User{ + UserID: user.UserID, + Nickname: user.Nickname, + FaceURL: user.FaceURL, + }, + BeginDisableTime: blockUser.BeginDisableTime, + EndDisableTime: blockUser.EndDisableTime, + }) + } + } + return blockUserInfos, nil +} + +func GetUserByName(userName string, showNumber, pageNumber int32) ([]db.User, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + var users []db.User + if err != nil { + return users, err + } + dbConn.LogMode(false) + err = dbConn.Table("users").Where(fmt.Sprintf(" name like '%%%s%%' ", userName)).Limit(showNumber).Offset(showNumber * (pageNumber - 1)).Find(&users).Error + return users, err +} + +func GetUsersCount(user db.User) (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var count int32 + if err := dbConn.Table("users").Where(fmt.Sprintf(" name like '%%%s%%' ", user.Nickname)).Count(&count).Error; err != nil { + return 0, err + } + return count, nil +} + +func GetBlockUsersNumCount() (int32, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return 0, err + } + dbConn.LogMode(false) + var count int32 + if err := dbConn.Model(&db.BlackList{}).Count(&count).Error; err != nil { + return 0, err + } + return count, nil +} + +func SetConversation(conversation db.Conversation) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + newConversation := conversation + if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") + return dbConn.Model(&db.Conversation{}).Create(conversation).Error + // if exist, then update record + } else { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") + //force update + return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). + Update(map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt, "is_pinned": conversation.IsPinned, "is_private_chat": conversation.IsPrivateChat}).Error + } +} + +func PeerUserSetConversation(conversation db.Conversation) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + newConversation := conversation + if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") + return dbConn.Model(&db.Conversation{}).Create(conversation).Error + // if exist, then update record + } + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") + //force update + return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). + Update(map[string]interface{}{"is_private_chat": conversation.IsPrivateChat}).Error + +} + +func SetRecvMsgOpt(conversation db.Conversation) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + dbConn.LogMode(false) + newConversation := conversation + if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create") + return dbConn.Model(&db.Conversation{}).Create(conversation).Error + // if exist, then update record + } else { + log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update") + //force update + return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID). + Update(map[string]interface{}{"recv_msg_opt": conversation.RecvMsgOpt}).Error + } +} + +func GetUserAllConversations(ownerUserID string) ([]db.Conversation, error) { + var conversations []db.Conversation + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return conversations, err + } + dbConn.LogMode(false) + err = dbConn.Model(&db.Conversation{}).Where("owner_user_id=?", ownerUserID).Find(&conversations).Error + return conversations, err +} + +func GetConversation(OwnerUserID, conversationID string) (db.Conversation, error) { + var conversation db.Conversation + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return conversation, err + } + err = dbConn.Model(&db.Conversation{ + OwnerUserID: OwnerUserID, + ConversationID: conversationID, + }).Find(&conversation).Error + return conversation, err +} + +func GetConversations(OwnerUserID string, conversationIDs []string) ([]db.Conversation, error) { + var conversations []db.Conversation + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return conversations, err + } + err = dbConn.Model(&db.Conversation{}).Where("conversation_id IN (?) and owner_user_id=?", conversationIDs, OwnerUserID).Find(&conversations).Error + return conversations, err +} diff --git a/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go b/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go new file mode 100644 index 000000000..99c099ac4 --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_msg_model/chat_log_model.go @@ -0,0 +1,51 @@ +/* +** description(""). +** copyright('tuoyun,www.tuoyun.net'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/3/4 11:18). + */ +package im_mysql_msg_model + +import ( + "Open_IM/pkg/common/constant" + "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + pbMsg "Open_IM/pkg/proto/chat" + "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "github.com/golang/protobuf/jsonpb" + "github.com/golang/protobuf/proto" + "github.com/jinzhu/copier" +) + +func InsertMessageToChatLog(msg pbMsg.MsgDataToMQ) error { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + chatLog := new(db.ChatLog) + copier.Copy(chatLog, msg.MsgData) + switch msg.MsgData.SessionType { + case constant.GroupChatType: + chatLog.RecvID = msg.MsgData.GroupID + case constant.SingleChatType: + chatLog.RecvID = msg.MsgData.RecvID + } + if msg.MsgData.ContentType >= constant.NotificationBegin && msg.MsgData.ContentType <= constant.NotificationEnd { + var tips server_api_params.TipsComm + _ = proto.Unmarshal(msg.MsgData.Content, &tips) + marshaler := jsonpb.Marshaler{ + OrigName: true, + EnumsAsInts: false, + EmitDefaults: false, + } + chatLog.Content, _ = marshaler.MarshalToString(&tips) + + } else { + chatLog.Content = string(msg.MsgData.Content) + } + chatLog.CreateTime = utils.UnixMillSecondToTime(msg.MsgData.CreateTime) + chatLog.SendTime = utils.UnixMillSecondToTime(msg.MsgData.SendTime) + log.NewDebug("test", "this is ", chatLog) + return dbConn.Table("chat_logs").Create(chatLog).Error +} diff --git a/pkg/common/db/mysql_model/im_mysql_msg_model/hash_code.go b/pkg/common/db/mysql_model/im_mysql_msg_model/hash_code.go new file mode 100644 index 000000000..a631462ce --- /dev/null +++ b/pkg/common/db/mysql_model/im_mysql_msg_model/hash_code.go @@ -0,0 +1,36 @@ +package im_mysql_msg_model + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/db" + "hash/crc32" + "strconv" +) + +func getHashMsgDBAddr(userID string) string { + hCode := crc32.ChecksumIEEE([]byte(userID)) + return config.Config.Mysql.DBAddress[hCode%uint32(len(config.Config.Mysql.DBAddress))] +} + +func getHashMsgTableIndex(userID string) int { + hCode := crc32.ChecksumIEEE([]byte(userID)) + return int(hCode % uint32(config.Config.Mysql.DBMsgTableNum)) +} + +func QueryUserMsgID(userID string) ([]string, error) { + dbAddress, dbTableIndex := getHashMsgDBAddr(userID), getHashMsgTableIndex(userID) + dbTableName := "receive" + strconv.Itoa(dbTableIndex) + + dbConn, _ := db.DB.MysqlDB.GormDB(dbAddress, config.Config.Mysql.DBTableName) + + var msgID string + var msgIDList []string + rows, _ := dbConn.Raw("select msg_id from ? where user_id = ?", dbTableName, userID).Rows() + defer rows.Close() + for rows.Next() { + rows.Scan(&msgID) + msgIDList = append(msgIDList, msgID) + } + + return msgIDList, nil +} diff --git a/pkg/common/db/redisModel.go b/pkg/common/db/redisModel.go new file mode 100644 index 000000000..2faa9a6d8 --- /dev/null +++ b/pkg/common/db/redisModel.go @@ -0,0 +1,157 @@ +package db + +import ( + "Open_IM/pkg/common/constant" + log2 "Open_IM/pkg/common/log" + "github.com/garyburd/redigo/redis" +) + +const ( + AccountTempCode = "ACCOUNT_TEMP_CODE" + resetPwdTempCode = "RESET_PWD_TEMP_CODE" + userIncrSeq = "REDIS_USER_INCR_SEQ:" // user incr seq + appleDeviceToken = "DEVICE_TOKEN" + userMinSeq = "REDIS_USER_MIN_SEQ:" + uidPidToken = "UID_PID_TOKEN_STATUS:" + conversationReceiveMessageOpt = "CON_RECV_MSG_OPT:" + GetuiToken = "GETUI" +) + +func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) { + con := d.redisPool.Get() + if err := con.Err(); err != nil { + log2.Error("", "", "redis cmd = %v, err = %v", cmd, err) + return nil, err + } + defer con.Close() + + params := make([]interface{}, 0) + params = append(params, key) + + if len(args) > 0 { + for _, v := range args { + params = append(params, v) + } + } + + return con.Do(cmd, params...) +} +func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) { + key := AccountTempCode + account + return redis.Bool(d.Exec("EXISTS", key)) +} +func (d *DataBases) SetAccountCode(account string, code, ttl int) (err error) { + key := AccountTempCode + account + _, err = d.Exec("SET", key, code, "ex", ttl) + return err +} +func (d *DataBases) GetAccountCode(account string) (string, error) { + key := AccountTempCode + account + return redis.String(d.Exec("GET", key)) +} + +//Perform seq auto-increment operation of user messages +func (d *DataBases) IncrUserSeq(uid string) (uint64, error) { + key := userIncrSeq + uid + return redis.Uint64(d.Exec("INCR", key)) +} + +//Get the largest Seq +func (d *DataBases) GetUserMaxSeq(uid string) (uint64, error) { + key := userIncrSeq + uid + return redis.Uint64(d.Exec("GET", key)) +} + +//Set the user's minimum seq +func (d *DataBases) SetUserMinSeq(uid string, minSeq uint32) (err error) { + key := userMinSeq + uid + _, err = d.Exec("SET", key, minSeq) + return err +} + +//Get the smallest Seq +func (d *DataBases) GetUserMinSeq(uid string) (uint64, error) { + key := userMinSeq + uid + return redis.Uint64(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 +} + +//Delete Apple device token +func (d *DataBases) DelAppleDeviceToken(accountAddress string) (err error) { + key := appleDeviceToken + accountAddress + _, err = d.Exec("DEL", key) + return err +} + +//Store userid and platform class to redis +func (d *DataBases) AddTokenFlag(userID string, platformID int32, token string, flag int) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + log2.NewDebug("", "add token key is ", key) + _, err1 := d.Exec("HSet", key, token, flag) + return err1 +} + +func (d *DataBases) GetTokenMapByUidPid(userID, platformID string) (map[string]int, error) { + key := uidPidToken + userID + ":" + platformID + log2.NewDebug("", "get token key is ", key) + return redis.IntMap(d.Exec("HGETALL", key)) +} +func (d *DataBases) SetTokenMapByUidPid(userID string, platformID int32, m map[string]int) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) + return err +} +func (d *DataBases) DeleteTokenByUidPid(userID string, platformID int32, fields []string) error { + key := uidPidToken + userID + ":" + constant.PlatformIDToName(platformID) + _, err := d.Exec("HDEL", key, redis.Args{}.Add().AddFlat(fields)...) + return err +} + +func (d *DataBases) SetSingleConversationRecvMsgOpt(userID, conversationID string, opt int32) error { + key := conversationReceiveMessageOpt + userID + _, err := d.Exec("HSet", key, conversationID, opt) + return err +} + +func (d *DataBases) GetSingleConversationRecvMsgOpt(userID, conversationID string) (int, error) { + key := conversationReceiveMessageOpt + userID + return redis.Int(d.Exec("HGet", key, conversationID)) +} +func (d *DataBases) GetAllConversationMsgOpt(userID string) (map[string]int, error) { + key := conversationReceiveMessageOpt + userID + return redis.IntMap(d.Exec("HGETALL", key)) +} +func (d *DataBases) SetMultiConversationMsgOpt(userID string, m map[string]int) error { + key := conversationReceiveMessageOpt + userID + _, err := d.Exec("hmset", key, redis.Args{}.Add().AddFlat(m)...) + return err +} +func (d *DataBases) GetMultiConversationMsgOpt(userID string, conversationIDs []string) (m map[string]int, err error) { + m = make(map[string]int) + key := conversationReceiveMessageOpt + userID + i, err := redis.Ints(d.Exec("hmget", key, redis.Args{}.Add().AddFlat(conversationIDs)...)) + if err != nil { + return m, err + } + for k, v := range conversationIDs { + m[v] = i[k] + } + return m, nil + +} + +func (d *DataBases) SetGetuiToken(token string, expireTime int64) error { + _, err := d.Exec("SET", GetuiToken, token, "ex", expireTime) + return err +} + +func (d *DataBases) GetGetuiToken() (string, error) { + result, err := redis.String(d.Exec("GET", GetuiToken)) + return result, err +} diff --git a/pkg/common/db/redisModel_test.go b/pkg/common/db/redisModel_test.go new file mode 100644 index 000000000..1d9d254b7 --- /dev/null +++ b/pkg/common/db/redisModel_test.go @@ -0,0 +1,27 @@ +package db + +import ( + "fmt" + "github.com/stretchr/testify/assert" + "testing" +) + +func Test_SetTokenMapByUidPid(t *testing.T) { + m := make(map[string]int, 0) + m["test1"] = 1 + m["test2"] = 2 + m["2332"] = 4 + _ = DB.SetTokenMapByUidPid("1234", 2, m) + +} +func Test_GetTokenMapByUidPid(t *testing.T) { + m, err := DB.GetTokenMapByUidPid("1234", "Android") + assert.Nil(t, err) + fmt.Println(m) +} + +func TestDataBases_GetMultiConversationMsgOpt(t *testing.T) { + m, err := DB.GetMultiConversationMsgOpt("fg", []string{"user", "age", "color"}) + assert.Nil(t, err) + fmt.Println(m) +} diff --git a/pkg/common/http/http_client.go b/pkg/common/http/http_client.go new file mode 100644 index 000000000..e227da91e --- /dev/null +++ b/pkg/common/http/http_client.go @@ -0,0 +1,66 @@ +/* +** description(""). +** copyright('open-im,www.open-im.io'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/5/27 10:31). + */ +package http + +import ( + "bytes" + "encoding/json" + "io/ioutil" + "net/http" + "time" +) + +func Get(url string) (response []byte, err error) { + client := http.Client{Timeout: 5 * time.Second} + resp, err := client.Get(url) + if err != nil { + return nil, err + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + return body, nil +} + +//application/json; charset=utf-8 +func Post(url string, data interface{}, timeOutSecond int) (content []byte, err error) { + jsonStr, err := json.Marshal(data) + if err != nil { + return nil, err + } + req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr)) + if err != nil { + return nil, err + } + req.Close = true + req.Header.Add("content-type", "application/json; charset=utf-8") + + client := &http.Client{Timeout: time.Duration(timeOutSecond) * time.Second} + 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 +} + +func PostReturn(url string, input, output interface{}, timeOut int) error { + b, err := Post(url, input, timeOut) + if err != nil { + return err + } + if err = json.Unmarshal(b, output); err != nil { + return err + } + return nil +} diff --git a/pkg/common/http/http_resp.go b/pkg/common/http/http_resp.go new file mode 100644 index 000000000..cdbf04463 --- /dev/null +++ b/pkg/common/http/http_resp.go @@ -0,0 +1,43 @@ +package http + +import ( + "Open_IM/pkg/common/constant" + "fmt" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + //"Open_IM/pkg/cms_api_struct" + "net/http" + + "github.com/gin-gonic/gin" +) + +type BaseResp struct { + Code int32 `json:"code"` + ErrMsg string `json:"err_msg"` + Data interface{} `json:"data"` +} + +func RespHttp200(ctx *gin.Context, err error, data interface{}) { + var resp BaseResp + switch e := err.(type) { + case constant.ErrInfo: + resp.Code = e.ErrCode + resp.ErrMsg = e.ErrMsg + default: + s, ok := status.FromError(err) + if !ok { + fmt.Println("need grpc format error") + return + } + resp.Code = int32(s.Code()) + resp.ErrMsg = s.Message() + } + resp.Data = data + ctx.JSON(http.StatusOK, resp) +} + +// warp error +func WrapError(err constant.ErrInfo) error { + return status.Error(codes.Code(err.ErrCode), err.ErrMsg) +} diff --git a/pkg/common/kafka/consumer.go b/pkg/common/kafka/consumer.go new file mode 100644 index 000000000..771145906 --- /dev/null +++ b/pkg/common/kafka/consumer.go @@ -0,0 +1,36 @@ +package kafka + +import ( + "github.com/Shopify/sarama" + "sync" +) + +type Consumer struct { + addr []string + WG sync.WaitGroup + Topic string + PartitionList []int32 + Consumer sarama.Consumer +} + +func NewKafkaConsumer(addr []string, topic string) *Consumer { + p := Consumer{} + p.Topic = topic + p.addr = addr + + consumer, err := sarama.NewConsumer(p.addr, nil) + if err != nil { + panic(err.Error()) + return nil + } + p.Consumer = consumer + + partitionList, err := consumer.Partitions(p.Topic) + if err != nil { + panic(err.Error()) + return nil + } + p.PartitionList = partitionList + + return &p +} diff --git a/pkg/common/kafka/consumer_group.go b/pkg/common/kafka/consumer_group.go new file mode 100644 index 000000000..3af714373 --- /dev/null +++ b/pkg/common/kafka/consumer_group.go @@ -0,0 +1,53 @@ +/* +** description(""). +** copyright('tuoyun,www.tuoyun.net'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/5/11 9:36). + */ +package kafka + +import ( + "context" + "github.com/Shopify/sarama" +) + +type MConsumerGroup struct { + sarama.ConsumerGroup + groupID string + topics []string +} + +type MConsumerGroupConfig struct { + KafkaVersion sarama.KafkaVersion + OffsetsInitial int64 + IsReturnErr bool +} + +func NewMConsumerGroup(consumerConfig *MConsumerGroupConfig, topics, addr []string, groupID string) *MConsumerGroup { + config := sarama.NewConfig() + config.Version = consumerConfig.KafkaVersion + config.Consumer.Offsets.Initial = consumerConfig.OffsetsInitial + config.Consumer.Return.Errors = consumerConfig.IsReturnErr + client, err := sarama.NewClient(addr, config) + if err != nil { + panic(err.Error()) + } + consumerGroup, err := sarama.NewConsumerGroupFromClient(groupID, client) + if err != nil { + panic(err.Error()) + } + return &MConsumerGroup{ + consumerGroup, + groupID, + topics, + } +} +func (mc *MConsumerGroup) RegisterHandleAndConsumer(handler sarama.ConsumerGroupHandler) { + ctx := context.Background() + for { + err := mc.ConsumerGroup.Consume(ctx, mc.topics, handler) + if err != nil { + panic(err.Error()) + } + } +} diff --git a/pkg/common/kafka/producer.go b/pkg/common/kafka/producer.go new file mode 100644 index 000000000..98ad92209 --- /dev/null +++ b/pkg/common/kafka/producer.go @@ -0,0 +1,49 @@ +package kafka + +import ( + log2 "Open_IM/pkg/common/log" + "github.com/Shopify/sarama" + "github.com/golang/protobuf/proto" +) + +type Producer struct { + topic string + addr []string + config *sarama.Config + producer sarama.SyncProducer +} + +func NewKafkaProducer(addr []string, topic string) *Producer { + p := Producer{} + p.config = sarama.NewConfig() //Instantiate a sarama Config + p.config.Producer.Return.Successes = true //Whether to enable the successes channel to be notified after the message is sent successfully + p.config.Producer.RequiredAcks = sarama.WaitForAll //Set producer Message Reply level 0 1 all + p.config.Producer.Partitioner = sarama.NewHashPartitioner //Set the hash-key automatic hash partition. When sending a message, you must specify the key value of the message. If there is no key, the partition will be selected randomly + + p.addr = addr + p.topic = topic + + producer, err := sarama.NewSyncProducer(p.addr, p.config) //Initialize the client + if err != nil { + panic(err.Error()) + return nil + } + p.producer = producer + return &p +} + +func (p *Producer) SendMessage(m proto.Message, key ...string) (int32, int64, error) { + kMsg := &sarama.ProducerMessage{} + kMsg.Topic = p.topic + if len(key) == 1 { + kMsg.Key = sarama.StringEncoder(key[0]) + } + bMsg, err := proto.Marshal(m) + if err != nil { + log2.Error("", "", "proto marshal err = %s", err.Error()) + return -1, -1, err + } + kMsg.Value = sarama.ByteEncoder(bMsg) + + return p.producer.SendMessage(kMsg) +} diff --git a/pkg/common/log/es_hk.go b/pkg/common/log/es_hk.go new file mode 100644 index 000000000..19eafaed5 --- /dev/null +++ b/pkg/common/log/es_hk.go @@ -0,0 +1,107 @@ +/* +** 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 +} + +func (hook *esHook) Levels() []logrus.Level { + return logrus.AllLevels +} + +//sendEs +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..bc908ee03 --- /dev/null +++ b/pkg/common/log/file_line_hk.go @@ -0,0 +1,71 @@ +/* +** 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(6) + return nil +} + +//func (f *fileHook) Fire(entry *logrus.Entry) error { +// var s string +// _, b, c, _ := runtime.Caller(10) +// i := strings.SplitAfter(b, "/") +// if len(i) > 3 { +// s = i[len(i)-3] + i[len(i)-2] + i[len(i)-1] + ":" + utils.IntToString(c) +// } +// entry.Data["FilePath"] = s +// 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..caf4c9126 --- /dev/null +++ b/pkg/common/log/logrus.go @@ -0,0 +1,199 @@ +package log + +import ( + "Open_IM/pkg/common/config" + "bufio" + "fmt" + "os" + "time" + + nested "github.com/antonfisher/nested-logrus-formatter" + rotatelogs "github.com/lestrrat-go/file-rotatelogs" + "github.com/rifflock/lfshook" + "github.com/sirupsen/logrus" +) + +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.Error()) + } + writer := bufio.NewWriter(src) + logger.SetOutput(writer) + //logger.SetOutput(os.Stdout) + //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, "all", moduleName), + logrus.InfoLevel: initRotateLogs(rotationTime, maxRemainNum, "all", moduleName), + logrus.WarnLevel: initRotateLogs(rotationTime, maxRemainNum, "all", moduleName), + logrus.ErrorLevel: initRotateLogs(rotationTime, maxRemainNum, "all", 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.Error()) + } else { + return writer + } +} + +func Info(OperationID string, args ...interface{}) { + logger.WithFields(logrus.Fields{ + "OperationID": OperationID, + "PID": logger.Pid, + }).Infoln(args) +} + +func Error(OperationID string, args ...interface{}) { + logger.WithFields(logrus.Fields{ + "OperationID": OperationID, + "PID": logger.Pid, + }).Errorln(args) +} + +func Debug(OperationID string, args ...interface{}) { + logger.WithFields(logrus.Fields{ + "OperationID": OperationID, + "PID": logger.Pid, + }).Debugln(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 new file mode 100644 index 000000000..3c3245e63 --- /dev/null +++ b/pkg/common/multi_terminal_login/multi_terminal_login.go @@ -0,0 +1,73 @@ +package multi_terminal_login + +// +//import ( +// "Open_IM/internal/push/content_struct" +// "Open_IM/internal/push/logic" +// "Open_IM/pkg/common/config" +// "Open_IM/pkg/common/constant" +// "Open_IM/pkg/common/db" +// pbChat "Open_IM/pkg/proto/chat" +// "Open_IM/pkg/utils" +//) +// +//const DayOfSecond = 24*60*60 +//func MultiTerminalLoginChecker(uid, token string, platformID int32) error { +// // 1.check userid and platform class 0 not exists and 1 exists +// exists, err := db.DB.ExistsUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID))) +// if err != nil { +// return err +// } +// //get config multi login policy +// if config.Config.MultiLoginPolicy { +// //OnlyOneTerminalAccess policy need to check all terminal +// if constant.PlatformNameToClass(constant.PlatformIDToName(platformID)) == "PC" { +// exists, err = db.DB.ExistsUserIDAndPlatform(uid, "Mobile") +// if err != nil { +// return err +// } +// } else { +// exists, err = db.DB.ExistsUserIDAndPlatform(uid, "PC") +// if err != nil { +// return err +// } +// } +// if exists == 1 { +// err := db.DB.SetUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire*DayOfSecond) +// if err != nil { +// return err +// } +// PushMessageToTheTerminal(uid, platformID) +// return nil +// } +// } else if config.Config.MultiLoginPolicy.MobileAndPCTerminalAccessButOtherTerminalKickEachOther { +// // common terminal need to kick eich other +// if exists == 1 { +// err := db.DB.SetUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire*DayOfSecond) +// if err != nil { +// return err +// } +// PushMessageToTheTerminal(uid, platformID) +// return nil +// } +// } +// err = db.DB.SetUserIDAndPlatform(uid, constant.PlatformNameToClass(constant.PlatformIDToName(platformID)), token, config.Config.TokenPolicy.AccessExpire*DayOfSecond) +// if err != nil { +// return err +// } +// PushMessageToTheTerminal(uid, platformID) +// return nil +//} +//// +////func PushMessageToTheTerminal(uid string, platform int32) { +//// +//// logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ +//// SendID: uid, +//// RecvID: uid, +//// Content: content_struct.NewContentStructString(1, "", "Your account is already logged on other terminal,please confirm"), +//// SendTime: utils.GetCurrentTimestampBySecond(), +//// MsgFrom: constant.SysMsgType, +//// ContentType: constant.KickOnlineTip, +//// PlatformID: platform, +//// }) +////} diff --git a/pkg/common/token_verify/jwt_token.go b/pkg/common/token_verify/jwt_token.go new file mode 100644 index 000000000..bfff43116 --- /dev/null +++ b/pkg/common/token_verify/jwt_token.go @@ -0,0 +1,231 @@ +package token_verify + +import ( + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/constant" + commonDB "Open_IM/pkg/common/db" + "Open_IM/pkg/common/log" + "Open_IM/pkg/utils" + "github.com/garyburd/redigo/redis" + "github.com/golang-jwt/jwt/v4" + "time" +) + +//var ( +// TokenExpired = errors.New("token is timed out, please log in again") +// TokenInvalid = errors.New("token has been invalidated") +// TokenNotValidYet = errors.New("token not active yet") +// TokenMalformed = errors.New("that's not even a token") +// TokenUnknown = errors.New("couldn't handle this token") +//) + +type Claims struct { + UID string + Platform string //login platform + jwt.RegisteredClaims +} + +func BuildClaims(uid, platform string, ttl int64) Claims { + now := time.Now() + return Claims{ + UID: uid, + Platform: platform, + 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 string, platformID int32) (string, int64, error) { + claims := BuildClaims(userID, constant.PlatformIDToName(platformID), config.Config.TokenPolicy.AccessExpire) + token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) + tokenString, err := token.SignedString([]byte(config.Config.TokenPolicy.AccessSecret)) + if err != nil { + return "", 0, err + } + //remove Invalid token + m, err := commonDB.DB.GetTokenMapByUidPid(userID, constant.PlatformIDToName(platformID)) + if err != nil && err != redis.ErrNil { + return "", 0, err + } + var deleteTokenKey []string + for k, v := range m { + _, err = GetClaimFromToken(k) + if err != nil || v != constant.NormalToken { + deleteTokenKey = append(deleteTokenKey, k) + } + } + if len(deleteTokenKey) != 0 { + err = commonDB.DB.DeleteTokenByUidPid(userID, platformID, deleteTokenKey) + if err != nil { + return "", 0, err + } + } + err = commonDB.DB.AddTokenFlag(userID, platformID, tokenString, constant.NormalToken) + if err != nil { + return "", 0, err + } + return tokenString, claims.ExpiresAt.Time.Unix(), err +} + +func secret() jwt.Keyfunc { + return func(token *jwt.Token) (interface{}, error) { + return []byte(config.Config.TokenPolicy.AccessSecret), nil + } +} + +func GetClaimFromToken(tokensString string) (*Claims, error) { + token, err := jwt.ParseWithClaims(tokensString, &Claims{}, secret()) + if err != nil { + if ve, ok := err.(*jwt.ValidationError); ok { + if ve.Errors&jwt.ValidationErrorMalformed != 0 { + return nil, &constant.ErrTokenMalformed + } else if ve.Errors&jwt.ValidationErrorExpired != 0 { + return nil, &constant.ErrTokenExpired + } else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 { + return nil, &constant.ErrTokenNotValidYet + } else { + return nil, &constant.ErrTokenUnknown + } + } else { + return nil, &constant.ErrTokenNotValidYet + } + } else { + if claims, ok := token.Claims.(*Claims); ok && token.Valid { + //log.NewDebug("", claims.UID, claims.Platform) + return claims, nil + } + return nil, &constant.ErrTokenNotValidYet + } +} + +func IsAppManagerAccess(token string, OpUserID string) bool { + claims, err := ParseToken(token, "") + if err != nil { + return false + } + if utils.IsContain(claims.UID, config.Config.Manager.AppManagerUid) && claims.UID == OpUserID { + return true + } + return false +} + +func IsManagerUserID(OpUserID string) bool { + if utils.IsContain(OpUserID, config.Config.Manager.AppManagerUid) { + return true + } else { + return false + } +} + +func CheckAccess(OpUserID string, OwnerUserID string) bool { + if utils.IsContain(OpUserID, config.Config.Manager.AppManagerUid) { + return true + } + if OpUserID == OwnerUserID { + return true + } + return false +} + +func GetUserIDFromToken(token string, operationID string) (bool, string) { + claims, err := ParseToken(token, operationID) + if err != nil { + log.Error(operationID, "ParseToken failed, ", err.Error(), token) + return false, "" + } + return true, claims.UID +} + +func ParseTokenGetUserID(token string, operationID string) (error, string) { + claims, err := ParseToken(token, operationID) + if err != nil { + return utils.Wrap(err, ""), "" + } + return nil, claims.UID +} + +func ParseToken(tokensString, operationID string) (claims *Claims, err error) { + claims, err = GetClaimFromToken(tokensString) + if err != nil { + log.NewError(operationID, "token validate err", err.Error(), tokensString) + return nil, utils.Wrap(err, "") + } + + m, err := commonDB.DB.GetTokenMapByUidPid(claims.UID, claims.Platform) + if err != nil { + log.NewError(operationID, "get token from redis err", err.Error(), tokensString) + return nil, utils.Wrap(&constant.ErrTokenInvalid, "get token from redis err") + } + if m == nil { + log.NewError(operationID, "get token from redis err", "m is nil", tokensString) + return nil, utils.Wrap(&constant.ErrTokenInvalid, "get token from redis err") + } + if v, ok := m[tokensString]; ok { + switch v { + case constant.NormalToken: + log.NewDebug(operationID, "this is normal return", claims) + return claims, nil + case constant.InValidToken: + return nil, utils.Wrap(&constant.ErrTokenInvalid, "") + case constant.KickedToken: + log.Error(operationID, "this token has been kicked by other same terminal ", constant.ErrTokenKicked) + return nil, utils.Wrap(&constant.ErrTokenKicked, "this token has been kicked by other same terminal ") + case constant.ExpiredToken: + return nil, utils.Wrap(&constant.ErrTokenExpired, "") + default: + return nil, utils.Wrap(&constant.ErrTokenUnknown, "") + } + } + log.NewError(operationID, "redis token map not find", constant.ErrTokenUnknown) + return nil, utils.Wrap(&constant.ErrTokenUnknown, "redis token map not find") +} + +//func MakeTheTokenInvalid(currentClaims *Claims, platformClass string) (bool, error) { +// storedRedisTokenInterface, err := db.DB.GetPlatformToken(currentClaims.UID, platformClass) +// if err != nil { +// return false, err +// } +// storedRedisPlatformClaims, err := ParseRedisInterfaceToken(storedRedisTokenInterface) +// if err != nil { +// return false, err +// } +// //if issue time less than redis token then make this token invalid +// if currentClaims.IssuedAt.Time.Unix() < storedRedisPlatformClaims.IssuedAt.Time.Unix() { +// return true, constant.TokenInvalid +// } +// return false, nil +//} + +func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) { + return GetClaimFromToken(string(redisToken.([]uint8))) +} + +//Validation token, false means failure, true means successful verification +func VerifyToken(token, uid string) (bool, error) { + claims, err := ParseToken(token, "") + if err != nil { + return false, err + } + if claims.UID != uid { + return false, &constant.ErrTokenUnknown + } + + log.NewDebug("", claims.UID, claims.Platform) + return true, nil +} +func WsVerifyToken(token, uid string, platformID string) (bool, error, string) { + claims, err := ParseToken(token, "") + if err != nil { + return false, err, "parse token err" + } + if claims.UID != uid { + return false, &constant.ErrTokenUnknown, "uid is not same to token uid" + } + if claims.Platform != constant.PlatformIDToName(utils.StringToInt32(platformID)) { + return false, &constant.ErrTokenUnknown, "platform is not same to token platform" + } + log.NewDebug("", claims.UID, claims.Platform) + return true, nil, "" +} diff --git a/pkg/common/utils/utils.go b/pkg/common/utils/utils.go new file mode 100644 index 000000000..003f659a9 --- /dev/null +++ b/pkg/common/utils/utils.go @@ -0,0 +1,161 @@ +package utils + +import ( + db "Open_IM/pkg/common/db" + imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model" + "Open_IM/pkg/common/token_verify" + open_im_sdk "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "math/rand" + "strconv" + "time" +) + +func OperationIDGenerator() string { + return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10) +} + +func FriendOpenIMCopyDB(dst *db.Friend, src *open_im_sdk.FriendInfo) { + utils.CopyStructFields(dst, src) + dst.FriendUserID = src.FriendUser.UserID + dst.CreateTime = utils.UnixSecondToTime(int64(src.CreateTime)) +} + +func FriendDBCopyOpenIM(dst *open_im_sdk.FriendInfo, src *db.Friend) error { + utils.CopyStructFields(dst, src) + user, err := imdb.GetUserByUserID(src.FriendUserID) + if err != nil { + return utils.Wrap(err, "") + } + utils.CopyStructFields(dst.FriendUser, user) + dst.CreateTime = uint32(src.CreateTime.Unix()) + if dst.FriendUser == nil { + dst.FriendUser = &open_im_sdk.UserInfo{} + } + dst.FriendUser.CreateTime = uint32(user.CreateTime.Unix()) + return nil +} + +// +func FriendRequestOpenIMCopyDB(dst *db.FriendRequest, src *open_im_sdk.FriendRequest) { + utils.CopyStructFields(dst, src) + dst.CreateTime = utils.UnixSecondToTime(int64(src.CreateTime)) + dst.HandleTime = utils.UnixSecondToTime(int64(src.HandleTime)) +} + +func FriendRequestDBCopyOpenIM(dst *open_im_sdk.FriendRequest, src *db.FriendRequest) error { + utils.CopyStructFields(dst, src) + user, err := imdb.GetUserByUserID(src.FromUserID) + if err != nil { + return utils.Wrap(err, "") + } + dst.FromNickname = user.Nickname + dst.FromFaceURL = user.FaceURL + dst.FromGender = user.Gender + user, err = imdb.GetUserByUserID(src.ToUserID) + if err != nil { + return utils.Wrap(err, "") + } + dst.ToNickname = user.Nickname + dst.ToFaceURL = user.FaceURL + dst.ToGender = user.Gender + dst.CreateTime = uint32(src.CreateTime.Unix()) + dst.HandleTime = uint32(src.HandleTime.Unix()) + return nil +} + +func BlackOpenIMCopyDB(dst *db.Black, src *open_im_sdk.BlackInfo) { + utils.CopyStructFields(dst, src) + dst.BlockUserID = src.BlackUserInfo.UserID + dst.CreateTime = utils.UnixSecondToTime(int64(src.CreateTime)) +} + +func BlackDBCopyOpenIM(dst *open_im_sdk.BlackInfo, src *db.Black) error { + utils.CopyStructFields(dst, src) + dst.CreateTime = uint32(src.CreateTime.Unix()) + user, err := imdb.GetUserByUserID(src.BlockUserID) + if err != nil { + return utils.Wrap(err, "") + } + utils.CopyStructFields(dst.BlackUserInfo, user) + return nil +} + +func GroupOpenIMCopyDB(dst *db.Group, src *open_im_sdk.GroupInfo) { + utils.CopyStructFields(dst, src) +} + +func GroupDBCopyOpenIM(dst *open_im_sdk.GroupInfo, src *db.Group) error { + utils.CopyStructFields(dst, src) + user, err := imdb.GetGroupOwnerInfoByGroupID(src.GroupID) + if err != nil { + return utils.Wrap(err, "") + } + dst.OwnerUserID = user.UserID + + dst.MemberCount, err = imdb.GetGroupMemberNumByGroupID(src.GroupID) + if err != nil { + return utils.Wrap(err, "") + } + dst.CreateTime = uint32(src.CreateTime.Unix()) + return nil +} + +func GroupMemberOpenIMCopyDB(dst *db.GroupMember, src *open_im_sdk.GroupMemberFullInfo) { + utils.CopyStructFields(dst, src) +} + +func GroupMemberDBCopyOpenIM(dst *open_im_sdk.GroupMemberFullInfo, src *db.GroupMember) error { + utils.CopyStructFields(dst, src) + if token_verify.IsManagerUserID(src.UserID) { + u, err := imdb.GetUserByUserID(src.UserID) + if err != nil { + return utils.Wrap(err, "") + } + + utils.CopyStructFields(dst, u) + + dst.AppMangerLevel = 1 + } + dst.JoinTime = int32(src.JoinTime.Unix()) + if src.MuteEndTime.Unix() < 0 { + dst.JoinTime = 0 + return nil + } + dst.MuteEndTime = uint32(src.MuteEndTime.Unix()) + if dst.MuteEndTime < uint32(time.Now().Unix()) { + dst.MuteEndTime = 0 + } + return nil +} + +func GroupRequestOpenIMCopyDB(dst *db.GroupRequest, src *open_im_sdk.GroupRequest) { + utils.CopyStructFields(dst, src) +} + +func GroupRequestDBCopyOpenIM(dst *open_im_sdk.GroupRequest, src *db.GroupRequest) { + utils.CopyStructFields(dst, src) + dst.ReqTime = uint32(src.ReqTime.Unix()) + dst.HandleTime = uint32(src.HandledTime.Unix()) +} + +func UserOpenIMCopyDB(dst *db.User, src *open_im_sdk.UserInfo) { + utils.CopyStructFields(dst, src) + dst.Birth = utils.UnixSecondToTime(int64(src.Birth)) + dst.CreateTime = utils.UnixSecondToTime(int64(src.CreateTime)) +} + +func UserDBCopyOpenIM(dst *open_im_sdk.UserInfo, src *db.User) { + utils.CopyStructFields(dst, src) + dst.CreateTime = uint32(src.CreateTime.Unix()) + dst.Birth = uint32(src.Birth.Unix()) +} + +func UserDBCopyOpenIMPublicUser(dst *open_im_sdk.PublicUserInfo, src *db.User) { + utils.CopyStructFields(dst, src) +} + +// +//func PublicUserDBCopyOpenIM(dst *open_im_sdk.PublicUserInfo, src *db.User){ +// +//} diff --git a/pkg/grpc-etcdv3/getcdv3/pool.go b/pkg/grpc-etcdv3/getcdv3/pool.go new file mode 100644 index 000000000..943f4bd3f --- /dev/null +++ b/pkg/grpc-etcdv3/getcdv3/pool.go @@ -0,0 +1,254 @@ +// Package grpcpool provides a pool of grpc clients +package getcdv3 + +import ( + "context" + "errors" + "sync" + "time" + + "google.golang.org/grpc" +) + +var ( + // ErrClosed is the error when the client pool is closed + ErrClosed = errors.New("grpc pool: client pool is closed") + // ErrTimeout is the error when the client pool timed out + ErrTimeout = errors.New("grpc pool: client pool timed out") + // ErrAlreadyClosed is the error when the client conn was already closed + ErrAlreadyClosed = errors.New("grpc pool: the connection was already closed") + // ErrFullPool is the error when the pool is already full + ErrFullPool = errors.New("grpc pool: closing a ClientConn into a full pool") +) + +// Factory is a function type creating a grpc client +type Factory func(schema, etcdaddr, servicename string) (*grpc.ClientConn, error) + +// FactoryWithContext is a function type creating a grpc client +// that accepts the context parameter that could be passed from +// Get or NewWithContext method. +type FactoryWithContext func(context.Context) (*grpc.ClientConn, error) + +// Pool is the grpc client pool +type Pool struct { + clients chan ClientConn + factory FactoryWithContext + idleTimeout time.Duration + maxLifeDuration time.Duration + mu sync.RWMutex +} + +// ClientConn is the wrapper for a grpc client conn +type ClientConn struct { + *grpc.ClientConn + pool *Pool + timeUsed time.Time + timeInitiated time.Time + unhealthy bool +} + +// New creates a new clients pool with the given initial and maximum capacity, +// and the timeout for the idle clients. Returns an error if the initial +// clients could not be created +func New(factory Factory, schema, etcdaddr, servicename string, init, capacity int, idleTimeout time.Duration, + maxLifeDuration ...time.Duration) (*Pool, error) { + return NewWithContext(context.Background(), func(ctx context.Context) (*grpc.ClientConn, error) { return factory(schema, etcdaddr, servicename) }, + init, capacity, idleTimeout, maxLifeDuration...) +} + +// NewWithContext creates a new clients pool with the given initial and maximum +// capacity, and the timeout for the idle clients. The context parameter would +// be passed to the factory method during initialization. Returns an error if the +// initial clients could not be created. +func NewWithContext(ctx context.Context, factory FactoryWithContext, init, capacity int, idleTimeout time.Duration, + maxLifeDuration ...time.Duration) (*Pool, error) { + + if capacity <= 0 { + capacity = 1 + } + if init < 0 { + init = 0 + } + if init > capacity { + init = capacity + } + p := &Pool{ + clients: make(chan ClientConn, capacity), + factory: factory, + idleTimeout: idleTimeout, + } + if len(maxLifeDuration) > 0 { + p.maxLifeDuration = maxLifeDuration[0] + } + for i := 0; i < init; i++ { + c, err := factory(ctx) + if err != nil { + return nil, err + } + + p.clients <- ClientConn{ + ClientConn: c, + pool: p, + timeUsed: time.Now(), + timeInitiated: time.Now(), + } + } + // Fill the rest of the pool with empty clients + for i := 0; i < capacity-init; i++ { + p.clients <- ClientConn{ + pool: p, + } + } + return p, nil +} + +func (p *Pool) getClients() chan ClientConn { + p.mu.RLock() + defer p.mu.RUnlock() + + return p.clients +} + +// Close empties the pool calling Close on all its clients. +// You can call Close while there are outstanding clients. +// The pool channel is then closed, and Get will not be allowed anymore +func (p *Pool) Close() { + p.mu.Lock() + clients := p.clients + p.clients = nil + p.mu.Unlock() + + if clients == nil { + return + } + + close(clients) + for client := range clients { + if client.ClientConn == nil { + continue + } + client.ClientConn.Close() + } +} + +// IsClosed returns true if the client pool is closed. +func (p *Pool) IsClosed() bool { + return p == nil || p.getClients() == nil +} + +// Get will return the next available client. If capacity +// has not been reached, it will create a new one using the factory. Otherwise, +// it will wait till the next client becomes available or a timeout. +// A timeout of 0 is an indefinite wait +func (p *Pool) Get(ctx context.Context) (*ClientConn, error) { + clients := p.getClients() + if clients == nil { + return nil, ErrClosed + } + + wrapper := ClientConn{ + pool: p, + } + select { + case wrapper = <-clients: + // All good + case <-ctx.Done(): + return nil, ErrTimeout // it would better returns ctx.Err() + } + + // If the wrapper was idle too long, close the connection and create a new + // one. It's safe to assume that there isn't any newer client as the client + // we fetched is the first in the channel + idleTimeout := p.idleTimeout + if wrapper.ClientConn != nil && idleTimeout > 0 && + wrapper.timeUsed.Add(idleTimeout).Before(time.Now()) { + + wrapper.ClientConn.Close() + wrapper.ClientConn = nil + } + + var err error + if wrapper.ClientConn == nil { + wrapper.ClientConn, err = p.factory(ctx) + if err != nil { + // If there was an error, we want to put back a placeholder + // client in the channel + clients <- ClientConn{ + pool: p, + } + } + // This is a new connection, reset its initiated time + wrapper.timeInitiated = time.Now() + } + + return &wrapper, err +} + +// Unhealthy marks the client conn as unhealthy, so that the connection +// gets reset when closed +func (c *ClientConn) Unhealthy() { + c.unhealthy = true +} + +// Close returns a ClientConn to the pool. It is safe to call multiple time, +// but will return an error after first time +func (c *ClientConn) Close() error { + if c == nil { + return nil + } + if c.ClientConn == nil { + return ErrAlreadyClosed + } + if c.pool.IsClosed() { + return ErrClosed + } + // If the wrapper connection has become too old, we want to recycle it. To + // clarify the logic: if the sum of the initialization time and the max + // duration is before Now(), it means the initialization is so old adding + // the maximum duration couldn't put in the future. This sum therefore + // corresponds to the cut-off point: if it's in the future we still have + // time, if it's in the past it's too old + maxDuration := c.pool.maxLifeDuration + if maxDuration > 0 && c.timeInitiated.Add(maxDuration).Before(time.Now()) { + c.Unhealthy() + } + + // We're cloning the wrapper so we can set ClientConn to nil in the one + // used by the user + wrapper := ClientConn{ + pool: c.pool, + ClientConn: c.ClientConn, + timeUsed: time.Now(), + } + if c.unhealthy { + wrapper.ClientConn.Close() + wrapper.ClientConn = nil + } else { + wrapper.timeInitiated = c.timeInitiated + } + select { + case c.pool.clients <- wrapper: + // All good + default: + return ErrFullPool + } + + c.ClientConn = nil // Mark as closed + return nil +} + +// Capacity returns the capacity +func (p *Pool) Capacity() int { + if p.IsClosed() { + return 0 + } + return cap(p.clients) +} + +// Available returns the number of currently unused clients +func (p *Pool) Available() int { + if p.IsClosed() { + return 0 + } + return len(p.clients) +} diff --git a/pkg/grpc-etcdv3/getcdv3/register.go b/pkg/grpc-etcdv3/getcdv3/register.go new file mode 100644 index 000000000..6bfdb626c --- /dev/null +++ b/pkg/grpc-etcdv3/getcdv3/register.go @@ -0,0 +1,118 @@ +package getcdv3 + +import ( + "Open_IM/pkg/common/log" + "context" + "fmt" + "go.etcd.io/etcd/clientv3" + "net" + "strconv" + "strings" + "time" +) + +type RegEtcd struct { + cli *clientv3.Client + ctx context.Context + cancel context.CancelFunc + key string +} + +var rEtcd *RegEtcd + +// "%s:///%s/" +func GetPrefix(schema, serviceName string) string { + return fmt.Sprintf("%s:///%s/", schema, serviceName) +} + +// "%s:///%s" +func GetPrefix4Unique(schema, serviceName string) string { + return fmt.Sprintf("%s:///%s", schema, serviceName) +} + +// "%s:///%s/" -> "%s:///%s:ip:port" +func RegisterEtcd4Unique(schema, etcdAddr, myHost string, myPort int, serviceName string, ttl int) error { + serviceName = serviceName + ":" + net.JoinHostPort(myHost, strconv.Itoa(myPort)) + return RegisterEtcd(schema, etcdAddr, myHost, myPort, serviceName, ttl) +} + +//etcdAddr separated by commas +func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName string, ttl int) error { + ttl = ttl * 3 + cli, err := clientv3.New(clientv3.Config{ + Endpoints: strings.Split(etcdAddr, ","), DialTimeout: 5 * time.Second}) + + log.Info("", "RegisterEtcd, ", schema, etcdAddr, myHost, myPort, serviceName, ttl) + if err != nil { + return fmt.Errorf("create etcd clientv3 client failed, errmsg:%v, etcd addr:%s", err, etcdAddr) + } + + //lease + ctx, cancel := context.WithCancel(context.Background()) + resp, err := cli.Grant(ctx, int64(ttl)) + if err != nil { + return fmt.Errorf("grant failed") + } + + // schema:///serviceName/ip:port ->ip:port + serviceValue := net.JoinHostPort(myHost, strconv.Itoa(myPort)) + serviceKey := GetPrefix(schema, serviceName) + serviceValue + + //set key->value + if _, err := cli.Put(ctx, serviceKey, serviceValue, clientv3.WithLease(resp.ID)); err != nil { + return fmt.Errorf("put failed, errmsg:%v, key:%s, value:%s", err, serviceKey, serviceValue) + } + + //keepalive + kresp, err := cli.KeepAlive(ctx, resp.ID) + if err != nil { + return fmt.Errorf("keepalive failed, errmsg:%v, lease id:%d", err, resp.ID) + } + //log.Info("", "RegisterEtcd ok ") + + go func() { + for { + select { + case pv, ok := <-kresp: + if ok == true { + log.Debug("", "KeepAlive kresp ok", pv) + } else { + log.Error("", "KeepAlive kresp failed", pv) + t := time.NewTicker(time.Duration(ttl/2) * time.Second) + for { + select { + case <-t.C: + } + ctx, _ := context.WithCancel(context.Background()) + resp, err := cli.Grant(ctx, int64(ttl)) + if err != nil { + log.Error("", "Grant failed ", err.Error()) + continue + } + + if _, err := cli.Put(ctx, serviceKey, serviceValue, clientv3.WithLease(resp.ID)); err != nil { + log.Error("", "etcd Put failed ", err.Error(), serviceKey, serviceValue, resp.ID) + continue + } else { + log.Info("", "etcd Put ok", serviceKey, serviceValue, resp.ID) + } + + } + } + } + } + }() + + rEtcd = &RegEtcd{ctx: ctx, + cli: cli, + cancel: cancel, + key: serviceKey} + + return nil +} + +func UnRegisterEtcd() { + //delete + rEtcd.cancel() + rEtcd.cli.Delete(rEtcd.ctx, rEtcd.key) +} diff --git a/pkg/grpc-etcdv3/getcdv3/resolver.go b/pkg/grpc-etcdv3/getcdv3/resolver.go new file mode 100644 index 000000000..1e57f8cdd --- /dev/null +++ b/pkg/grpc-etcdv3/getcdv3/resolver.go @@ -0,0 +1,262 @@ +package getcdv3 + +import ( + "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" +) + +type Resolver struct { + cc resolver.ClientConn + serviceName string + grpcClientConn *grpc.ClientConn + cli *clientv3.Client + schema string + etcdAddr string + watchStartRevision int64 +} + +var ( + nameResolver = make(map[string]*Resolver) + rwNameResolverMutex sync.RWMutex +) + +func NewResolver(schema, etcdAddr, serviceName string) (*Resolver, error) { + etcdCli, err := clientv3.New(clientv3.Config{ + Endpoints: strings.Split(etcdAddr, ","), + }) + if err != nil { + return nil, err + } + + var r Resolver + r.serviceName = serviceName + r.cli = etcdCli + r.schema = schema + r.etcdAddr = etcdAddr + resolver.Register(&r) + + conn, err := grpc.Dial( + GetPrefix(schema, serviceName), + grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"LoadBalancingPolicy": "%s"}`, roundrobin.Name)), + grpc.WithInsecure(), + grpc.WithTimeout(time.Duration(5)*time.Second), + ) + if err == nil { + r.grpcClientConn = conn + } + return &r, err +} + +func (r1 *Resolver) ResolveNow(rn resolver.ResolveNowOptions) { +} + +func (r1 *Resolver) Close() { +} + +func GetConn(schema, etcdaddr, serviceName string) *grpc.ClientConn { + rwNameResolverMutex.RLock() + r, ok := nameResolver[schema+serviceName] + rwNameResolverMutex.RUnlock() + if ok { + return r.grpcClientConn + } + + rwNameResolverMutex.Lock() + r, ok = nameResolver[schema+serviceName] + if ok { + rwNameResolverMutex.Unlock() + return r.grpcClientConn + } + + r, err := NewResolver(schema, etcdaddr, serviceName) + if err != nil { + rwNameResolverMutex.Unlock() + return nil + } + + nameResolver[schema+serviceName] = r + rwNameResolverMutex.Unlock() + return r.grpcClientConn +} + +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) + } + r.cc = cc + + ctx, _ := context.WithTimeout(context.Background(), 5*time.Second) + // "%s:///%s" + prefix := GetPrefix(r.schema, r.serviceName) + // get key first + resp, err := r.cli.Get(ctx, prefix, clientv3.WithPrefix()) + if err == nil { + var addrList []resolver.Address + for i := range resp.Kvs { + //log.Debug("", "init addr: ", string(resp.Kvs[i].Value)) + addrList = append(addrList, resolver.Address{Addr: string(resp.Kvs[i].Value)}) + } + r.cc.UpdateState(resolver.State{Addresses: addrList}) + r.watchStartRevision = resp.Header.Revision + 1 + go r.watch(prefix, addrList) + } else { + return nil, fmt.Errorf("etcd get failed, prefix: %s", prefix) + } + + return r, nil +} + +func (r *Resolver) Scheme() string { + return r.schema +} + +func exists(addrList []resolver.Address, addr string) bool { + for _, v := range addrList { + if v.Addr == addr { + return true + } + } + return false +} + +func remove(s []resolver.Address, addr string) ([]resolver.Address, bool) { + for i := range s { + if s[i].Addr == addr { + s[i] = s[len(s)-1] + return s[:len(s)-1], true + } + } + return nil, false +} + +func (r *Resolver) watch(prefix string, addrList []resolver.Address) { + rch := r.cli.Watch(context.Background(), prefix, clientv3.WithPrefix(), clientv3.WithPrefix()) + for n := range rch { + flag := 0 + for _, ev := range n.Events { + switch ev.Type { + case mvccpb.PUT: + if !exists(addrList, string(ev.Kv.Value)) { + flag = 1 + addrList = append(addrList, resolver.Address{Addr: string(ev.Kv.Value)}) + //log.Debug("", "after add, new list: ", addrList) + } + case mvccpb.DELETE: + //log.Debug("remove addr key: ", string(ev.Kv.Key), "value:", string(ev.Kv.Value)) + i := strings.LastIndexAny(string(ev.Kv.Key), "/") + if i < 0 { + return + } + t := string(ev.Kv.Key)[i+1:] + //log.Debug("remove addr key: ", string(ev.Kv.Key), "value:", string(ev.Kv.Value), "addr:", t) + if s, ok := remove(addrList, t); ok { + flag = 1 + addrList = s + //log.Debug("after remove, new list: ", addrList) + } + } + } + + if flag == 1 { + r.cc.UpdateState(resolver.State{Addresses: addrList}) + //log.Debug("update: ", addrList) + } + } +} + +func GetConn4Unique(schema, etcdaddr, servicename string) []*grpc.ClientConn { + gEtcdCli, err := clientv3.New(clientv3.Config{Endpoints: strings.Split(etcdaddr, ",")}) + if err != nil { + //log.Error("clientv3.New failed", err.Error()) + return nil + } + + ctx, _ := context.WithTimeout(context.Background(), 5*time.Second) + // "%s:///%s" + prefix := GetPrefix4Unique(schema, servicename) + + resp, err := gEtcdCli.Get(ctx, prefix, clientv3.WithPrefix()) + // "%s:///%s:ip:port" -> %s:ip:port + allService := make([]string, 0) + if err == nil { + for i := range resp.Kvs { + k := string(resp.Kvs[i].Key) + + b := strings.LastIndex(k, "///") + k1 := k[b+len("///"):] + + e := strings.Index(k1, "/") + k2 := k1[:e] + allService = append(allService, k2) + } + } else { + gEtcdCli.Close() + //log.Error("gEtcdCli.Get failed", err.Error()) + return nil + } + gEtcdCli.Close() + + allConn := make([]*grpc.ClientConn, 0) + for _, v := range allService { + r := GetConn(schema, etcdaddr, v) + allConn = append(allConn, r) + } + + return allConn +} + +var ( + service2pool = make(map[string]*Pool) + service2poolMu sync.Mutex +) + +func GetconnFactory(schema, etcdaddr, servicename string) (*grpc.ClientConn, error) { + c := GetConn(schema, etcdaddr, servicename) + if c != nil { + return c, nil + } else { + return c, fmt.Errorf("GetConn failed") + } +} + +func GetConnPool(schema, etcdaddr, servicename string) (*ClientConn, error) { + //get pool + p := NewPool(schema, etcdaddr, servicename) + //poo->get + + ctx, _ := context.WithDeadline(context.Background(), time.Now().Add(1000*time.Millisecond)) + + c, err := p.Get(ctx) + //log.Info("", "Get ", err) + return c, err + +} + +func NewPool(schema, etcdaddr, servicename string) *Pool { + + if _, ok := service2pool[schema+servicename]; !ok { + // + service2poolMu.Lock() + if _, ok1 := service2pool[schema+servicename]; !ok1 { + p, err := New(GetconnFactory, schema, etcdaddr, servicename, 5, 10, 1) + if err == nil { + service2pool[schema+servicename] = p + } + } + service2poolMu.Unlock() + } + + return service2pool[schema+servicename] +} +func GetGrpcConn(schema, etcdaddr, servicename string) *grpc.ClientConn { + return nameResolver[schema+servicename].grpcClientConn +} diff --git a/pkg/proto/admin_cms/admin_cms.pb.go b/pkg/proto/admin_cms/admin_cms.pb.go new file mode 100644 index 000000000..890f409a9 --- /dev/null +++ b/pkg/proto/admin_cms/admin_cms.pb.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.15.5 +// source: admin_cms/admin_cms.proto + +package admin_cms + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type AdminLoginReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OperationID string `protobuf:"bytes,1,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + AdminID string `protobuf:"bytes,2,opt,name=AdminID,proto3" json:"AdminID,omitempty"` + Secret string `protobuf:"bytes,3,opt,name=Secret,proto3" json:"Secret,omitempty"` +} + +func (x *AdminLoginReq) Reset() { + *x = AdminLoginReq{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_cms_admin_cms_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdminLoginReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminLoginReq) ProtoMessage() {} + +func (x *AdminLoginReq) ProtoReflect() protoreflect.Message { + mi := &file_admin_cms_admin_cms_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdminLoginReq.ProtoReflect.Descriptor instead. +func (*AdminLoginReq) Descriptor() ([]byte, []int) { + return file_admin_cms_admin_cms_proto_rawDescGZIP(), []int{0} +} + +func (x *AdminLoginReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +func (x *AdminLoginReq) GetAdminID() string { + if x != nil { + return x.AdminID + } + return "" +} + +func (x *AdminLoginReq) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +type AdminLoginResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *AdminLoginResp) Reset() { + *x = AdminLoginResp{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_cms_admin_cms_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AdminLoginResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdminLoginResp) ProtoMessage() {} + +func (x *AdminLoginResp) ProtoReflect() protoreflect.Message { + mi := &file_admin_cms_admin_cms_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdminLoginResp.ProtoReflect.Descriptor instead. +func (*AdminLoginResp) Descriptor() ([]byte, []int) { + return file_admin_cms_admin_cms_proto_rawDescGZIP(), []int{1} +} + +func (x *AdminLoginResp) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +var File_admin_cms_admin_cms_proto protoreflect.FileDescriptor + +var file_admin_cms_admin_cms_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x2f, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x22, 0x63, 0x0a, 0x0d, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x64, 0x6d, + 0x69, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x26, 0x0a, 0x0e, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x32, 0x4d, 0x0a, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x43, 0x4d, 0x53, 0x12, + 0x41, 0x0a, 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x18, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, + 0x63, 0x6d, 0x73, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x42, 0x17, 0x5a, 0x15, 0x2e, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6d, + 0x73, 0x3b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x63, 0x6d, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_admin_cms_admin_cms_proto_rawDescOnce sync.Once + file_admin_cms_admin_cms_proto_rawDescData = file_admin_cms_admin_cms_proto_rawDesc +) + +func file_admin_cms_admin_cms_proto_rawDescGZIP() []byte { + file_admin_cms_admin_cms_proto_rawDescOnce.Do(func() { + file_admin_cms_admin_cms_proto_rawDescData = protoimpl.X.CompressGZIP(file_admin_cms_admin_cms_proto_rawDescData) + }) + return file_admin_cms_admin_cms_proto_rawDescData +} + +var file_admin_cms_admin_cms_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_admin_cms_admin_cms_proto_goTypes = []interface{}{ + (*AdminLoginReq)(nil), // 0: admin_cms.AdminLoginReq + (*AdminLoginResp)(nil), // 1: admin_cms.AdminLoginResp +} +var file_admin_cms_admin_cms_proto_depIdxs = []int32{ + 0, // 0: admin_cms.adminCMS.AdminLogin:input_type -> admin_cms.AdminLoginReq + 1, // 1: admin_cms.adminCMS.AdminLogin:output_type -> admin_cms.AdminLoginResp + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_admin_cms_admin_cms_proto_init() } +func file_admin_cms_admin_cms_proto_init() { + if File_admin_cms_admin_cms_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_admin_cms_admin_cms_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdminLoginReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_cms_admin_cms_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AdminLoginResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_admin_cms_admin_cms_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_admin_cms_admin_cms_proto_goTypes, + DependencyIndexes: file_admin_cms_admin_cms_proto_depIdxs, + MessageInfos: file_admin_cms_admin_cms_proto_msgTypes, + }.Build() + File_admin_cms_admin_cms_proto = out.File + file_admin_cms_admin_cms_proto_rawDesc = nil + file_admin_cms_admin_cms_proto_goTypes = nil + file_admin_cms_admin_cms_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// AdminCMSClient is the client API for AdminCMS service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AdminCMSClient interface { + AdminLogin(ctx context.Context, in *AdminLoginReq, opts ...grpc.CallOption) (*AdminLoginResp, error) +} + +type adminCMSClient struct { + cc grpc.ClientConnInterface +} + +func NewAdminCMSClient(cc grpc.ClientConnInterface) AdminCMSClient { + return &adminCMSClient{cc} +} + +func (c *adminCMSClient) AdminLogin(ctx context.Context, in *AdminLoginReq, opts ...grpc.CallOption) (*AdminLoginResp, error) { + out := new(AdminLoginResp) + err := c.cc.Invoke(ctx, "/admin_cms.adminCMS/AdminLogin", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AdminCMSServer is the server API for AdminCMS service. +type AdminCMSServer interface { + AdminLogin(context.Context, *AdminLoginReq) (*AdminLoginResp, error) +} + +// UnimplementedAdminCMSServer can be embedded to have forward compatible implementations. +type UnimplementedAdminCMSServer struct { +} + +func (*UnimplementedAdminCMSServer) AdminLogin(context.Context, *AdminLoginReq) (*AdminLoginResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AdminLogin not implemented") +} + +func RegisterAdminCMSServer(s *grpc.Server, srv AdminCMSServer) { + s.RegisterService(&_AdminCMS_serviceDesc, srv) +} + +func _AdminCMS_AdminLogin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AdminLoginReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminCMSServer).AdminLogin(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/admin_cms.adminCMS/AdminLogin", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminCMSServer).AdminLogin(ctx, req.(*AdminLoginReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _AdminCMS_serviceDesc = grpc.ServiceDesc{ + ServiceName: "admin_cms.adminCMS", + HandlerType: (*AdminCMSServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AdminLogin", + Handler: _AdminCMS_AdminLogin_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "admin_cms/admin_cms.proto", +} diff --git a/pkg/proto/admin_cms/admin_cms.proto b/pkg/proto/admin_cms/admin_cms.proto new file mode 100644 index 000000000..6759268ed --- /dev/null +++ b/pkg/proto/admin_cms/admin_cms.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +option go_package = "./admin_cms;admin_cms"; +package admin_cms; + +message AdminLoginReq { + string OperationID = 1; + string AdminID = 2; + string Secret = 3; +} + + +message AdminLoginResp { + string token = 1; +} + +service adminCMS { + rpc AdminLogin(AdminLoginReq) returns(AdminLoginResp); +} \ No newline at end of file diff --git a/pkg/proto/auth/auth.pb.go b/pkg/proto/auth/auth.pb.go new file mode 100644 index 000000000..3941570ee --- /dev/null +++ b/pkg/proto/auth/auth.pb.go @@ -0,0 +1,414 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: auth/auth.proto + +package pbAuth // import "./auth" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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 CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_auth_88965eda3ab7f34d, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type UserRegisterReq struct { + UserInfo *sdk_ws.UserInfo `protobuf:"bytes,1,opt,name=UserInfo" json:"UserInfo,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 *UserRegisterReq) Reset() { *m = UserRegisterReq{} } +func (m *UserRegisterReq) String() string { return proto.CompactTextString(m) } +func (*UserRegisterReq) ProtoMessage() {} +func (*UserRegisterReq) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_88965eda3ab7f34d, []int{1} +} +func (m *UserRegisterReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserRegisterReq.Unmarshal(m, b) +} +func (m *UserRegisterReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserRegisterReq.Marshal(b, m, deterministic) +} +func (dst *UserRegisterReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserRegisterReq.Merge(dst, src) +} +func (m *UserRegisterReq) XXX_Size() int { + return xxx_messageInfo_UserRegisterReq.Size(m) +} +func (m *UserRegisterReq) XXX_DiscardUnknown() { + xxx_messageInfo_UserRegisterReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UserRegisterReq proto.InternalMessageInfo + +func (m *UserRegisterReq) GetUserInfo() *sdk_ws.UserInfo { + if m != nil { + return m.UserInfo + } + return nil +} + +func (m *UserRegisterReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type UserRegisterResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_88965eda3ab7f34d, []int{2} +} +func (m *UserRegisterResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserRegisterResp.Unmarshal(m, b) +} +func (m *UserRegisterResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserRegisterResp.Marshal(b, m, deterministic) +} +func (dst *UserRegisterResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserRegisterResp.Merge(dst, src) +} +func (m *UserRegisterResp) XXX_Size() int { + return xxx_messageInfo_UserRegisterResp.Size(m) +} +func (m *UserRegisterResp) XXX_DiscardUnknown() { + xxx_messageInfo_UserRegisterResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UserRegisterResp proto.InternalMessageInfo + +func (m *UserRegisterResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type UserTokenReq struct { + Platform int32 `protobuf:"varint,1,opt,name=Platform" json:"Platform,omitempty"` + FromUserID string `protobuf:"bytes,2,opt,name=FromUserID" json:"FromUserID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_88965eda3ab7f34d, []int{3} +} +func (m *UserTokenReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserTokenReq.Unmarshal(m, b) +} +func (m *UserTokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserTokenReq.Marshal(b, m, deterministic) +} +func (dst *UserTokenReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserTokenReq.Merge(dst, src) +} +func (m *UserTokenReq) XXX_Size() int { + return xxx_messageInfo_UserTokenReq.Size(m) +} +func (m *UserTokenReq) XXX_DiscardUnknown() { + xxx_messageInfo_UserTokenReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UserTokenReq proto.InternalMessageInfo + +func (m *UserTokenReq) GetPlatform() int32 { + if m != nil { + return m.Platform + } + return 0 +} + +func (m *UserTokenReq) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *UserTokenReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *UserTokenReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type UserTokenResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` + ExpiredTime int64 `protobuf:"varint,3,opt,name=ExpiredTime" json:"ExpiredTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_88965eda3ab7f34d, []int{4} +} +func (m *UserTokenResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserTokenResp.Unmarshal(m, b) +} +func (m *UserTokenResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserTokenResp.Marshal(b, m, deterministic) +} +func (dst *UserTokenResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserTokenResp.Merge(dst, src) +} +func (m *UserTokenResp) XXX_Size() int { + return xxx_messageInfo_UserTokenResp.Size(m) +} +func (m *UserTokenResp) XXX_DiscardUnknown() { + xxx_messageInfo_UserTokenResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UserTokenResp proto.InternalMessageInfo + +func (m *UserTokenResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *UserTokenResp) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *UserTokenResp) GetExpiredTime() int64 { + if m != nil { + return m.ExpiredTime + } + return 0 +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "pbAuth.CommonResp") + proto.RegisterType((*UserRegisterReq)(nil), "pbAuth.UserRegisterReq") + proto.RegisterType((*UserRegisterResp)(nil), "pbAuth.UserRegisterResp") + proto.RegisterType((*UserTokenReq)(nil), "pbAuth.UserTokenReq") + proto.RegisterType((*UserTokenResp)(nil), "pbAuth.UserTokenResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Auth service + +type AuthClient interface { + UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterResp, error) + UserToken(ctx context.Context, in *UserTokenReq, opts ...grpc.CallOption) (*UserTokenResp, error) +} + +type authClient struct { + cc *grpc.ClientConn +} + +func NewAuthClient(cc *grpc.ClientConn) AuthClient { + return &authClient{cc} +} + +func (c *authClient) UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterResp, error) { + out := new(UserRegisterResp) + err := grpc.Invoke(ctx, "/pbAuth.Auth/UserRegister", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *authClient) UserToken(ctx context.Context, in *UserTokenReq, opts ...grpc.CallOption) (*UserTokenResp, error) { + out := new(UserTokenResp) + err := grpc.Invoke(ctx, "/pbAuth.Auth/UserToken", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Auth service + +type AuthServer interface { + UserRegister(context.Context, *UserRegisterReq) (*UserRegisterResp, error) + UserToken(context.Context, *UserTokenReq) (*UserTokenResp, error) +} + +func RegisterAuthServer(s *grpc.Server, srv AuthServer) { + s.RegisterService(&_Auth_serviceDesc, srv) +} + +func _Auth_UserRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UserRegisterReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).UserRegister(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbAuth.Auth/UserRegister", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).UserRegister(ctx, req.(*UserRegisterReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Auth_UserToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UserTokenReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).UserToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbAuth.Auth/UserToken", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).UserToken(ctx, req.(*UserTokenReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Auth_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pbAuth.Auth", + HandlerType: (*AuthServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UserRegister", + Handler: _Auth_UserRegister_Handler, + }, + { + MethodName: "UserToken", + Handler: _Auth_UserToken_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "auth/auth.proto", +} + +func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_88965eda3ab7f34d) } + +var fileDescriptor_auth_88965eda3ab7f34d = []byte{ + // 369 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x52, 0x4d, 0x4b, 0xc3, 0x40, + 0x10, 0x25, 0xf6, 0xc3, 0x76, 0x6a, 0xa9, 0x2c, 0x55, 0x43, 0x04, 0xa9, 0x39, 0xf5, 0x94, 0x40, + 0x3d, 0x28, 0x08, 0x42, 0xad, 0x16, 0x7a, 0x28, 0x95, 0xa5, 0x5e, 0xbc, 0x84, 0x94, 0x6e, 0xdb, + 0x90, 0x26, 0xbb, 0xee, 0xa6, 0x56, 0xf0, 0xe8, 0xc5, 0x9f, 0x2d, 0xbb, 0xf9, 0x70, 0xad, 0x3d, + 0x79, 0x49, 0x98, 0x79, 0x2f, 0xf3, 0xde, 0x9b, 0x0c, 0xb4, 0xfc, 0x4d, 0xb2, 0x72, 0xe5, 0xc3, + 0x61, 0x9c, 0x26, 0x14, 0x55, 0xd9, 0xac, 0xbf, 0x49, 0x56, 0xd6, 0xe5, 0x84, 0x91, 0xd8, 0x1b, + 0x8d, 0x5d, 0x16, 0x2e, 0x5d, 0x05, 0xb9, 0x62, 0x1e, 0x7a, 0x5b, 0xe1, 0x6e, 0x45, 0x4a, 0xb5, + 0xef, 0x00, 0x06, 0x34, 0x8a, 0x68, 0x8c, 0x89, 0x60, 0xc8, 0x84, 0x43, 0xc2, 0xf9, 0x80, 0xce, + 0x89, 0x69, 0x74, 0x8c, 0x6e, 0x05, 0xe7, 0x25, 0x3a, 0x85, 0x2a, 0xe1, 0x7c, 0x2c, 0x96, 0xe6, + 0x41, 0xc7, 0xe8, 0xd6, 0x71, 0x56, 0xd9, 0x6b, 0x68, 0x3d, 0x0b, 0xc2, 0x31, 0x59, 0x06, 0x22, + 0x91, 0xef, 0x57, 0x74, 0x0d, 0x35, 0xd9, 0x1a, 0xc5, 0x0b, 0xaa, 0xa6, 0x34, 0x7a, 0xe7, 0x8e, + 0x20, 0xfc, 0x8d, 0x70, 0xcf, 0x67, 0x81, 0xc7, 0x7c, 0xee, 0x47, 0xc2, 0xc9, 0x29, 0xb8, 0x20, + 0xa3, 0x0e, 0x34, 0x26, 0x8c, 0x70, 0x3f, 0x09, 0x68, 0x3c, 0x7a, 0xc8, 0x84, 0xf4, 0x96, 0x3d, + 0x84, 0xe3, 0xdf, 0x6a, 0x82, 0xa1, 0x9e, 0x9e, 0x20, 0x13, 0x44, 0x4e, 0xba, 0x01, 0xe7, 0x07, + 0xc1, 0x1a, 0xcb, 0xfe, 0x32, 0xe0, 0x48, 0x0e, 0x9a, 0xd2, 0x90, 0xc4, 0xd2, 0xb3, 0x05, 0xb5, + 0xa7, 0xb5, 0x9f, 0x2c, 0x28, 0x8f, 0xb2, 0xe4, 0x45, 0x8d, 0x2e, 0x00, 0x86, 0x9c, 0x46, 0xca, + 0x66, 0xee, 0x4a, 0xeb, 0xc8, 0x6f, 0x27, 0x2c, 0x43, 0x4b, 0x0a, 0x2d, 0xea, 0xdd, 0x48, 0xe5, + 0xbf, 0x91, 0x3e, 0xa0, 0xa9, 0x39, 0xf9, 0x5f, 0x1e, 0xd4, 0x86, 0x8a, 0x1a, 0x90, 0xb9, 0x4b, + 0x0b, 0x29, 0xfe, 0xf8, 0xce, 0x02, 0x4e, 0xe6, 0xd3, 0x20, 0x22, 0xca, 0x5b, 0x09, 0xeb, 0xad, + 0xde, 0xa7, 0x01, 0x65, 0x39, 0x17, 0xf5, 0xd3, 0x7d, 0xe4, 0x8b, 0x45, 0x67, 0xb9, 0xe0, 0xce, + 0xcf, 0xb5, 0xcc, 0xfd, 0x80, 0x60, 0xe8, 0x06, 0xea, 0x45, 0x10, 0xd4, 0xd6, 0x69, 0xf9, 0x96, + 0xad, 0x93, 0x3d, 0x5d, 0xc1, 0xee, 0x5b, 0x2f, 0x4d, 0x47, 0x9d, 0xef, 0x6d, 0x0a, 0xcf, 0xaa, + 0xea, 0x36, 0xaf, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x20, 0x74, 0x9f, 0xd9, 0x02, 0x00, + 0x00, +} diff --git a/pkg/proto/auth/auth.proto b/pkg/proto/auth/auth.proto new file mode 100644 index 000000000..c91921fe9 --- /dev/null +++ b/pkg/proto/auth/auth.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +package pbAuth; +option go_package = "./auth;pbAuth"; + +message CommonResp{ + int32 errCode = 1; + string errMsg = 2; +} + +message UserRegisterReq { + server_api_params.UserInfo UserInfo = 1; + string OperationID = 2; +} +message UserRegisterResp { + CommonResp CommonResp = 1; +} + + +message UserTokenReq { + int32 Platform = 1; + string FromUserID = 2; + string OpUserID = 3; + string OperationID = 4; +} +message UserTokenResp { + CommonResp CommonResp = 1; + string Token = 2; + int64 ExpiredTime = 3; +} + + +service Auth { + rpc UserRegister(UserRegisterReq) returns(UserRegisterResp); + rpc UserToken(UserTokenReq) returns(UserTokenResp); +} diff --git a/pkg/proto/auto_proto.sh b/pkg/proto/auto_proto.sh new file mode 100644 index 000000000..25408d46e --- /dev/null +++ b/pkg/proto/auto_proto.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +source ./proto_dir.cfg + +for ((i = 0; i < ${#all_proto[*]}; i++)); do + proto=${all_proto[$i]} + protoc -I ../../../ -I ./ --go_out=plugins=grpc:. $proto + s=`echo $proto | sed 's/ //g'` + v=${s//proto/pb.go} + protoc-go-inject-tag -input=./$v + echo "protoc --go_out=plugins=grpc:." $proto +done +echo "proto file generate success..." diff --git a/pkg/proto/base/base.proto b/pkg/proto/base/base.proto new file mode 100644 index 000000000..6d5144f0b --- /dev/null +++ b/pkg/proto/base/base.proto @@ -0,0 +1,5 @@ +syntax = "proto3"; +package base; + + + diff --git a/pkg/proto/chat/chat.pb.go b/pkg/proto/chat/chat.pb.go new file mode 100644 index 000000000..cf1c6ba50 --- /dev/null +++ b/pkg/proto/chat/chat.pb.go @@ -0,0 +1,650 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: chat/chat.proto + +package pbChat // import "./chat" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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 MsgDataToMQ struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDataToMQ) Reset() { *m = MsgDataToMQ{} } +func (m *MsgDataToMQ) String() string { return proto.CompactTextString(m) } +func (*MsgDataToMQ) ProtoMessage() {} +func (*MsgDataToMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_83f286704599d5b1, []int{0} +} +func (m *MsgDataToMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToMQ.Unmarshal(m, b) +} +func (m *MsgDataToMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToMQ.Marshal(b, m, deterministic) +} +func (dst *MsgDataToMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToMQ.Merge(dst, src) +} +func (m *MsgDataToMQ) XXX_Size() int { + return xxx_messageInfo_MsgDataToMQ.Size(m) +} +func (m *MsgDataToMQ) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToMQ.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataToMQ proto.InternalMessageInfo + +func (m *MsgDataToMQ) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *MsgDataToMQ) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *MsgDataToMQ) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +type MsgDataToDB struct { + MsgData *sdk_ws.MsgData `protobuf:"bytes,1,opt,name=msgData" json:"msgData,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 *MsgDataToDB) Reset() { *m = MsgDataToDB{} } +func (m *MsgDataToDB) String() string { return proto.CompactTextString(m) } +func (*MsgDataToDB) ProtoMessage() {} +func (*MsgDataToDB) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_83f286704599d5b1, []int{1} +} +func (m *MsgDataToDB) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MsgDataToDB.Unmarshal(m, b) +} +func (m *MsgDataToDB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MsgDataToDB.Marshal(b, m, deterministic) +} +func (dst *MsgDataToDB) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDataToDB.Merge(dst, src) +} +func (m *MsgDataToDB) XXX_Size() int { + return xxx_messageInfo_MsgDataToDB.Size(m) +} +func (m *MsgDataToDB) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDataToDB.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDataToDB proto.InternalMessageInfo + +func (m *MsgDataToDB) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +func (m *MsgDataToDB) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type PushMsgDataToMQ struct { + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"` + PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PushMsgDataToMQ) Reset() { *m = PushMsgDataToMQ{} } +func (m *PushMsgDataToMQ) String() string { return proto.CompactTextString(m) } +func (*PushMsgDataToMQ) ProtoMessage() {} +func (*PushMsgDataToMQ) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_83f286704599d5b1, []int{2} +} +func (m *PushMsgDataToMQ) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PushMsgDataToMQ.Unmarshal(m, b) +} +func (m *PushMsgDataToMQ) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PushMsgDataToMQ.Marshal(b, m, deterministic) +} +func (dst *PushMsgDataToMQ) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushMsgDataToMQ.Merge(dst, src) +} +func (m *PushMsgDataToMQ) XXX_Size() int { + return xxx_messageInfo_PushMsgDataToMQ.Size(m) +} +func (m *PushMsgDataToMQ) XXX_DiscardUnknown() { + xxx_messageInfo_PushMsgDataToMQ.DiscardUnknown(m) +} + +var xxx_messageInfo_PushMsgDataToMQ proto.InternalMessageInfo + +func (m *PushMsgDataToMQ) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *PushMsgDataToMQ) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +func (m *PushMsgDataToMQ) GetPushToUserID() string { + if m != nil { + return m.PushToUserID + } + return "" +} + +// message PullMessageReq { +// string UserID = 1; +// int64 SeqBegin = 2; +// int64 SeqEnd = 3; +// string OperationID = 4; +// } +// +// message PullMessageResp { +// int32 ErrCode = 1; +// string ErrMsg = 2; +// int64 MaxSeq = 3; +// int64 MinSeq = 4; +// repeated GatherFormat SingleUserMsg = 5; +// repeated GatherFormat GroupUserMsg = 6; +// } +// message PullMessageBySeqListReq{ +// string UserID = 1; +// string OperationID = 2; +// repeated int64 seqList =3; +// } +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_83f286704599d5b1, []int{3} +} +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"` + MaxSeq uint32 `protobuf:"varint,3,opt,name=MaxSeq" json:"MaxSeq,omitempty"` + MinSeq uint32 `protobuf:"varint,4,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_chat_83f286704599d5b1, []int{4} +} +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) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetMaxAndMinSeqResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetMaxAndMinSeqResp) GetMaxSeq() uint32 { + if m != nil { + return m.MaxSeq + } + return 0 +} + +func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 { + if m != nil { + return m.MinSeq + } + return 0 +} + +type SendMsgReq struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,3,opt,name=msgData" json:"msgData,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SendMsgReq) Reset() { *m = SendMsgReq{} } +func (m *SendMsgReq) String() string { return proto.CompactTextString(m) } +func (*SendMsgReq) ProtoMessage() {} +func (*SendMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_83f286704599d5b1, []int{5} +} +func (m *SendMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsgReq.Unmarshal(m, b) +} +func (m *SendMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsgReq.Marshal(b, m, deterministic) +} +func (dst *SendMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsgReq.Merge(dst, src) +} +func (m *SendMsgReq) XXX_Size() int { + return xxx_messageInfo_SendMsgReq.Size(m) +} +func (m *SendMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SendMsgReq proto.InternalMessageInfo + +func (m *SendMsgReq) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *SendMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *SendMsgReq) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +type SendMsgResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,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:"-"` +} + +func (m *SendMsgResp) Reset() { *m = SendMsgResp{} } +func (m *SendMsgResp) String() string { return proto.CompactTextString(m) } +func (*SendMsgResp) ProtoMessage() {} +func (*SendMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_chat_83f286704599d5b1, []int{6} +} +func (m *SendMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsgResp.Unmarshal(m, b) +} +func (m *SendMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsgResp.Marshal(b, m, deterministic) +} +func (dst *SendMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsgResp.Merge(dst, src) +} +func (m *SendMsgResp) XXX_Size() int { + return xxx_messageInfo_SendMsgResp.Size(m) +} +func (m *SendMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SendMsgResp proto.InternalMessageInfo + +func (m *SendMsgResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *SendMsgResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *SendMsgResp) GetServerMsgID() string { + if m != nil { + return m.ServerMsgID + } + return "" +} + +func (m *SendMsgResp) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *SendMsgResp) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + +func init() { + proto.RegisterType((*MsgDataToMQ)(nil), "pbChat.MsgDataToMQ") + proto.RegisterType((*MsgDataToDB)(nil), "pbChat.MsgDataToDB") + proto.RegisterType((*PushMsgDataToMQ)(nil), "pbChat.PushMsgDataToMQ") + proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "pbChat.GetMaxAndMinSeqReq") + proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "pbChat.GetMaxAndMinSeqResp") + proto.RegisterType((*SendMsgReq)(nil), "pbChat.SendMsgReq") + proto.RegisterType((*SendMsgResp)(nil), "pbChat.SendMsgResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Chat service + +type ChatClient interface { + GetMaxAndMinSeq(ctx context.Context, in *GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*GetMaxAndMinSeqResp, error) + PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) + SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error) + DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) +} + +type chatClient struct { + cc *grpc.ClientConn +} + +func NewChatClient(cc *grpc.ClientConn) ChatClient { + return &chatClient{cc} +} + +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 + } + return out, nil +} + +func (c *chatClient) PullMessageBySeqList(ctx context.Context, in *sdk_ws.PullMessageBySeqListReq, opts ...grpc.CallOption) (*sdk_ws.PullMessageBySeqListResp, error) { + out := new(sdk_ws.PullMessageBySeqListResp) + err := grpc.Invoke(ctx, "/pbChat.Chat/PullMessageBySeqList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatClient) SendMsg(ctx context.Context, in *SendMsgReq, opts ...grpc.CallOption) (*SendMsgResp, error) { + out := new(SendMsgResp) + err := grpc.Invoke(ctx, "/pbChat.Chat/SendMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatClient) DelMsgList(ctx context.Context, in *sdk_ws.DelMsgListReq, opts ...grpc.CallOption) (*sdk_ws.DelMsgListResp, error) { + out := new(sdk_ws.DelMsgListResp) + err := grpc.Invoke(ctx, "/pbChat.Chat/DelMsgList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Chat service + +type ChatServer interface { + GetMaxAndMinSeq(context.Context, *GetMaxAndMinSeqReq) (*GetMaxAndMinSeqResp, error) + PullMessageBySeqList(context.Context, *sdk_ws.PullMessageBySeqListReq) (*sdk_ws.PullMessageBySeqListResp, error) + SendMsg(context.Context, *SendMsgReq) (*SendMsgResp, error) + DelMsgList(context.Context, *sdk_ws.DelMsgListReq) (*sdk_ws.DelMsgListResp, error) +} + +func RegisterChatServer(s *grpc.Server, srv ChatServer) { + s.RegisterService(&_Chat_serviceDesc, srv) +} + +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).GetMaxAndMinSeq(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbChat.Chat/GetMaxAndMinSeq", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServer).GetMaxAndMinSeq(ctx, req.(*GetMaxAndMinSeqReq)) + } + 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(sdk_ws.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.(*sdk_ws.PullMessageBySeqListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Chat_SendMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServer).SendMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbChat.Chat/SendMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServer).SendMsg(ctx, req.(*SendMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Chat_DelMsgList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(sdk_ws.DelMsgListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServer).DelMsgList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbChat.Chat/DelMsgList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServer).DelMsgList(ctx, req.(*sdk_ws.DelMsgListReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Chat_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pbChat.Chat", + HandlerType: (*ChatServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetMaxAndMinSeq", + Handler: _Chat_GetMaxAndMinSeq_Handler, + }, + { + MethodName: "PullMessageBySeqList", + Handler: _Chat_PullMessageBySeqList_Handler, + }, + { + MethodName: "SendMsg", + Handler: _Chat_SendMsg_Handler, + }, + { + MethodName: "DelMsgList", + Handler: _Chat_DelMsgList_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "chat/chat.proto", +} + +func init() { proto.RegisterFile("chat/chat.proto", fileDescriptor_chat_83f286704599d5b1) } + +var fileDescriptor_chat_83f286704599d5b1 = []byte{ + // 507 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcd, 0x6e, 0xda, 0x40, + 0x10, 0x96, 0x49, 0x80, 0x32, 0x34, 0x42, 0xda, 0x44, 0x95, 0xe5, 0x5e, 0x1c, 0x9f, 0x50, 0x2b, + 0x19, 0x89, 0xf6, 0xd6, 0x53, 0x89, 0xa3, 0x8a, 0xaa, 0xdb, 0x24, 0x86, 0x5e, 0x7a, 0x41, 0x9b, + 0x30, 0x32, 0x16, 0x60, 0x2f, 0x3b, 0xa6, 0xa4, 0xed, 0x33, 0xf4, 0x19, 0xfa, 0x3e, 0x7d, 0xaa, + 0xca, 0xbb, 0x26, 0x98, 0x40, 0x15, 0x4e, 0xbd, 0x58, 0x9a, 0x6f, 0x3e, 0x7f, 0x3f, 0xeb, 0x1f, + 0x68, 0xdd, 0x4d, 0x44, 0xd6, 0xc9, 0x2f, 0xbe, 0x54, 0x69, 0x96, 0xb2, 0x9a, 0xbc, 0xbd, 0x98, + 0x88, 0xcc, 0x39, 0xbf, 0x92, 0x98, 0x8c, 0xfa, 0xbc, 0x23, 0xa7, 0x51, 0x47, 0xaf, 0x3a, 0x34, + 0x9e, 0x8e, 0x56, 0xd4, 0x59, 0x91, 0xa1, 0x7a, 0x3f, 0xa1, 0xc9, 0x29, 0x0a, 0x44, 0x26, 0x86, + 0x29, 0xbf, 0x61, 0x67, 0x50, 0xcd, 0xd2, 0x29, 0x26, 0xb6, 0xe5, 0x5a, 0xed, 0x46, 0x68, 0x06, + 0xe6, 0x42, 0x33, 0x95, 0xa8, 0x44, 0x16, 0xa7, 0x49, 0x3f, 0xb0, 0x2b, 0x7a, 0x57, 0x86, 0xd8, + 0x5b, 0xa8, 0xcf, 0x8d, 0x8c, 0x7d, 0xe4, 0x5a, 0xed, 0x66, 0xd7, 0xf1, 0x09, 0xd5, 0x37, 0x54, + 0x23, 0x21, 0xe3, 0x91, 0x14, 0x4a, 0xcc, 0xc9, 0x2f, 0x8c, 0xc2, 0x35, 0xd5, 0xc3, 0x92, 0x79, + 0xd0, 0x2b, 0x8b, 0x58, 0x07, 0x8b, 0x3c, 0x1d, 0xce, 0xfb, 0x65, 0x41, 0xeb, 0x7a, 0x49, 0x93, + 0x72, 0x51, 0x17, 0x9a, 0x57, 0xa5, 0xbb, 0x4c, 0xdd, 0x32, 0x54, 0x4e, 0x53, 0x39, 0x3c, 0x8d, + 0x07, 0xcf, 0xe5, 0x92, 0x26, 0xc3, 0xf4, 0x0b, 0xa1, 0xea, 0x07, 0xfa, 0x34, 0x1a, 0xe1, 0x16, + 0xe6, 0x7d, 0x06, 0xf6, 0x01, 0x33, 0x2e, 0xee, 0xdf, 0x27, 0x63, 0x1e, 0x27, 0x03, 0x5c, 0x84, + 0xb8, 0x60, 0x2f, 0xa0, 0x56, 0xdc, 0x63, 0xc2, 0x14, 0xd3, 0xe3, 0xa4, 0x95, 0x9d, 0xa4, 0xde, + 0x0a, 0x4e, 0x77, 0xf4, 0x48, 0x32, 0x1b, 0xea, 0x97, 0x4a, 0x5d, 0xa4, 0x63, 0xd4, 0x8a, 0xd5, + 0x70, 0x3d, 0xe6, 0x56, 0x97, 0x4a, 0x71, 0x8a, 0x0a, 0xb5, 0x62, 0xca, 0x71, 0x2e, 0xee, 0x07, + 0xb8, 0xd0, 0xb1, 0x4f, 0xc2, 0x62, 0xd2, 0xb8, 0xd6, 0xb5, 0x8f, 0x0b, 0x5c, 0x4f, 0xde, 0x0f, + 0x80, 0x01, 0x26, 0x63, 0x4e, 0x51, 0x5e, 0xe0, 0xff, 0xbe, 0x3b, 0xbf, 0x2d, 0x68, 0x3e, 0x98, + 0x9b, 0xb6, 0xb8, 0xdd, 0x16, 0x37, 0x6d, 0x71, 0xab, 0xad, 0x99, 0xf2, 0x64, 0xc6, 0x87, 0x53, + 0xd4, 0x0f, 0x74, 0xb5, 0x46, 0x58, 0x86, 0x72, 0xc6, 0xdd, 0x2c, 0xc6, 0x24, 0x33, 0x8c, 0xaa, + 0x61, 0x94, 0x20, 0xe6, 0xc0, 0x33, 0xc2, 0x64, 0x3c, 0x8c, 0xe7, 0x68, 0xd7, 0x5c, 0xab, 0x7d, + 0x14, 0x3e, 0xcc, 0xdd, 0x3f, 0x15, 0x38, 0xce, 0x3f, 0x43, 0xf6, 0x11, 0x5a, 0x8f, 0x9e, 0x0f, + 0x73, 0x7c, 0xf3, 0x89, 0xfa, 0xbb, 0x2f, 0x82, 0xf3, 0xf2, 0x9f, 0x3b, 0x92, 0x2c, 0x85, 0xb3, + 0xeb, 0xe5, 0x6c, 0xc6, 0x91, 0x48, 0x44, 0xd8, 0xfb, 0x3e, 0xc0, 0xc5, 0xa7, 0x98, 0x32, 0xf6, + 0x6a, 0xcf, 0x99, 0xed, 0x23, 0xe6, 0x06, 0xaf, 0x0f, 0xe6, 0x92, 0x64, 0x5d, 0xa8, 0x17, 0xc7, + 0xcc, 0xd8, 0x3a, 0xd8, 0xe6, 0xa1, 0x3b, 0xa7, 0x3b, 0x18, 0x49, 0x76, 0x03, 0x10, 0xe0, 0x8c, + 0x53, 0xa4, 0xa3, 0xb9, 0x7b, 0xec, 0x36, 0xeb, 0x5c, 0xe4, 0xfc, 0x09, 0x06, 0xc9, 0x5e, 0xeb, + 0xeb, 0x89, 0xaf, 0x7f, 0x71, 0xef, 0x8c, 0xdf, 0x6d, 0x4d, 0xff, 0xbf, 0xde, 0xfc, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0x6f, 0x9d, 0x6f, 0xa0, 0xfd, 0x04, 0x00, 0x00, +} diff --git a/pkg/proto/chat/chat.proto b/pkg/proto/chat/chat.proto new file mode 100644 index 000000000..146994f01 --- /dev/null +++ b/pkg/proto/chat/chat.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./chat;pbChat"; +package pbChat; + + + +message MsgDataToMQ{ + string token =1; + string operationID = 2; + server_api_params.MsgData msgData = 3; +} + + +message MsgDataToDB { + server_api_params.MsgData msgData = 1; + string operationID = 2; + +} +message PushMsgDataToMQ{ + string OperationID = 1; + server_api_params.MsgData msgData = 2; + string pushToUserID = 3; +} + +//message PullMessageReq { +// string UserID = 1; +// int64 SeqBegin = 2; +// int64 SeqEnd = 3; +// string OperationID = 4; +//} +// +//message PullMessageResp { +// int32 ErrCode = 1; +// string ErrMsg = 2; +// int64 MaxSeq = 3; +// int64 MinSeq = 4; +// repeated GatherFormat SingleUserMsg = 5; +// repeated GatherFormat GroupUserMsg = 6; +//} +//message PullMessageBySeqListReq{ +// string UserID = 1; +// string OperationID = 2; +// repeated int64 seqList =3; +//} +message GetMaxAndMinSeqReq { + string UserID = 1; + string OperationID = 2; +} +message GetMaxAndMinSeqResp { + int32 ErrCode = 1; + string ErrMsg = 2; + uint32 MaxSeq = 3; + uint32 MinSeq = 4; +} + +message SendMsgReq { + +string token =1; +string operationID = 2; +server_api_params.MsgData msgData = 3; + + +} + +message SendMsgResp { + int32 errCode = 1; + string errMsg = 2; + string serverMsgID = 4; + string clientMsgID = 5; + int64 sendTime = 6; + +} + + + +service Chat { + rpc GetMaxAndMinSeq(GetMaxAndMinSeqReq) returns(GetMaxAndMinSeqResp); + rpc PullMessageBySeqList(server_api_params.PullMessageBySeqListReq) returns(server_api_params.PullMessageBySeqListResp); + rpc SendMsg(SendMsgReq) returns(SendMsgResp); + rpc DelMsgList(server_api_params.DelMsgListReq) returns(server_api_params.DelMsgListResp); +} diff --git a/pkg/proto/friend/friend.pb.go b/pkg/proto/friend/friend.pb.go new file mode 100644 index 000000000..88e92e2f5 --- /dev/null +++ b/pkg/proto/friend/friend.pb.go @@ -0,0 +1,1990 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: friend/friend.proto + +package friend // import "./friend" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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 CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type CommID struct { + OpUserID string `protobuf:"bytes,1,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + ToUserID string `protobuf:"bytes,4,opt,name=ToUserID" json:"ToUserID,omitempty"` + FromUserID string `protobuf:"bytes,5,opt,name=FromUserID" json:"FromUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommID) Reset() { *m = CommID{} } +func (m *CommID) String() string { return proto.CompactTextString(m) } +func (*CommID) ProtoMessage() {} +func (*CommID) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{1} +} +func (m *CommID) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommID.Unmarshal(m, b) +} +func (m *CommID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommID.Marshal(b, m, deterministic) +} +func (dst *CommID) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommID.Merge(dst, src) +} +func (m *CommID) XXX_Size() int { + return xxx_messageInfo_CommID.Size(m) +} +func (m *CommID) XXX_DiscardUnknown() { + xxx_messageInfo_CommID.DiscardUnknown(m) +} + +var xxx_messageInfo_CommID proto.InternalMessageInfo + +func (m *CommID) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *CommID) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *CommID) GetToUserID() string { + if m != nil { + return m.ToUserID + } + return "" +} + +func (m *CommID) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +type GetFriendsInfoReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{2} +} +func (m *GetFriendsInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendsInfoReq.Unmarshal(m, b) +} +func (m *GetFriendsInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendsInfoReq.Marshal(b, m, deterministic) +} +func (dst *GetFriendsInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendsInfoReq.Merge(dst, src) +} +func (m *GetFriendsInfoReq) XXX_Size() int { + return xxx_messageInfo_GetFriendsInfoReq.Size(m) +} +func (m *GetFriendsInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendsInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFriendsInfoReq proto.InternalMessageInfo + +func (m *GetFriendsInfoReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type GetFriendInfoResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + FriendInfoList []*sdk_ws.FriendInfo `protobuf:"bytes,3,rep,name=FriendInfoList" json:"FriendInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{3} +} +func (m *GetFriendInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendInfoResp.Unmarshal(m, b) +} +func (m *GetFriendInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendInfoResp.Marshal(b, m, deterministic) +} +func (dst *GetFriendInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendInfoResp.Merge(dst, src) +} +func (m *GetFriendInfoResp) XXX_Size() int { + return xxx_messageInfo_GetFriendInfoResp.Size(m) +} +func (m *GetFriendInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFriendInfoResp proto.InternalMessageInfo + +func (m *GetFriendInfoResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetFriendInfoResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetFriendInfoResp) GetFriendInfoList() []*sdk_ws.FriendInfo { + if m != nil { + return m.FriendInfoList + } + return nil +} + +type AddFriendReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + ReqMsg string `protobuf:"bytes,2,opt,name=ReqMsg" json:"ReqMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{4} +} +func (m *AddFriendReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddFriendReq.Unmarshal(m, b) +} +func (m *AddFriendReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddFriendReq.Marshal(b, m, deterministic) +} +func (dst *AddFriendReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddFriendReq.Merge(dst, src) +} +func (m *AddFriendReq) XXX_Size() int { + return xxx_messageInfo_AddFriendReq.Size(m) +} +func (m *AddFriendReq) XXX_DiscardUnknown() { + xxx_messageInfo_AddFriendReq.DiscardUnknown(m) +} + +var xxx_messageInfo_AddFriendReq proto.InternalMessageInfo + +func (m *AddFriendReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +func (m *AddFriendReq) GetReqMsg() string { + if m != nil { + return m.ReqMsg + } + return "" +} + +type AddFriendResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddFriendResp) Reset() { *m = AddFriendResp{} } +func (m *AddFriendResp) String() string { return proto.CompactTextString(m) } +func (*AddFriendResp) ProtoMessage() {} +func (*AddFriendResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{5} +} +func (m *AddFriendResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddFriendResp.Unmarshal(m, b) +} +func (m *AddFriendResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddFriendResp.Marshal(b, m, deterministic) +} +func (dst *AddFriendResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddFriendResp.Merge(dst, src) +} +func (m *AddFriendResp) XXX_Size() int { + return xxx_messageInfo_AddFriendResp.Size(m) +} +func (m *AddFriendResp) XXX_DiscardUnknown() { + xxx_messageInfo_AddFriendResp.DiscardUnknown(m) +} + +var xxx_messageInfo_AddFriendResp proto.InternalMessageInfo + +func (m *AddFriendResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type ImportFriendReq struct { + FriendUserIDList []string `protobuf:"bytes,1,rep,name=FriendUserIDList" json:"FriendUserIDList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + FromUserID string `protobuf:"bytes,3,opt,name=FromUserID" json:"FromUserID,omitempty"` + OpUserID string `protobuf:"bytes,4,opt,name=OpUserID" json:"OpUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{6} +} +func (m *ImportFriendReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImportFriendReq.Unmarshal(m, b) +} +func (m *ImportFriendReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImportFriendReq.Marshal(b, m, deterministic) +} +func (dst *ImportFriendReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportFriendReq.Merge(dst, src) +} +func (m *ImportFriendReq) XXX_Size() int { + return xxx_messageInfo_ImportFriendReq.Size(m) +} +func (m *ImportFriendReq) XXX_DiscardUnknown() { + xxx_messageInfo_ImportFriendReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ImportFriendReq proto.InternalMessageInfo + +func (m *ImportFriendReq) GetFriendUserIDList() []string { + if m != nil { + return m.FriendUserIDList + } + return nil +} + +func (m *ImportFriendReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *ImportFriendReq) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *ImportFriendReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type UserIDResult struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + Result int32 `protobuf:"varint,2,opt,name=Result" json:"Result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserIDResult) Reset() { *m = UserIDResult{} } +func (m *UserIDResult) String() string { return proto.CompactTextString(m) } +func (*UserIDResult) ProtoMessage() {} +func (*UserIDResult) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{7} +} +func (m *UserIDResult) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserIDResult.Unmarshal(m, b) +} +func (m *UserIDResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserIDResult.Marshal(b, m, deterministic) +} +func (dst *UserIDResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserIDResult.Merge(dst, src) +} +func (m *UserIDResult) XXX_Size() int { + return xxx_messageInfo_UserIDResult.Size(m) +} +func (m *UserIDResult) XXX_DiscardUnknown() { + xxx_messageInfo_UserIDResult.DiscardUnknown(m) +} + +var xxx_messageInfo_UserIDResult proto.InternalMessageInfo + +func (m *UserIDResult) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *UserIDResult) GetResult() int32 { + if m != nil { + return m.Result + } + return 0 +} + +type ImportFriendResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + UserIDResultList []*UserIDResult `protobuf:"bytes,2,rep,name=UserIDResultList" json:"UserIDResultList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{8} +} +func (m *ImportFriendResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImportFriendResp.Unmarshal(m, b) +} +func (m *ImportFriendResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImportFriendResp.Marshal(b, m, deterministic) +} +func (dst *ImportFriendResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportFriendResp.Merge(dst, src) +} +func (m *ImportFriendResp) XXX_Size() int { + return xxx_messageInfo_ImportFriendResp.Size(m) +} +func (m *ImportFriendResp) XXX_DiscardUnknown() { + xxx_messageInfo_ImportFriendResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ImportFriendResp proto.InternalMessageInfo + +func (m *ImportFriendResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *ImportFriendResp) GetUserIDResultList() []*UserIDResult { + if m != nil { + return m.UserIDResultList + } + return nil +} + +type GetFriendApplyListReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetFriendApplyListReq) Reset() { *m = GetFriendApplyListReq{} } +func (m *GetFriendApplyListReq) String() string { return proto.CompactTextString(m) } +func (*GetFriendApplyListReq) ProtoMessage() {} +func (*GetFriendApplyListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{9} +} +func (m *GetFriendApplyListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendApplyListReq.Unmarshal(m, b) +} +func (m *GetFriendApplyListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendApplyListReq.Marshal(b, m, deterministic) +} +func (dst *GetFriendApplyListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendApplyListReq.Merge(dst, src) +} +func (m *GetFriendApplyListReq) XXX_Size() int { + return xxx_messageInfo_GetFriendApplyListReq.Size(m) +} +func (m *GetFriendApplyListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendApplyListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFriendApplyListReq proto.InternalMessageInfo + +func (m *GetFriendApplyListReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type GetFriendApplyListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + FriendRequestList []*sdk_ws.FriendRequest `protobuf:"bytes,3,rep,name=FriendRequestList" json:"FriendRequestList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetFriendApplyListResp) Reset() { *m = GetFriendApplyListResp{} } +func (m *GetFriendApplyListResp) String() string { return proto.CompactTextString(m) } +func (*GetFriendApplyListResp) ProtoMessage() {} +func (*GetFriendApplyListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{10} +} +func (m *GetFriendApplyListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendApplyListResp.Unmarshal(m, b) +} +func (m *GetFriendApplyListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendApplyListResp.Marshal(b, m, deterministic) +} +func (dst *GetFriendApplyListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendApplyListResp.Merge(dst, src) +} +func (m *GetFriendApplyListResp) XXX_Size() int { + return xxx_messageInfo_GetFriendApplyListResp.Size(m) +} +func (m *GetFriendApplyListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendApplyListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFriendApplyListResp proto.InternalMessageInfo + +func (m *GetFriendApplyListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetFriendApplyListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetFriendApplyListResp) GetFriendRequestList() []*sdk_ws.FriendRequest { + if m != nil { + return m.FriendRequestList + } + return nil +} + +type GetFriendListReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{11} +} +func (m *GetFriendListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendListReq.Unmarshal(m, b) +} +func (m *GetFriendListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendListReq.Marshal(b, m, deterministic) +} +func (dst *GetFriendListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendListReq.Merge(dst, src) +} +func (m *GetFriendListReq) XXX_Size() int { + return xxx_messageInfo_GetFriendListReq.Size(m) +} +func (m *GetFriendListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFriendListReq proto.InternalMessageInfo + +func (m *GetFriendListReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type GetFriendListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + FriendInfoList []*sdk_ws.FriendInfo `protobuf:"bytes,3,rep,name=FriendInfoList" json:"FriendInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{12} +} +func (m *GetFriendListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetFriendListResp.Unmarshal(m, b) +} +func (m *GetFriendListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetFriendListResp.Marshal(b, m, deterministic) +} +func (dst *GetFriendListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetFriendListResp.Merge(dst, src) +} +func (m *GetFriendListResp) XXX_Size() int { + return xxx_messageInfo_GetFriendListResp.Size(m) +} +func (m *GetFriendListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetFriendListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetFriendListResp proto.InternalMessageInfo + +func (m *GetFriendListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetFriendListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetFriendListResp) GetFriendInfoList() []*sdk_ws.FriendInfo { + if m != nil { + return m.FriendInfoList + } + return nil +} + +type AddBlacklistReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{13} +} +func (m *AddBlacklistReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddBlacklistReq.Unmarshal(m, b) +} +func (m *AddBlacklistReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddBlacklistReq.Marshal(b, m, deterministic) +} +func (dst *AddBlacklistReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddBlacklistReq.Merge(dst, src) +} +func (m *AddBlacklistReq) XXX_Size() int { + return xxx_messageInfo_AddBlacklistReq.Size(m) +} +func (m *AddBlacklistReq) XXX_DiscardUnknown() { + xxx_messageInfo_AddBlacklistReq.DiscardUnknown(m) +} + +var xxx_messageInfo_AddBlacklistReq proto.InternalMessageInfo + +func (m *AddBlacklistReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type AddBlacklistResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddBlacklistResp) Reset() { *m = AddBlacklistResp{} } +func (m *AddBlacklistResp) String() string { return proto.CompactTextString(m) } +func (*AddBlacklistResp) ProtoMessage() {} +func (*AddBlacklistResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{14} +} +func (m *AddBlacklistResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddBlacklistResp.Unmarshal(m, b) +} +func (m *AddBlacklistResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddBlacklistResp.Marshal(b, m, deterministic) +} +func (dst *AddBlacklistResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddBlacklistResp.Merge(dst, src) +} +func (m *AddBlacklistResp) XXX_Size() int { + return xxx_messageInfo_AddBlacklistResp.Size(m) +} +func (m *AddBlacklistResp) XXX_DiscardUnknown() { + xxx_messageInfo_AddBlacklistResp.DiscardUnknown(m) +} + +var xxx_messageInfo_AddBlacklistResp proto.InternalMessageInfo + +func (m *AddBlacklistResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type RemoveBlacklistReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{15} +} +func (m *RemoveBlacklistReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveBlacklistReq.Unmarshal(m, b) +} +func (m *RemoveBlacklistReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveBlacklistReq.Marshal(b, m, deterministic) +} +func (dst *RemoveBlacklistReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveBlacklistReq.Merge(dst, src) +} +func (m *RemoveBlacklistReq) XXX_Size() int { + return xxx_messageInfo_RemoveBlacklistReq.Size(m) +} +func (m *RemoveBlacklistReq) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveBlacklistReq.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveBlacklistReq proto.InternalMessageInfo + +func (m *RemoveBlacklistReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type RemoveBlacklistResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveBlacklistResp) Reset() { *m = RemoveBlacklistResp{} } +func (m *RemoveBlacklistResp) String() string { return proto.CompactTextString(m) } +func (*RemoveBlacklistResp) ProtoMessage() {} +func (*RemoveBlacklistResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{16} +} +func (m *RemoveBlacklistResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveBlacklistResp.Unmarshal(m, b) +} +func (m *RemoveBlacklistResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveBlacklistResp.Marshal(b, m, deterministic) +} +func (dst *RemoveBlacklistResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveBlacklistResp.Merge(dst, src) +} +func (m *RemoveBlacklistResp) XXX_Size() int { + return xxx_messageInfo_RemoveBlacklistResp.Size(m) +} +func (m *RemoveBlacklistResp) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveBlacklistResp.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveBlacklistResp proto.InternalMessageInfo + +func (m *RemoveBlacklistResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetBlacklistReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{17} +} +func (m *GetBlacklistReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBlacklistReq.Unmarshal(m, b) +} +func (m *GetBlacklistReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBlacklistReq.Marshal(b, m, deterministic) +} +func (dst *GetBlacklistReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlacklistReq.Merge(dst, src) +} +func (m *GetBlacklistReq) XXX_Size() int { + return xxx_messageInfo_GetBlacklistReq.Size(m) +} +func (m *GetBlacklistReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlacklistReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlacklistReq proto.InternalMessageInfo + +func (m *GetBlacklistReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type GetBlacklistResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + BlackUserInfoList []*sdk_ws.PublicUserInfo `protobuf:"bytes,3,rep,name=BlackUserInfoList" json:"BlackUserInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{18} +} +func (m *GetBlacklistResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBlacklistResp.Unmarshal(m, b) +} +func (m *GetBlacklistResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBlacklistResp.Marshal(b, m, deterministic) +} +func (dst *GetBlacklistResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlacklistResp.Merge(dst, src) +} +func (m *GetBlacklistResp) XXX_Size() int { + return xxx_messageInfo_GetBlacklistResp.Size(m) +} +func (m *GetBlacklistResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlacklistResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlacklistResp proto.InternalMessageInfo + +func (m *GetBlacklistResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetBlacklistResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetBlacklistResp) GetBlackUserInfoList() []*sdk_ws.PublicUserInfo { + if m != nil { + return m.BlackUserInfoList + } + return nil +} + +type IsFriendReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{19} +} +func (m *IsFriendReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IsFriendReq.Unmarshal(m, b) +} +func (m *IsFriendReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IsFriendReq.Marshal(b, m, deterministic) +} +func (dst *IsFriendReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_IsFriendReq.Merge(dst, src) +} +func (m *IsFriendReq) XXX_Size() int { + return xxx_messageInfo_IsFriendReq.Size(m) +} +func (m *IsFriendReq) XXX_DiscardUnknown() { + xxx_messageInfo_IsFriendReq.DiscardUnknown(m) +} + +var xxx_messageInfo_IsFriendReq proto.InternalMessageInfo + +func (m *IsFriendReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type IsFriendResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + Response bool `protobuf:"varint,3,opt,name=Response" json:"Response,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{20} +} +func (m *IsFriendResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IsFriendResp.Unmarshal(m, b) +} +func (m *IsFriendResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IsFriendResp.Marshal(b, m, deterministic) +} +func (dst *IsFriendResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_IsFriendResp.Merge(dst, src) +} +func (m *IsFriendResp) XXX_Size() int { + return xxx_messageInfo_IsFriendResp.Size(m) +} +func (m *IsFriendResp) XXX_DiscardUnknown() { + xxx_messageInfo_IsFriendResp.DiscardUnknown(m) +} + +var xxx_messageInfo_IsFriendResp proto.InternalMessageInfo + +func (m *IsFriendResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *IsFriendResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *IsFriendResp) GetResponse() bool { + if m != nil { + return m.Response + } + return false +} + +type IsInBlackListReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{21} +} +func (m *IsInBlackListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IsInBlackListReq.Unmarshal(m, b) +} +func (m *IsInBlackListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IsInBlackListReq.Marshal(b, m, deterministic) +} +func (dst *IsInBlackListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_IsInBlackListReq.Merge(dst, src) +} +func (m *IsInBlackListReq) XXX_Size() int { + return xxx_messageInfo_IsInBlackListReq.Size(m) +} +func (m *IsInBlackListReq) XXX_DiscardUnknown() { + xxx_messageInfo_IsInBlackListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_IsInBlackListReq proto.InternalMessageInfo + +func (m *IsInBlackListReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type IsInBlackListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + Response bool `protobuf:"varint,3,opt,name=Response" json:"Response,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{22} +} +func (m *IsInBlackListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IsInBlackListResp.Unmarshal(m, b) +} +func (m *IsInBlackListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IsInBlackListResp.Marshal(b, m, deterministic) +} +func (dst *IsInBlackListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_IsInBlackListResp.Merge(dst, src) +} +func (m *IsInBlackListResp) XXX_Size() int { + return xxx_messageInfo_IsInBlackListResp.Size(m) +} +func (m *IsInBlackListResp) XXX_DiscardUnknown() { + xxx_messageInfo_IsInBlackListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_IsInBlackListResp proto.InternalMessageInfo + +func (m *IsInBlackListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *IsInBlackListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *IsInBlackListResp) GetResponse() bool { + if m != nil { + return m.Response + } + return false +} + +type DeleteFriendReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{23} +} +func (m *DeleteFriendReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteFriendReq.Unmarshal(m, b) +} +func (m *DeleteFriendReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteFriendReq.Marshal(b, m, deterministic) +} +func (dst *DeleteFriendReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteFriendReq.Merge(dst, src) +} +func (m *DeleteFriendReq) XXX_Size() int { + return xxx_messageInfo_DeleteFriendReq.Size(m) +} +func (m *DeleteFriendReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteFriendReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteFriendReq proto.InternalMessageInfo + +func (m *DeleteFriendReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type DeleteFriendResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteFriendResp) Reset() { *m = DeleteFriendResp{} } +func (m *DeleteFriendResp) String() string { return proto.CompactTextString(m) } +func (*DeleteFriendResp) ProtoMessage() {} +func (*DeleteFriendResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{24} +} +func (m *DeleteFriendResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteFriendResp.Unmarshal(m, b) +} +func (m *DeleteFriendResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteFriendResp.Marshal(b, m, deterministic) +} +func (dst *DeleteFriendResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteFriendResp.Merge(dst, src) +} +func (m *DeleteFriendResp) XXX_Size() int { + return xxx_messageInfo_DeleteFriendResp.Size(m) +} +func (m *DeleteFriendResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteFriendResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteFriendResp proto.InternalMessageInfo + +func (m *DeleteFriendResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +// process +type AddFriendResponseReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + HandleResult int32 `protobuf:"varint,2,opt,name=handleResult" json:"handleResult,omitempty"` + HandleMsg string `protobuf:"bytes,3,opt,name=handleMsg" json:"handleMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_74b4824fb8c5de90, []int{25} +} +func (m *AddFriendResponseReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddFriendResponseReq.Unmarshal(m, b) +} +func (m *AddFriendResponseReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddFriendResponseReq.Marshal(b, m, deterministic) +} +func (dst *AddFriendResponseReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddFriendResponseReq.Merge(dst, src) +} +func (m *AddFriendResponseReq) XXX_Size() int { + return xxx_messageInfo_AddFriendResponseReq.Size(m) +} +func (m *AddFriendResponseReq) XXX_DiscardUnknown() { + xxx_messageInfo_AddFriendResponseReq.DiscardUnknown(m) +} + +var xxx_messageInfo_AddFriendResponseReq proto.InternalMessageInfo + +func (m *AddFriendResponseReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +func (m *AddFriendResponseReq) GetHandleResult() int32 { + if m != nil { + return m.HandleResult + } + return 0 +} + +func (m *AddFriendResponseReq) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +type AddFriendResponseResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddFriendResponseResp) Reset() { *m = AddFriendResponseResp{} } +func (m *AddFriendResponseResp) String() string { return proto.CompactTextString(m) } +func (*AddFriendResponseResp) ProtoMessage() {} +func (*AddFriendResponseResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{26} +} +func (m *AddFriendResponseResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddFriendResponseResp.Unmarshal(m, b) +} +func (m *AddFriendResponseResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddFriendResponseResp.Marshal(b, m, deterministic) +} +func (dst *AddFriendResponseResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddFriendResponseResp.Merge(dst, src) +} +func (m *AddFriendResponseResp) XXX_Size() int { + return xxx_messageInfo_AddFriendResponseResp.Size(m) +} +func (m *AddFriendResponseResp) XXX_DiscardUnknown() { + xxx_messageInfo_AddFriendResponseResp.DiscardUnknown(m) +} + +var xxx_messageInfo_AddFriendResponseResp proto.InternalMessageInfo + +func (m *AddFriendResponseResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type SetFriendRemarkReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + Remark string `protobuf:"bytes,2,opt,name=Remark" json:"Remark,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetFriendRemarkReq) Reset() { *m = SetFriendRemarkReq{} } +func (m *SetFriendRemarkReq) String() string { return proto.CompactTextString(m) } +func (*SetFriendRemarkReq) ProtoMessage() {} +func (*SetFriendRemarkReq) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{27} +} +func (m *SetFriendRemarkReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetFriendRemarkReq.Unmarshal(m, b) +} +func (m *SetFriendRemarkReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetFriendRemarkReq.Marshal(b, m, deterministic) +} +func (dst *SetFriendRemarkReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetFriendRemarkReq.Merge(dst, src) +} +func (m *SetFriendRemarkReq) XXX_Size() int { + return xxx_messageInfo_SetFriendRemarkReq.Size(m) +} +func (m *SetFriendRemarkReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetFriendRemarkReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetFriendRemarkReq proto.InternalMessageInfo + +func (m *SetFriendRemarkReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +func (m *SetFriendRemarkReq) GetRemark() string { + if m != nil { + return m.Remark + } + return "" +} + +type SetFriendRemarkResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetFriendRemarkResp) Reset() { *m = SetFriendRemarkResp{} } +func (m *SetFriendRemarkResp) String() string { return proto.CompactTextString(m) } +func (*SetFriendRemarkResp) ProtoMessage() {} +func (*SetFriendRemarkResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{28} +} +func (m *SetFriendRemarkResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetFriendRemarkResp.Unmarshal(m, b) +} +func (m *SetFriendRemarkResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetFriendRemarkResp.Marshal(b, m, deterministic) +} +func (dst *SetFriendRemarkResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetFriendRemarkResp.Merge(dst, src) +} +func (m *SetFriendRemarkResp) XXX_Size() int { + return xxx_messageInfo_SetFriendRemarkResp.Size(m) +} +func (m *SetFriendRemarkResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetFriendRemarkResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetFriendRemarkResp proto.InternalMessageInfo + +func (m *SetFriendRemarkResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetSelfApplyListReq struct { + CommID *CommID `protobuf:"bytes,1,opt,name=CommID" json:"CommID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSelfApplyListReq) Reset() { *m = GetSelfApplyListReq{} } +func (m *GetSelfApplyListReq) String() string { return proto.CompactTextString(m) } +func (*GetSelfApplyListReq) ProtoMessage() {} +func (*GetSelfApplyListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{29} +} +func (m *GetSelfApplyListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSelfApplyListReq.Unmarshal(m, b) +} +func (m *GetSelfApplyListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSelfApplyListReq.Marshal(b, m, deterministic) +} +func (dst *GetSelfApplyListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSelfApplyListReq.Merge(dst, src) +} +func (m *GetSelfApplyListReq) XXX_Size() int { + return xxx_messageInfo_GetSelfApplyListReq.Size(m) +} +func (m *GetSelfApplyListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetSelfApplyListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSelfApplyListReq proto.InternalMessageInfo + +func (m *GetSelfApplyListReq) GetCommID() *CommID { + if m != nil { + return m.CommID + } + return nil +} + +type GetSelfApplyListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + FriendRequestList []*sdk_ws.FriendRequest `protobuf:"bytes,3,rep,name=FriendRequestList" json:"FriendRequestList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSelfApplyListResp) Reset() { *m = GetSelfApplyListResp{} } +func (m *GetSelfApplyListResp) String() string { return proto.CompactTextString(m) } +func (*GetSelfApplyListResp) ProtoMessage() {} +func (*GetSelfApplyListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_friend_74b4824fb8c5de90, []int{30} +} +func (m *GetSelfApplyListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSelfApplyListResp.Unmarshal(m, b) +} +func (m *GetSelfApplyListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSelfApplyListResp.Marshal(b, m, deterministic) +} +func (dst *GetSelfApplyListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSelfApplyListResp.Merge(dst, src) +} +func (m *GetSelfApplyListResp) XXX_Size() int { + return xxx_messageInfo_GetSelfApplyListResp.Size(m) +} +func (m *GetSelfApplyListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetSelfApplyListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSelfApplyListResp proto.InternalMessageInfo + +func (m *GetSelfApplyListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetSelfApplyListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetSelfApplyListResp) GetFriendRequestList() []*sdk_ws.FriendRequest { + if m != nil { + return m.FriendRequestList + } + return nil +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "friend.CommonResp") + proto.RegisterType((*CommID)(nil), "friend.CommID") + proto.RegisterType((*GetFriendsInfoReq)(nil), "friend.GetFriendsInfoReq") + proto.RegisterType((*GetFriendInfoResp)(nil), "friend.GetFriendInfoResp") + proto.RegisterType((*AddFriendReq)(nil), "friend.AddFriendReq") + proto.RegisterType((*AddFriendResp)(nil), "friend.AddFriendResp") + proto.RegisterType((*ImportFriendReq)(nil), "friend.ImportFriendReq") + proto.RegisterType((*UserIDResult)(nil), "friend.UserIDResult") + proto.RegisterType((*ImportFriendResp)(nil), "friend.ImportFriendResp") + proto.RegisterType((*GetFriendApplyListReq)(nil), "friend.GetFriendApplyListReq") + proto.RegisterType((*GetFriendApplyListResp)(nil), "friend.GetFriendApplyListResp") + proto.RegisterType((*GetFriendListReq)(nil), "friend.GetFriendListReq") + proto.RegisterType((*GetFriendListResp)(nil), "friend.GetFriendListResp") + proto.RegisterType((*AddBlacklistReq)(nil), "friend.AddBlacklistReq") + proto.RegisterType((*AddBlacklistResp)(nil), "friend.AddBlacklistResp") + proto.RegisterType((*RemoveBlacklistReq)(nil), "friend.RemoveBlacklistReq") + proto.RegisterType((*RemoveBlacklistResp)(nil), "friend.RemoveBlacklistResp") + proto.RegisterType((*GetBlacklistReq)(nil), "friend.GetBlacklistReq") + proto.RegisterType((*GetBlacklistResp)(nil), "friend.GetBlacklistResp") + proto.RegisterType((*IsFriendReq)(nil), "friend.IsFriendReq") + proto.RegisterType((*IsFriendResp)(nil), "friend.IsFriendResp") + proto.RegisterType((*IsInBlackListReq)(nil), "friend.IsInBlackListReq") + proto.RegisterType((*IsInBlackListResp)(nil), "friend.IsInBlackListResp") + proto.RegisterType((*DeleteFriendReq)(nil), "friend.DeleteFriendReq") + proto.RegisterType((*DeleteFriendResp)(nil), "friend.DeleteFriendResp") + proto.RegisterType((*AddFriendResponseReq)(nil), "friend.AddFriendResponseReq") + proto.RegisterType((*AddFriendResponseResp)(nil), "friend.AddFriendResponseResp") + proto.RegisterType((*SetFriendRemarkReq)(nil), "friend.SetFriendRemarkReq") + proto.RegisterType((*SetFriendRemarkResp)(nil), "friend.SetFriendRemarkResp") + proto.RegisterType((*GetSelfApplyListReq)(nil), "friend.GetSelfApplyListReq") + proto.RegisterType((*GetSelfApplyListResp)(nil), "friend.GetSelfApplyListResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Friend service + +type FriendClient interface { + // rpc getFriendsInfo(GetFriendsInfoReq) returns(GetFriendInfoResp); + AddFriend(ctx context.Context, in *AddFriendReq, opts ...grpc.CallOption) (*AddFriendResp, error) + GetFriendApplyList(ctx context.Context, in *GetFriendApplyListReq, opts ...grpc.CallOption) (*GetFriendApplyListResp, error) + GetSelfApplyList(ctx context.Context, in *GetSelfApplyListReq, opts ...grpc.CallOption) (*GetSelfApplyListResp, error) + GetFriendList(ctx context.Context, in *GetFriendListReq, opts ...grpc.CallOption) (*GetFriendListResp, error) + AddBlacklist(ctx context.Context, in *AddBlacklistReq, opts ...grpc.CallOption) (*AddBlacklistResp, error) + RemoveBlacklist(ctx context.Context, in *RemoveBlacklistReq, opts ...grpc.CallOption) (*RemoveBlacklistResp, error) + IsFriend(ctx context.Context, in *IsFriendReq, opts ...grpc.CallOption) (*IsFriendResp, error) + IsInBlackList(ctx context.Context, in *IsInBlackListReq, opts ...grpc.CallOption) (*IsInBlackListResp, error) + GetBlacklist(ctx context.Context, in *GetBlacklistReq, opts ...grpc.CallOption) (*GetBlacklistResp, error) + DeleteFriend(ctx context.Context, in *DeleteFriendReq, opts ...grpc.CallOption) (*DeleteFriendResp, error) + AddFriendResponse(ctx context.Context, in *AddFriendResponseReq, opts ...grpc.CallOption) (*AddFriendResponseResp, error) + SetFriendRemark(ctx context.Context, in *SetFriendRemarkReq, opts ...grpc.CallOption) (*SetFriendRemarkResp, error) + ImportFriend(ctx context.Context, in *ImportFriendReq, opts ...grpc.CallOption) (*ImportFriendResp, error) +} + +type friendClient struct { + cc *grpc.ClientConn +} + +func NewFriendClient(cc *grpc.ClientConn) FriendClient { + return &friendClient{cc} +} + +func (c *friendClient) AddFriend(ctx context.Context, in *AddFriendReq, opts ...grpc.CallOption) (*AddFriendResp, error) { + out := new(AddFriendResp) + err := grpc.Invoke(ctx, "/friend.friend/addFriend", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) GetFriendApplyList(ctx context.Context, in *GetFriendApplyListReq, opts ...grpc.CallOption) (*GetFriendApplyListResp, error) { + out := new(GetFriendApplyListResp) + err := grpc.Invoke(ctx, "/friend.friend/getFriendApplyList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) GetSelfApplyList(ctx context.Context, in *GetSelfApplyListReq, opts ...grpc.CallOption) (*GetSelfApplyListResp, error) { + out := new(GetSelfApplyListResp) + err := grpc.Invoke(ctx, "/friend.friend/getSelfApplyList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) GetFriendList(ctx context.Context, in *GetFriendListReq, opts ...grpc.CallOption) (*GetFriendListResp, error) { + out := new(GetFriendListResp) + err := grpc.Invoke(ctx, "/friend.friend/getFriendList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) AddBlacklist(ctx context.Context, in *AddBlacklistReq, opts ...grpc.CallOption) (*AddBlacklistResp, error) { + out := new(AddBlacklistResp) + err := grpc.Invoke(ctx, "/friend.friend/addBlacklist", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) RemoveBlacklist(ctx context.Context, in *RemoveBlacklistReq, opts ...grpc.CallOption) (*RemoveBlacklistResp, error) { + out := new(RemoveBlacklistResp) + err := grpc.Invoke(ctx, "/friend.friend/removeBlacklist", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) IsFriend(ctx context.Context, in *IsFriendReq, opts ...grpc.CallOption) (*IsFriendResp, error) { + out := new(IsFriendResp) + err := grpc.Invoke(ctx, "/friend.friend/isFriend", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) IsInBlackList(ctx context.Context, in *IsInBlackListReq, opts ...grpc.CallOption) (*IsInBlackListResp, error) { + out := new(IsInBlackListResp) + err := grpc.Invoke(ctx, "/friend.friend/isInBlackList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) GetBlacklist(ctx context.Context, in *GetBlacklistReq, opts ...grpc.CallOption) (*GetBlacklistResp, error) { + out := new(GetBlacklistResp) + err := grpc.Invoke(ctx, "/friend.friend/getBlacklist", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) DeleteFriend(ctx context.Context, in *DeleteFriendReq, opts ...grpc.CallOption) (*DeleteFriendResp, error) { + out := new(DeleteFriendResp) + err := grpc.Invoke(ctx, "/friend.friend/deleteFriend", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) AddFriendResponse(ctx context.Context, in *AddFriendResponseReq, opts ...grpc.CallOption) (*AddFriendResponseResp, error) { + out := new(AddFriendResponseResp) + err := grpc.Invoke(ctx, "/friend.friend/addFriendResponse", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) SetFriendRemark(ctx context.Context, in *SetFriendRemarkReq, opts ...grpc.CallOption) (*SetFriendRemarkResp, error) { + out := new(SetFriendRemarkResp) + err := grpc.Invoke(ctx, "/friend.friend/setFriendRemark", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *friendClient) ImportFriend(ctx context.Context, in *ImportFriendReq, opts ...grpc.CallOption) (*ImportFriendResp, error) { + out := new(ImportFriendResp) + err := grpc.Invoke(ctx, "/friend.friend/importFriend", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Friend service + +type FriendServer interface { + // rpc getFriendsInfo(GetFriendsInfoReq) returns(GetFriendInfoResp); + AddFriend(context.Context, *AddFriendReq) (*AddFriendResp, error) + GetFriendApplyList(context.Context, *GetFriendApplyListReq) (*GetFriendApplyListResp, error) + GetSelfApplyList(context.Context, *GetSelfApplyListReq) (*GetSelfApplyListResp, error) + GetFriendList(context.Context, *GetFriendListReq) (*GetFriendListResp, error) + AddBlacklist(context.Context, *AddBlacklistReq) (*AddBlacklistResp, error) + RemoveBlacklist(context.Context, *RemoveBlacklistReq) (*RemoveBlacklistResp, error) + IsFriend(context.Context, *IsFriendReq) (*IsFriendResp, error) + IsInBlackList(context.Context, *IsInBlackListReq) (*IsInBlackListResp, error) + GetBlacklist(context.Context, *GetBlacklistReq) (*GetBlacklistResp, error) + DeleteFriend(context.Context, *DeleteFriendReq) (*DeleteFriendResp, error) + AddFriendResponse(context.Context, *AddFriendResponseReq) (*AddFriendResponseResp, error) + SetFriendRemark(context.Context, *SetFriendRemarkReq) (*SetFriendRemarkResp, error) + ImportFriend(context.Context, *ImportFriendReq) (*ImportFriendResp, error) +} + +func RegisterFriendServer(s *grpc.Server, srv FriendServer) { + s.RegisterService(&_Friend_serviceDesc, srv) +} + +func _Friend_AddFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddFriendReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).AddFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/AddFriend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).AddFriend(ctx, req.(*AddFriendReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_GetFriendApplyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFriendApplyListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).GetFriendApplyList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/GetFriendApplyList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).GetFriendApplyList(ctx, req.(*GetFriendApplyListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_GetSelfApplyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSelfApplyListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).GetSelfApplyList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/GetSelfApplyList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).GetSelfApplyList(ctx, req.(*GetSelfApplyListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_GetFriendList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFriendListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).GetFriendList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/GetFriendList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).GetFriendList(ctx, req.(*GetFriendListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_AddBlacklist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddBlacklistReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).AddBlacklist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/AddBlacklist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).AddBlacklist(ctx, req.(*AddBlacklistReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_RemoveBlacklist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveBlacklistReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).RemoveBlacklist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/RemoveBlacklist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).RemoveBlacklist(ctx, req.(*RemoveBlacklistReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_IsFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IsFriendReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).IsFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/IsFriend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).IsFriend(ctx, req.(*IsFriendReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_IsInBlackList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IsInBlackListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).IsInBlackList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/IsInBlackList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).IsInBlackList(ctx, req.(*IsInBlackListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_GetBlacklist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlacklistReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).GetBlacklist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/GetBlacklist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).GetBlacklist(ctx, req.(*GetBlacklistReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_DeleteFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteFriendReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).DeleteFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/DeleteFriend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).DeleteFriend(ctx, req.(*DeleteFriendReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_AddFriendResponse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddFriendResponseReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).AddFriendResponse(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/AddFriendResponse", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).AddFriendResponse(ctx, req.(*AddFriendResponseReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_SetFriendRemark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetFriendRemarkReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).SetFriendRemark(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/SetFriendRemark", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).SetFriendRemark(ctx, req.(*SetFriendRemarkReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Friend_ImportFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportFriendReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FriendServer).ImportFriend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/friend.friend/ImportFriend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FriendServer).ImportFriend(ctx, req.(*ImportFriendReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Friend_serviceDesc = grpc.ServiceDesc{ + ServiceName: "friend.friend", + HandlerType: (*FriendServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "addFriend", + Handler: _Friend_AddFriend_Handler, + }, + { + MethodName: "getFriendApplyList", + Handler: _Friend_GetFriendApplyList_Handler, + }, + { + MethodName: "getSelfApplyList", + Handler: _Friend_GetSelfApplyList_Handler, + }, + { + MethodName: "getFriendList", + Handler: _Friend_GetFriendList_Handler, + }, + { + MethodName: "addBlacklist", + Handler: _Friend_AddBlacklist_Handler, + }, + { + MethodName: "removeBlacklist", + Handler: _Friend_RemoveBlacklist_Handler, + }, + { + MethodName: "isFriend", + Handler: _Friend_IsFriend_Handler, + }, + { + MethodName: "isInBlackList", + Handler: _Friend_IsInBlackList_Handler, + }, + { + MethodName: "getBlacklist", + Handler: _Friend_GetBlacklist_Handler, + }, + { + MethodName: "deleteFriend", + Handler: _Friend_DeleteFriend_Handler, + }, + { + MethodName: "addFriendResponse", + Handler: _Friend_AddFriendResponse_Handler, + }, + { + MethodName: "setFriendRemark", + Handler: _Friend_SetFriendRemark_Handler, + }, + { + MethodName: "importFriend", + Handler: _Friend_ImportFriend_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "friend/friend.proto", +} + +func init() { proto.RegisterFile("friend/friend.proto", fileDescriptor_friend_74b4824fb8c5de90) } + +var fileDescriptor_friend_74b4824fb8c5de90 = []byte{ + // 950 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcf, 0x8f, 0xdb, 0x44, + 0x14, 0x96, 0x9b, 0x6e, 0x9a, 0xbc, 0xa4, 0x4d, 0x32, 0xc9, 0x96, 0xe0, 0xee, 0x56, 0xa9, 0x0f, + 0x28, 0xe2, 0x90, 0x48, 0x41, 0x95, 0x58, 0x0a, 0x85, 0x74, 0x93, 0xac, 0x0c, 0x6c, 0x53, 0xcd, + 0x96, 0x0b, 0x42, 0x8a, 0xdc, 0x7a, 0x36, 0x58, 0x71, 0xec, 0xa9, 0xc7, 0xdb, 0x15, 0x37, 0xc4, + 0x89, 0x03, 0x57, 0x24, 0x04, 0x07, 0xfe, 0x55, 0x64, 0x8f, 0x1d, 0xcf, 0xd8, 0xce, 0x0a, 0x9b, + 0x3d, 0x70, 0xda, 0x7d, 0xef, 0xcd, 0xf7, 0xf2, 0x7e, 0xcd, 0xfb, 0xc6, 0xd0, 0xbd, 0xf4, 0x2c, + 0xe2, 0x98, 0x63, 0xfe, 0x67, 0x44, 0x3d, 0xd7, 0x77, 0x51, 0x95, 0x4b, 0xea, 0x93, 0x25, 0x25, + 0xce, 0x4a, 0x3f, 0x1f, 0xd3, 0xcd, 0x7a, 0x1c, 0x9a, 0xc6, 0xcc, 0xdc, 0xac, 0xae, 0xd9, 0xf8, + 0x9a, 0xf1, 0xa3, 0xda, 0x73, 0x80, 0x53, 0x77, 0xbb, 0x75, 0x1d, 0x4c, 0x18, 0x45, 0x7d, 0xb8, + 0x47, 0x3c, 0xef, 0xd4, 0x35, 0x49, 0x5f, 0x19, 0x28, 0xc3, 0x03, 0x1c, 0x8b, 0xe8, 0x21, 0x54, + 0x89, 0xe7, 0x9d, 0xb3, 0x75, 0xff, 0xce, 0x40, 0x19, 0xd6, 0x71, 0x24, 0x69, 0xbf, 0x28, 0x50, + 0x0d, 0x1c, 0xe8, 0x33, 0xa4, 0x42, 0x6d, 0x49, 0xbf, 0x63, 0xc4, 0xd3, 0x67, 0x21, 0xba, 0x8e, + 0x77, 0x32, 0x1a, 0x40, 0x63, 0x49, 0x89, 0x67, 0xf8, 0x96, 0xeb, 0xe8, 0xb3, 0xc8, 0x87, 0xa8, + 0x0a, 0xd0, 0xaf, 0xdd, 0x08, 0x7d, 0x97, 0xa3, 0x63, 0x19, 0x3d, 0x06, 0x58, 0x78, 0xee, 0x36, + 0xb2, 0x1e, 0x84, 0x56, 0x41, 0xa3, 0x3d, 0x83, 0xce, 0x19, 0xf1, 0x17, 0x61, 0xd2, 0x4c, 0x77, + 0x2e, 0x5d, 0x4c, 0xde, 0xa1, 0x8f, 0xe2, 0xc0, 0xc2, 0x60, 0x1a, 0x93, 0x07, 0xa3, 0xa8, 0x46, + 0x5c, 0x8b, 0x23, 0xab, 0xf6, 0x9b, 0x22, 0xa0, 0x39, 0x98, 0x57, 0x62, 0x2e, 0x57, 0x62, 0x9e, + 0x54, 0x62, 0x2e, 0x55, 0x82, 0x4b, 0x68, 0x0e, 0x0f, 0x12, 0x1f, 0xdf, 0x5a, 0xcc, 0xef, 0x57, + 0x06, 0x95, 0x61, 0x63, 0x72, 0x3c, 0x62, 0xc4, 0x7b, 0x4f, 0xbc, 0x95, 0x41, 0xad, 0x15, 0x35, + 0x3c, 0x63, 0xcb, 0x46, 0xc2, 0x8f, 0xa5, 0x40, 0xda, 0x4b, 0x68, 0x4e, 0x4d, 0x93, 0x2b, 0x0b, + 0xa4, 0x11, 0x84, 0x85, 0xc9, 0x3b, 0x21, 0x2c, 0x2e, 0x69, 0xa7, 0x70, 0x5f, 0xf0, 0xc7, 0x28, + 0x9a, 0x88, 0x1d, 0x8f, 0x9c, 0x22, 0xd1, 0x29, 0xb7, 0x60, 0xe1, 0x94, 0xf6, 0x97, 0x02, 0x2d, + 0x7d, 0x4b, 0x5d, 0xcf, 0x4f, 0x02, 0xfb, 0x18, 0xda, 0x5c, 0xe0, 0x4d, 0x08, 0x33, 0x56, 0x06, + 0x95, 0x61, 0x1d, 0x67, 0xf4, 0xff, 0xa2, 0xfd, 0x72, 0x8b, 0x2b, 0xe9, 0x16, 0x4b, 0xc3, 0x75, + 0x57, 0x1e, 0x2e, 0xed, 0x39, 0x34, 0xf9, 0x7f, 0x98, 0xb0, 0x2b, 0xdb, 0x0f, 0x4a, 0x21, 0x8d, + 0x61, 0x24, 0xf1, 0x12, 0x05, 0x27, 0xc2, 0x00, 0x0e, 0x70, 0x24, 0x69, 0xbf, 0x2a, 0xd0, 0x96, + 0xb3, 0x2b, 0x57, 0x26, 0xf4, 0x15, 0xb4, 0xc5, 0x40, 0xc2, 0x92, 0xdc, 0x09, 0x87, 0xa0, 0x17, + 0x23, 0x45, 0x3b, 0xce, 0x9c, 0xd6, 0xbe, 0x84, 0xc3, 0xdd, 0x2c, 0x4e, 0x29, 0xb5, 0x7f, 0x0a, + 0xb4, 0x45, 0xa6, 0xf9, 0x4f, 0x05, 0x1e, 0xe6, 0x79, 0x28, 0x35, 0xd2, 0x2f, 0xa1, 0xb3, 0xeb, + 0xf7, 0x15, 0x61, 0xbe, 0x30, 0xd5, 0x83, 0xbd, 0x53, 0x1d, 0x9d, 0xc5, 0x59, 0xa8, 0xf6, 0x19, + 0xb4, 0x77, 0xb1, 0x15, 0x4d, 0x4c, 0xba, 0xa6, 0xff, 0x21, 0xa7, 0x5b, 0xba, 0xa6, 0x27, 0xd0, + 0x9a, 0x9a, 0xe6, 0x0b, 0xdb, 0x78, 0xbb, 0xb1, 0x0b, 0x66, 0xb2, 0x80, 0xb6, 0x0c, 0x2d, 0x79, + 0x29, 0x3f, 0x07, 0x84, 0xc9, 0xd6, 0x7d, 0x4f, 0x4a, 0x45, 0xa1, 0x43, 0x37, 0x83, 0x2e, 0x19, + 0xc8, 0x09, 0xb4, 0xce, 0x88, 0x5f, 0x2a, 0x8a, 0xdf, 0x95, 0x70, 0x24, 0xe4, 0x18, 0x8a, 0x37, + 0x75, 0x09, 0x9d, 0xd0, 0x45, 0x78, 0x9f, 0xe4, 0xbe, 0x3e, 0xc9, 0xe9, 0xeb, 0xab, 0xab, 0x37, + 0xb6, 0xf5, 0x36, 0x3e, 0x8c, 0xb3, 0x58, 0xed, 0x29, 0x34, 0x74, 0x56, 0x78, 0x09, 0x6b, 0x3f, + 0x40, 0x33, 0x81, 0x95, 0xca, 0x44, 0x85, 0x5a, 0x80, 0x74, 0x1d, 0x46, 0xc2, 0x2d, 0x58, 0xc3, + 0x3b, 0x39, 0xb8, 0x3e, 0x3a, 0xd3, 0x9d, 0x30, 0xda, 0xa2, 0xd7, 0xc7, 0x80, 0x4e, 0x0a, 0x7b, + 0xeb, 0xe1, 0x9d, 0x40, 0x6b, 0x46, 0x6c, 0xe2, 0x93, 0xe2, 0x75, 0x5b, 0x40, 0x5b, 0x86, 0x96, + 0x9c, 0xc4, 0x9f, 0x15, 0xe8, 0x49, 0x6c, 0x17, 0x04, 0x56, 0x84, 0x45, 0x35, 0x68, 0xfe, 0x68, + 0x38, 0xa6, 0x4d, 0x24, 0xa2, 0x90, 0x74, 0xe8, 0x08, 0xea, 0x5c, 0x0e, 0xca, 0xc3, 0x99, 0x2a, + 0x51, 0x68, 0xdf, 0xc0, 0x61, 0x4e, 0x04, 0x25, 0xf3, 0x79, 0x0d, 0xe8, 0x82, 0xec, 0x58, 0x69, + 0x6b, 0x78, 0x9b, 0xc2, 0x4f, 0x82, 0x00, 0x94, 0x3c, 0x09, 0x02, 0x29, 0xb8, 0xfa, 0x19, 0xaf, + 0x25, 0x03, 0xfc, 0x02, 0xba, 0x67, 0xc4, 0xbf, 0x20, 0xf6, 0x65, 0x29, 0xb6, 0xfa, 0x43, 0x81, + 0x5e, 0x16, 0xff, 0x7f, 0xe0, 0xaa, 0xc9, 0xdf, 0xf7, 0x20, 0x7a, 0x46, 0xa3, 0x4f, 0xa1, 0x6e, + 0xc4, 0x2d, 0x45, 0x3b, 0x26, 0x17, 0x5f, 0x69, 0xea, 0x61, 0x8e, 0x96, 0x51, 0x74, 0x01, 0x68, + 0x9d, 0x21, 0x63, 0x74, 0x1c, 0x1f, 0xce, 0xa5, 0x7a, 0xf5, 0xf1, 0x4d, 0x66, 0x46, 0xd1, 0x39, + 0xb4, 0xd7, 0xa9, 0x9a, 0xa1, 0x47, 0x02, 0x26, 0xdd, 0x0d, 0xf5, 0x68, 0xbf, 0x91, 0x51, 0x34, + 0x83, 0xfb, 0x6b, 0x91, 0x57, 0x51, 0x3f, 0xf3, 0xfb, 0xb1, 0xa3, 0x0f, 0xf7, 0x58, 0x18, 0x45, + 0x53, 0x68, 0x1a, 0x02, 0xa9, 0xa1, 0x0f, 0x84, 0x82, 0x88, 0xcc, 0xa0, 0xf6, 0xf3, 0x0d, 0x8c, + 0xa2, 0xaf, 0xa1, 0xe5, 0xc9, 0x8c, 0x84, 0xd4, 0xf8, 0x70, 0x96, 0xe8, 0xd4, 0x47, 0x7b, 0x6d, + 0x8c, 0xa2, 0xa7, 0x50, 0xb3, 0xa2, 0x45, 0x8c, 0xba, 0xf1, 0x41, 0x61, 0xa3, 0xab, 0xbd, 0xac, + 0x92, 0xd7, 0xc2, 0x12, 0xb7, 0x64, 0x52, 0x8b, 0xf4, 0xe2, 0x4d, 0x6a, 0x91, 0x5d, 0xab, 0x53, + 0x68, 0xae, 0x05, 0x4e, 0x4b, 0x6a, 0x91, 0x62, 0x49, 0xb5, 0x9f, 0x6f, 0xe0, 0x2e, 0x4c, 0x61, + 0x21, 0x26, 0x2e, 0x52, 0x1b, 0x36, 0x71, 0x91, 0xd9, 0x9f, 0xaf, 0xa0, 0x63, 0xa4, 0x17, 0x11, + 0x3a, 0xca, 0x9d, 0xd3, 0x68, 0x4b, 0xaa, 0xc7, 0x37, 0x58, 0x79, 0x83, 0x98, 0xbc, 0x37, 0x92, + 0x06, 0x65, 0xd7, 0x54, 0xd2, 0xa0, 0xbc, 0x65, 0x33, 0x85, 0xa6, 0x25, 0x3c, 0xb9, 0x93, 0x04, + 0x53, 0x9f, 0x19, 0x49, 0x82, 0xe9, 0x17, 0xfa, 0x8b, 0xce, 0xf7, 0xad, 0x51, 0xf4, 0xdd, 0xfb, + 0x8c, 0xff, 0x79, 0x53, 0x0d, 0x3f, 0x6a, 0x3f, 0xf9, 0x27, 0x00, 0x00, 0xff, 0xff, 0x26, 0xd5, + 0xdf, 0x90, 0x16, 0x0f, 0x00, 0x00, +} diff --git a/pkg/proto/friend/friend.proto b/pkg/proto/friend/friend.proto new file mode 100644 index 000000000..0050582d1 --- /dev/null +++ b/pkg/proto/friend/friend.proto @@ -0,0 +1,169 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./friend;friend"; +package friend; + +message CommonResp{ + int32 errCode = 1; + string errMsg = 2; +} + +message CommID{ + string OpUserID = 1; + string OperationID = 2; + string ToUserID = 4; + string FromUserID = 5; +} + + +message GetFriendsInfoReq{ + CommID CommID = 1; +} +message GetFriendInfoResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.FriendInfo FriendInfoList = 3; +// int32 IsBlack = 4; +} + + +message AddFriendReq{ + CommID CommID = 1; + string ReqMsg = 2; +} +message AddFriendResp{ + CommonResp CommonResp = 1; +} + + +message ImportFriendReq{ + repeated string FriendUserIDList = 1; + string OperationID = 2; + string FromUserID = 3; + string OpUserID = 4; +} +message UserIDResult{ + string UserID = 1; + int32 Result = 2; +} +message ImportFriendResp{ + CommonResp CommonResp = 1; + repeated UserIDResult UserIDResultList = 2; +} + + +message GetFriendApplyListReq{ + CommID CommID = 1; +} +message GetFriendApplyListResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.FriendRequest FriendRequestList = 3; +} + + +message GetFriendListReq{ + CommID CommID = 1; +} +message GetFriendListResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.FriendInfo FriendInfoList = 3; +} + + +message AddBlacklistReq{ + CommID CommID = 1; +} +message AddBlacklistResp{ + CommonResp CommonResp = 1; +} + + +message RemoveBlacklistReq{ + CommID CommID = 1; +} +message RemoveBlacklistResp{ + CommonResp CommonResp = 1; +} + +message GetBlacklistReq{ + CommID CommID = 1; +} +message GetBlacklistResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.PublicUserInfo BlackUserInfoList = 3; +} + + +message IsFriendReq{ + CommID CommID = 1; +} +message IsFriendResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + bool Response = 3; +} + + +message IsInBlackListReq{ + CommID CommID = 1; +} +message IsInBlackListResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + bool Response = 3; +} + + +message DeleteFriendReq{ + CommID CommID = 1; +} +message DeleteFriendResp{ + CommonResp CommonResp = 1; +} + +//process +message AddFriendResponseReq{ + CommID CommID = 1; + int32 handleResult = 2; + string handleMsg = 3; +} +message AddFriendResponseResp{ + CommonResp CommonResp = 1; +} + +message SetFriendRemarkReq{ + CommID CommID = 1; + string Remark = 2; +} +message SetFriendRemarkResp{ + CommonResp CommonResp = 1; +} + +message GetSelfApplyListReq{ + CommID CommID = 1; +} +message GetSelfApplyListResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.FriendRequest FriendRequestList = 3; +} + +service friend{ + // rpc getFriendsInfo(GetFriendsInfoReq) returns(GetFriendInfoResp); + rpc addFriend(AddFriendReq) returns(AddFriendResp); + rpc getFriendApplyList(GetFriendApplyListReq) returns(GetFriendApplyListResp); + rpc getSelfApplyList(GetSelfApplyListReq) returns(GetSelfApplyListResp); + rpc getFriendList(GetFriendListReq) returns(GetFriendListResp); + rpc addBlacklist(AddBlacklistReq) returns(AddBlacklistResp); + rpc removeBlacklist(RemoveBlacklistReq) returns(RemoveBlacklistResp); + rpc isFriend(IsFriendReq) returns(IsFriendResp); + rpc isInBlackList(IsInBlackListReq) returns(IsInBlackListResp); + rpc getBlacklist(GetBlacklistReq) returns(GetBlacklistResp); + rpc deleteFriend(DeleteFriendReq) returns(DeleteFriendResp); + rpc addFriendResponse(AddFriendResponseReq) returns(AddFriendResponseResp); + rpc setFriendRemark(SetFriendRemarkReq) returns(SetFriendRemarkResp); + rpc importFriend(ImportFriendReq) returns(ImportFriendResp); +} \ No newline at end of file diff --git a/pkg/proto/group/group.pb.go b/pkg/proto/group/group.pb.go new file mode 100644 index 000000000..2f8176fad --- /dev/null +++ b/pkg/proto/group/group.pb.go @@ -0,0 +1,4481 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: group/group.proto + +package group // import "./group" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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 CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GroupAddMemberInfo struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + RoleLevel int32 `protobuf:"varint,2,opt,name=RoleLevel" json:"RoleLevel,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{1} +} +func (m *GroupAddMemberInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupAddMemberInfo.Unmarshal(m, b) +} +func (m *GroupAddMemberInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupAddMemberInfo.Marshal(b, m, deterministic) +} +func (dst *GroupAddMemberInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupAddMemberInfo.Merge(dst, src) +} +func (m *GroupAddMemberInfo) XXX_Size() int { + return xxx_messageInfo_GroupAddMemberInfo.Size(m) +} +func (m *GroupAddMemberInfo) XXX_DiscardUnknown() { + xxx_messageInfo_GroupAddMemberInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupAddMemberInfo proto.InternalMessageInfo + +func (m *GroupAddMemberInfo) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GroupAddMemberInfo) GetRoleLevel() int32 { + if m != nil { + return m.RoleLevel + } + return 0 +} + +type CreateGroupReq struct { + InitMemberList []*GroupAddMemberInfo `protobuf:"bytes,1,rep,name=InitMemberList" json:"InitMemberList,omitempty"` + GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,2,opt,name=GroupInfo" json:"GroupInfo,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,4,opt,name=OpUserID" json:"OpUserID,omitempty"` + OwnerUserID string `protobuf:"bytes,5,opt,name=OwnerUserID" json:"OwnerUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{2} +} +func (m *CreateGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateGroupReq.Unmarshal(m, b) +} +func (m *CreateGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateGroupReq.Marshal(b, m, deterministic) +} +func (dst *CreateGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateGroupReq.Merge(dst, src) +} +func (m *CreateGroupReq) XXX_Size() int { + return xxx_messageInfo_CreateGroupReq.Size(m) +} +func (m *CreateGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_CreateGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateGroupReq proto.InternalMessageInfo + +func (m *CreateGroupReq) GetInitMemberList() []*GroupAddMemberInfo { + if m != nil { + return m.InitMemberList + } + return nil +} + +func (m *CreateGroupReq) GetGroupInfo() *sdk_ws.GroupInfo { + if m != nil { + return m.GroupInfo + } + return nil +} + +func (m *CreateGroupReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *CreateGroupReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *CreateGroupReq) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +type CreateGroupResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,3,opt,name=GroupInfo" json:"GroupInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{3} +} +func (m *CreateGroupResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateGroupResp.Unmarshal(m, b) +} +func (m *CreateGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateGroupResp.Marshal(b, m, deterministic) +} +func (dst *CreateGroupResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateGroupResp.Merge(dst, src) +} +func (m *CreateGroupResp) XXX_Size() int { + return xxx_messageInfo_CreateGroupResp.Size(m) +} +func (m *CreateGroupResp) XXX_DiscardUnknown() { + xxx_messageInfo_CreateGroupResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateGroupResp proto.InternalMessageInfo + +func (m *CreateGroupResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CreateGroupResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *CreateGroupResp) GetGroupInfo() *sdk_ws.GroupInfo { + if m != nil { + return m.GroupInfo + } + return nil +} + +type GetGroupsInfoReq struct { + GroupIDList []string `protobuf:"bytes,1,rep,name=GroupIDList" json:"GroupIDList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{4} +} +func (m *GetGroupsInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupsInfoReq.Unmarshal(m, b) +} +func (m *GetGroupsInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupsInfoReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupsInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupsInfoReq.Merge(dst, src) +} +func (m *GetGroupsInfoReq) XXX_Size() int { + return xxx_messageInfo_GetGroupsInfoReq.Size(m) +} +func (m *GetGroupsInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupsInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupsInfoReq proto.InternalMessageInfo + +func (m *GetGroupsInfoReq) GetGroupIDList() []string { + if m != nil { + return m.GroupIDList + } + return nil +} + +func (m *GetGroupsInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetGroupsInfoReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetGroupsInfoResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + GroupInfoList []*sdk_ws.GroupInfo `protobuf:"bytes,3,rep,name=GroupInfoList" json:"GroupInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{5} +} +func (m *GetGroupsInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupsInfoResp.Unmarshal(m, b) +} +func (m *GetGroupsInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupsInfoResp.Marshal(b, m, deterministic) +} +func (dst *GetGroupsInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupsInfoResp.Merge(dst, src) +} +func (m *GetGroupsInfoResp) XXX_Size() int { + return xxx_messageInfo_GetGroupsInfoResp.Size(m) +} +func (m *GetGroupsInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupsInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupsInfoResp proto.InternalMessageInfo + +func (m *GetGroupsInfoResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetGroupsInfoResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetGroupsInfoResp) GetGroupInfoList() []*sdk_ws.GroupInfo { + if m != nil { + return m.GroupInfoList + } + return nil +} + +type SetGroupInfoReq struct { + GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,1,opt,name=GroupInfo" json:"GroupInfo,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{6} +} +func (m *SetGroupInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetGroupInfoReq.Unmarshal(m, b) +} +func (m *SetGroupInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetGroupInfoReq.Marshal(b, m, deterministic) +} +func (dst *SetGroupInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetGroupInfoReq.Merge(dst, src) +} +func (m *SetGroupInfoReq) XXX_Size() int { + return xxx_messageInfo_SetGroupInfoReq.Size(m) +} +func (m *SetGroupInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetGroupInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetGroupInfoReq proto.InternalMessageInfo + +func (m *SetGroupInfoReq) GetGroupInfo() *sdk_ws.GroupInfo { + if m != nil { + return m.GroupInfo + } + return nil +} + +func (m *SetGroupInfoReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SetGroupInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetGroupInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetGroupInfoResp) Reset() { *m = SetGroupInfoResp{} } +func (m *SetGroupInfoResp) String() string { return proto.CompactTextString(m) } +func (*SetGroupInfoResp) ProtoMessage() {} +func (*SetGroupInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{7} +} +func (m *SetGroupInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetGroupInfoResp.Unmarshal(m, b) +} +func (m *SetGroupInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetGroupInfoResp.Marshal(b, m, deterministic) +} +func (dst *SetGroupInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetGroupInfoResp.Merge(dst, src) +} +func (m *SetGroupInfoResp) XXX_Size() int { + return xxx_messageInfo_SetGroupInfoResp.Size(m) +} +func (m *SetGroupInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetGroupInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetGroupInfoResp proto.InternalMessageInfo + +func (m *SetGroupInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetGroupApplicationListReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + FromUserID string `protobuf:"bytes,3,opt,name=FromUserID" json:"FromUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetGroupApplicationListReq) Reset() { *m = GetGroupApplicationListReq{} } +func (m *GetGroupApplicationListReq) String() string { return proto.CompactTextString(m) } +func (*GetGroupApplicationListReq) ProtoMessage() {} +func (*GetGroupApplicationListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{8} +} +func (m *GetGroupApplicationListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupApplicationListReq.Unmarshal(m, b) +} +func (m *GetGroupApplicationListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupApplicationListReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupApplicationListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupApplicationListReq.Merge(dst, src) +} +func (m *GetGroupApplicationListReq) XXX_Size() int { + return xxx_messageInfo_GetGroupApplicationListReq.Size(m) +} +func (m *GetGroupApplicationListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupApplicationListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupApplicationListReq proto.InternalMessageInfo + +func (m *GetGroupApplicationListReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetGroupApplicationListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetGroupApplicationListReq) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +type GetGroupApplicationListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + GroupRequestList []*sdk_ws.GroupRequest `protobuf:"bytes,3,rep,name=GroupRequestList" json:"GroupRequestList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetGroupApplicationListResp) Reset() { *m = GetGroupApplicationListResp{} } +func (m *GetGroupApplicationListResp) String() string { return proto.CompactTextString(m) } +func (*GetGroupApplicationListResp) ProtoMessage() {} +func (*GetGroupApplicationListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{9} +} +func (m *GetGroupApplicationListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupApplicationListResp.Unmarshal(m, b) +} +func (m *GetGroupApplicationListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupApplicationListResp.Marshal(b, m, deterministic) +} +func (dst *GetGroupApplicationListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupApplicationListResp.Merge(dst, src) +} +func (m *GetGroupApplicationListResp) XXX_Size() int { + return xxx_messageInfo_GetGroupApplicationListResp.Size(m) +} +func (m *GetGroupApplicationListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupApplicationListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupApplicationListResp proto.InternalMessageInfo + +func (m *GetGroupApplicationListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetGroupApplicationListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetGroupApplicationListResp) GetGroupRequestList() []*sdk_ws.GroupRequest { + if m != nil { + return m.GroupRequestList + } + return nil +} + +type GetUserReqApplicationListReq struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserReqApplicationListReq) Reset() { *m = GetUserReqApplicationListReq{} } +func (m *GetUserReqApplicationListReq) String() string { return proto.CompactTextString(m) } +func (*GetUserReqApplicationListReq) ProtoMessage() {} +func (*GetUserReqApplicationListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{10} +} +func (m *GetUserReqApplicationListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserReqApplicationListReq.Unmarshal(m, b) +} +func (m *GetUserReqApplicationListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserReqApplicationListReq.Marshal(b, m, deterministic) +} +func (dst *GetUserReqApplicationListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserReqApplicationListReq.Merge(dst, src) +} +func (m *GetUserReqApplicationListReq) XXX_Size() int { + return xxx_messageInfo_GetUserReqApplicationListReq.Size(m) +} +func (m *GetUserReqApplicationListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserReqApplicationListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserReqApplicationListReq proto.InternalMessageInfo + +func (m *GetUserReqApplicationListReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserReqApplicationListReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetUserReqApplicationListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserReqApplicationListResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + GroupRequestList []*sdk_ws.GroupRequest `protobuf:"bytes,2,rep,name=GroupRequestList" json:"GroupRequestList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserReqApplicationListResp) Reset() { *m = GetUserReqApplicationListResp{} } +func (m *GetUserReqApplicationListResp) String() string { return proto.CompactTextString(m) } +func (*GetUserReqApplicationListResp) ProtoMessage() {} +func (*GetUserReqApplicationListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{11} +} +func (m *GetUserReqApplicationListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserReqApplicationListResp.Unmarshal(m, b) +} +func (m *GetUserReqApplicationListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserReqApplicationListResp.Marshal(b, m, deterministic) +} +func (dst *GetUserReqApplicationListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserReqApplicationListResp.Merge(dst, src) +} +func (m *GetUserReqApplicationListResp) XXX_Size() int { + return xxx_messageInfo_GetUserReqApplicationListResp.Size(m) +} +func (m *GetUserReqApplicationListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserReqApplicationListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserReqApplicationListResp proto.InternalMessageInfo + +func (m *GetUserReqApplicationListResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserReqApplicationListResp) GetGroupRequestList() []*sdk_ws.GroupRequest { + if m != nil { + return m.GroupRequestList + } + return nil +} + +type TransferGroupOwnerReq struct { + GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` + OldOwnerUserID string `protobuf:"bytes,2,opt,name=OldOwnerUserID" json:"OldOwnerUserID,omitempty"` + NewOwnerUserID string `protobuf:"bytes,3,opt,name=NewOwnerUserID" json:"NewOwnerUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,5,opt,name=OpUserID" json:"OpUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{12} +} +func (m *TransferGroupOwnerReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TransferGroupOwnerReq.Unmarshal(m, b) +} +func (m *TransferGroupOwnerReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TransferGroupOwnerReq.Marshal(b, m, deterministic) +} +func (dst *TransferGroupOwnerReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransferGroupOwnerReq.Merge(dst, src) +} +func (m *TransferGroupOwnerReq) XXX_Size() int { + return xxx_messageInfo_TransferGroupOwnerReq.Size(m) +} +func (m *TransferGroupOwnerReq) XXX_DiscardUnknown() { + xxx_messageInfo_TransferGroupOwnerReq.DiscardUnknown(m) +} + +var xxx_messageInfo_TransferGroupOwnerReq proto.InternalMessageInfo + +func (m *TransferGroupOwnerReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *TransferGroupOwnerReq) GetOldOwnerUserID() string { + if m != nil { + return m.OldOwnerUserID + } + return "" +} + +func (m *TransferGroupOwnerReq) GetNewOwnerUserID() string { + if m != nil { + return m.NewOwnerUserID + } + return "" +} + +func (m *TransferGroupOwnerReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *TransferGroupOwnerReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type TransferGroupOwnerResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{13} +} +func (m *TransferGroupOwnerResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TransferGroupOwnerResp.Unmarshal(m, b) +} +func (m *TransferGroupOwnerResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TransferGroupOwnerResp.Marshal(b, m, deterministic) +} +func (dst *TransferGroupOwnerResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransferGroupOwnerResp.Merge(dst, src) +} +func (m *TransferGroupOwnerResp) XXX_Size() int { + return xxx_messageInfo_TransferGroupOwnerResp.Size(m) +} +func (m *TransferGroupOwnerResp) XXX_DiscardUnknown() { + xxx_messageInfo_TransferGroupOwnerResp.DiscardUnknown(m) +} + +var xxx_messageInfo_TransferGroupOwnerResp proto.InternalMessageInfo + +func (m *TransferGroupOwnerResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type JoinGroupReq struct { + GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` + ReqMessage string `protobuf:"bytes,2,opt,name=ReqMessage" json:"ReqMessage,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{14} +} +func (m *JoinGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_JoinGroupReq.Unmarshal(m, b) +} +func (m *JoinGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_JoinGroupReq.Marshal(b, m, deterministic) +} +func (dst *JoinGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_JoinGroupReq.Merge(dst, src) +} +func (m *JoinGroupReq) XXX_Size() int { + return xxx_messageInfo_JoinGroupReq.Size(m) +} +func (m *JoinGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_JoinGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_JoinGroupReq proto.InternalMessageInfo + +func (m *JoinGroupReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *JoinGroupReq) GetReqMessage() string { + if m != nil { + return m.ReqMessage + } + return "" +} + +func (m *JoinGroupReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *JoinGroupReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type JoinGroupResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JoinGroupResp) Reset() { *m = JoinGroupResp{} } +func (m *JoinGroupResp) String() string { return proto.CompactTextString(m) } +func (*JoinGroupResp) ProtoMessage() {} +func (*JoinGroupResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{15} +} +func (m *JoinGroupResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_JoinGroupResp.Unmarshal(m, b) +} +func (m *JoinGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_JoinGroupResp.Marshal(b, m, deterministic) +} +func (dst *JoinGroupResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_JoinGroupResp.Merge(dst, src) +} +func (m *JoinGroupResp) XXX_Size() int { + return xxx_messageInfo_JoinGroupResp.Size(m) +} +func (m *JoinGroupResp) XXX_DiscardUnknown() { + xxx_messageInfo_JoinGroupResp.DiscardUnknown(m) +} + +var xxx_messageInfo_JoinGroupResp proto.InternalMessageInfo + +func (m *JoinGroupResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GroupApplicationResponseReq struct { + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=GroupID" json:"GroupID,omitempty"` + FromUserID string `protobuf:"bytes,4,opt,name=FromUserID" json:"FromUserID,omitempty"` + HandledMsg string `protobuf:"bytes,5,opt,name=HandledMsg" json:"HandledMsg,omitempty"` + HandleResult int32 `protobuf:"varint,6,opt,name=HandleResult" json:"HandleResult,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupApplicationResponseReq) Reset() { *m = GroupApplicationResponseReq{} } +func (m *GroupApplicationResponseReq) String() string { return proto.CompactTextString(m) } +func (*GroupApplicationResponseReq) ProtoMessage() {} +func (*GroupApplicationResponseReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{16} +} +func (m *GroupApplicationResponseReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupApplicationResponseReq.Unmarshal(m, b) +} +func (m *GroupApplicationResponseReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupApplicationResponseReq.Marshal(b, m, deterministic) +} +func (dst *GroupApplicationResponseReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupApplicationResponseReq.Merge(dst, src) +} +func (m *GroupApplicationResponseReq) XXX_Size() int { + return xxx_messageInfo_GroupApplicationResponseReq.Size(m) +} +func (m *GroupApplicationResponseReq) XXX_DiscardUnknown() { + xxx_messageInfo_GroupApplicationResponseReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupApplicationResponseReq proto.InternalMessageInfo + +func (m *GroupApplicationResponseReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GroupApplicationResponseReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GroupApplicationResponseReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GroupApplicationResponseReq) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *GroupApplicationResponseReq) GetHandledMsg() string { + if m != nil { + return m.HandledMsg + } + return "" +} + +func (m *GroupApplicationResponseReq) GetHandleResult() int32 { + if m != nil { + return m.HandleResult + } + return 0 +} + +type GroupApplicationResponseResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupApplicationResponseResp) Reset() { *m = GroupApplicationResponseResp{} } +func (m *GroupApplicationResponseResp) String() string { return proto.CompactTextString(m) } +func (*GroupApplicationResponseResp) ProtoMessage() {} +func (*GroupApplicationResponseResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{17} +} +func (m *GroupApplicationResponseResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupApplicationResponseResp.Unmarshal(m, b) +} +func (m *GroupApplicationResponseResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupApplicationResponseResp.Marshal(b, m, deterministic) +} +func (dst *GroupApplicationResponseResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupApplicationResponseResp.Merge(dst, src) +} +func (m *GroupApplicationResponseResp) XXX_Size() int { + return xxx_messageInfo_GroupApplicationResponseResp.Size(m) +} +func (m *GroupApplicationResponseResp) XXX_DiscardUnknown() { + xxx_messageInfo_GroupApplicationResponseResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupApplicationResponseResp proto.InternalMessageInfo + +func (m *GroupApplicationResponseResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type QuitGroupReq struct { + GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{18} +} +func (m *QuitGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QuitGroupReq.Unmarshal(m, b) +} +func (m *QuitGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QuitGroupReq.Marshal(b, m, deterministic) +} +func (dst *QuitGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuitGroupReq.Merge(dst, src) +} +func (m *QuitGroupReq) XXX_Size() int { + return xxx_messageInfo_QuitGroupReq.Size(m) +} +func (m *QuitGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_QuitGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_QuitGroupReq proto.InternalMessageInfo + +func (m *QuitGroupReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *QuitGroupReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *QuitGroupReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type QuitGroupResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QuitGroupResp) Reset() { *m = QuitGroupResp{} } +func (m *QuitGroupResp) String() string { return proto.CompactTextString(m) } +func (*QuitGroupResp) ProtoMessage() {} +func (*QuitGroupResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{19} +} +func (m *QuitGroupResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QuitGroupResp.Unmarshal(m, b) +} +func (m *QuitGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QuitGroupResp.Marshal(b, m, deterministic) +} +func (dst *QuitGroupResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuitGroupResp.Merge(dst, src) +} +func (m *QuitGroupResp) XXX_Size() int { + return xxx_messageInfo_QuitGroupResp.Size(m) +} +func (m *QuitGroupResp) XXX_DiscardUnknown() { + xxx_messageInfo_QuitGroupResp.DiscardUnknown(m) +} + +var xxx_messageInfo_QuitGroupResp proto.InternalMessageInfo + +func (m *QuitGroupResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetGroupMemberListReq struct { + GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + Filter int32 `protobuf:"varint,4,opt,name=Filter" json:"Filter,omitempty"` + NextSeq int32 `protobuf:"varint,5,opt,name=NextSeq" json:"NextSeq,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{20} +} +func (m *GetGroupMemberListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupMemberListReq.Unmarshal(m, b) +} +func (m *GetGroupMemberListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupMemberListReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupMemberListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupMemberListReq.Merge(dst, src) +} +func (m *GetGroupMemberListReq) XXX_Size() int { + return xxx_messageInfo_GetGroupMemberListReq.Size(m) +} +func (m *GetGroupMemberListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupMemberListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupMemberListReq proto.InternalMessageInfo + +func (m *GetGroupMemberListReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GetGroupMemberListReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetGroupMemberListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetGroupMemberListReq) GetFilter() int32 { + if m != nil { + return m.Filter + } + return 0 +} + +func (m *GetGroupMemberListReq) GetNextSeq() int32 { + if m != nil { + return m.NextSeq + } + return 0 +} + +type GetGroupMemberListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + MemberList []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList" json:"memberList,omitempty"` + NextSeq int32 `protobuf:"varint,4,opt,name=nextSeq" json:"nextSeq,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{21} +} +func (m *GetGroupMemberListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupMemberListResp.Unmarshal(m, b) +} +func (m *GetGroupMemberListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupMemberListResp.Marshal(b, m, deterministic) +} +func (dst *GetGroupMemberListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupMemberListResp.Merge(dst, src) +} +func (m *GetGroupMemberListResp) XXX_Size() int { + return xxx_messageInfo_GetGroupMemberListResp.Size(m) +} +func (m *GetGroupMemberListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupMemberListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupMemberListResp proto.InternalMessageInfo + +func (m *GetGroupMemberListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetGroupMemberListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetGroupMemberListResp) GetMemberList() []*sdk_ws.GroupMemberFullInfo { + if m != nil { + return m.MemberList + } + return nil +} + +func (m *GetGroupMemberListResp) GetNextSeq() int32 { + if m != nil { + return m.NextSeq + } + return 0 +} + +type GetGroupMembersInfoReq struct { + GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` + MemberList []string `protobuf:"bytes,2,rep,name=memberList" json:"memberList,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{22} +} +func (m *GetGroupMembersInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupMembersInfoReq.Unmarshal(m, b) +} +func (m *GetGroupMembersInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupMembersInfoReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupMembersInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupMembersInfoReq.Merge(dst, src) +} +func (m *GetGroupMembersInfoReq) XXX_Size() int { + return xxx_messageInfo_GetGroupMembersInfoReq.Size(m) +} +func (m *GetGroupMembersInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupMembersInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupMembersInfoReq proto.InternalMessageInfo + +func (m *GetGroupMembersInfoReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GetGroupMembersInfoReq) GetMemberList() []string { + if m != nil { + return m.MemberList + } + return nil +} + +func (m *GetGroupMembersInfoReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetGroupMembersInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetGroupMembersInfoResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + MemberList []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList" json:"memberList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{23} +} +func (m *GetGroupMembersInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupMembersInfoResp.Unmarshal(m, b) +} +func (m *GetGroupMembersInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupMembersInfoResp.Marshal(b, m, deterministic) +} +func (dst *GetGroupMembersInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupMembersInfoResp.Merge(dst, src) +} +func (m *GetGroupMembersInfoResp) XXX_Size() int { + return xxx_messageInfo_GetGroupMembersInfoResp.Size(m) +} +func (m *GetGroupMembersInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupMembersInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupMembersInfoResp proto.InternalMessageInfo + +func (m *GetGroupMembersInfoResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetGroupMembersInfoResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetGroupMembersInfoResp) GetMemberList() []*sdk_ws.GroupMemberFullInfo { + if m != nil { + return m.MemberList + } + return nil +} + +type KickGroupMemberReq struct { + GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` + KickedUserIDList []string `protobuf:"bytes,2,rep,name=KickedUserIDList" json:"KickedUserIDList,omitempty"` + Reason string `protobuf:"bytes,3,opt,name=Reason" json:"Reason,omitempty"` + OperationID string `protobuf:"bytes,5,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserID string `protobuf:"bytes,6,opt,name=OpUserID" json:"OpUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{24} +} +func (m *KickGroupMemberReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KickGroupMemberReq.Unmarshal(m, b) +} +func (m *KickGroupMemberReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KickGroupMemberReq.Marshal(b, m, deterministic) +} +func (dst *KickGroupMemberReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_KickGroupMemberReq.Merge(dst, src) +} +func (m *KickGroupMemberReq) XXX_Size() int { + return xxx_messageInfo_KickGroupMemberReq.Size(m) +} +func (m *KickGroupMemberReq) XXX_DiscardUnknown() { + xxx_messageInfo_KickGroupMemberReq.DiscardUnknown(m) +} + +var xxx_messageInfo_KickGroupMemberReq proto.InternalMessageInfo + +func (m *KickGroupMemberReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *KickGroupMemberReq) GetKickedUserIDList() []string { + if m != nil { + return m.KickedUserIDList + } + return nil +} + +func (m *KickGroupMemberReq) GetReason() string { + if m != nil { + return m.Reason + } + return "" +} + +func (m *KickGroupMemberReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *KickGroupMemberReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type Id2Result struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + Result int32 `protobuf:"varint,2,opt,name=Result" json:"Result,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{25} +} +func (m *Id2Result) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Id2Result.Unmarshal(m, b) +} +func (m *Id2Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Id2Result.Marshal(b, m, deterministic) +} +func (dst *Id2Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Id2Result.Merge(dst, src) +} +func (m *Id2Result) XXX_Size() int { + return xxx_messageInfo_Id2Result.Size(m) +} +func (m *Id2Result) XXX_DiscardUnknown() { + xxx_messageInfo_Id2Result.DiscardUnknown(m) +} + +var xxx_messageInfo_Id2Result proto.InternalMessageInfo + +func (m *Id2Result) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *Id2Result) GetResult() int32 { + if m != nil { + return m.Result + } + return 0 +} + +type KickGroupMemberResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + Id2ResultList []*Id2Result `protobuf:"bytes,3,rep,name=Id2ResultList" json:"Id2ResultList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{26} +} +func (m *KickGroupMemberResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_KickGroupMemberResp.Unmarshal(m, b) +} +func (m *KickGroupMemberResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_KickGroupMemberResp.Marshal(b, m, deterministic) +} +func (dst *KickGroupMemberResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_KickGroupMemberResp.Merge(dst, src) +} +func (m *KickGroupMemberResp) XXX_Size() int { + return xxx_messageInfo_KickGroupMemberResp.Size(m) +} +func (m *KickGroupMemberResp) XXX_DiscardUnknown() { + xxx_messageInfo_KickGroupMemberResp.DiscardUnknown(m) +} + +var xxx_messageInfo_KickGroupMemberResp proto.InternalMessageInfo + +func (m *KickGroupMemberResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *KickGroupMemberResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *KickGroupMemberResp) GetId2ResultList() []*Id2Result { + if m != nil { + return m.Id2ResultList + } + return nil +} + +type GetJoinedGroupListReq struct { + FromUserID string `protobuf:"bytes,1,opt,name=FromUserID" json:"FromUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{27} +} +func (m *GetJoinedGroupListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinedGroupListReq.Unmarshal(m, b) +} +func (m *GetJoinedGroupListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinedGroupListReq.Marshal(b, m, deterministic) +} +func (dst *GetJoinedGroupListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinedGroupListReq.Merge(dst, src) +} +func (m *GetJoinedGroupListReq) XXX_Size() int { + return xxx_messageInfo_GetJoinedGroupListReq.Size(m) +} +func (m *GetJoinedGroupListReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinedGroupListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetJoinedGroupListReq proto.InternalMessageInfo + +func (m *GetJoinedGroupListReq) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *GetJoinedGroupListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetJoinedGroupListReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetJoinedGroupListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + GroupList []*sdk_ws.GroupInfo `protobuf:"bytes,3,rep,name=GroupList" json:"GroupList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{28} +} +func (m *GetJoinedGroupListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetJoinedGroupListResp.Unmarshal(m, b) +} +func (m *GetJoinedGroupListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetJoinedGroupListResp.Marshal(b, m, deterministic) +} +func (dst *GetJoinedGroupListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetJoinedGroupListResp.Merge(dst, src) +} +func (m *GetJoinedGroupListResp) XXX_Size() int { + return xxx_messageInfo_GetJoinedGroupListResp.Size(m) +} +func (m *GetJoinedGroupListResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetJoinedGroupListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetJoinedGroupListResp proto.InternalMessageInfo + +func (m *GetJoinedGroupListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetJoinedGroupListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetJoinedGroupListResp) GetGroupList() []*sdk_ws.GroupInfo { + if m != nil { + return m.GroupList + } + return nil +} + +type InviteUserToGroupReq struct { + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=GroupID" json:"GroupID,omitempty"` + Reason string `protobuf:"bytes,4,opt,name=Reason" json:"Reason,omitempty"` + InvitedUserIDList []string `protobuf:"bytes,5,rep,name=InvitedUserIDList" json:"InvitedUserIDList,omitempty"` + OpUserID string `protobuf:"bytes,6,opt,name=OpUserID" json:"OpUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{29} +} +func (m *InviteUserToGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InviteUserToGroupReq.Unmarshal(m, b) +} +func (m *InviteUserToGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InviteUserToGroupReq.Marshal(b, m, deterministic) +} +func (dst *InviteUserToGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_InviteUserToGroupReq.Merge(dst, src) +} +func (m *InviteUserToGroupReq) XXX_Size() int { + return xxx_messageInfo_InviteUserToGroupReq.Size(m) +} +func (m *InviteUserToGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_InviteUserToGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_InviteUserToGroupReq proto.InternalMessageInfo + +func (m *InviteUserToGroupReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *InviteUserToGroupReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *InviteUserToGroupReq) GetReason() string { + if m != nil { + return m.Reason + } + return "" +} + +func (m *InviteUserToGroupReq) GetInvitedUserIDList() []string { + if m != nil { + return m.InvitedUserIDList + } + return nil +} + +func (m *InviteUserToGroupReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type InviteUserToGroupResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + Id2ResultList []*Id2Result `protobuf:"bytes,3,rep,name=Id2ResultList" json:"Id2ResultList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{30} +} +func (m *InviteUserToGroupResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InviteUserToGroupResp.Unmarshal(m, b) +} +func (m *InviteUserToGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InviteUserToGroupResp.Marshal(b, m, deterministic) +} +func (dst *InviteUserToGroupResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_InviteUserToGroupResp.Merge(dst, src) +} +func (m *InviteUserToGroupResp) XXX_Size() int { + return xxx_messageInfo_InviteUserToGroupResp.Size(m) +} +func (m *InviteUserToGroupResp) XXX_DiscardUnknown() { + xxx_messageInfo_InviteUserToGroupResp.DiscardUnknown(m) +} + +var xxx_messageInfo_InviteUserToGroupResp proto.InternalMessageInfo + +func (m *InviteUserToGroupResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *InviteUserToGroupResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *InviteUserToGroupResp) GetId2ResultList() []*Id2Result { + if m != nil { + return m.Id2ResultList + } + return nil +} + +type GetGroupAllMemberReq struct { + GroupID string `protobuf:"bytes,1,opt,name=GroupID" json:"GroupID,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{31} +} +func (m *GetGroupAllMemberReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupAllMemberReq.Unmarshal(m, b) +} +func (m *GetGroupAllMemberReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupAllMemberReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupAllMemberReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupAllMemberReq.Merge(dst, src) +} +func (m *GetGroupAllMemberReq) XXX_Size() int { + return xxx_messageInfo_GetGroupAllMemberReq.Size(m) +} +func (m *GetGroupAllMemberReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupAllMemberReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupAllMemberReq proto.InternalMessageInfo + +func (m *GetGroupAllMemberReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GetGroupAllMemberReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetGroupAllMemberReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetGroupAllMemberResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=ErrCode" json:"ErrCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=ErrMsg" json:"ErrMsg,omitempty"` + MemberList []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList" json:"memberList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_3c77315b028a1402, []int{32} +} +func (m *GetGroupAllMemberResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupAllMemberResp.Unmarshal(m, b) +} +func (m *GetGroupAllMemberResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupAllMemberResp.Marshal(b, m, deterministic) +} +func (dst *GetGroupAllMemberResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupAllMemberResp.Merge(dst, src) +} +func (m *GetGroupAllMemberResp) XXX_Size() int { + return xxx_messageInfo_GetGroupAllMemberResp.Size(m) +} +func (m *GetGroupAllMemberResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupAllMemberResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupAllMemberResp proto.InternalMessageInfo + +func (m *GetGroupAllMemberResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetGroupAllMemberResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetGroupAllMemberResp) GetMemberList() []*sdk_ws.GroupMemberFullInfo { + if m != nil { + return m.MemberList + } + return nil +} + +type CMSGroup struct { + GroupInfo *sdk_ws.GroupInfo `protobuf:"bytes,1,opt,name=GroupInfo" json:"GroupInfo,omitempty"` + GroupMasterName string `protobuf:"bytes,2,opt,name=GroupMasterName" json:"GroupMasterName,omitempty"` + GroupMasterId string `protobuf:"bytes,3,opt,name=GroupMasterId" json:"GroupMasterId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CMSGroup) Reset() { *m = CMSGroup{} } +func (m *CMSGroup) String() string { return proto.CompactTextString(m) } +func (*CMSGroup) ProtoMessage() {} +func (*CMSGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{33} +} +func (m *CMSGroup) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CMSGroup.Unmarshal(m, b) +} +func (m *CMSGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CMSGroup.Marshal(b, m, deterministic) +} +func (dst *CMSGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_CMSGroup.Merge(dst, src) +} +func (m *CMSGroup) XXX_Size() int { + return xxx_messageInfo_CMSGroup.Size(m) +} +func (m *CMSGroup) XXX_DiscardUnknown() { + xxx_messageInfo_CMSGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_CMSGroup proto.InternalMessageInfo + +func (m *CMSGroup) GetGroupInfo() *sdk_ws.GroupInfo { + if m != nil { + return m.GroupInfo + } + return nil +} + +func (m *CMSGroup) GetGroupMasterName() string { + if m != nil { + return m.GroupMasterName + } + return "" +} + +func (m *CMSGroup) GetGroupMasterId() string { + if m != nil { + return m.GroupMasterId + } + return "" +} + +type GetGroupReq struct { + GroupName string `protobuf:"bytes,1,opt,name=GroupName" json:"GroupName,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetGroupReq) Reset() { *m = GetGroupReq{} } +func (m *GetGroupReq) String() string { return proto.CompactTextString(m) } +func (*GetGroupReq) ProtoMessage() {} +func (*GetGroupReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{34} +} +func (m *GetGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupReq.Unmarshal(m, b) +} +func (m *GetGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupReq.Merge(dst, src) +} +func (m *GetGroupReq) XXX_Size() int { + return xxx_messageInfo_GetGroupReq.Size(m) +} +func (m *GetGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupReq proto.InternalMessageInfo + +func (m *GetGroupReq) GetGroupName() string { + if m != nil { + return m.GroupName + } + return "" +} + +func (m *GetGroupReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetGroupReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetGroupResp struct { + CMSGroups []*CMSGroup `protobuf:"bytes,1,rep,name=CMSGroups" json:"CMSGroups,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + GroupNums int32 `protobuf:"varint,3,opt,name=GroupNums" json:"GroupNums,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetGroupResp) Reset() { *m = GetGroupResp{} } +func (m *GetGroupResp) String() string { return proto.CompactTextString(m) } +func (*GetGroupResp) ProtoMessage() {} +func (*GetGroupResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{35} +} +func (m *GetGroupResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupResp.Unmarshal(m, b) +} +func (m *GetGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupResp.Marshal(b, m, deterministic) +} +func (dst *GetGroupResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupResp.Merge(dst, src) +} +func (m *GetGroupResp) XXX_Size() int { + return xxx_messageInfo_GetGroupResp.Size(m) +} +func (m *GetGroupResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupResp proto.InternalMessageInfo + +func (m *GetGroupResp) GetCMSGroups() []*CMSGroup { + if m != nil { + return m.CMSGroups + } + return nil +} + +func (m *GetGroupResp) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetGroupResp) GetGroupNums() int32 { + if m != nil { + return m.GroupNums + } + return 0 +} + +type GetGroupsReq struct { + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=Pagination" json:"Pagination,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 *GetGroupsReq) Reset() { *m = GetGroupsReq{} } +func (m *GetGroupsReq) String() string { return proto.CompactTextString(m) } +func (*GetGroupsReq) ProtoMessage() {} +func (*GetGroupsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{36} +} +func (m *GetGroupsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupsReq.Unmarshal(m, b) +} +func (m *GetGroupsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupsReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupsReq.Merge(dst, src) +} +func (m *GetGroupsReq) XXX_Size() int { + return xxx_messageInfo_GetGroupsReq.Size(m) +} +func (m *GetGroupsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupsReq proto.InternalMessageInfo + +func (m *GetGroupsReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetGroupsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetGroupsResp struct { + CMSGroups []*CMSGroup `protobuf:"bytes,1,rep,name=CMSGroups" json:"CMSGroups,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + GroupNum int32 `protobuf:"varint,3,opt,name=GroupNum" json:"GroupNum,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetGroupsResp) Reset() { *m = GetGroupsResp{} } +func (m *GetGroupsResp) String() string { return proto.CompactTextString(m) } +func (*GetGroupsResp) ProtoMessage() {} +func (*GetGroupsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{37} +} +func (m *GetGroupsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupsResp.Unmarshal(m, b) +} +func (m *GetGroupsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupsResp.Marshal(b, m, deterministic) +} +func (dst *GetGroupsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupsResp.Merge(dst, src) +} +func (m *GetGroupsResp) XXX_Size() int { + return xxx_messageInfo_GetGroupsResp.Size(m) +} +func (m *GetGroupsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupsResp proto.InternalMessageInfo + +func (m *GetGroupsResp) GetCMSGroups() []*CMSGroup { + if m != nil { + return m.CMSGroups + } + return nil +} + +func (m *GetGroupsResp) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetGroupsResp) GetGroupNum() int32 { + if m != nil { + return m.GroupNum + } + return 0 +} + +type GetGroupMemberReq struct { + GroupId string `protobuf:"bytes,1,opt,name=GroupId" json:"GroupId,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 *GetGroupMemberReq) Reset() { *m = GetGroupMemberReq{} } +func (m *GetGroupMemberReq) String() string { return proto.CompactTextString(m) } +func (*GetGroupMemberReq) ProtoMessage() {} +func (*GetGroupMemberReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{38} +} +func (m *GetGroupMemberReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupMemberReq.Unmarshal(m, b) +} +func (m *GetGroupMemberReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupMemberReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupMemberReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupMemberReq.Merge(dst, src) +} +func (m *GetGroupMemberReq) XXX_Size() int { + return xxx_messageInfo_GetGroupMemberReq.Size(m) +} +func (m *GetGroupMemberReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupMemberReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupMemberReq proto.InternalMessageInfo + +func (m *GetGroupMemberReq) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *GetGroupMemberReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type OperateGroupStatusReq struct { + GroupId string `protobuf:"bytes,1,opt,name=GroupId" json:"GroupId,omitempty"` + Status int32 `protobuf:"varint,2,opt,name=Status" json:"Status,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OperateGroupStatusReq) Reset() { *m = OperateGroupStatusReq{} } +func (m *OperateGroupStatusReq) String() string { return proto.CompactTextString(m) } +func (*OperateGroupStatusReq) ProtoMessage() {} +func (*OperateGroupStatusReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{39} +} +func (m *OperateGroupStatusReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OperateGroupStatusReq.Unmarshal(m, b) +} +func (m *OperateGroupStatusReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OperateGroupStatusReq.Marshal(b, m, deterministic) +} +func (dst *OperateGroupStatusReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperateGroupStatusReq.Merge(dst, src) +} +func (m *OperateGroupStatusReq) XXX_Size() int { + return xxx_messageInfo_OperateGroupStatusReq.Size(m) +} +func (m *OperateGroupStatusReq) XXX_DiscardUnknown() { + xxx_messageInfo_OperateGroupStatusReq.DiscardUnknown(m) +} + +var xxx_messageInfo_OperateGroupStatusReq proto.InternalMessageInfo + +func (m *OperateGroupStatusReq) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *OperateGroupStatusReq) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *OperateGroupStatusReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type OperateGroupStatusResp struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OperateGroupStatusResp) Reset() { *m = OperateGroupStatusResp{} } +func (m *OperateGroupStatusResp) String() string { return proto.CompactTextString(m) } +func (*OperateGroupStatusResp) ProtoMessage() {} +func (*OperateGroupStatusResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{40} +} +func (m *OperateGroupStatusResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OperateGroupStatusResp.Unmarshal(m, b) +} +func (m *OperateGroupStatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OperateGroupStatusResp.Marshal(b, m, deterministic) +} +func (dst *OperateGroupStatusResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperateGroupStatusResp.Merge(dst, src) +} +func (m *OperateGroupStatusResp) XXX_Size() int { + return xxx_messageInfo_OperateGroupStatusResp.Size(m) +} +func (m *OperateGroupStatusResp) XXX_DiscardUnknown() { + xxx_messageInfo_OperateGroupStatusResp.DiscardUnknown(m) +} + +var xxx_messageInfo_OperateGroupStatusResp proto.InternalMessageInfo + +type OperateUserRoleReq struct { + GroupId string `protobuf:"bytes,1,opt,name=GroupId" json:"GroupId,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=UserId" json:"UserId,omitempty"` + RoleLevel int32 `protobuf:"varint,3,opt,name=RoleLevel" json:"RoleLevel,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OperateUserRoleReq) Reset() { *m = OperateUserRoleReq{} } +func (m *OperateUserRoleReq) String() string { return proto.CompactTextString(m) } +func (*OperateUserRoleReq) ProtoMessage() {} +func (*OperateUserRoleReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{41} +} +func (m *OperateUserRoleReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OperateUserRoleReq.Unmarshal(m, b) +} +func (m *OperateUserRoleReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OperateUserRoleReq.Marshal(b, m, deterministic) +} +func (dst *OperateUserRoleReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperateUserRoleReq.Merge(dst, src) +} +func (m *OperateUserRoleReq) XXX_Size() int { + return xxx_messageInfo_OperateUserRoleReq.Size(m) +} +func (m *OperateUserRoleReq) XXX_DiscardUnknown() { + xxx_messageInfo_OperateUserRoleReq.DiscardUnknown(m) +} + +var xxx_messageInfo_OperateUserRoleReq proto.InternalMessageInfo + +func (m *OperateUserRoleReq) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *OperateUserRoleReq) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *OperateUserRoleReq) GetRoleLevel() int32 { + if m != nil { + return m.RoleLevel + } + return 0 +} + +func (m *OperateUserRoleReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type OperateUserRoleResp struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OperateUserRoleResp) Reset() { *m = OperateUserRoleResp{} } +func (m *OperateUserRoleResp) String() string { return proto.CompactTextString(m) } +func (*OperateUserRoleResp) ProtoMessage() {} +func (*OperateUserRoleResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{42} +} +func (m *OperateUserRoleResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OperateUserRoleResp.Unmarshal(m, b) +} +func (m *OperateUserRoleResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OperateUserRoleResp.Marshal(b, m, deterministic) +} +func (dst *OperateUserRoleResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperateUserRoleResp.Merge(dst, src) +} +func (m *OperateUserRoleResp) XXX_Size() int { + return xxx_messageInfo_OperateUserRoleResp.Size(m) +} +func (m *OperateUserRoleResp) XXX_DiscardUnknown() { + xxx_messageInfo_OperateUserRoleResp.DiscardUnknown(m) +} + +var xxx_messageInfo_OperateUserRoleResp proto.InternalMessageInfo + +type DeleteGroupReq struct { + GroupId string `protobuf:"bytes,1,opt,name=GroupId" json:"GroupId,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 *DeleteGroupReq) Reset() { *m = DeleteGroupReq{} } +func (m *DeleteGroupReq) String() string { return proto.CompactTextString(m) } +func (*DeleteGroupReq) ProtoMessage() {} +func (*DeleteGroupReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{43} +} +func (m *DeleteGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteGroupReq.Unmarshal(m, b) +} +func (m *DeleteGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteGroupReq.Marshal(b, m, deterministic) +} +func (dst *DeleteGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteGroupReq.Merge(dst, src) +} +func (m *DeleteGroupReq) XXX_Size() int { + return xxx_messageInfo_DeleteGroupReq.Size(m) +} +func (m *DeleteGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteGroupReq proto.InternalMessageInfo + +func (m *DeleteGroupReq) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *DeleteGroupReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type DeleteGroupResp struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteGroupResp) Reset() { *m = DeleteGroupResp{} } +func (m *DeleteGroupResp) String() string { return proto.CompactTextString(m) } +func (*DeleteGroupResp) ProtoMessage() {} +func (*DeleteGroupResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{44} +} +func (m *DeleteGroupResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteGroupResp.Unmarshal(m, b) +} +func (m *DeleteGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteGroupResp.Marshal(b, m, deterministic) +} +func (dst *DeleteGroupResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteGroupResp.Merge(dst, src) +} +func (m *DeleteGroupResp) XXX_Size() int { + return xxx_messageInfo_DeleteGroupResp.Size(m) +} +func (m *DeleteGroupResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteGroupResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteGroupResp proto.InternalMessageInfo + +type GetGroupByIdReq struct { + GroupId string `protobuf:"bytes,1,opt,name=GroupId" json:"GroupId,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 *GetGroupByIdReq) Reset() { *m = GetGroupByIdReq{} } +func (m *GetGroupByIdReq) String() string { return proto.CompactTextString(m) } +func (*GetGroupByIdReq) ProtoMessage() {} +func (*GetGroupByIdReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{45} +} +func (m *GetGroupByIdReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupByIdReq.Unmarshal(m, b) +} +func (m *GetGroupByIdReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupByIdReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupByIdReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupByIdReq.Merge(dst, src) +} +func (m *GetGroupByIdReq) XXX_Size() int { + return xxx_messageInfo_GetGroupByIdReq.Size(m) +} +func (m *GetGroupByIdReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupByIdReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupByIdReq proto.InternalMessageInfo + +func (m *GetGroupByIdReq) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *GetGroupByIdReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetGroupByIdResp struct { + CMSGroup *CMSGroup `protobuf:"bytes,1,opt,name=CMSGroup" json:"CMSGroup,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetGroupByIdResp) Reset() { *m = GetGroupByIdResp{} } +func (m *GetGroupByIdResp) String() string { return proto.CompactTextString(m) } +func (*GetGroupByIdResp) ProtoMessage() {} +func (*GetGroupByIdResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{46} +} +func (m *GetGroupByIdResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupByIdResp.Unmarshal(m, b) +} +func (m *GetGroupByIdResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupByIdResp.Marshal(b, m, deterministic) +} +func (dst *GetGroupByIdResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupByIdResp.Merge(dst, src) +} +func (m *GetGroupByIdResp) XXX_Size() int { + return xxx_messageInfo_GetGroupByIdResp.Size(m) +} +func (m *GetGroupByIdResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupByIdResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupByIdResp proto.InternalMessageInfo + +func (m *GetGroupByIdResp) GetCMSGroup() *CMSGroup { + if m != nil { + return m.CMSGroup + } + return nil +} + +type GetGroupMembersCMSReq struct { + GroupId string `protobuf:"bytes,1,opt,name=GroupId" json:"GroupId,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=UserName" json:"UserName,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetGroupMembersCMSReq) Reset() { *m = GetGroupMembersCMSReq{} } +func (m *GetGroupMembersCMSReq) String() string { return proto.CompactTextString(m) } +func (*GetGroupMembersCMSReq) ProtoMessage() {} +func (*GetGroupMembersCMSReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{47} +} +func (m *GetGroupMembersCMSReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupMembersCMSReq.Unmarshal(m, b) +} +func (m *GetGroupMembersCMSReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupMembersCMSReq.Marshal(b, m, deterministic) +} +func (dst *GetGroupMembersCMSReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupMembersCMSReq.Merge(dst, src) +} +func (m *GetGroupMembersCMSReq) XXX_Size() int { + return xxx_messageInfo_GetGroupMembersCMSReq.Size(m) +} +func (m *GetGroupMembersCMSReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupMembersCMSReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupMembersCMSReq proto.InternalMessageInfo + +func (m *GetGroupMembersCMSReq) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *GetGroupMembersCMSReq) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +func (m *GetGroupMembersCMSReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetGroupMembersCMSReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetGroupMembersCMSResp struct { + Members []*sdk_ws.GroupMemberFullInfo `protobuf:"bytes,1,rep,name=members" json:"members,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + MemberNums int32 `protobuf:"varint,3,opt,name=MemberNums" json:"MemberNums,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetGroupMembersCMSResp) Reset() { *m = GetGroupMembersCMSResp{} } +func (m *GetGroupMembersCMSResp) String() string { return proto.CompactTextString(m) } +func (*GetGroupMembersCMSResp) ProtoMessage() {} +func (*GetGroupMembersCMSResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{48} +} +func (m *GetGroupMembersCMSResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetGroupMembersCMSResp.Unmarshal(m, b) +} +func (m *GetGroupMembersCMSResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetGroupMembersCMSResp.Marshal(b, m, deterministic) +} +func (dst *GetGroupMembersCMSResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetGroupMembersCMSResp.Merge(dst, src) +} +func (m *GetGroupMembersCMSResp) XXX_Size() int { + return xxx_messageInfo_GetGroupMembersCMSResp.Size(m) +} +func (m *GetGroupMembersCMSResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetGroupMembersCMSResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetGroupMembersCMSResp proto.InternalMessageInfo + +func (m *GetGroupMembersCMSResp) GetMembers() []*sdk_ws.GroupMemberFullInfo { + if m != nil { + return m.Members + } + return nil +} + +func (m *GetGroupMembersCMSResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetGroupMembersCMSResp) GetMemberNums() int32 { + if m != nil { + return m.MemberNums + } + return 0 +} + +type RemoveGroupMembersCMSReq struct { + GroupId string `protobuf:"bytes,1,opt,name=GroupId" json:"GroupId,omitempty"` + UserIds []string `protobuf:"bytes,2,rep,name=UserIds" json:"UserIds,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserId string `protobuf:"bytes,4,opt,name=OpUserId" json:"OpUserId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveGroupMembersCMSReq) Reset() { *m = RemoveGroupMembersCMSReq{} } +func (m *RemoveGroupMembersCMSReq) String() string { return proto.CompactTextString(m) } +func (*RemoveGroupMembersCMSReq) ProtoMessage() {} +func (*RemoveGroupMembersCMSReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{49} +} +func (m *RemoveGroupMembersCMSReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveGroupMembersCMSReq.Unmarshal(m, b) +} +func (m *RemoveGroupMembersCMSReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveGroupMembersCMSReq.Marshal(b, m, deterministic) +} +func (dst *RemoveGroupMembersCMSReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveGroupMembersCMSReq.Merge(dst, src) +} +func (m *RemoveGroupMembersCMSReq) XXX_Size() int { + return xxx_messageInfo_RemoveGroupMembersCMSReq.Size(m) +} +func (m *RemoveGroupMembersCMSReq) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveGroupMembersCMSReq.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveGroupMembersCMSReq proto.InternalMessageInfo + +func (m *RemoveGroupMembersCMSReq) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *RemoveGroupMembersCMSReq) GetUserIds() []string { + if m != nil { + return m.UserIds + } + return nil +} + +func (m *RemoveGroupMembersCMSReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *RemoveGroupMembersCMSReq) GetOpUserId() string { + if m != nil { + return m.OpUserId + } + return "" +} + +type RemoveGroupMembersCMSResp struct { + Success []string `protobuf:"bytes,1,rep,name=success" json:"success,omitempty"` + Failed []string `protobuf:"bytes,2,rep,name=failed" json:"failed,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveGroupMembersCMSResp) Reset() { *m = RemoveGroupMembersCMSResp{} } +func (m *RemoveGroupMembersCMSResp) String() string { return proto.CompactTextString(m) } +func (*RemoveGroupMembersCMSResp) ProtoMessage() {} +func (*RemoveGroupMembersCMSResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{50} +} +func (m *RemoveGroupMembersCMSResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveGroupMembersCMSResp.Unmarshal(m, b) +} +func (m *RemoveGroupMembersCMSResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveGroupMembersCMSResp.Marshal(b, m, deterministic) +} +func (dst *RemoveGroupMembersCMSResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveGroupMembersCMSResp.Merge(dst, src) +} +func (m *RemoveGroupMembersCMSResp) XXX_Size() int { + return xxx_messageInfo_RemoveGroupMembersCMSResp.Size(m) +} +func (m *RemoveGroupMembersCMSResp) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveGroupMembersCMSResp.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveGroupMembersCMSResp proto.InternalMessageInfo + +func (m *RemoveGroupMembersCMSResp) GetSuccess() []string { + if m != nil { + return m.Success + } + return nil +} + +func (m *RemoveGroupMembersCMSResp) GetFailed() []string { + if m != nil { + return m.Failed + } + return nil +} + +type AddGroupMembersCMSReq struct { + GroupId string `protobuf:"bytes,1,opt,name=GroupId" json:"GroupId,omitempty"` + UserIds []string `protobuf:"bytes,2,rep,name=UserIds" json:"UserIds,omitempty"` + OperationId string `protobuf:"bytes,3,opt,name=OperationId" json:"OperationId,omitempty"` + OpUserId string `protobuf:"bytes,4,opt,name=OpUserId" json:"OpUserId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddGroupMembersCMSReq) Reset() { *m = AddGroupMembersCMSReq{} } +func (m *AddGroupMembersCMSReq) String() string { return proto.CompactTextString(m) } +func (*AddGroupMembersCMSReq) ProtoMessage() {} +func (*AddGroupMembersCMSReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{51} +} +func (m *AddGroupMembersCMSReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddGroupMembersCMSReq.Unmarshal(m, b) +} +func (m *AddGroupMembersCMSReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddGroupMembersCMSReq.Marshal(b, m, deterministic) +} +func (dst *AddGroupMembersCMSReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddGroupMembersCMSReq.Merge(dst, src) +} +func (m *AddGroupMembersCMSReq) XXX_Size() int { + return xxx_messageInfo_AddGroupMembersCMSReq.Size(m) +} +func (m *AddGroupMembersCMSReq) XXX_DiscardUnknown() { + xxx_messageInfo_AddGroupMembersCMSReq.DiscardUnknown(m) +} + +var xxx_messageInfo_AddGroupMembersCMSReq proto.InternalMessageInfo + +func (m *AddGroupMembersCMSReq) GetGroupId() string { + if m != nil { + return m.GroupId + } + return "" +} + +func (m *AddGroupMembersCMSReq) GetUserIds() []string { + if m != nil { + return m.UserIds + } + return nil +} + +func (m *AddGroupMembersCMSReq) GetOperationId() string { + if m != nil { + return m.OperationId + } + return "" +} + +func (m *AddGroupMembersCMSReq) GetOpUserId() string { + if m != nil { + return m.OpUserId + } + return "" +} + +type AddGroupMembersCMSResp struct { + Success []string `protobuf:"bytes,1,rep,name=success" json:"success,omitempty"` + Failed []string `protobuf:"bytes,2,rep,name=failed" json:"failed,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddGroupMembersCMSResp) Reset() { *m = AddGroupMembersCMSResp{} } +func (m *AddGroupMembersCMSResp) String() string { return proto.CompactTextString(m) } +func (*AddGroupMembersCMSResp) ProtoMessage() {} +func (*AddGroupMembersCMSResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{52} +} +func (m *AddGroupMembersCMSResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddGroupMembersCMSResp.Unmarshal(m, b) +} +func (m *AddGroupMembersCMSResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddGroupMembersCMSResp.Marshal(b, m, deterministic) +} +func (dst *AddGroupMembersCMSResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddGroupMembersCMSResp.Merge(dst, src) +} +func (m *AddGroupMembersCMSResp) XXX_Size() int { + return xxx_messageInfo_AddGroupMembersCMSResp.Size(m) +} +func (m *AddGroupMembersCMSResp) XXX_DiscardUnknown() { + xxx_messageInfo_AddGroupMembersCMSResp.DiscardUnknown(m) +} + +var xxx_messageInfo_AddGroupMembersCMSResp proto.InternalMessageInfo + +func (m *AddGroupMembersCMSResp) GetSuccess() []string { + if m != nil { + return m.Success + } + return nil +} + +func (m *AddGroupMembersCMSResp) GetFailed() []string { + if m != nil { + return m.Failed + } + return nil +} + +type DismissGroupReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DismissGroupReq) Reset() { *m = DismissGroupReq{} } +func (m *DismissGroupReq) String() string { return proto.CompactTextString(m) } +func (*DismissGroupReq) ProtoMessage() {} +func (*DismissGroupReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{53} +} +func (m *DismissGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DismissGroupReq.Unmarshal(m, b) +} +func (m *DismissGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DismissGroupReq.Marshal(b, m, deterministic) +} +func (dst *DismissGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DismissGroupReq.Merge(dst, src) +} +func (m *DismissGroupReq) XXX_Size() int { + return xxx_messageInfo_DismissGroupReq.Size(m) +} +func (m *DismissGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_DismissGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DismissGroupReq proto.InternalMessageInfo + +func (m *DismissGroupReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *DismissGroupReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *DismissGroupReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +type DismissGroupResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DismissGroupResp) Reset() { *m = DismissGroupResp{} } +func (m *DismissGroupResp) String() string { return proto.CompactTextString(m) } +func (*DismissGroupResp) ProtoMessage() {} +func (*DismissGroupResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{54} +} +func (m *DismissGroupResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DismissGroupResp.Unmarshal(m, b) +} +func (m *DismissGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DismissGroupResp.Marshal(b, m, deterministic) +} +func (dst *DismissGroupResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DismissGroupResp.Merge(dst, src) +} +func (m *DismissGroupResp) XXX_Size() int { + return xxx_messageInfo_DismissGroupResp.Size(m) +} +func (m *DismissGroupResp) XXX_DiscardUnknown() { + xxx_messageInfo_DismissGroupResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DismissGroupResp proto.InternalMessageInfo + +func (m *DismissGroupResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type MuteGroupMemberReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` + UserID string `protobuf:"bytes,4,opt,name=userID" json:"userID,omitempty"` + MutedSeconds uint32 `protobuf:"varint,5,opt,name=mutedSeconds" json:"mutedSeconds,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MuteGroupMemberReq) Reset() { *m = MuteGroupMemberReq{} } +func (m *MuteGroupMemberReq) String() string { return proto.CompactTextString(m) } +func (*MuteGroupMemberReq) ProtoMessage() {} +func (*MuteGroupMemberReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{55} +} +func (m *MuteGroupMemberReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MuteGroupMemberReq.Unmarshal(m, b) +} +func (m *MuteGroupMemberReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MuteGroupMemberReq.Marshal(b, m, deterministic) +} +func (dst *MuteGroupMemberReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_MuteGroupMemberReq.Merge(dst, src) +} +func (m *MuteGroupMemberReq) XXX_Size() int { + return xxx_messageInfo_MuteGroupMemberReq.Size(m) +} +func (m *MuteGroupMemberReq) XXX_DiscardUnknown() { + xxx_messageInfo_MuteGroupMemberReq.DiscardUnknown(m) +} + +var xxx_messageInfo_MuteGroupMemberReq proto.InternalMessageInfo + +func (m *MuteGroupMemberReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *MuteGroupMemberReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *MuteGroupMemberReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *MuteGroupMemberReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *MuteGroupMemberReq) GetMutedSeconds() uint32 { + if m != nil { + return m.MutedSeconds + } + return 0 +} + +type MuteGroupMemberResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MuteGroupMemberResp) Reset() { *m = MuteGroupMemberResp{} } +func (m *MuteGroupMemberResp) String() string { return proto.CompactTextString(m) } +func (*MuteGroupMemberResp) ProtoMessage() {} +func (*MuteGroupMemberResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{56} +} +func (m *MuteGroupMemberResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MuteGroupMemberResp.Unmarshal(m, b) +} +func (m *MuteGroupMemberResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MuteGroupMemberResp.Marshal(b, m, deterministic) +} +func (dst *MuteGroupMemberResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_MuteGroupMemberResp.Merge(dst, src) +} +func (m *MuteGroupMemberResp) XXX_Size() int { + return xxx_messageInfo_MuteGroupMemberResp.Size(m) +} +func (m *MuteGroupMemberResp) XXX_DiscardUnknown() { + xxx_messageInfo_MuteGroupMemberResp.DiscardUnknown(m) +} + +var xxx_messageInfo_MuteGroupMemberResp proto.InternalMessageInfo + +func (m *MuteGroupMemberResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type CancelMuteGroupMemberReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` + UserID string `protobuf:"bytes,4,opt,name=userID" json:"userID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CancelMuteGroupMemberReq) Reset() { *m = CancelMuteGroupMemberReq{} } +func (m *CancelMuteGroupMemberReq) String() string { return proto.CompactTextString(m) } +func (*CancelMuteGroupMemberReq) ProtoMessage() {} +func (*CancelMuteGroupMemberReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{57} +} +func (m *CancelMuteGroupMemberReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CancelMuteGroupMemberReq.Unmarshal(m, b) +} +func (m *CancelMuteGroupMemberReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CancelMuteGroupMemberReq.Marshal(b, m, deterministic) +} +func (dst *CancelMuteGroupMemberReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CancelMuteGroupMemberReq.Merge(dst, src) +} +func (m *CancelMuteGroupMemberReq) XXX_Size() int { + return xxx_messageInfo_CancelMuteGroupMemberReq.Size(m) +} +func (m *CancelMuteGroupMemberReq) XXX_DiscardUnknown() { + xxx_messageInfo_CancelMuteGroupMemberReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CancelMuteGroupMemberReq proto.InternalMessageInfo + +func (m *CancelMuteGroupMemberReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *CancelMuteGroupMemberReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *CancelMuteGroupMemberReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *CancelMuteGroupMemberReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +type CancelMuteGroupMemberResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CancelMuteGroupMemberResp) Reset() { *m = CancelMuteGroupMemberResp{} } +func (m *CancelMuteGroupMemberResp) String() string { return proto.CompactTextString(m) } +func (*CancelMuteGroupMemberResp) ProtoMessage() {} +func (*CancelMuteGroupMemberResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{58} +} +func (m *CancelMuteGroupMemberResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CancelMuteGroupMemberResp.Unmarshal(m, b) +} +func (m *CancelMuteGroupMemberResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CancelMuteGroupMemberResp.Marshal(b, m, deterministic) +} +func (dst *CancelMuteGroupMemberResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CancelMuteGroupMemberResp.Merge(dst, src) +} +func (m *CancelMuteGroupMemberResp) XXX_Size() int { + return xxx_messageInfo_CancelMuteGroupMemberResp.Size(m) +} +func (m *CancelMuteGroupMemberResp) XXX_DiscardUnknown() { + xxx_messageInfo_CancelMuteGroupMemberResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CancelMuteGroupMemberResp proto.InternalMessageInfo + +func (m *CancelMuteGroupMemberResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type MuteGroupReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MuteGroupReq) Reset() { *m = MuteGroupReq{} } +func (m *MuteGroupReq) String() string { return proto.CompactTextString(m) } +func (*MuteGroupReq) ProtoMessage() {} +func (*MuteGroupReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{59} +} +func (m *MuteGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MuteGroupReq.Unmarshal(m, b) +} +func (m *MuteGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MuteGroupReq.Marshal(b, m, deterministic) +} +func (dst *MuteGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_MuteGroupReq.Merge(dst, src) +} +func (m *MuteGroupReq) XXX_Size() int { + return xxx_messageInfo_MuteGroupReq.Size(m) +} +func (m *MuteGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_MuteGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_MuteGroupReq proto.InternalMessageInfo + +func (m *MuteGroupReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *MuteGroupReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *MuteGroupReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +type MuteGroupResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MuteGroupResp) Reset() { *m = MuteGroupResp{} } +func (m *MuteGroupResp) String() string { return proto.CompactTextString(m) } +func (*MuteGroupResp) ProtoMessage() {} +func (*MuteGroupResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{60} +} +func (m *MuteGroupResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MuteGroupResp.Unmarshal(m, b) +} +func (m *MuteGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MuteGroupResp.Marshal(b, m, deterministic) +} +func (dst *MuteGroupResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_MuteGroupResp.Merge(dst, src) +} +func (m *MuteGroupResp) XXX_Size() int { + return xxx_messageInfo_MuteGroupResp.Size(m) +} +func (m *MuteGroupResp) XXX_DiscardUnknown() { + xxx_messageInfo_MuteGroupResp.DiscardUnknown(m) +} + +var xxx_messageInfo_MuteGroupResp proto.InternalMessageInfo + +func (m *MuteGroupResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type CancelMuteGroupReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CancelMuteGroupReq) Reset() { *m = CancelMuteGroupReq{} } +func (m *CancelMuteGroupReq) String() string { return proto.CompactTextString(m) } +func (*CancelMuteGroupReq) ProtoMessage() {} +func (*CancelMuteGroupReq) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{61} +} +func (m *CancelMuteGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CancelMuteGroupReq.Unmarshal(m, b) +} +func (m *CancelMuteGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CancelMuteGroupReq.Marshal(b, m, deterministic) +} +func (dst *CancelMuteGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CancelMuteGroupReq.Merge(dst, src) +} +func (m *CancelMuteGroupReq) XXX_Size() int { + return xxx_messageInfo_CancelMuteGroupReq.Size(m) +} +func (m *CancelMuteGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_CancelMuteGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CancelMuteGroupReq proto.InternalMessageInfo + +func (m *CancelMuteGroupReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *CancelMuteGroupReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *CancelMuteGroupReq) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +type CancelMuteGroupResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CancelMuteGroupResp) Reset() { *m = CancelMuteGroupResp{} } +func (m *CancelMuteGroupResp) String() string { return proto.CompactTextString(m) } +func (*CancelMuteGroupResp) ProtoMessage() {} +func (*CancelMuteGroupResp) Descriptor() ([]byte, []int) { + return fileDescriptor_group_3c77315b028a1402, []int{62} +} +func (m *CancelMuteGroupResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CancelMuteGroupResp.Unmarshal(m, b) +} +func (m *CancelMuteGroupResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CancelMuteGroupResp.Marshal(b, m, deterministic) +} +func (dst *CancelMuteGroupResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CancelMuteGroupResp.Merge(dst, src) +} +func (m *CancelMuteGroupResp) XXX_Size() int { + return xxx_messageInfo_CancelMuteGroupResp.Size(m) +} +func (m *CancelMuteGroupResp) XXX_DiscardUnknown() { + xxx_messageInfo_CancelMuteGroupResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CancelMuteGroupResp proto.InternalMessageInfo + +func (m *CancelMuteGroupResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "group.CommonResp") + proto.RegisterType((*GroupAddMemberInfo)(nil), "group.GroupAddMemberInfo") + proto.RegisterType((*CreateGroupReq)(nil), "group.CreateGroupReq") + proto.RegisterType((*CreateGroupResp)(nil), "group.CreateGroupResp") + proto.RegisterType((*GetGroupsInfoReq)(nil), "group.GetGroupsInfoReq") + proto.RegisterType((*GetGroupsInfoResp)(nil), "group.GetGroupsInfoResp") + proto.RegisterType((*SetGroupInfoReq)(nil), "group.SetGroupInfoReq") + proto.RegisterType((*SetGroupInfoResp)(nil), "group.SetGroupInfoResp") + proto.RegisterType((*GetGroupApplicationListReq)(nil), "group.GetGroupApplicationListReq") + proto.RegisterType((*GetGroupApplicationListResp)(nil), "group.GetGroupApplicationListResp") + proto.RegisterType((*GetUserReqApplicationListReq)(nil), "group.GetUserReqApplicationListReq") + proto.RegisterType((*GetUserReqApplicationListResp)(nil), "group.GetUserReqApplicationListResp") + proto.RegisterType((*TransferGroupOwnerReq)(nil), "group.TransferGroupOwnerReq") + proto.RegisterType((*TransferGroupOwnerResp)(nil), "group.TransferGroupOwnerResp") + proto.RegisterType((*JoinGroupReq)(nil), "group.JoinGroupReq") + proto.RegisterType((*JoinGroupResp)(nil), "group.JoinGroupResp") + proto.RegisterType((*GroupApplicationResponseReq)(nil), "group.GroupApplicationResponseReq") + proto.RegisterType((*GroupApplicationResponseResp)(nil), "group.GroupApplicationResponseResp") + proto.RegisterType((*QuitGroupReq)(nil), "group.QuitGroupReq") + proto.RegisterType((*QuitGroupResp)(nil), "group.QuitGroupResp") + proto.RegisterType((*GetGroupMemberListReq)(nil), "group.GetGroupMemberListReq") + proto.RegisterType((*GetGroupMemberListResp)(nil), "group.GetGroupMemberListResp") + proto.RegisterType((*GetGroupMembersInfoReq)(nil), "group.GetGroupMembersInfoReq") + proto.RegisterType((*GetGroupMembersInfoResp)(nil), "group.GetGroupMembersInfoResp") + proto.RegisterType((*KickGroupMemberReq)(nil), "group.KickGroupMemberReq") + proto.RegisterType((*Id2Result)(nil), "group.Id2Result") + proto.RegisterType((*KickGroupMemberResp)(nil), "group.KickGroupMemberResp") + proto.RegisterType((*GetJoinedGroupListReq)(nil), "group.GetJoinedGroupListReq") + proto.RegisterType((*GetJoinedGroupListResp)(nil), "group.GetJoinedGroupListResp") + proto.RegisterType((*InviteUserToGroupReq)(nil), "group.InviteUserToGroupReq") + proto.RegisterType((*InviteUserToGroupResp)(nil), "group.InviteUserToGroupResp") + proto.RegisterType((*GetGroupAllMemberReq)(nil), "group.GetGroupAllMemberReq") + proto.RegisterType((*GetGroupAllMemberResp)(nil), "group.GetGroupAllMemberResp") + proto.RegisterType((*CMSGroup)(nil), "group.CMSGroup") + proto.RegisterType((*GetGroupReq)(nil), "group.GetGroupReq") + proto.RegisterType((*GetGroupResp)(nil), "group.GetGroupResp") + proto.RegisterType((*GetGroupsReq)(nil), "group.GetGroupsReq") + proto.RegisterType((*GetGroupsResp)(nil), "group.GetGroupsResp") + proto.RegisterType((*GetGroupMemberReq)(nil), "group.GetGroupMemberReq") + proto.RegisterType((*OperateGroupStatusReq)(nil), "group.OperateGroupStatusReq") + proto.RegisterType((*OperateGroupStatusResp)(nil), "group.OperateGroupStatusResp") + proto.RegisterType((*OperateUserRoleReq)(nil), "group.OperateUserRoleReq") + proto.RegisterType((*OperateUserRoleResp)(nil), "group.OperateUserRoleResp") + proto.RegisterType((*DeleteGroupReq)(nil), "group.DeleteGroupReq") + proto.RegisterType((*DeleteGroupResp)(nil), "group.DeleteGroupResp") + proto.RegisterType((*GetGroupByIdReq)(nil), "group.GetGroupByIdReq") + proto.RegisterType((*GetGroupByIdResp)(nil), "group.GetGroupByIdResp") + proto.RegisterType((*GetGroupMembersCMSReq)(nil), "group.GetGroupMembersCMSReq") + proto.RegisterType((*GetGroupMembersCMSResp)(nil), "group.GetGroupMembersCMSResp") + proto.RegisterType((*RemoveGroupMembersCMSReq)(nil), "group.RemoveGroupMembersCMSReq") + proto.RegisterType((*RemoveGroupMembersCMSResp)(nil), "group.RemoveGroupMembersCMSResp") + proto.RegisterType((*AddGroupMembersCMSReq)(nil), "group.AddGroupMembersCMSReq") + proto.RegisterType((*AddGroupMembersCMSResp)(nil), "group.AddGroupMembersCMSResp") + proto.RegisterType((*DismissGroupReq)(nil), "group.DismissGroupReq") + proto.RegisterType((*DismissGroupResp)(nil), "group.DismissGroupResp") + proto.RegisterType((*MuteGroupMemberReq)(nil), "group.MuteGroupMemberReq") + proto.RegisterType((*MuteGroupMemberResp)(nil), "group.MuteGroupMemberResp") + proto.RegisterType((*CancelMuteGroupMemberReq)(nil), "group.CancelMuteGroupMemberReq") + proto.RegisterType((*CancelMuteGroupMemberResp)(nil), "group.CancelMuteGroupMemberResp") + proto.RegisterType((*MuteGroupReq)(nil), "group.MuteGroupReq") + proto.RegisterType((*MuteGroupResp)(nil), "group.MuteGroupResp") + proto.RegisterType((*CancelMuteGroupReq)(nil), "group.CancelMuteGroupReq") + proto.RegisterType((*CancelMuteGroupResp)(nil), "group.CancelMuteGroupResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Group service + +type GroupClient interface { + CreateGroup(ctx context.Context, in *CreateGroupReq, opts ...grpc.CallOption) (*CreateGroupResp, error) + JoinGroup(ctx context.Context, in *JoinGroupReq, opts ...grpc.CallOption) (*JoinGroupResp, error) + QuitGroup(ctx context.Context, in *QuitGroupReq, opts ...grpc.CallOption) (*QuitGroupResp, error) + GetGroupsInfo(ctx context.Context, in *GetGroupsInfoReq, opts ...grpc.CallOption) (*GetGroupsInfoResp, error) + SetGroupInfo(ctx context.Context, in *SetGroupInfoReq, opts ...grpc.CallOption) (*SetGroupInfoResp, error) + GetGroupApplicationList(ctx context.Context, in *GetGroupApplicationListReq, opts ...grpc.CallOption) (*GetGroupApplicationListResp, error) + GetUserReqApplicationList(ctx context.Context, in *GetUserReqApplicationListReq, opts ...grpc.CallOption) (*GetUserReqApplicationListResp, error) + TransferGroupOwner(ctx context.Context, in *TransferGroupOwnerReq, opts ...grpc.CallOption) (*TransferGroupOwnerResp, error) + GroupApplicationResponse(ctx context.Context, in *GroupApplicationResponseReq, opts ...grpc.CallOption) (*GroupApplicationResponseResp, error) + GetGroupMemberList(ctx context.Context, in *GetGroupMemberListReq, opts ...grpc.CallOption) (*GetGroupMemberListResp, error) + GetGroupMembersInfo(ctx context.Context, in *GetGroupMembersInfoReq, opts ...grpc.CallOption) (*GetGroupMembersInfoResp, error) + KickGroupMember(ctx context.Context, in *KickGroupMemberReq, opts ...grpc.CallOption) (*KickGroupMemberResp, error) + GetJoinedGroupList(ctx context.Context, in *GetJoinedGroupListReq, opts ...grpc.CallOption) (*GetJoinedGroupListResp, error) + InviteUserToGroup(ctx context.Context, in *InviteUserToGroupReq, opts ...grpc.CallOption) (*InviteUserToGroupResp, error) + GetGroupAllMember(ctx context.Context, in *GetGroupAllMemberReq, opts ...grpc.CallOption) (*GetGroupAllMemberResp, error) + GetGroupById(ctx context.Context, in *GetGroupByIdReq, opts ...grpc.CallOption) (*GetGroupByIdResp, error) + GetGroup(ctx context.Context, in *GetGroupReq, opts ...grpc.CallOption) (*GetGroupResp, error) + GetGroups(ctx context.Context, in *GetGroupsReq, opts ...grpc.CallOption) (*GetGroupsResp, error) + OperateGroupStatus(ctx context.Context, in *OperateGroupStatusReq, opts ...grpc.CallOption) (*OperateGroupStatusResp, error) + OperateUserRole(ctx context.Context, in *OperateUserRoleReq, opts ...grpc.CallOption) (*OperateUserRoleResp, error) + DeleteGroup(ctx context.Context, in *DeleteGroupReq, opts ...grpc.CallOption) (*DeleteGroupResp, error) + GetGroupMembersCMS(ctx context.Context, in *GetGroupMembersCMSReq, opts ...grpc.CallOption) (*GetGroupMembersCMSResp, error) + RemoveGroupMembersCMS(ctx context.Context, in *RemoveGroupMembersCMSReq, opts ...grpc.CallOption) (*RemoveGroupMembersCMSResp, error) + AddGroupMembersCMS(ctx context.Context, in *AddGroupMembersCMSReq, opts ...grpc.CallOption) (*AddGroupMembersCMSResp, error) + DismissGroup(ctx context.Context, in *DismissGroupReq, opts ...grpc.CallOption) (*DismissGroupResp, error) + MuteGroupMember(ctx context.Context, in *MuteGroupMemberReq, opts ...grpc.CallOption) (*MuteGroupMemberResp, error) + CancelMuteGroupMember(ctx context.Context, in *CancelMuteGroupMemberReq, opts ...grpc.CallOption) (*CancelMuteGroupMemberResp, error) + MuteGroup(ctx context.Context, in *MuteGroupReq, opts ...grpc.CallOption) (*MuteGroupResp, error) + CancelMuteGroup(ctx context.Context, in *CancelMuteGroupReq, opts ...grpc.CallOption) (*CancelMuteGroupResp, error) +} + +type groupClient struct { + cc *grpc.ClientConn +} + +func NewGroupClient(cc *grpc.ClientConn) GroupClient { + return &groupClient{cc} +} + +func (c *groupClient) CreateGroup(ctx context.Context, in *CreateGroupReq, opts ...grpc.CallOption) (*CreateGroupResp, error) { + out := new(CreateGroupResp) + err := grpc.Invoke(ctx, "/group.group/createGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) JoinGroup(ctx context.Context, in *JoinGroupReq, opts ...grpc.CallOption) (*JoinGroupResp, error) { + out := new(JoinGroupResp) + err := grpc.Invoke(ctx, "/group.group/joinGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) QuitGroup(ctx context.Context, in *QuitGroupReq, opts ...grpc.CallOption) (*QuitGroupResp, error) { + out := new(QuitGroupResp) + err := grpc.Invoke(ctx, "/group.group/quitGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroupsInfo(ctx context.Context, in *GetGroupsInfoReq, opts ...grpc.CallOption) (*GetGroupsInfoResp, error) { + out := new(GetGroupsInfoResp) + err := grpc.Invoke(ctx, "/group.group/getGroupsInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) SetGroupInfo(ctx context.Context, in *SetGroupInfoReq, opts ...grpc.CallOption) (*SetGroupInfoResp, error) { + out := new(SetGroupInfoResp) + err := grpc.Invoke(ctx, "/group.group/setGroupInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroupApplicationList(ctx context.Context, in *GetGroupApplicationListReq, opts ...grpc.CallOption) (*GetGroupApplicationListResp, error) { + out := new(GetGroupApplicationListResp) + err := grpc.Invoke(ctx, "/group.group/getGroupApplicationList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetUserReqApplicationList(ctx context.Context, in *GetUserReqApplicationListReq, opts ...grpc.CallOption) (*GetUserReqApplicationListResp, error) { + out := new(GetUserReqApplicationListResp) + err := grpc.Invoke(ctx, "/group.group/getUserReqApplicationList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) TransferGroupOwner(ctx context.Context, in *TransferGroupOwnerReq, opts ...grpc.CallOption) (*TransferGroupOwnerResp, error) { + out := new(TransferGroupOwnerResp) + err := grpc.Invoke(ctx, "/group.group/transferGroupOwner", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GroupApplicationResponse(ctx context.Context, in *GroupApplicationResponseReq, opts ...grpc.CallOption) (*GroupApplicationResponseResp, error) { + out := new(GroupApplicationResponseResp) + err := grpc.Invoke(ctx, "/group.group/groupApplicationResponse", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroupMemberList(ctx context.Context, in *GetGroupMemberListReq, opts ...grpc.CallOption) (*GetGroupMemberListResp, error) { + out := new(GetGroupMemberListResp) + err := grpc.Invoke(ctx, "/group.group/getGroupMemberList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroupMembersInfo(ctx context.Context, in *GetGroupMembersInfoReq, opts ...grpc.CallOption) (*GetGroupMembersInfoResp, error) { + out := new(GetGroupMembersInfoResp) + err := grpc.Invoke(ctx, "/group.group/getGroupMembersInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) KickGroupMember(ctx context.Context, in *KickGroupMemberReq, opts ...grpc.CallOption) (*KickGroupMemberResp, error) { + out := new(KickGroupMemberResp) + err := grpc.Invoke(ctx, "/group.group/kickGroupMember", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetJoinedGroupList(ctx context.Context, in *GetJoinedGroupListReq, opts ...grpc.CallOption) (*GetJoinedGroupListResp, error) { + out := new(GetJoinedGroupListResp) + err := grpc.Invoke(ctx, "/group.group/getJoinedGroupList", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) InviteUserToGroup(ctx context.Context, in *InviteUserToGroupReq, opts ...grpc.CallOption) (*InviteUserToGroupResp, error) { + out := new(InviteUserToGroupResp) + err := grpc.Invoke(ctx, "/group.group/inviteUserToGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroupAllMember(ctx context.Context, in *GetGroupAllMemberReq, opts ...grpc.CallOption) (*GetGroupAllMemberResp, error) { + out := new(GetGroupAllMemberResp) + err := grpc.Invoke(ctx, "/group.group/getGroupAllMember", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroupById(ctx context.Context, in *GetGroupByIdReq, opts ...grpc.CallOption) (*GetGroupByIdResp, error) { + out := new(GetGroupByIdResp) + err := grpc.Invoke(ctx, "/group.group/GetGroupById", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroup(ctx context.Context, in *GetGroupReq, opts ...grpc.CallOption) (*GetGroupResp, error) { + out := new(GetGroupResp) + err := grpc.Invoke(ctx, "/group.group/GetGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroups(ctx context.Context, in *GetGroupsReq, opts ...grpc.CallOption) (*GetGroupsResp, error) { + out := new(GetGroupsResp) + err := grpc.Invoke(ctx, "/group.group/GetGroups", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) OperateGroupStatus(ctx context.Context, in *OperateGroupStatusReq, opts ...grpc.CallOption) (*OperateGroupStatusResp, error) { + out := new(OperateGroupStatusResp) + err := grpc.Invoke(ctx, "/group.group/OperateGroupStatus", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) OperateUserRole(ctx context.Context, in *OperateUserRoleReq, opts ...grpc.CallOption) (*OperateUserRoleResp, error) { + out := new(OperateUserRoleResp) + err := grpc.Invoke(ctx, "/group.group/OperateUserRole", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) DeleteGroup(ctx context.Context, in *DeleteGroupReq, opts ...grpc.CallOption) (*DeleteGroupResp, error) { + out := new(DeleteGroupResp) + err := grpc.Invoke(ctx, "/group.group/DeleteGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) GetGroupMembersCMS(ctx context.Context, in *GetGroupMembersCMSReq, opts ...grpc.CallOption) (*GetGroupMembersCMSResp, error) { + out := new(GetGroupMembersCMSResp) + err := grpc.Invoke(ctx, "/group.group/GetGroupMembersCMS", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) RemoveGroupMembersCMS(ctx context.Context, in *RemoveGroupMembersCMSReq, opts ...grpc.CallOption) (*RemoveGroupMembersCMSResp, error) { + out := new(RemoveGroupMembersCMSResp) + err := grpc.Invoke(ctx, "/group.group/RemoveGroupMembersCMS", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) AddGroupMembersCMS(ctx context.Context, in *AddGroupMembersCMSReq, opts ...grpc.CallOption) (*AddGroupMembersCMSResp, error) { + out := new(AddGroupMembersCMSResp) + err := grpc.Invoke(ctx, "/group.group/AddGroupMembersCMS", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) DismissGroup(ctx context.Context, in *DismissGroupReq, opts ...grpc.CallOption) (*DismissGroupResp, error) { + out := new(DismissGroupResp) + err := grpc.Invoke(ctx, "/group.group/DismissGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) MuteGroupMember(ctx context.Context, in *MuteGroupMemberReq, opts ...grpc.CallOption) (*MuteGroupMemberResp, error) { + out := new(MuteGroupMemberResp) + err := grpc.Invoke(ctx, "/group.group/MuteGroupMember", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) CancelMuteGroupMember(ctx context.Context, in *CancelMuteGroupMemberReq, opts ...grpc.CallOption) (*CancelMuteGroupMemberResp, error) { + out := new(CancelMuteGroupMemberResp) + err := grpc.Invoke(ctx, "/group.group/CancelMuteGroupMember", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) MuteGroup(ctx context.Context, in *MuteGroupReq, opts ...grpc.CallOption) (*MuteGroupResp, error) { + out := new(MuteGroupResp) + err := grpc.Invoke(ctx, "/group.group/MuteGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *groupClient) CancelMuteGroup(ctx context.Context, in *CancelMuteGroupReq, opts ...grpc.CallOption) (*CancelMuteGroupResp, error) { + out := new(CancelMuteGroupResp) + err := grpc.Invoke(ctx, "/group.group/CancelMuteGroup", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Group service + +type GroupServer interface { + CreateGroup(context.Context, *CreateGroupReq) (*CreateGroupResp, error) + JoinGroup(context.Context, *JoinGroupReq) (*JoinGroupResp, error) + QuitGroup(context.Context, *QuitGroupReq) (*QuitGroupResp, error) + GetGroupsInfo(context.Context, *GetGroupsInfoReq) (*GetGroupsInfoResp, error) + SetGroupInfo(context.Context, *SetGroupInfoReq) (*SetGroupInfoResp, error) + GetGroupApplicationList(context.Context, *GetGroupApplicationListReq) (*GetGroupApplicationListResp, error) + GetUserReqApplicationList(context.Context, *GetUserReqApplicationListReq) (*GetUserReqApplicationListResp, error) + TransferGroupOwner(context.Context, *TransferGroupOwnerReq) (*TransferGroupOwnerResp, error) + GroupApplicationResponse(context.Context, *GroupApplicationResponseReq) (*GroupApplicationResponseResp, error) + GetGroupMemberList(context.Context, *GetGroupMemberListReq) (*GetGroupMemberListResp, error) + GetGroupMembersInfo(context.Context, *GetGroupMembersInfoReq) (*GetGroupMembersInfoResp, error) + KickGroupMember(context.Context, *KickGroupMemberReq) (*KickGroupMemberResp, error) + GetJoinedGroupList(context.Context, *GetJoinedGroupListReq) (*GetJoinedGroupListResp, error) + InviteUserToGroup(context.Context, *InviteUserToGroupReq) (*InviteUserToGroupResp, error) + GetGroupAllMember(context.Context, *GetGroupAllMemberReq) (*GetGroupAllMemberResp, error) + GetGroupById(context.Context, *GetGroupByIdReq) (*GetGroupByIdResp, error) + GetGroup(context.Context, *GetGroupReq) (*GetGroupResp, error) + GetGroups(context.Context, *GetGroupsReq) (*GetGroupsResp, error) + OperateGroupStatus(context.Context, *OperateGroupStatusReq) (*OperateGroupStatusResp, error) + OperateUserRole(context.Context, *OperateUserRoleReq) (*OperateUserRoleResp, error) + DeleteGroup(context.Context, *DeleteGroupReq) (*DeleteGroupResp, error) + GetGroupMembersCMS(context.Context, *GetGroupMembersCMSReq) (*GetGroupMembersCMSResp, error) + RemoveGroupMembersCMS(context.Context, *RemoveGroupMembersCMSReq) (*RemoveGroupMembersCMSResp, error) + AddGroupMembersCMS(context.Context, *AddGroupMembersCMSReq) (*AddGroupMembersCMSResp, error) + DismissGroup(context.Context, *DismissGroupReq) (*DismissGroupResp, error) + MuteGroupMember(context.Context, *MuteGroupMemberReq) (*MuteGroupMemberResp, error) + CancelMuteGroupMember(context.Context, *CancelMuteGroupMemberReq) (*CancelMuteGroupMemberResp, error) + MuteGroup(context.Context, *MuteGroupReq) (*MuteGroupResp, error) + CancelMuteGroup(context.Context, *CancelMuteGroupReq) (*CancelMuteGroupResp, error) +} + +func RegisterGroupServer(s *grpc.Server, srv GroupServer) { + s.RegisterService(&_Group_serviceDesc, srv) +} + +func _Group_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).CreateGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/CreateGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).CreateGroup(ctx, req.(*CreateGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_JoinGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(JoinGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).JoinGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/JoinGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).JoinGroup(ctx, req.(*JoinGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_QuitGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuitGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).QuitGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/QuitGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).QuitGroup(ctx, req.(*QuitGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroupsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupsInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroupsInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroupsInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroupsInfo(ctx, req.(*GetGroupsInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_SetGroupInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetGroupInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).SetGroupInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/SetGroupInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).SetGroupInfo(ctx, req.(*SetGroupInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroupApplicationList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupApplicationListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroupApplicationList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroupApplicationList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroupApplicationList(ctx, req.(*GetGroupApplicationListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetUserReqApplicationList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserReqApplicationListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetUserReqApplicationList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetUserReqApplicationList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetUserReqApplicationList(ctx, req.(*GetUserReqApplicationListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_TransferGroupOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TransferGroupOwnerReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).TransferGroupOwner(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/TransferGroupOwner", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).TransferGroupOwner(ctx, req.(*TransferGroupOwnerReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GroupApplicationResponse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GroupApplicationResponseReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GroupApplicationResponse(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GroupApplicationResponse", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GroupApplicationResponse(ctx, req.(*GroupApplicationResponseReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroupMemberList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupMemberListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroupMemberList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroupMemberList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroupMemberList(ctx, req.(*GetGroupMemberListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroupMembersInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupMembersInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroupMembersInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroupMembersInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroupMembersInfo(ctx, req.(*GetGroupMembersInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_KickGroupMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KickGroupMemberReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).KickGroupMember(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/KickGroupMember", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).KickGroupMember(ctx, req.(*KickGroupMemberReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetJoinedGroupList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetJoinedGroupListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetJoinedGroupList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetJoinedGroupList", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetJoinedGroupList(ctx, req.(*GetJoinedGroupListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_InviteUserToGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InviteUserToGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).InviteUserToGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/InviteUserToGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).InviteUserToGroup(ctx, req.(*InviteUserToGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroupAllMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupAllMemberReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroupAllMember(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroupAllMember", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroupAllMember(ctx, req.(*GetGroupAllMemberReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroupById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupByIdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroupById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroupById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroupById(ctx, req.(*GetGroupByIdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroup(ctx, req.(*GetGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroups", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroups(ctx, req.(*GetGroupsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_OperateGroupStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OperateGroupStatusReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).OperateGroupStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/OperateGroupStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).OperateGroupStatus(ctx, req.(*OperateGroupStatusReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_OperateUserRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OperateUserRoleReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).OperateUserRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/OperateUserRole", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).OperateUserRole(ctx, req.(*OperateUserRoleReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).DeleteGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/DeleteGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).DeleteGroup(ctx, req.(*DeleteGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_GetGroupMembersCMS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupMembersCMSReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).GetGroupMembersCMS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/GetGroupMembersCMS", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).GetGroupMembersCMS(ctx, req.(*GetGroupMembersCMSReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_RemoveGroupMembersCMS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveGroupMembersCMSReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).RemoveGroupMembersCMS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/RemoveGroupMembersCMS", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).RemoveGroupMembersCMS(ctx, req.(*RemoveGroupMembersCMSReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_AddGroupMembersCMS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddGroupMembersCMSReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).AddGroupMembersCMS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/AddGroupMembersCMS", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).AddGroupMembersCMS(ctx, req.(*AddGroupMembersCMSReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_DismissGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DismissGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).DismissGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/DismissGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).DismissGroup(ctx, req.(*DismissGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_MuteGroupMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MuteGroupMemberReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).MuteGroupMember(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/MuteGroupMember", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).MuteGroupMember(ctx, req.(*MuteGroupMemberReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_CancelMuteGroupMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelMuteGroupMemberReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).CancelMuteGroupMember(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/CancelMuteGroupMember", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).CancelMuteGroupMember(ctx, req.(*CancelMuteGroupMemberReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_MuteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MuteGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).MuteGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/MuteGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).MuteGroup(ctx, req.(*MuteGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Group_CancelMuteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CancelMuteGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GroupServer).CancelMuteGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/group.group/CancelMuteGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GroupServer).CancelMuteGroup(ctx, req.(*CancelMuteGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Group_serviceDesc = grpc.ServiceDesc{ + ServiceName: "group.group", + HandlerType: (*GroupServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "createGroup", + Handler: _Group_CreateGroup_Handler, + }, + { + MethodName: "joinGroup", + Handler: _Group_JoinGroup_Handler, + }, + { + MethodName: "quitGroup", + Handler: _Group_QuitGroup_Handler, + }, + { + MethodName: "getGroupsInfo", + Handler: _Group_GetGroupsInfo_Handler, + }, + { + MethodName: "setGroupInfo", + Handler: _Group_SetGroupInfo_Handler, + }, + { + MethodName: "getGroupApplicationList", + Handler: _Group_GetGroupApplicationList_Handler, + }, + { + MethodName: "getUserReqApplicationList", + Handler: _Group_GetUserReqApplicationList_Handler, + }, + { + MethodName: "transferGroupOwner", + Handler: _Group_TransferGroupOwner_Handler, + }, + { + MethodName: "groupApplicationResponse", + Handler: _Group_GroupApplicationResponse_Handler, + }, + { + MethodName: "getGroupMemberList", + Handler: _Group_GetGroupMemberList_Handler, + }, + { + MethodName: "getGroupMembersInfo", + Handler: _Group_GetGroupMembersInfo_Handler, + }, + { + MethodName: "kickGroupMember", + Handler: _Group_KickGroupMember_Handler, + }, + { + MethodName: "getJoinedGroupList", + Handler: _Group_GetJoinedGroupList_Handler, + }, + { + MethodName: "inviteUserToGroup", + Handler: _Group_InviteUserToGroup_Handler, + }, + { + MethodName: "getGroupAllMember", + Handler: _Group_GetGroupAllMember_Handler, + }, + { + MethodName: "GetGroupById", + Handler: _Group_GetGroupById_Handler, + }, + { + MethodName: "GetGroup", + Handler: _Group_GetGroup_Handler, + }, + { + MethodName: "GetGroups", + Handler: _Group_GetGroups_Handler, + }, + { + MethodName: "OperateGroupStatus", + Handler: _Group_OperateGroupStatus_Handler, + }, + { + MethodName: "OperateUserRole", + Handler: _Group_OperateUserRole_Handler, + }, + { + MethodName: "DeleteGroup", + Handler: _Group_DeleteGroup_Handler, + }, + { + MethodName: "GetGroupMembersCMS", + Handler: _Group_GetGroupMembersCMS_Handler, + }, + { + MethodName: "RemoveGroupMembersCMS", + Handler: _Group_RemoveGroupMembersCMS_Handler, + }, + { + MethodName: "AddGroupMembersCMS", + Handler: _Group_AddGroupMembersCMS_Handler, + }, + { + MethodName: "DismissGroup", + Handler: _Group_DismissGroup_Handler, + }, + { + MethodName: "MuteGroupMember", + Handler: _Group_MuteGroupMember_Handler, + }, + { + MethodName: "CancelMuteGroupMember", + Handler: _Group_CancelMuteGroupMember_Handler, + }, + { + MethodName: "MuteGroup", + Handler: _Group_MuteGroup_Handler, + }, + { + MethodName: "CancelMuteGroup", + Handler: _Group_CancelMuteGroup_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "group/group.proto", +} + +func init() { proto.RegisterFile("group/group.proto", fileDescriptor_group_3c77315b028a1402) } + +var fileDescriptor_group_3c77315b028a1402 = []byte{ + // 2068 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0x4f, 0x6f, 0xdb, 0xc8, + 0x15, 0x07, 0xed, 0xc8, 0xb6, 0x9e, 0xad, 0xc8, 0x1e, 0x47, 0xb6, 0xc2, 0xf5, 0x66, 0xbd, 0xb3, + 0xe9, 0x22, 0xe8, 0x1f, 0x1b, 0xcd, 0x02, 0x39, 0x74, 0x8b, 0xa6, 0xf1, 0x9f, 0xc4, 0x4a, 0x22, + 0xbb, 0xa1, 0xd3, 0x4b, 0x2e, 0xa9, 0x56, 0x1c, 0x0b, 0xaa, 0x25, 0x92, 0xe6, 0x50, 0x4e, 0xdb, + 0xcb, 0xa2, 0x97, 0x05, 0xb6, 0xed, 0xa1, 0x45, 0x81, 0x3d, 0x15, 0x68, 0x73, 0xeb, 0xa1, 0x87, + 0x1e, 0xda, 0x73, 0xd1, 0x8f, 0xd1, 0x4f, 0xd1, 0xaf, 0x50, 0x70, 0x66, 0x38, 0x1c, 0x0e, 0x87, + 0xb4, 0x42, 0x25, 0xcd, 0x45, 0xc0, 0xbc, 0x79, 0xc3, 0xf7, 0x7b, 0x6f, 0xe6, 0xbd, 0x79, 0xef, + 0x8d, 0x60, 0x6d, 0x10, 0xfa, 0x93, 0x60, 0x97, 0xfd, 0xee, 0x04, 0xa1, 0x1f, 0xf9, 0xa8, 0xc6, + 0x06, 0xf6, 0xc7, 0x27, 0x01, 0xf1, 0x5e, 0x76, 0xba, 0xbb, 0xc1, 0xf9, 0x60, 0x97, 0xcd, 0xec, + 0x52, 0xf7, 0xfc, 0xe5, 0x2b, 0xba, 0xfb, 0x8a, 0x72, 0x4e, 0xfc, 0x23, 0x80, 0x7d, 0x7f, 0x3c, + 0xf6, 0x3d, 0x87, 0xd0, 0x00, 0xb5, 0x61, 0xf1, 0x30, 0x0c, 0xf7, 0x7d, 0x97, 0xb4, 0xad, 0x6d, + 0xeb, 0x4e, 0xcd, 0x49, 0x86, 0x68, 0x03, 0x16, 0x0e, 0xc3, 0xb0, 0x4b, 0x07, 0xed, 0xb9, 0x6d, + 0xeb, 0x4e, 0xdd, 0x11, 0x23, 0xfc, 0x18, 0xd0, 0xa3, 0x58, 0xd6, 0x03, 0xd7, 0xed, 0x92, 0xf1, + 0x17, 0x24, 0xec, 0x78, 0x67, 0x7e, 0xcc, 0xfd, 0x53, 0x4a, 0xc2, 0xce, 0x01, 0xfb, 0x4c, 0xdd, + 0x11, 0x23, 0xb4, 0x05, 0x75, 0xc7, 0x1f, 0x91, 0xa7, 0xe4, 0x92, 0x8c, 0xd8, 0x87, 0x6a, 0x4e, + 0x4a, 0xc0, 0xff, 0xb5, 0xe0, 0xfa, 0x7e, 0x48, 0x7a, 0x11, 0x61, 0x9f, 0x74, 0xc8, 0x05, 0x7a, + 0x00, 0xd7, 0x3b, 0xde, 0x30, 0xe2, 0x9f, 0x7e, 0x3a, 0xa4, 0x51, 0xdb, 0xda, 0x9e, 0xbf, 0xb3, + 0x7c, 0xf7, 0xe6, 0x0e, 0x57, 0x37, 0x2f, 0xdb, 0xd1, 0x16, 0xa0, 0x1f, 0x40, 0x9d, 0x71, 0xc5, + 0x93, 0x4c, 0xe6, 0xf2, 0xdd, 0xad, 0x1d, 0x4a, 0xc2, 0x4b, 0x12, 0xbe, 0xec, 0x05, 0xc3, 0x97, + 0x41, 0x2f, 0xec, 0x8d, 0xe9, 0x8e, 0xe4, 0x71, 0x52, 0x76, 0xb4, 0x0d, 0xcb, 0x27, 0x01, 0x09, + 0x7b, 0xd1, 0xd0, 0xf7, 0x3a, 0x07, 0xed, 0x79, 0xa6, 0x8c, 0x4a, 0x42, 0x36, 0x2c, 0x9d, 0x04, + 0x42, 0xd7, 0x6b, 0x6c, 0x5a, 0x8e, 0xd9, 0xea, 0x57, 0x1e, 0x09, 0xc5, 0x74, 0x4d, 0xac, 0x4e, + 0x49, 0xf8, 0x4b, 0x68, 0x66, 0x14, 0xae, 0xb2, 0x05, 0x59, 0x05, 0xe7, 0xdf, 0x48, 0x41, 0x1c, + 0xc2, 0xea, 0x23, 0x12, 0xb1, 0x31, 0x65, 0x73, 0xe4, 0x22, 0x86, 0xcd, 0x19, 0x0e, 0xa4, 0xc1, + 0xeb, 0x8e, 0x4a, 0xd2, 0xcd, 0x32, 0x57, 0x6e, 0x96, 0xf9, 0xac, 0x59, 0xf0, 0xd7, 0x16, 0xac, + 0x69, 0x42, 0x2b, 0xe9, 0xbd, 0x07, 0x0d, 0xa9, 0x08, 0x43, 0x3a, 0xcf, 0x8e, 0x46, 0xb9, 0xee, + 0xd9, 0x25, 0xf8, 0xb7, 0x16, 0x34, 0x4f, 0x05, 0x96, 0x44, 0xff, 0x8c, 0x3d, 0xad, 0x37, 0x3b, + 0x30, 0xaa, 0xde, 0x73, 0x86, 0xe3, 0x50, 0x7a, 0x98, 0xf0, 0x21, 0xac, 0x66, 0xc1, 0xd0, 0x00, + 0x7d, 0x5f, 0x75, 0x50, 0x01, 0x67, 0x4d, 0x9c, 0xfe, 0x74, 0xc2, 0x51, 0x98, 0xf0, 0xaf, 0xc0, + 0x4e, 0xec, 0xfb, 0x20, 0x08, 0x46, 0xc3, 0x3e, 0xfb, 0x7e, 0xac, 0x6f, 0xac, 0x9e, 0x0a, 0xd1, + 0x2a, 0x87, 0x68, 0xd8, 0xd8, 0x5b, 0x00, 0x0f, 0x43, 0x7f, 0x9c, 0xd9, 0x5a, 0x85, 0x82, 0xff, + 0x64, 0xc1, 0x07, 0x85, 0xc2, 0x2b, 0x6d, 0xf3, 0x13, 0x58, 0x4d, 0xc2, 0xc1, 0x84, 0xd0, 0x48, + 0xd9, 0xe9, 0x8f, 0x8a, 0x76, 0x45, 0xb0, 0x3a, 0xb9, 0x85, 0x38, 0x82, 0xad, 0x47, 0x24, 0x8a, + 0xb1, 0x3a, 0xe4, 0xc2, 0x60, 0x9c, 0xa2, 0xc0, 0x35, 0xdb, 0xbe, 0xfe, 0xd9, 0x82, 0x0f, 0x4b, + 0xc4, 0x56, 0xda, 0x65, 0xa3, 0x5d, 0xe6, 0xaa, 0xda, 0xe5, 0x5f, 0x16, 0xb4, 0x9e, 0x87, 0x3d, + 0x8f, 0x9e, 0x91, 0x90, 0x4d, 0xb2, 0x28, 0x15, 0x5b, 0xa4, 0x0d, 0x8b, 0xc2, 0xf5, 0x85, 0x49, + 0x92, 0x21, 0xfa, 0x14, 0xae, 0x9f, 0x8c, 0x5c, 0x35, 0xc2, 0x71, 0xcb, 0x68, 0xd4, 0x98, 0xef, + 0x98, 0xbc, 0x52, 0xf9, 0xb8, 0x89, 0x34, 0xaa, 0x6e, 0xc7, 0x6b, 0xe5, 0x51, 0xa5, 0xa6, 0x45, + 0x95, 0x27, 0xb0, 0x61, 0x52, 0xa0, 0x9a, 0x07, 0x7d, 0x65, 0xc1, 0xca, 0x63, 0x7f, 0xe8, 0xc9, + 0x7b, 0xa8, 0xd8, 0x0a, 0xb7, 0x00, 0x1c, 0x72, 0xd1, 0x25, 0x94, 0xf6, 0x06, 0x44, 0x58, 0x40, + 0xa1, 0x94, 0x45, 0xc2, 0xab, 0x35, 0xc6, 0x7b, 0xd0, 0x50, 0x70, 0x54, 0x53, 0xe6, 0x3f, 0xb1, + 0x4b, 0x6a, 0xfe, 0x18, 0x4f, 0xf8, 0x1e, 0x25, 0x22, 0xde, 0xab, 0x28, 0xac, 0x72, 0xbb, 0xeb, + 0xa7, 0x5f, 0xb1, 0xcc, 0x7c, 0xce, 0x32, 0x4a, 0xa8, 0xb8, 0xa6, 0x87, 0x8a, 0x78, 0xfe, 0xa8, + 0xe7, 0xb9, 0x23, 0xe2, 0xc6, 0x4e, 0xcf, 0xf7, 0x53, 0xa1, 0x20, 0x0c, 0x2b, 0x7c, 0xe4, 0x10, + 0x3a, 0x19, 0x45, 0xed, 0x05, 0x16, 0x2f, 0x32, 0x34, 0xfc, 0x0c, 0xb6, 0x8a, 0x55, 0xab, 0x66, + 0xae, 0x33, 0x58, 0x79, 0x36, 0x19, 0x46, 0x53, 0x6c, 0xfd, 0x6c, 0xd7, 0xe0, 0x1e, 0x34, 0x14, + 0x39, 0xd5, 0xb0, 0xbe, 0xb6, 0xa0, 0x95, 0x44, 0xdb, 0x34, 0xe5, 0x29, 0x47, 0x3d, 0x53, 0x28, + 0x8b, 0x03, 0xe4, 0xc3, 0xe1, 0x28, 0x22, 0x21, 0xdb, 0xd0, 0x9a, 0x23, 0x46, 0xb1, 0xbc, 0x63, + 0xf2, 0x8b, 0xe8, 0x94, 0x5c, 0xb0, 0x9d, 0xac, 0x39, 0xc9, 0x10, 0xff, 0xcd, 0x82, 0x0d, 0x13, + 0xc6, 0x4a, 0x97, 0xc1, 0x43, 0x80, 0x71, 0x9a, 0x0b, 0xf2, 0x6b, 0xe0, 0xd3, 0xa2, 0x70, 0xc7, + 0xa5, 0x3d, 0x9c, 0x8c, 0x46, 0xec, 0x36, 0x55, 0x56, 0xc6, 0x92, 0x3d, 0x01, 0x97, 0xeb, 0x91, + 0x0c, 0xf1, 0xef, 0x73, 0x70, 0x65, 0x62, 0x54, 0x1a, 0x04, 0x14, 0x58, 0x73, 0x2c, 0x63, 0x52, + 0xc5, 0xcd, 0x16, 0x04, 0xfe, 0x68, 0xc1, 0xa6, 0x11, 0xd2, 0xfb, 0x34, 0x21, 0xfe, 0xbb, 0x05, + 0xe8, 0xc9, 0xb0, 0x7f, 0xae, 0xf0, 0x95, 0x1b, 0xe9, 0xdb, 0xb0, 0x1a, 0xf3, 0x13, 0x97, 0x2b, + 0xae, 0x98, 0x2a, 0x47, 0x8f, 0xc1, 0x3b, 0xa4, 0x47, 0x7d, 0x4f, 0x98, 0x4b, 0x8c, 0x74, 0x63, + 0xd5, 0xca, 0x5d, 0x6e, 0x41, 0x73, 0xb9, 0xcf, 0xa1, 0xde, 0x71, 0xef, 0xf2, 0xd0, 0x51, 0x78, + 0xd5, 0x33, 0xd1, 0x2c, 0xe0, 0xf0, 0x02, 0x45, 0x8c, 0xf0, 0x97, 0xb0, 0x9e, 0x53, 0xb7, 0xd2, + 0x06, 0xdc, 0x83, 0x86, 0x44, 0xa1, 0xec, 0xc1, 0xaa, 0x70, 0x75, 0x39, 0xe7, 0x64, 0xd9, 0xf0, + 0x84, 0xf9, 0x7a, 0x7c, 0x1d, 0x10, 0x97, 0xa1, 0x48, 0x7c, 0x3d, 0x1b, 0x68, 0xad, 0x5c, 0xa0, + 0xdd, 0x86, 0x65, 0x3f, 0x1f, 0xa7, 0xfc, 0x29, 0xe3, 0xd4, 0x57, 0xdc, 0x21, 0x72, 0x72, 0x67, + 0xaa, 0x55, 0xa6, 0xce, 0xd7, 0x53, 0x76, 0xfc, 0x0f, 0x0b, 0x6e, 0x74, 0xbc, 0xcb, 0x61, 0x44, + 0x62, 0x64, 0xcf, 0x7d, 0x19, 0xa1, 0xaf, 0x8e, 0xc3, 0xc5, 0x97, 0x54, 0x7a, 0xd0, 0xae, 0x65, + 0x0e, 0xda, 0x77, 0x61, 0x8d, 0xcb, 0x52, 0x4f, 0x6b, 0x8d, 0x9d, 0xd6, 0xfc, 0x44, 0xe9, 0xa1, + 0xfb, 0xb5, 0x05, 0x2d, 0x03, 0xec, 0xff, 0xeb, 0xd1, 0xf1, 0xe0, 0x86, 0x4c, 0xca, 0x47, 0xa3, + 0x69, 0x9c, 0x75, 0xb6, 0x84, 0xf7, 0x0f, 0xca, 0xbd, 0xa4, 0x08, 0x7c, 0xaf, 0xf1, 0xea, 0x1b, + 0x0b, 0x96, 0xf6, 0xbb, 0xa7, 0x8c, 0x6d, 0xa6, 0x1a, 0xef, 0x0e, 0x34, 0xb9, 0xac, 0x1e, 0x8d, + 0x48, 0x78, 0xdc, 0x1b, 0x27, 0x69, 0x9f, 0x4e, 0x46, 0xb7, 0x45, 0x85, 0xca, 0x49, 0x1d, 0x57, + 0x98, 0x2a, 0x4b, 0x8c, 0xc3, 0xfb, 0x72, 0x62, 0xac, 0x78, 0x53, 0xb6, 0x04, 0x36, 0xf6, 0x65, + 0xbe, 0x2d, 0x29, 0x01, 0x1d, 0x00, 0xfc, 0xa4, 0x37, 0x18, 0x7a, 0xcc, 0xd4, 0xa2, 0x9f, 0x71, + 0xdb, 0x00, 0x5d, 0x64, 0xf7, 0x29, 0xaf, 0xa3, 0xac, 0x9b, 0x62, 0x0b, 0x5f, 0x5b, 0xb0, 0x92, + 0xa2, 0xa2, 0x01, 0xfa, 0x1e, 0xd4, 0x13, 0xf3, 0x51, 0xd1, 0x85, 0x69, 0x26, 0xd9, 0x89, 0xa0, + 0x3b, 0x29, 0xc7, 0x5b, 0xc2, 0x29, 0x6d, 0x31, 0x19, 0x53, 0x86, 0xb2, 0xe6, 0xa4, 0x04, 0x7c, + 0x99, 0x42, 0xa4, 0xb1, 0xe5, 0xb2, 0x32, 0xad, 0xb7, 0x63, 0x9b, 0x7c, 0x38, 0xc1, 0x7f, 0xb1, + 0xa0, 0xa1, 0x08, 0x7e, 0x5f, 0xc6, 0xb1, 0x61, 0x29, 0xb1, 0x85, 0xb0, 0x8d, 0x1c, 0xe3, 0x93, + 0xb4, 0xc7, 0x62, 0x70, 0x77, 0x37, 0xeb, 0xee, 0xee, 0x14, 0x3a, 0x9f, 0x43, 0x8b, 0x0f, 0x79, + 0xaf, 0xea, 0x34, 0xea, 0x45, 0x13, 0x5a, 0xfe, 0xd1, 0x0d, 0x58, 0xe0, 0x6c, 0xc9, 0x4d, 0xca, + 0x47, 0x53, 0x1c, 0xbe, 0x36, 0x6c, 0x98, 0x84, 0xf1, 0xca, 0x0c, 0x89, 0x29, 0x56, 0x4e, 0xfb, + 0x23, 0x72, 0x25, 0x08, 0x16, 0xb6, 0xdc, 0x24, 0xac, 0xf0, 0x51, 0xb6, 0x15, 0x39, 0xaf, 0xb5, + 0x22, 0xa7, 0x48, 0xca, 0x5a, 0xb0, 0x9e, 0xc3, 0x41, 0x03, 0xfc, 0x14, 0xae, 0x1f, 0x90, 0x11, + 0x51, 0x5a, 0x98, 0xb3, 0x18, 0x7d, 0x0d, 0x9a, 0x99, 0xaf, 0xd1, 0x00, 0x77, 0xa1, 0x99, 0x6c, + 0xec, 0xde, 0x2f, 0x3b, 0xee, 0xac, 0x12, 0xee, 0xa7, 0x0d, 0x40, 0xfe, 0x39, 0x1a, 0xa0, 0xef, + 0xa4, 0x81, 0x52, 0x38, 0x51, 0xee, 0x2c, 0x4b, 0x06, 0xfc, 0xcf, 0x5c, 0x09, 0x42, 0xf7, 0xbb, + 0xa7, 0xe5, 0xb0, 0x6c, 0x58, 0x8a, 0x8d, 0xa6, 0x84, 0x4e, 0x39, 0xd6, 0x5c, 0x63, 0xfe, 0xed, + 0xf8, 0xb0, 0x61, 0xff, 0xfe, 0x9d, 0xcf, 0xf3, 0x19, 0x6e, 0x1a, 0xa0, 0x1f, 0xc3, 0x22, 0xbf, + 0x37, 0x12, 0x57, 0x9e, 0xf6, 0xba, 0x49, 0x96, 0xa1, 0x43, 0x83, 0x7f, 0x7f, 0xcb, 0xa8, 0x04, + 0xaf, 0x55, 0x0b, 0xb4, 0xb8, 0x05, 0xc0, 0x25, 0x28, 0xe1, 0x4f, 0xa1, 0xe0, 0xdf, 0x59, 0xd0, + 0x76, 0xc8, 0xd8, 0xbf, 0x24, 0x6f, 0x64, 0xfe, 0x36, 0x2c, 0x72, 0x27, 0xa0, 0x22, 0xff, 0x4e, + 0x86, 0x6f, 0xd4, 0xef, 0x76, 0xb5, 0x7e, 0xb7, 0x8b, 0xbb, 0x70, 0xb3, 0x00, 0x0d, 0xbf, 0xf8, + 0xe9, 0xa4, 0xdf, 0x27, 0x94, 0x8a, 0x8e, 0x72, 0x32, 0x8c, 0x3d, 0xf4, 0xac, 0x37, 0x1c, 0x11, + 0x57, 0xa0, 0x11, 0x23, 0xfc, 0xb5, 0x05, 0xad, 0x07, 0xae, 0xfb, 0x2e, 0x54, 0x73, 0xf3, 0xaa, + 0xb9, 0xa5, 0xaa, 0x3d, 0x86, 0x0d, 0x13, 0x94, 0x4a, 0x7a, 0x0d, 0xa1, 0x79, 0x30, 0xa4, 0xe3, + 0x21, 0xa5, 0x32, 0x46, 0xd8, 0xb0, 0xe4, 0x6b, 0x3d, 0x59, 0x3f, 0x98, 0x3a, 0x7b, 0x6f, 0xc3, + 0xe2, 0x20, 0x9b, 0xdd, 0x8a, 0x21, 0x3e, 0x84, 0xd5, 0xac, 0x28, 0xde, 0x66, 0xe8, 0x4f, 0xd3, + 0x66, 0x48, 0x99, 0xf0, 0x5f, 0x2d, 0x40, 0xdd, 0x49, 0x44, 0xb4, 0xeb, 0xe4, 0x1d, 0xa1, 0x8e, + 0x0d, 0x37, 0x51, 0x9b, 0x46, 0x62, 0x84, 0x30, 0xac, 0x8c, 0x27, 0x11, 0x71, 0x4f, 0x49, 0xdf, + 0xf7, 0x5c, 0xca, 0xaa, 0xbf, 0x86, 0x93, 0xa1, 0xe1, 0x23, 0x58, 0xcf, 0x21, 0xad, 0xa6, 0xf4, + 0x6f, 0x2c, 0x68, 0xef, 0xf7, 0xbc, 0x3e, 0x19, 0xbd, 0x7f, 0xd5, 0xf1, 0x31, 0xdc, 0x2c, 0xc0, + 0x52, 0x4d, 0xb9, 0x33, 0x58, 0x91, 0x5f, 0x7a, 0x97, 0x07, 0x70, 0x0f, 0x1a, 0x8a, 0x9c, 0x6a, + 0x58, 0x47, 0x80, 0x34, 0xdd, 0xdf, 0x25, 0xe2, 0x23, 0x58, 0xcf, 0x49, 0xab, 0x84, 0xfb, 0xee, + 0x37, 0x6b, 0xc0, 0xdf, 0x61, 0xd1, 0x0f, 0x61, 0xb9, 0x9f, 0x3e, 0xf3, 0xa1, 0x56, 0xb2, 0x2e, + 0xf3, 0xd6, 0x69, 0x6f, 0x98, 0xc8, 0x34, 0x40, 0xf7, 0xa0, 0xfe, 0xf3, 0xa4, 0x07, 0x8c, 0xd6, + 0x05, 0x93, 0xda, 0x9d, 0xb6, 0x6f, 0xe4, 0x89, 0x7c, 0xdd, 0x45, 0xd2, 0x60, 0x94, 0xeb, 0xd4, + 0xd6, 0xa6, 0x5c, 0x97, 0xed, 0x43, 0xee, 0x41, 0x63, 0xa0, 0x3e, 0xcf, 0xa1, 0xcd, 0xe4, 0xb1, + 0x55, 0x7b, 0x29, 0xb4, 0xdb, 0xe6, 0x09, 0x1a, 0xa0, 0xfb, 0xb0, 0x42, 0x95, 0x97, 0x2c, 0x94, + 0xe8, 0xa6, 0xbd, 0xb5, 0xd9, 0x9b, 0x46, 0x3a, 0x0d, 0xd0, 0xcf, 0x60, 0x73, 0x60, 0x7e, 0x46, + 0x42, 0x1f, 0x6b, 0x52, 0xf3, 0xcf, 0x38, 0x36, 0xbe, 0x8a, 0x85, 0x06, 0xe8, 0x0c, 0x6e, 0x0e, + 0x8a, 0xde, 0x64, 0xd0, 0x27, 0xe9, 0x07, 0x0a, 0x1f, 0x8b, 0xec, 0xdb, 0x57, 0x33, 0xd1, 0x00, + 0x3d, 0x03, 0x14, 0xe5, 0x1e, 0x26, 0xd0, 0x96, 0x58, 0x6b, 0x7c, 0x74, 0xb1, 0x3f, 0x2c, 0x99, + 0xa5, 0x01, 0xea, 0x43, 0x7b, 0x50, 0xd0, 0xf5, 0x46, 0x38, 0xf3, 0x32, 0x6e, 0xec, 0xf8, 0xdb, + 0x9f, 0x5c, 0xc9, 0xc3, 0x71, 0x0f, 0x72, 0x6d, 0x5b, 0x89, 0xdb, 0xd8, 0x75, 0x96, 0xb8, 0x0b, + 0xfa, 0xbd, 0xcf, 0x61, 0x7d, 0x90, 0xef, 0x63, 0x22, 0xf3, 0x2a, 0x79, 0xca, 0x6e, 0x95, 0x4d, + 0xd3, 0x00, 0x1d, 0x41, 0xf3, 0x3c, 0xdb, 0x98, 0x43, 0xc9, 0xdf, 0x03, 0xf2, 0xfd, 0x49, 0xdb, + 0x2e, 0x9a, 0x92, 0x2a, 0x6b, 0x9d, 0x2e, 0x55, 0xe5, 0x7c, 0xf3, 0x4d, 0x55, 0xd9, 0xd4, 0x22, + 0x3b, 0x86, 0xb5, 0xa1, 0xde, 0xfc, 0x41, 0x1f, 0x24, 0xfd, 0x1a, 0x43, 0x37, 0xcb, 0xde, 0x2a, + 0x9e, 0xe4, 0xdf, 0x1b, 0xe8, 0x8d, 0x15, 0xf9, 0x3d, 0x53, 0x8f, 0xc7, 0xde, 0x2a, 0x9e, 0xe4, + 0x8e, 0xaa, 0xe6, 0xff, 0xd2, 0x51, 0xb5, 0x1a, 0xc3, 0xde, 0x34, 0xd2, 0x69, 0x80, 0x3e, 0x83, + 0xa5, 0x84, 0x86, 0x90, 0xc6, 0x14, 0x2f, 0x5c, 0xcf, 0xd1, 0x78, 0x68, 0x92, 0x31, 0x03, 0xe9, + 0x1c, 0x54, 0x0d, 0x4d, 0xd9, 0x32, 0xfb, 0x99, 0x2c, 0xfe, 0x94, 0xba, 0x50, 0x6e, 0x90, 0xb1, + 0x3e, 0x95, 0x1b, 0x64, 0x2e, 0x28, 0xe3, 0xd3, 0xa3, 0xd5, 0x71, 0xf2, 0xf4, 0xe4, 0xeb, 0x4c, + 0x79, 0x7a, 0x0c, 0xa5, 0x5f, 0x1c, 0xe5, 0x95, 0x62, 0x4d, 0x46, 0xf9, 0x6c, 0x39, 0x28, 0xa3, + 0xbc, 0x56, 0xd7, 0xc5, 0xaa, 0xe5, 0xcb, 0x91, 0x02, 0x77, 0x13, 0x79, 0x70, 0x81, 0xbb, 0xc9, + 0xd4, 0xf4, 0x05, 0xb4, 0x8c, 0xf9, 0x38, 0xfa, 0x48, 0xac, 0x2b, 0xaa, 0x1d, 0xec, 0xed, 0x72, + 0x06, 0x0e, 0x37, 0x9f, 0x10, 0x4b, 0xb8, 0xc6, 0xb4, 0x5d, 0xc2, 0x2d, 0xc8, 0xa4, 0xef, 0xc3, + 0x8a, 0x9a, 0xac, 0xca, 0xa3, 0xa8, 0x25, 0xcb, 0xf2, 0x28, 0xe6, 0x32, 0xdb, 0x23, 0x68, 0x6a, + 0xe9, 0x91, 0xdc, 0xca, 0x7c, 0x0a, 0x27, 0xb7, 0xd2, 0x94, 0x51, 0xbd, 0x80, 0x96, 0x31, 0xdd, + 0x92, 0x96, 0x2b, 0x4a, 0x0c, 0xa5, 0xe5, 0x8a, 0xb3, 0xb5, 0x7b, 0x50, 0x97, 0x64, 0x79, 0xf6, + 0xd5, 0xd4, 0x46, 0x9e, 0xfd, 0x6c, 0x06, 0x72, 0x04, 0x4d, 0xed, 0xa3, 0x52, 0xbb, 0x7c, 0x7a, + 0x24, 0xb5, 0x33, 0xe4, 0x32, 0x7b, 0xcd, 0x17, 0x8d, 0x1d, 0xfe, 0x77, 0xb1, 0xcf, 0xd9, 0xef, + 0x17, 0x0b, 0xec, 0xbf, 0x60, 0x9f, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x2b, 0x24, 0xa7, + 0x4a, 0x26, 0x00, 0x00, +} diff --git a/pkg/proto/group/group.proto b/pkg/proto/group/group.proto new file mode 100644 index 000000000..201bf6ef5 --- /dev/null +++ b/pkg/proto/group/group.proto @@ -0,0 +1,423 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./group;group"; +package group; + +message CommonResp{ + int32 ErrCode = 1; + string ErrMsg = 2; +} + +message GroupAddMemberInfo{ + string UserID = 1; + int32 RoleLevel = 2; +} + + +message CreateGroupReq{ + repeated GroupAddMemberInfo InitMemberList = 1; + server_api_params.GroupInfo GroupInfo = 2; + string OperationID = 3; + string OpUserID = 4; //app manager or group owner + string OwnerUserID = 5; //owner + + +} +message CreateGroupResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + server_api_params.GroupInfo GroupInfo = 3; +} + + +message GetGroupsInfoReq{ + repeated string GroupIDList = 1; + string OperationID = 2; + string OpUserID = 3; //No verification permission +} +message GetGroupsInfoResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupInfo GroupInfoList = 3; +} + + +message SetGroupInfoReq{ + server_api_params.GroupInfo GroupInfo = 1; + string OpUserID = 2; //app manager or group owner + string OperationID = 3; +} +message SetGroupInfoResp{ + CommonResp CommonResp = 1; +} + + +message GetGroupApplicationListReq { + string OpUserID = 1; //app manager or group owner(manager) + string OperationID = 2; + string FromUserID = 3; //owner or manager +} +message GetGroupApplicationListResp { + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupRequest GroupRequestList = 3; +} + +message GetUserReqApplicationListReq{ + string UserID = 1; + string OpUserID = 2; + string OperationID = 3; +} + +message GetUserReqApplicationListResp{ + CommonResp CommonResp = 1; + repeated server_api_params.GroupRequest GroupRequestList = 2; +} + + +message TransferGroupOwnerReq { + string GroupID = 1; + string OldOwnerUserID = 2; + string NewOwnerUserID = 3; + string OperationID = 4; + string OpUserID = 5; //app manager or group owner +} +message TransferGroupOwnerResp{ + CommonResp CommonResp = 1; +} + +message JoinGroupReq{ + string GroupID = 1; + string ReqMessage = 2; + string OpUserID = 3; + string OperationID = 4; +} +message JoinGroupResp{ + CommonResp CommonResp = 1; +} + + +message GroupApplicationResponseReq{ + string OperationID = 1; + string OpUserID = 2; + string GroupID = 3; + string FromUserID = 4; // + string HandledMsg = 5; + int32 HandleResult = 6; +} +message GroupApplicationResponseResp{ + CommonResp CommonResp = 1; +} + + + +message QuitGroupReq{ + string GroupID = 1; + string OperationID = 2; + string OpUserID = 3; +} +message QuitGroupResp{ + CommonResp CommonResp = 1; +} + + + +message GetGroupMemberListReq { + string GroupID = 1; + string OpUserID = 2; //No verification permission + string OperationID = 3; + int32 Filter = 4; + int32 NextSeq = 5; +} + +message GetGroupMemberListResp { + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupMemberFullInfo memberList = 3; + int32 nextSeq = 4; +} + + +message GetGroupMembersInfoReq { + string GroupID = 1; + repeated string memberList = 2; + string OpUserID = 3; //No verification permission + string OperationID = 4; +} + +message GetGroupMembersInfoResp { + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupMemberFullInfo memberList = 3; +} + +message KickGroupMemberReq { + string GroupID = 1; + repeated string KickedUserIDList = 2; + string Reason = 3; + string OperationID = 5; + string OpUserID = 6; //app manger or group manager +} + +message Id2Result { + string UserID = 1; + int32 Result = 2; //0 ok; -1 error +} + +message KickGroupMemberResp { + int32 ErrCode = 1; + string ErrMsg = 2; + repeated Id2Result Id2ResultList = 3; +} + + +message GetJoinedGroupListReq { + string FromUserID = 1; + string operationID = 2; + string OpUserID = 3; //app manager or FromUserID +} +message GetJoinedGroupListResp{ + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupInfo GroupList = 3; +} + + +message InviteUserToGroupReq { + string OperationID = 2; + string GroupID = 3; + string Reason = 4; + repeated string InvitedUserIDList = 5; + string OpUserID = 6; //group member or app manager +} +message InviteUserToGroupResp { + int32 ErrCode = 1; + string ErrMsg = 2; + repeated Id2Result Id2ResultList = 3; // 0 ok, -1 error +} + + +message GetGroupAllMemberReq { + string GroupID = 1; + string OpUserID = 2; //No verification permission + string OperationID = 3; +} +message GetGroupAllMemberResp { + int32 ErrCode = 1; + string ErrMsg = 2; + repeated server_api_params.GroupMemberFullInfo memberList = 3; +} + +message CMSGroup { + server_api_params.GroupInfo GroupInfo = 1; + string GroupMasterName = 2; + string GroupMasterId = 3; +} + +message GetGroupReq { + string GroupName = 1; + server_api_params.RequestPagination Pagination = 2; + string OperationID = 3; +} + +message GetGroupResp { + repeated CMSGroup CMSGroups = 1; + server_api_params.RequestPagination Pagination = 2; + int32 GroupNums = 3; +} + +message GetGroupsReq { + server_api_params.RequestPagination Pagination = 1; + string OperationID = 2; +} + +message GetGroupsResp { + repeated CMSGroup CMSGroups = 1; + server_api_params.RequestPagination Pagination = 2; + int32 GroupNum = 3; +} + +message GetGroupMemberReq { + string GroupId = 1; + string OperationID = 2; +} + +message OperateGroupStatusReq { + string GroupId = 1; + int32 Status = 2; + string OperationID = 3; +} + +message OperateGroupStatusResp { + +} + +message OperateUserRoleReq { + string GroupId = 1; + string UserId = 2; + int32 RoleLevel = 3; + string OperationID = 4; +} + +message OperateUserRoleResp { + +} + +message DeleteGroupReq { + string GroupId = 1; + string OperationID = 2; +} + +message DeleteGroupResp { + +} + +message GetGroupByIdReq { + string GroupId = 1; + string OperationID = 2; +} + +message GetGroupByIdResp { + CMSGroup CMSGroup = 1; +} + +message GetGroupMembersCMSReq { + string GroupId = 1; + string UserName = 2; + server_api_params.RequestPagination Pagination = 3; + string OperationID = 4; +} + +message GetGroupMembersCMSResp { + repeated server_api_params.GroupMemberFullInfo members = 1; + server_api_params.ResponsePagination Pagination = 2; + int32 MemberNums = 3; +} + +message RemoveGroupMembersCMSReq { + string GroupId = 1; + repeated string UserIds = 2; + string OperationID = 3; + string OpUserId = 4; +} + +message RemoveGroupMembersCMSResp { + repeated string success = 1; + repeated string failed = 2; +} + +message AddGroupMembersCMSReq { + string GroupId = 1; + repeated string UserIds = 2; + string OperationId = 3; + string OpUserId = 4; +} + +message AddGroupMembersCMSResp { + repeated string success = 1; + repeated string failed = 2; +} + +message DismissGroupReq{ + string opUserID = 1; //group or app manager + string operationID = 2; + string groupID = 3; +} + +message DismissGroupResp{ + CommonResp commonResp = 1; +} + + +message MuteGroupMemberReq{ + string opUserID = 1; //group or app manager + string operationID = 2; + string groupID = 3; + string userID = 4; + uint32 mutedSeconds = 5; +} + +message MuteGroupMemberResp{ + CommonResp commonResp = 1; +} + + + +message CancelMuteGroupMemberReq{ + string opUserID = 1; //group or app manager + string operationID = 2; + string groupID = 3; + string userID = 4; +} + +message CancelMuteGroupMemberResp{ + CommonResp commonResp = 1; +} + + +message MuteGroupReq{ + string opUserID = 1; //group or app manager + string operationID = 2; + string groupID = 3; +} + +message MuteGroupResp{ + CommonResp commonResp = 1; +} + + + +message CancelMuteGroupReq{ + string opUserID = 1; //group or app manager + string operationID = 2; + string groupID = 3; +} + +message CancelMuteGroupResp{ + CommonResp commonResp = 1; +} + + + + + +service group{ + rpc createGroup(CreateGroupReq) returns(CreateGroupResp); + rpc joinGroup(JoinGroupReq) returns(JoinGroupResp); + rpc quitGroup(QuitGroupReq) returns(QuitGroupResp); + rpc getGroupsInfo(GetGroupsInfoReq) returns(GetGroupsInfoResp); + rpc setGroupInfo(SetGroupInfoReq) returns(SetGroupInfoResp); + rpc getGroupApplicationList(GetGroupApplicationListReq) returns(GetGroupApplicationListResp); + rpc getUserReqApplicationList(GetUserReqApplicationListReq) returns(GetUserReqApplicationListResp); + rpc transferGroupOwner(TransferGroupOwnerReq) returns(TransferGroupOwnerResp); + rpc groupApplicationResponse(GroupApplicationResponseReq) returns(GroupApplicationResponseResp); + rpc getGroupMemberList(GetGroupMemberListReq) returns(GetGroupMemberListResp); + rpc getGroupMembersInfo(GetGroupMembersInfoReq) returns(GetGroupMembersInfoResp); + rpc kickGroupMember(KickGroupMemberReq) returns (KickGroupMemberResp); + rpc getJoinedGroupList(GetJoinedGroupListReq) returns (GetJoinedGroupListResp); + rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp); + rpc getGroupAllMember(GetGroupAllMemberReq) returns(GetGroupAllMemberResp); + + rpc GetGroupById(GetGroupByIdReq) returns(GetGroupByIdResp); + rpc GetGroup(GetGroupReq) returns(GetGroupResp); + rpc GetGroups(GetGroupsReq) returns(GetGroupsResp); + rpc OperateGroupStatus(OperateGroupStatusReq) returns(OperateGroupStatusResp); + rpc OperateUserRole(OperateUserRoleReq) returns(OperateUserRoleResp); + rpc DeleteGroup(DeleteGroupReq) returns(DeleteGroupResp); + rpc GetGroupMembersCMS(GetGroupMembersCMSReq) returns(GetGroupMembersCMSResp); + rpc RemoveGroupMembersCMS(RemoveGroupMembersCMSReq) returns(RemoveGroupMembersCMSResp); + rpc AddGroupMembersCMS(AddGroupMembersCMSReq) returns(AddGroupMembersCMSResp); + + rpc DismissGroup(DismissGroupReq) returns(DismissGroupResp); + rpc MuteGroupMember(MuteGroupMemberReq) returns(MuteGroupMemberResp); + rpc CancelMuteGroupMember(CancelMuteGroupMemberReq) returns(CancelMuteGroupMemberResp); + rpc MuteGroup(MuteGroupReq) returns(MuteGroupResp); + rpc CancelMuteGroup(CancelMuteGroupReq) returns(CancelMuteGroupResp); +} + + + + + + + diff --git a/pkg/proto/message_cms/message_cms.pb.go b/pkg/proto/message_cms/message_cms.pb.go new file mode 100644 index 000000000..317439903 --- /dev/null +++ b/pkg/proto/message_cms/message_cms.pb.go @@ -0,0 +1,1083 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.15.5 +// source: message_cms/message_cms.proto + +package message_cms + +import ( + sdk_ws "Open_IM/pkg/proto/sdk_ws" + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type BoradcastMessageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *BoradcastMessageReq) Reset() { + *x = BoradcastMessageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BoradcastMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoradcastMessageReq) ProtoMessage() {} + +func (x *BoradcastMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BoradcastMessageReq.ProtoReflect.Descriptor instead. +func (*BoradcastMessageReq) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{0} +} + +func (x *BoradcastMessageReq) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *BoradcastMessageReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type BoradcastMessageResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *BoradcastMessageResp) Reset() { + *x = BoradcastMessageResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BoradcastMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BoradcastMessageResp) ProtoMessage() {} + +func (x *BoradcastMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BoradcastMessageResp.ProtoReflect.Descriptor instead. +func (*BoradcastMessageResp) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{1} +} + +type MassSendMessageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"` + UserIds []string `protobuf:"bytes,2,rep,name=UserIds,proto3" json:"UserIds,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *MassSendMessageReq) Reset() { + *x = MassSendMessageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MassSendMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MassSendMessageReq) ProtoMessage() {} + +func (x *MassSendMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MassSendMessageReq.ProtoReflect.Descriptor instead. +func (*MassSendMessageReq) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{2} +} + +func (x *MassSendMessageReq) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *MassSendMessageReq) GetUserIds() []string { + if x != nil { + return x.UserIds + } + return nil +} + +func (x *MassSendMessageReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type MassSendMessageResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MassSendMessageResp) Reset() { + *x = MassSendMessageResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MassSendMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MassSendMessageResp) ProtoMessage() {} + +func (x *MassSendMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MassSendMessageResp.ProtoReflect.Descriptor instead. +func (*MassSendMessageResp) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{3} +} + +type GetChatLogsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Content string `protobuf:"bytes,1,opt,name=Content,proto3" json:"Content,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId,omitempty"` + GroupId string `protobuf:"bytes,3,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + Date string `protobuf:"bytes,4,opt,name=Date,proto3" json:"Date,omitempty"` + SessionType int32 `protobuf:"varint,5,opt,name=SessionType,proto3" json:"SessionType,omitempty"` + ContentType int32 `protobuf:"varint,6,opt,name=ContentType,proto3" json:"ContentType,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,7,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,8,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetChatLogsReq) Reset() { + *x = GetChatLogsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetChatLogsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetChatLogsReq) ProtoMessage() {} + +func (x *GetChatLogsReq) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetChatLogsReq.ProtoReflect.Descriptor instead. +func (*GetChatLogsReq) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{4} +} + +func (x *GetChatLogsReq) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *GetChatLogsReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *GetChatLogsReq) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *GetChatLogsReq) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *GetChatLogsReq) GetSessionType() int32 { + if x != nil { + return x.SessionType + } + return 0 +} + +func (x *GetChatLogsReq) GetContentType() int32 { + if x != nil { + return x.ContentType + } + return 0 +} + +func (x *GetChatLogsReq) GetPagination() *sdk_ws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetChatLogsReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type ChatLogs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SessionType int32 `protobuf:"varint,1,opt,name=SessionType,proto3" json:"SessionType,omitempty"` + ContentType int32 `protobuf:"varint,2,opt,name=ContentType,proto3" json:"ContentType,omitempty"` + SenderNickName string `protobuf:"bytes,3,opt,name=SenderNickName,proto3" json:"SenderNickName,omitempty"` + SenderId string `protobuf:"bytes,4,opt,name=SenderId,proto3" json:"SenderId,omitempty"` + ReciverNickName string `protobuf:"bytes,5,opt,name=ReciverNickName,proto3" json:"ReciverNickName,omitempty"` + ReciverId string `protobuf:"bytes,6,opt,name=ReciverId,proto3" json:"ReciverId,omitempty"` + SearchContent string `protobuf:"bytes,7,opt,name=SearchContent,proto3" json:"SearchContent,omitempty"` + WholeContent string `protobuf:"bytes,8,opt,name=WholeContent,proto3" json:"WholeContent,omitempty"` + GroupId string `protobuf:"bytes,9,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + GroupName string `protobuf:"bytes,10,opt,name=GroupName,proto3" json:"GroupName,omitempty"` + Date string `protobuf:"bytes,11,opt,name=Date,proto3" json:"Date,omitempty"` +} + +func (x *ChatLogs) Reset() { + *x = ChatLogs{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChatLogs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChatLogs) ProtoMessage() {} + +func (x *ChatLogs) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChatLogs.ProtoReflect.Descriptor instead. +func (*ChatLogs) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{5} +} + +func (x *ChatLogs) GetSessionType() int32 { + if x != nil { + return x.SessionType + } + return 0 +} + +func (x *ChatLogs) GetContentType() int32 { + if x != nil { + return x.ContentType + } + return 0 +} + +func (x *ChatLogs) GetSenderNickName() string { + if x != nil { + return x.SenderNickName + } + return "" +} + +func (x *ChatLogs) GetSenderId() string { + if x != nil { + return x.SenderId + } + return "" +} + +func (x *ChatLogs) GetReciverNickName() string { + if x != nil { + return x.ReciverNickName + } + return "" +} + +func (x *ChatLogs) GetReciverId() string { + if x != nil { + return x.ReciverId + } + return "" +} + +func (x *ChatLogs) GetSearchContent() string { + if x != nil { + return x.SearchContent + } + return "" +} + +func (x *ChatLogs) GetWholeContent() string { + if x != nil { + return x.WholeContent + } + return "" +} + +func (x *ChatLogs) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *ChatLogs) GetGroupName() string { + if x != nil { + return x.GroupName + } + return "" +} + +func (x *ChatLogs) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +type GetChatLogsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChatLogs []*ChatLogs `protobuf:"bytes,1,rep,name=ChatLogs,proto3" json:"ChatLogs,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination,proto3" json:"Pagination,omitempty"` + ChatLogsNum int32 `protobuf:"varint,3,opt,name=ChatLogsNum,proto3" json:"ChatLogsNum,omitempty"` +} + +func (x *GetChatLogsResp) Reset() { + *x = GetChatLogsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetChatLogsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetChatLogsResp) ProtoMessage() {} + +func (x *GetChatLogsResp) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetChatLogsResp.ProtoReflect.Descriptor instead. +func (*GetChatLogsResp) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{6} +} + +func (x *GetChatLogsResp) GetChatLogs() []*ChatLogs { + if x != nil { + return x.ChatLogs + } + return nil +} + +func (x *GetChatLogsResp) GetPagination() *sdk_ws.ResponsePagination { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *GetChatLogsResp) GetChatLogsNum() int32 { + if x != nil { + return x.ChatLogsNum + } + return 0 +} + +type WithdrawMessageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServerMsgId string `protobuf:"bytes,1,opt,name=ServerMsgId,proto3" json:"ServerMsgId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *WithdrawMessageReq) Reset() { + *x = WithdrawMessageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WithdrawMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WithdrawMessageReq) ProtoMessage() {} + +func (x *WithdrawMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WithdrawMessageReq.ProtoReflect.Descriptor instead. +func (*WithdrawMessageReq) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{7} +} + +func (x *WithdrawMessageReq) GetServerMsgId() string { + if x != nil { + return x.ServerMsgId + } + return "" +} + +func (x *WithdrawMessageReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type WithdrawMessageResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *WithdrawMessageResp) Reset() { + *x = WithdrawMessageResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_cms_message_cms_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WithdrawMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WithdrawMessageResp) ProtoMessage() {} + +func (x *WithdrawMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_cms_message_cms_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WithdrawMessageResp.ProtoReflect.Descriptor instead. +func (*WithdrawMessageResp) Descriptor() ([]byte, []int) { + return file_message_cms_message_cms_proto_rawDescGZIP(), []int{8} +} + +var File_message_cms_message_cms_proto protoreflect.FileDescriptor + +var file_message_cms_message_cms_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x1a, 0x21, 0x4f, 0x70, + 0x65, 0x6e, 0x5f, 0x49, 0x4d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x73, 0x64, 0x6b, 0x5f, 0x77, 0x73, 0x2f, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x51, 0x0a, 0x13, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x22, 0x16, 0x0a, 0x14, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x6a, 0x0a, 0x12, 0x4d, 0x61, + 0x73, 0x73, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x15, 0x0a, 0x13, 0x4d, 0x61, 0x73, 0x73, 0x53, 0x65, + 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x9c, 0x02, + 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, + 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x44, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, + 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xf0, 0x02, 0x0a, + 0x08, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, + 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, 0x63, + 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x69, 0x76, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x52, 0x65, 0x63, 0x69, + 0x76, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x52, + 0x65, 0x63, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x52, 0x65, 0x63, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x22, 0x0a, 0x0c, 0x57, 0x68, 0x6f, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x57, 0x68, 0x6f, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x44, + 0x61, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, 0x22, + 0xad, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x08, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6d, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x08, 0x43, 0x68, + 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x45, 0x0a, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0a, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, + 0x0b, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x4e, 0x75, 0x6d, 0x22, + 0x58, 0x0a, 0x12, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, + 0x73, 0x67, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x15, 0x0a, 0x13, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x32, 0xdb, 0x02, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x4d, 0x53, 0x12, + 0x57, 0x0a, 0x10, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, + 0x73, 0x2e, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, + 0x63, 0x6d, 0x73, 0x2e, 0x42, 0x6f, 0x72, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x0f, 0x4d, 0x61, 0x73, 0x73, + 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x4d, 0x61, 0x73, 0x73, 0x53, 0x65, + 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x4d, 0x61, 0x73, 0x73, 0x53, + 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x48, + 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x1b, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, + 0x68, 0x61, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, + 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x0f, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x2e, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x1b, + 0x5a, 0x19, 0x2e, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x3b, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6d, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_message_cms_message_cms_proto_rawDescOnce sync.Once + file_message_cms_message_cms_proto_rawDescData = file_message_cms_message_cms_proto_rawDesc +) + +func file_message_cms_message_cms_proto_rawDescGZIP() []byte { + file_message_cms_message_cms_proto_rawDescOnce.Do(func() { + file_message_cms_message_cms_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_cms_message_cms_proto_rawDescData) + }) + return file_message_cms_message_cms_proto_rawDescData +} + +var file_message_cms_message_cms_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_message_cms_message_cms_proto_goTypes = []interface{}{ + (*BoradcastMessageReq)(nil), // 0: message_cms.BoradcastMessageReq + (*BoradcastMessageResp)(nil), // 1: message_cms.BoradcastMessageResp + (*MassSendMessageReq)(nil), // 2: message_cms.MassSendMessageReq + (*MassSendMessageResp)(nil), // 3: message_cms.MassSendMessageResp + (*GetChatLogsReq)(nil), // 4: message_cms.GetChatLogsReq + (*ChatLogs)(nil), // 5: message_cms.ChatLogs + (*GetChatLogsResp)(nil), // 6: message_cms.GetChatLogsResp + (*WithdrawMessageReq)(nil), // 7: message_cms.WithdrawMessageReq + (*WithdrawMessageResp)(nil), // 8: message_cms.WithdrawMessageResp + (*sdk_ws.RequestPagination)(nil), // 9: server_api_params.RequestPagination + (*sdk_ws.ResponsePagination)(nil), // 10: server_api_params.ResponsePagination +} +var file_message_cms_message_cms_proto_depIdxs = []int32{ + 9, // 0: message_cms.GetChatLogsReq.Pagination:type_name -> server_api_params.RequestPagination + 5, // 1: message_cms.GetChatLogsResp.ChatLogs:type_name -> message_cms.ChatLogs + 10, // 2: message_cms.GetChatLogsResp.Pagination:type_name -> server_api_params.ResponsePagination + 0, // 3: message_cms.messageCMS.BoradcastMessage:input_type -> message_cms.BoradcastMessageReq + 2, // 4: message_cms.messageCMS.MassSendMessage:input_type -> message_cms.MassSendMessageReq + 4, // 5: message_cms.messageCMS.GetChatLogs:input_type -> message_cms.GetChatLogsReq + 7, // 6: message_cms.messageCMS.WithdrawMessage:input_type -> message_cms.WithdrawMessageReq + 1, // 7: message_cms.messageCMS.BoradcastMessage:output_type -> message_cms.BoradcastMessageResp + 3, // 8: message_cms.messageCMS.MassSendMessage:output_type -> message_cms.MassSendMessageResp + 6, // 9: message_cms.messageCMS.GetChatLogs:output_type -> message_cms.GetChatLogsResp + 8, // 10: message_cms.messageCMS.WithdrawMessage:output_type -> message_cms.WithdrawMessageResp + 7, // [7:11] is the sub-list for method output_type + 3, // [3:7] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_message_cms_message_cms_proto_init() } +func file_message_cms_message_cms_proto_init() { + if File_message_cms_message_cms_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_cms_message_cms_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BoradcastMessageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BoradcastMessageResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MassSendMessageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MassSendMessageResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetChatLogsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChatLogs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetChatLogsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WithdrawMessageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_cms_message_cms_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WithdrawMessageResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_cms_message_cms_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_message_cms_message_cms_proto_goTypes, + DependencyIndexes: file_message_cms_message_cms_proto_depIdxs, + MessageInfos: file_message_cms_message_cms_proto_msgTypes, + }.Build() + File_message_cms_message_cms_proto = out.File + file_message_cms_message_cms_proto_rawDesc = nil + file_message_cms_message_cms_proto_goTypes = nil + file_message_cms_message_cms_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// MessageCMSClient is the client API for MessageCMS service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MessageCMSClient interface { + BoradcastMessage(ctx context.Context, in *BoradcastMessageReq, opts ...grpc.CallOption) (*BoradcastMessageResp, error) + MassSendMessage(ctx context.Context, in *MassSendMessageReq, opts ...grpc.CallOption) (*MassSendMessageResp, error) + GetChatLogs(ctx context.Context, in *GetChatLogsReq, opts ...grpc.CallOption) (*GetChatLogsResp, error) + WithdrawMessage(ctx context.Context, in *WithdrawMessageReq, opts ...grpc.CallOption) (*WithdrawMessageResp, error) +} + +type messageCMSClient struct { + cc grpc.ClientConnInterface +} + +func NewMessageCMSClient(cc grpc.ClientConnInterface) MessageCMSClient { + return &messageCMSClient{cc} +} + +func (c *messageCMSClient) BoradcastMessage(ctx context.Context, in *BoradcastMessageReq, opts ...grpc.CallOption) (*BoradcastMessageResp, error) { + out := new(BoradcastMessageResp) + err := c.cc.Invoke(ctx, "/message_cms.messageCMS/BoradcastMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageCMSClient) MassSendMessage(ctx context.Context, in *MassSendMessageReq, opts ...grpc.CallOption) (*MassSendMessageResp, error) { + out := new(MassSendMessageResp) + err := c.cc.Invoke(ctx, "/message_cms.messageCMS/MassSendMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageCMSClient) GetChatLogs(ctx context.Context, in *GetChatLogsReq, opts ...grpc.CallOption) (*GetChatLogsResp, error) { + out := new(GetChatLogsResp) + err := c.cc.Invoke(ctx, "/message_cms.messageCMS/GetChatLogs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageCMSClient) WithdrawMessage(ctx context.Context, in *WithdrawMessageReq, opts ...grpc.CallOption) (*WithdrawMessageResp, error) { + out := new(WithdrawMessageResp) + err := c.cc.Invoke(ctx, "/message_cms.messageCMS/WithdrawMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MessageCMSServer is the server API for MessageCMS service. +type MessageCMSServer interface { + BoradcastMessage(context.Context, *BoradcastMessageReq) (*BoradcastMessageResp, error) + MassSendMessage(context.Context, *MassSendMessageReq) (*MassSendMessageResp, error) + GetChatLogs(context.Context, *GetChatLogsReq) (*GetChatLogsResp, error) + WithdrawMessage(context.Context, *WithdrawMessageReq) (*WithdrawMessageResp, error) +} + +// UnimplementedMessageCMSServer can be embedded to have forward compatible implementations. +type UnimplementedMessageCMSServer struct { +} + +func (*UnimplementedMessageCMSServer) BoradcastMessage(context.Context, *BoradcastMessageReq) (*BoradcastMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method BoradcastMessage not implemented") +} +func (*UnimplementedMessageCMSServer) MassSendMessage(context.Context, *MassSendMessageReq) (*MassSendMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method MassSendMessage not implemented") +} +func (*UnimplementedMessageCMSServer) GetChatLogs(context.Context, *GetChatLogsReq) (*GetChatLogsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChatLogs not implemented") +} +func (*UnimplementedMessageCMSServer) WithdrawMessage(context.Context, *WithdrawMessageReq) (*WithdrawMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawMessage not implemented") +} + +func RegisterMessageCMSServer(s *grpc.Server, srv MessageCMSServer) { + s.RegisterService(&_MessageCMS_serviceDesc, srv) +} + +func _MessageCMS_BoradcastMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BoradcastMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageCMSServer).BoradcastMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/message_cms.messageCMS/BoradcastMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageCMSServer).BoradcastMessage(ctx, req.(*BoradcastMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageCMS_MassSendMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MassSendMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageCMSServer).MassSendMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/message_cms.messageCMS/MassSendMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageCMSServer).MassSendMessage(ctx, req.(*MassSendMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageCMS_GetChatLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetChatLogsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageCMSServer).GetChatLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/message_cms.messageCMS/GetChatLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageCMSServer).GetChatLogs(ctx, req.(*GetChatLogsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageCMS_WithdrawMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WithdrawMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageCMSServer).WithdrawMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/message_cms.messageCMS/WithdrawMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageCMSServer).WithdrawMessage(ctx, req.(*WithdrawMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _MessageCMS_serviceDesc = grpc.ServiceDesc{ + ServiceName: "message_cms.messageCMS", + HandlerType: (*MessageCMSServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "BoradcastMessage", + Handler: _MessageCMS_BoradcastMessage_Handler, + }, + { + MethodName: "MassSendMessage", + Handler: _MessageCMS_MassSendMessage_Handler, + }, + { + MethodName: "GetChatLogs", + Handler: _MessageCMS_GetChatLogs_Handler, + }, + { + MethodName: "WithdrawMessage", + Handler: _MessageCMS_WithdrawMessage_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "message_cms/message_cms.proto", +} diff --git a/pkg/proto/message_cms/message_cms.proto b/pkg/proto/message_cms/message_cms.proto new file mode 100644 index 000000000..2a9647bb7 --- /dev/null +++ b/pkg/proto/message_cms/message_cms.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./message_cms;message_cms"; +package message_cms; + +message BoradcastMessageReq { + string Message = 1; + string OperationID = 2; +} + +message BoradcastMessageResp { + +} + +message MassSendMessageReq { + string Message = 1; + repeated string UserIds = 2; + string OperationID = 3; +} + +message MassSendMessageResp { + +} + +message GetChatLogsReq { + string Content = 1; + string UserId = 2; + string GroupId = 3; + string Date = 4; + int32 SessionType = 5; + int32 ContentType = 6; + server_api_params.RequestPagination Pagination = 7; + string OperationID = 8; + +} + +message ChatLogs { + int32 SessionType = 1; + int32 ContentType = 2; + string SenderNickName = 3; + string SenderId = 4; + string ReciverNickName = 5; + string ReciverId = 6; + string SearchContent = 7; + string WholeContent = 8; + string GroupId = 9; + string GroupName = 10; + string Date = 11; +} + +message GetChatLogsResp { + repeated ChatLogs ChatLogs = 1; + server_api_params.ResponsePagination Pagination = 2; + int32 ChatLogsNum = 3; +} + +message WithdrawMessageReq { + string ServerMsgId = 1; + string OperationID = 2; +} + +message WithdrawMessageResp { + +} + +service messageCMS { + rpc BoradcastMessage(BoradcastMessageReq) returns(BoradcastMessageResp); + rpc MassSendMessage(MassSendMessageReq) returns(MassSendMessageResp); + rpc GetChatLogs(GetChatLogsReq) returns(GetChatLogsResp); + rpc WithdrawMessage(WithdrawMessageReq) returns(WithdrawMessageResp); +} \ No newline at end of file diff --git a/pkg/proto/office/office.pb.go b/pkg/proto/office/office.pb.go new file mode 100644 index 000000000..32a6a004d --- /dev/null +++ b/pkg/proto/office/office.pb.go @@ -0,0 +1,2851 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: office/office.proto + +package office // import "./office" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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 CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_office_8a5f7d4f1783db20, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type TagUser struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TagUser) Reset() { *m = TagUser{} } +func (m *TagUser) String() string { return proto.CompactTextString(m) } +func (*TagUser) ProtoMessage() {} +func (*TagUser) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{1} +} +func (m *TagUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TagUser.Unmarshal(m, b) +} +func (m *TagUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TagUser.Marshal(b, m, deterministic) +} +func (dst *TagUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_TagUser.Merge(dst, src) +} +func (m *TagUser) XXX_Size() int { + return xxx_messageInfo_TagUser.Size(m) +} +func (m *TagUser) XXX_DiscardUnknown() { + xxx_messageInfo_TagUser.DiscardUnknown(m) +} + +var xxx_messageInfo_TagUser proto.InternalMessageInfo + +func (m *TagUser) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *TagUser) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +type Tag struct { + TagID string `protobuf:"bytes,1,opt,name=tagID" json:"tagID,omitempty"` + TagName string `protobuf:"bytes,2,opt,name=tagName" json:"tagName,omitempty"` + UserList []*TagUser `protobuf:"bytes,3,rep,name=userList" json:"userList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Tag) Reset() { *m = Tag{} } +func (m *Tag) String() string { return proto.CompactTextString(m) } +func (*Tag) ProtoMessage() {} +func (*Tag) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{2} +} +func (m *Tag) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Tag.Unmarshal(m, b) +} +func (m *Tag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Tag.Marshal(b, m, deterministic) +} +func (dst *Tag) XXX_Merge(src proto.Message) { + xxx_messageInfo_Tag.Merge(dst, src) +} +func (m *Tag) XXX_Size() int { + return xxx_messageInfo_Tag.Size(m) +} +func (m *Tag) XXX_DiscardUnknown() { + xxx_messageInfo_Tag.DiscardUnknown(m) +} + +var xxx_messageInfo_Tag proto.InternalMessageInfo + +func (m *Tag) GetTagID() string { + if m != nil { + return m.TagID + } + return "" +} + +func (m *Tag) GetTagName() string { + if m != nil { + return m.TagName + } + return "" +} + +func (m *Tag) GetUserList() []*TagUser { + if m != nil { + return m.UserList + } + return nil +} + +type GetUserTagsReq 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 *GetUserTagsReq) Reset() { *m = GetUserTagsReq{} } +func (m *GetUserTagsReq) String() string { return proto.CompactTextString(m) } +func (*GetUserTagsReq) ProtoMessage() {} +func (*GetUserTagsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{3} +} +func (m *GetUserTagsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserTagsReq.Unmarshal(m, b) +} +func (m *GetUserTagsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserTagsReq.Marshal(b, m, deterministic) +} +func (dst *GetUserTagsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserTagsReq.Merge(dst, src) +} +func (m *GetUserTagsReq) XXX_Size() int { + return xxx_messageInfo_GetUserTagsReq.Size(m) +} +func (m *GetUserTagsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserTagsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserTagsReq proto.InternalMessageInfo + +func (m *GetUserTagsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserTagsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserTagsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Tags []*Tag `protobuf:"bytes,2,rep,name=tags" json:"tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserTagsResp) Reset() { *m = GetUserTagsResp{} } +func (m *GetUserTagsResp) String() string { return proto.CompactTextString(m) } +func (*GetUserTagsResp) ProtoMessage() {} +func (*GetUserTagsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{4} +} +func (m *GetUserTagsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserTagsResp.Unmarshal(m, b) +} +func (m *GetUserTagsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserTagsResp.Marshal(b, m, deterministic) +} +func (dst *GetUserTagsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserTagsResp.Merge(dst, src) +} +func (m *GetUserTagsResp) XXX_Size() int { + return xxx_messageInfo_GetUserTagsResp.Size(m) +} +func (m *GetUserTagsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserTagsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserTagsResp proto.InternalMessageInfo + +func (m *GetUserTagsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserTagsResp) GetTags() []*Tag { + if m != nil { + return m.Tags + } + return nil +} + +type CreateTagReq struct { + TagName string `protobuf:"bytes,1,opt,name=tagName" json:"tagName,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + UserIDList []string `protobuf:"bytes,3,rep,name=userIDList" json:"userIDList,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateTagReq) Reset() { *m = CreateTagReq{} } +func (m *CreateTagReq) String() string { return proto.CompactTextString(m) } +func (*CreateTagReq) ProtoMessage() {} +func (*CreateTagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{5} +} +func (m *CreateTagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateTagReq.Unmarshal(m, b) +} +func (m *CreateTagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateTagReq.Marshal(b, m, deterministic) +} +func (dst *CreateTagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateTagReq.Merge(dst, src) +} +func (m *CreateTagReq) XXX_Size() int { + return xxx_messageInfo_CreateTagReq.Size(m) +} +func (m *CreateTagReq) XXX_DiscardUnknown() { + xxx_messageInfo_CreateTagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateTagReq proto.InternalMessageInfo + +func (m *CreateTagReq) GetTagName() string { + if m != nil { + return m.TagName + } + return "" +} + +func (m *CreateTagReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *CreateTagReq) GetUserIDList() []string { + if m != nil { + return m.UserIDList + } + return nil +} + +func (m *CreateTagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type CreateTagResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateTagResp) Reset() { *m = CreateTagResp{} } +func (m *CreateTagResp) String() string { return proto.CompactTextString(m) } +func (*CreateTagResp) ProtoMessage() {} +func (*CreateTagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{6} +} +func (m *CreateTagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateTagResp.Unmarshal(m, b) +} +func (m *CreateTagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateTagResp.Marshal(b, m, deterministic) +} +func (dst *CreateTagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateTagResp.Merge(dst, src) +} +func (m *CreateTagResp) XXX_Size() int { + return xxx_messageInfo_CreateTagResp.Size(m) +} +func (m *CreateTagResp) XXX_DiscardUnknown() { + xxx_messageInfo_CreateTagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateTagResp proto.InternalMessageInfo + +func (m *CreateTagResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type DeleteTagReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteTagReq) Reset() { *m = DeleteTagReq{} } +func (m *DeleteTagReq) String() string { return proto.CompactTextString(m) } +func (*DeleteTagReq) ProtoMessage() {} +func (*DeleteTagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{7} +} +func (m *DeleteTagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteTagReq.Unmarshal(m, b) +} +func (m *DeleteTagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteTagReq.Marshal(b, m, deterministic) +} +func (dst *DeleteTagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteTagReq.Merge(dst, src) +} +func (m *DeleteTagReq) XXX_Size() int { + return xxx_messageInfo_DeleteTagReq.Size(m) +} +func (m *DeleteTagReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteTagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteTagReq proto.InternalMessageInfo + +func (m *DeleteTagReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DeleteTagReq) GetTagID() string { + if m != nil { + return m.TagID + } + return "" +} + +func (m *DeleteTagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type DeleteTagResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteTagResp) Reset() { *m = DeleteTagResp{} } +func (m *DeleteTagResp) String() string { return proto.CompactTextString(m) } +func (*DeleteTagResp) ProtoMessage() {} +func (*DeleteTagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{8} +} +func (m *DeleteTagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteTagResp.Unmarshal(m, b) +} +func (m *DeleteTagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteTagResp.Marshal(b, m, deterministic) +} +func (dst *DeleteTagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteTagResp.Merge(dst, src) +} +func (m *DeleteTagResp) XXX_Size() int { + return xxx_messageInfo_DeleteTagResp.Size(m) +} +func (m *DeleteTagResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteTagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteTagResp proto.InternalMessageInfo + +func (m *DeleteTagResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type SetTagReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,omitempty"` + NewName string `protobuf:"bytes,3,opt,name=newName" json:"newName,omitempty"` + IncreaseUserIDList []string `protobuf:"bytes,4,rep,name=increaseUserIDList" json:"increaseUserIDList,omitempty"` + ReduceUserIDList []string `protobuf:"bytes,5,rep,name=reduceUserIDList" json:"reduceUserIDList,omitempty"` + OperationID string `protobuf:"bytes,6,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetTagReq) Reset() { *m = SetTagReq{} } +func (m *SetTagReq) String() string { return proto.CompactTextString(m) } +func (*SetTagReq) ProtoMessage() {} +func (*SetTagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{9} +} +func (m *SetTagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetTagReq.Unmarshal(m, b) +} +func (m *SetTagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetTagReq.Marshal(b, m, deterministic) +} +func (dst *SetTagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetTagReq.Merge(dst, src) +} +func (m *SetTagReq) XXX_Size() int { + return xxx_messageInfo_SetTagReq.Size(m) +} +func (m *SetTagReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetTagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetTagReq proto.InternalMessageInfo + +func (m *SetTagReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SetTagReq) GetTagID() string { + if m != nil { + return m.TagID + } + return "" +} + +func (m *SetTagReq) GetNewName() string { + if m != nil { + return m.NewName + } + return "" +} + +func (m *SetTagReq) GetIncreaseUserIDList() []string { + if m != nil { + return m.IncreaseUserIDList + } + return nil +} + +func (m *SetTagReq) GetReduceUserIDList() []string { + if m != nil { + return m.ReduceUserIDList + } + return nil +} + +func (m *SetTagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetTagResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetTagResp) Reset() { *m = SetTagResp{} } +func (m *SetTagResp) String() string { return proto.CompactTextString(m) } +func (*SetTagResp) ProtoMessage() {} +func (*SetTagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{10} +} +func (m *SetTagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetTagResp.Unmarshal(m, b) +} +func (m *SetTagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetTagResp.Marshal(b, m, deterministic) +} +func (dst *SetTagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetTagResp.Merge(dst, src) +} +func (m *SetTagResp) XXX_Size() int { + return xxx_messageInfo_SetTagResp.Size(m) +} +func (m *SetTagResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetTagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetTagResp proto.InternalMessageInfo + +func (m *SetTagResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type SendMsg2TagReq struct { + TagList []string `protobuf:"bytes,1,rep,name=tagList" json:"tagList,omitempty"` + UserList []string `protobuf:"bytes,2,rep,name=UserList" json:"UserList,omitempty"` + GroupList []string `protobuf:"bytes,3,rep,name=GroupList" json:"GroupList,omitempty"` + SendID string `protobuf:"bytes,4,opt,name=sendID" json:"sendID,omitempty"` + SenderPlatformID int32 `protobuf:"varint,5,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"` + Content string `protobuf:"bytes,6,opt,name=content" json:"content,omitempty"` + OperationID string `protobuf:"bytes,7,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SendMsg2TagReq) Reset() { *m = SendMsg2TagReq{} } +func (m *SendMsg2TagReq) String() string { return proto.CompactTextString(m) } +func (*SendMsg2TagReq) ProtoMessage() {} +func (*SendMsg2TagReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{11} +} +func (m *SendMsg2TagReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsg2TagReq.Unmarshal(m, b) +} +func (m *SendMsg2TagReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsg2TagReq.Marshal(b, m, deterministic) +} +func (dst *SendMsg2TagReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsg2TagReq.Merge(dst, src) +} +func (m *SendMsg2TagReq) XXX_Size() int { + return xxx_messageInfo_SendMsg2TagReq.Size(m) +} +func (m *SendMsg2TagReq) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsg2TagReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SendMsg2TagReq proto.InternalMessageInfo + +func (m *SendMsg2TagReq) GetTagList() []string { + if m != nil { + return m.TagList + } + return nil +} + +func (m *SendMsg2TagReq) GetUserList() []string { + if m != nil { + return m.UserList + } + return nil +} + +func (m *SendMsg2TagReq) GetGroupList() []string { + if m != nil { + return m.GroupList + } + return nil +} + +func (m *SendMsg2TagReq) GetSendID() string { + if m != nil { + return m.SendID + } + return "" +} + +func (m *SendMsg2TagReq) GetSenderPlatformID() int32 { + if m != nil { + return m.SenderPlatformID + } + return 0 +} + +func (m *SendMsg2TagReq) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *SendMsg2TagReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SendMsg2TagResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SendMsg2TagResp) Reset() { *m = SendMsg2TagResp{} } +func (m *SendMsg2TagResp) String() string { return proto.CompactTextString(m) } +func (*SendMsg2TagResp) ProtoMessage() {} +func (*SendMsg2TagResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{12} +} +func (m *SendMsg2TagResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SendMsg2TagResp.Unmarshal(m, b) +} +func (m *SendMsg2TagResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SendMsg2TagResp.Marshal(b, m, deterministic) +} +func (dst *SendMsg2TagResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendMsg2TagResp.Merge(dst, src) +} +func (m *SendMsg2TagResp) XXX_Size() int { + return xxx_messageInfo_SendMsg2TagResp.Size(m) +} +func (m *SendMsg2TagResp) XXX_DiscardUnknown() { + xxx_messageInfo_SendMsg2TagResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SendMsg2TagResp proto.InternalMessageInfo + +func (m *SendMsg2TagResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetTagSendLogsReq struct { + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=Pagination" json:"Pagination,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetTagSendLogsReq) Reset() { *m = GetTagSendLogsReq{} } +func (m *GetTagSendLogsReq) String() string { return proto.CompactTextString(m) } +func (*GetTagSendLogsReq) ProtoMessage() {} +func (*GetTagSendLogsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{13} +} +func (m *GetTagSendLogsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetTagSendLogsReq.Unmarshal(m, b) +} +func (m *GetTagSendLogsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetTagSendLogsReq.Marshal(b, m, deterministic) +} +func (dst *GetTagSendLogsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTagSendLogsReq.Merge(dst, src) +} +func (m *GetTagSendLogsReq) XXX_Size() int { + return xxx_messageInfo_GetTagSendLogsReq.Size(m) +} +func (m *GetTagSendLogsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetTagSendLogsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetTagSendLogsReq proto.InternalMessageInfo + +func (m *GetTagSendLogsReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetTagSendLogsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetTagSendLogsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type TagSendLog struct { + UserList []*TagUser `protobuf:"bytes,1,rep,name=userList" json:"userList,omitempty"` + Content string `protobuf:"bytes,2,opt,name=content" json:"content,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 *TagSendLog) Reset() { *m = TagSendLog{} } +func (m *TagSendLog) String() string { return proto.CompactTextString(m) } +func (*TagSendLog) ProtoMessage() {} +func (*TagSendLog) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{14} +} +func (m *TagSendLog) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TagSendLog.Unmarshal(m, b) +} +func (m *TagSendLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TagSendLog.Marshal(b, m, deterministic) +} +func (dst *TagSendLog) XXX_Merge(src proto.Message) { + xxx_messageInfo_TagSendLog.Merge(dst, src) +} +func (m *TagSendLog) XXX_Size() int { + return xxx_messageInfo_TagSendLog.Size(m) +} +func (m *TagSendLog) XXX_DiscardUnknown() { + xxx_messageInfo_TagSendLog.DiscardUnknown(m) +} + +var xxx_messageInfo_TagSendLog proto.InternalMessageInfo + +func (m *TagSendLog) GetUserList() []*TagUser { + if m != nil { + return m.UserList + } + return nil +} + +func (m *TagSendLog) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *TagSendLog) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + +type GetTagSendLogsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + TagSendLogs []*TagSendLog `protobuf:"bytes,3,rep,name=tagSendLogs" json:"tagSendLogs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetTagSendLogsResp) Reset() { *m = GetTagSendLogsResp{} } +func (m *GetTagSendLogsResp) String() string { return proto.CompactTextString(m) } +func (*GetTagSendLogsResp) ProtoMessage() {} +func (*GetTagSendLogsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{15} +} +func (m *GetTagSendLogsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetTagSendLogsResp.Unmarshal(m, b) +} +func (m *GetTagSendLogsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetTagSendLogsResp.Marshal(b, m, deterministic) +} +func (dst *GetTagSendLogsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTagSendLogsResp.Merge(dst, src) +} +func (m *GetTagSendLogsResp) XXX_Size() int { + return xxx_messageInfo_GetTagSendLogsResp.Size(m) +} +func (m *GetTagSendLogsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetTagSendLogsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetTagSendLogsResp proto.InternalMessageInfo + +func (m *GetTagSendLogsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetTagSendLogsResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetTagSendLogsResp) GetTagSendLogs() []*TagSendLog { + if m != nil { + return m.TagSendLogs + } + return nil +} + +type GetUserTagByIDReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserTagByIDReq) Reset() { *m = GetUserTagByIDReq{} } +func (m *GetUserTagByIDReq) String() string { return proto.CompactTextString(m) } +func (*GetUserTagByIDReq) ProtoMessage() {} +func (*GetUserTagByIDReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{16} +} +func (m *GetUserTagByIDReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserTagByIDReq.Unmarshal(m, b) +} +func (m *GetUserTagByIDReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserTagByIDReq.Marshal(b, m, deterministic) +} +func (dst *GetUserTagByIDReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserTagByIDReq.Merge(dst, src) +} +func (m *GetUserTagByIDReq) XXX_Size() int { + return xxx_messageInfo_GetUserTagByIDReq.Size(m) +} +func (m *GetUserTagByIDReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserTagByIDReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserTagByIDReq proto.InternalMessageInfo + +func (m *GetUserTagByIDReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserTagByIDReq) GetTagID() string { + if m != nil { + return m.TagID + } + return "" +} + +func (m *GetUserTagByIDReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserTagByIDResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Tag *Tag `protobuf:"bytes,2,opt,name=tag" json:"tag,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserTagByIDResp) Reset() { *m = GetUserTagByIDResp{} } +func (m *GetUserTagByIDResp) String() string { return proto.CompactTextString(m) } +func (*GetUserTagByIDResp) ProtoMessage() {} +func (*GetUserTagByIDResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{17} +} +func (m *GetUserTagByIDResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserTagByIDResp.Unmarshal(m, b) +} +func (m *GetUserTagByIDResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserTagByIDResp.Marshal(b, m, deterministic) +} +func (dst *GetUserTagByIDResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserTagByIDResp.Merge(dst, src) +} +func (m *GetUserTagByIDResp) XXX_Size() int { + return xxx_messageInfo_GetUserTagByIDResp.Size(m) +} +func (m *GetUserTagByIDResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserTagByIDResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserTagByIDResp proto.InternalMessageInfo + +func (m *GetUserTagByIDResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserTagByIDResp) GetTag() *Tag { + if m != nil { + return m.Tag + } + return nil +} + +type LikeUser struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LikeUser) Reset() { *m = LikeUser{} } +func (m *LikeUser) String() string { return proto.CompactTextString(m) } +func (*LikeUser) ProtoMessage() {} +func (*LikeUser) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{18} +} +func (m *LikeUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LikeUser.Unmarshal(m, b) +} +func (m *LikeUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LikeUser.Marshal(b, m, deterministic) +} +func (dst *LikeUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_LikeUser.Merge(dst, src) +} +func (m *LikeUser) XXX_Size() int { + return xxx_messageInfo_LikeUser.Size(m) +} +func (m *LikeUser) XXX_DiscardUnknown() { + xxx_messageInfo_LikeUser.DiscardUnknown(m) +} + +var xxx_messageInfo_LikeUser proto.InternalMessageInfo + +func (m *LikeUser) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *LikeUser) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +type Comment struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + ReplyUserID string `protobuf:"bytes,3,opt,name=replyUserID" json:"replyUserID,omitempty"` + ReplyUserName string `protobuf:"bytes,4,opt,name=replyUserName" json:"replyUserName,omitempty"` + ContentID string `protobuf:"bytes,5,opt,name=contentID" json:"contentID,omitempty"` + Content string `protobuf:"bytes,6,opt,name=content" json:"content,omitempty"` + CreateTime int32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Comment) Reset() { *m = Comment{} } +func (m *Comment) String() string { return proto.CompactTextString(m) } +func (*Comment) ProtoMessage() {} +func (*Comment) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{19} +} +func (m *Comment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Comment.Unmarshal(m, b) +} +func (m *Comment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Comment.Marshal(b, m, deterministic) +} +func (dst *Comment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Comment.Merge(dst, src) +} +func (m *Comment) XXX_Size() int { + return xxx_messageInfo_Comment.Size(m) +} +func (m *Comment) XXX_DiscardUnknown() { + xxx_messageInfo_Comment.DiscardUnknown(m) +} + +var xxx_messageInfo_Comment proto.InternalMessageInfo + +func (m *Comment) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *Comment) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +func (m *Comment) GetReplyUserID() string { + if m != nil { + return m.ReplyUserID + } + return "" +} + +func (m *Comment) GetReplyUserName() string { + if m != nil { + return m.ReplyUserName + } + return "" +} + +func (m *Comment) GetContentID() string { + if m != nil { + return m.ContentID + } + return "" +} + +func (m *Comment) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *Comment) GetCreateTime() int32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +type WorkMoment struct { + WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content" json:"content,omitempty"` + LikeUsers []*LikeUser `protobuf:"bytes,4,rep,name=likeUsers" json:"likeUsers,omitempty"` + Comments []*Comment `protobuf:"bytes,5,rep,name=comments" json:"comments,omitempty"` + WhoCanSeeUserIDList []string `protobuf:"bytes,6,rep,name=whoCanSeeUserIDList" json:"whoCanSeeUserIDList,omitempty"` + WhoCantSeeUserIDList []string `protobuf:"bytes,7,rep,name=whoCantSeeUserIDList" json:"whoCantSeeUserIDList,omitempty"` + IsPrivate bool `protobuf:"varint,8,opt,name=isPrivate" json:"isPrivate,omitempty"` + IsPublic bool `protobuf:"varint,9,opt,name=isPublic" json:"isPublic,omitempty"` + CreateTime int32 `protobuf:"varint,10,opt,name=CreateTime" json:"CreateTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkMoment) Reset() { *m = WorkMoment{} } +func (m *WorkMoment) String() string { return proto.CompactTextString(m) } +func (*WorkMoment) ProtoMessage() {} +func (*WorkMoment) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{20} +} +func (m *WorkMoment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkMoment.Unmarshal(m, b) +} +func (m *WorkMoment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkMoment.Marshal(b, m, deterministic) +} +func (dst *WorkMoment) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkMoment.Merge(dst, src) +} +func (m *WorkMoment) XXX_Size() int { + return xxx_messageInfo_WorkMoment.Size(m) +} +func (m *WorkMoment) XXX_DiscardUnknown() { + xxx_messageInfo_WorkMoment.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkMoment proto.InternalMessageInfo + +func (m *WorkMoment) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *WorkMoment) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *WorkMoment) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *WorkMoment) GetLikeUsers() []*LikeUser { + if m != nil { + return m.LikeUsers + } + return nil +} + +func (m *WorkMoment) GetComments() []*Comment { + if m != nil { + return m.Comments + } + return nil +} + +func (m *WorkMoment) GetWhoCanSeeUserIDList() []string { + if m != nil { + return m.WhoCanSeeUserIDList + } + return nil +} + +func (m *WorkMoment) GetWhoCantSeeUserIDList() []string { + if m != nil { + return m.WhoCantSeeUserIDList + } + return nil +} + +func (m *WorkMoment) GetIsPrivate() bool { + if m != nil { + return m.IsPrivate + } + return false +} + +func (m *WorkMoment) GetIsPublic() bool { + if m != nil { + return m.IsPublic + } + return false +} + +func (m *WorkMoment) GetCreateTime() int32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +type CreateOneWorkMomentReq struct { + WorkMoment *WorkMoment `protobuf:"bytes,1,opt,name=workMoment" json:"workMoment,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateOneWorkMomentReq) Reset() { *m = CreateOneWorkMomentReq{} } +func (m *CreateOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*CreateOneWorkMomentReq) ProtoMessage() {} +func (*CreateOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{21} +} +func (m *CreateOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateOneWorkMomentReq.Unmarshal(m, b) +} +func (m *CreateOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *CreateOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateOneWorkMomentReq.Merge(dst, src) +} +func (m *CreateOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_CreateOneWorkMomentReq.Size(m) +} +func (m *CreateOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_CreateOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateOneWorkMomentReq proto.InternalMessageInfo + +func (m *CreateOneWorkMomentReq) GetWorkMoment() *WorkMoment { + if m != nil { + return m.WorkMoment + } + return nil +} + +func (m *CreateOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *CreateOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type CreateOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateOneWorkMomentResp) Reset() { *m = CreateOneWorkMomentResp{} } +func (m *CreateOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*CreateOneWorkMomentResp) ProtoMessage() {} +func (*CreateOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{22} +} +func (m *CreateOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateOneWorkMomentResp.Unmarshal(m, b) +} +func (m *CreateOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *CreateOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateOneWorkMomentResp.Merge(dst, src) +} +func (m *CreateOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_CreateOneWorkMomentResp.Size(m) +} +func (m *CreateOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_CreateOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateOneWorkMomentResp proto.InternalMessageInfo + +func (m *CreateOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type DeleteOneWorkMomentReq struct { + WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteOneWorkMomentReq) Reset() { *m = DeleteOneWorkMomentReq{} } +func (m *DeleteOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*DeleteOneWorkMomentReq) ProtoMessage() {} +func (*DeleteOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{23} +} +func (m *DeleteOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteOneWorkMomentReq.Unmarshal(m, b) +} +func (m *DeleteOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *DeleteOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteOneWorkMomentReq.Merge(dst, src) +} +func (m *DeleteOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_DeleteOneWorkMomentReq.Size(m) +} +func (m *DeleteOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteOneWorkMomentReq proto.InternalMessageInfo + +func (m *DeleteOneWorkMomentReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *DeleteOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DeleteOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type DeleteOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteOneWorkMomentResp) Reset() { *m = DeleteOneWorkMomentResp{} } +func (m *DeleteOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*DeleteOneWorkMomentResp) ProtoMessage() {} +func (*DeleteOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{24} +} +func (m *DeleteOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteOneWorkMomentResp.Unmarshal(m, b) +} +func (m *DeleteOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *DeleteOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteOneWorkMomentResp.Merge(dst, src) +} +func (m *DeleteOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_DeleteOneWorkMomentResp.Size(m) +} +func (m *DeleteOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteOneWorkMomentResp proto.InternalMessageInfo + +func (m *DeleteOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type LikeOneWorkMomentReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + WorkMomentID string `protobuf:"bytes,2,opt,name=WorkMomentID" json:"WorkMomentID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LikeOneWorkMomentReq) Reset() { *m = LikeOneWorkMomentReq{} } +func (m *LikeOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*LikeOneWorkMomentReq) ProtoMessage() {} +func (*LikeOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{25} +} +func (m *LikeOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LikeOneWorkMomentReq.Unmarshal(m, b) +} +func (m *LikeOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LikeOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *LikeOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_LikeOneWorkMomentReq.Merge(dst, src) +} +func (m *LikeOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_LikeOneWorkMomentReq.Size(m) +} +func (m *LikeOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_LikeOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_LikeOneWorkMomentReq proto.InternalMessageInfo + +func (m *LikeOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *LikeOneWorkMomentReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *LikeOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type LikeOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LikeOneWorkMomentResp) Reset() { *m = LikeOneWorkMomentResp{} } +func (m *LikeOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*LikeOneWorkMomentResp) ProtoMessage() {} +func (*LikeOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{26} +} +func (m *LikeOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LikeOneWorkMomentResp.Unmarshal(m, b) +} +func (m *LikeOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LikeOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *LikeOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_LikeOneWorkMomentResp.Merge(dst, src) +} +func (m *LikeOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_LikeOneWorkMomentResp.Size(m) +} +func (m *LikeOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_LikeOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_LikeOneWorkMomentResp proto.InternalMessageInfo + +func (m *LikeOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type CommentOneWorkMomentReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + WorkMomentID string `protobuf:"bytes,2,opt,name=workMomentID" json:"workMomentID,omitempty"` + ReplyUserID string `protobuf:"bytes,3,opt,name=replyUserID" json:"replyUserID,omitempty"` + Content string `protobuf:"bytes,4,opt,name=content" json:"content,omitempty"` + OperationID string `protobuf:"bytes,5,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommentOneWorkMomentReq) Reset() { *m = CommentOneWorkMomentReq{} } +func (m *CommentOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*CommentOneWorkMomentReq) ProtoMessage() {} +func (*CommentOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{27} +} +func (m *CommentOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommentOneWorkMomentReq.Unmarshal(m, b) +} +func (m *CommentOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommentOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *CommentOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommentOneWorkMomentReq.Merge(dst, src) +} +func (m *CommentOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_CommentOneWorkMomentReq.Size(m) +} +func (m *CommentOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_CommentOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CommentOneWorkMomentReq proto.InternalMessageInfo + +func (m *CommentOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetReplyUserID() string { + if m != nil { + return m.ReplyUserID + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type CommentOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommentOneWorkMomentResp) Reset() { *m = CommentOneWorkMomentResp{} } +func (m *CommentOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*CommentOneWorkMomentResp) ProtoMessage() {} +func (*CommentOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{28} +} +func (m *CommentOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommentOneWorkMomentResp.Unmarshal(m, b) +} +func (m *CommentOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommentOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *CommentOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommentOneWorkMomentResp.Merge(dst, src) +} +func (m *CommentOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_CommentOneWorkMomentResp.Size(m) +} +func (m *CommentOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommentOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommentOneWorkMomentResp proto.InternalMessageInfo + +func (m *CommentOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetUserWorkMomentsReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsReq) Reset() { *m = GetUserWorkMomentsReq{} } +func (m *GetUserWorkMomentsReq) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsReq) ProtoMessage() {} +func (*GetUserWorkMomentsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{29} +} +func (m *GetUserWorkMomentsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsReq.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsReq.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsReq.Merge(dst, src) +} +func (m *GetUserWorkMomentsReq) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsReq.Size(m) +} +func (m *GetUserWorkMomentsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsReq proto.InternalMessageInfo + +func (m *GetUserWorkMomentsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUserWorkMomentsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserWorkMomentsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments" json:"workMoments,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsResp) Reset() { *m = GetUserWorkMomentsResp{} } +func (m *GetUserWorkMomentsResp) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsResp) ProtoMessage() {} +func (*GetUserWorkMomentsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{30} +} +func (m *GetUserWorkMomentsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsResp.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsResp.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsResp.Merge(dst, src) +} +func (m *GetUserWorkMomentsResp) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsResp.Size(m) +} +func (m *GetUserWorkMomentsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsResp proto.InternalMessageInfo + +func (m *GetUserWorkMomentsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserWorkMomentsResp) GetWorkMoments() []*WorkMoment { + if m != nil { + return m.WorkMoments + } + return nil +} + +func (m *GetUserWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +type GetUserFriendWorkMomentsReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserFriendWorkMomentsReq) Reset() { *m = GetUserFriendWorkMomentsReq{} } +func (m *GetUserFriendWorkMomentsReq) String() string { return proto.CompactTextString(m) } +func (*GetUserFriendWorkMomentsReq) ProtoMessage() {} +func (*GetUserFriendWorkMomentsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{31} +} +func (m *GetUserFriendWorkMomentsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserFriendWorkMomentsReq.Unmarshal(m, b) +} +func (m *GetUserFriendWorkMomentsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserFriendWorkMomentsReq.Marshal(b, m, deterministic) +} +func (dst *GetUserFriendWorkMomentsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserFriendWorkMomentsReq.Merge(dst, src) +} +func (m *GetUserFriendWorkMomentsReq) XXX_Size() int { + return xxx_messageInfo_GetUserFriendWorkMomentsReq.Size(m) +} +func (m *GetUserFriendWorkMomentsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserFriendWorkMomentsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserFriendWorkMomentsReq proto.InternalMessageInfo + +func (m *GetUserFriendWorkMomentsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserFriendWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUserFriendWorkMomentsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserFriendWorkMomentsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments" json:"workMoments,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserFriendWorkMomentsResp) Reset() { *m = GetUserFriendWorkMomentsResp{} } +func (m *GetUserFriendWorkMomentsResp) String() string { return proto.CompactTextString(m) } +func (*GetUserFriendWorkMomentsResp) ProtoMessage() {} +func (*GetUserFriendWorkMomentsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{32} +} +func (m *GetUserFriendWorkMomentsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserFriendWorkMomentsResp.Unmarshal(m, b) +} +func (m *GetUserFriendWorkMomentsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserFriendWorkMomentsResp.Marshal(b, m, deterministic) +} +func (dst *GetUserFriendWorkMomentsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserFriendWorkMomentsResp.Merge(dst, src) +} +func (m *GetUserFriendWorkMomentsResp) XXX_Size() int { + return xxx_messageInfo_GetUserFriendWorkMomentsResp.Size(m) +} +func (m *GetUserFriendWorkMomentsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserFriendWorkMomentsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserFriendWorkMomentsResp proto.InternalMessageInfo + +func (m *GetUserFriendWorkMomentsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserFriendWorkMomentsResp) GetWorkMoments() []*WorkMoment { + if m != nil { + return m.WorkMoments + } + return nil +} + +func (m *GetUserFriendWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +type CommentsMsg struct { + Comment *Comment `protobuf:"bytes,1,opt,name=comment" json:"comment,omitempty"` + WorkMomentID string `protobuf:"bytes,2,opt,name=workMomentID" json:"workMomentID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content" json:"content,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommentsMsg) Reset() { *m = CommentsMsg{} } +func (m *CommentsMsg) String() string { return proto.CompactTextString(m) } +func (*CommentsMsg) ProtoMessage() {} +func (*CommentsMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{33} +} +func (m *CommentsMsg) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommentsMsg.Unmarshal(m, b) +} +func (m *CommentsMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommentsMsg.Marshal(b, m, deterministic) +} +func (dst *CommentsMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommentsMsg.Merge(dst, src) +} +func (m *CommentsMsg) XXX_Size() int { + return xxx_messageInfo_CommentsMsg.Size(m) +} +func (m *CommentsMsg) XXX_DiscardUnknown() { + xxx_messageInfo_CommentsMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_CommentsMsg proto.InternalMessageInfo + +func (m *CommentsMsg) GetComment() *Comment { + if m != nil { + return m.Comment + } + return nil +} + +func (m *CommentsMsg) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *CommentsMsg) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +type GetUserWorkMomentsCommentsMsgReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsCommentsMsgReq) Reset() { *m = GetUserWorkMomentsCommentsMsgReq{} } +func (m *GetUserWorkMomentsCommentsMsgReq) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsCommentsMsgReq) ProtoMessage() {} +func (*GetUserWorkMomentsCommentsMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{34} +} +func (m *GetUserWorkMomentsCommentsMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsCommentsMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsCommentsMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.Merge(dst, src) +} +func (m *GetUserWorkMomentsCommentsMsgReq) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.Size(m) +} +func (m *GetUserWorkMomentsCommentsMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq proto.InternalMessageInfo + +func (m *GetUserWorkMomentsCommentsMsgReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserWorkMomentsCommentsMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetUserWorkMomentsCommentsMsgReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +type GetUserWorkMomentsCommentsMsgResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + CommentsMsgs []*CommentsMsg `protobuf:"bytes,2,rep,name=commentsMsgs" json:"commentsMsgs,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsCommentsMsgResp) Reset() { *m = GetUserWorkMomentsCommentsMsgResp{} } +func (m *GetUserWorkMomentsCommentsMsgResp) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsCommentsMsgResp) ProtoMessage() {} +func (*GetUserWorkMomentsCommentsMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{35} +} +func (m *GetUserWorkMomentsCommentsMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsCommentsMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsCommentsMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.Merge(dst, src) +} +func (m *GetUserWorkMomentsCommentsMsgResp) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.Size(m) +} +func (m *GetUserWorkMomentsCommentsMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp proto.InternalMessageInfo + +func (m *GetUserWorkMomentsCommentsMsgResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserWorkMomentsCommentsMsgResp) GetCommentsMsgs() []*CommentsMsg { + if m != nil { + return m.CommentsMsgs + } + return nil +} + +func (m *GetUserWorkMomentsCommentsMsgResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +type ClearUserWorkMomentsCommentsMsgReq 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 *ClearUserWorkMomentsCommentsMsgReq) Reset() { *m = ClearUserWorkMomentsCommentsMsgReq{} } +func (m *ClearUserWorkMomentsCommentsMsgReq) String() string { return proto.CompactTextString(m) } +func (*ClearUserWorkMomentsCommentsMsgReq) ProtoMessage() {} +func (*ClearUserWorkMomentsCommentsMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{36} +} +func (m *ClearUserWorkMomentsCommentsMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.Unmarshal(m, b) +} +func (m *ClearUserWorkMomentsCommentsMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.Marshal(b, m, deterministic) +} +func (dst *ClearUserWorkMomentsCommentsMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.Merge(dst, src) +} +func (m *ClearUserWorkMomentsCommentsMsgReq) XXX_Size() int { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.Size(m) +} +func (m *ClearUserWorkMomentsCommentsMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq proto.InternalMessageInfo + +func (m *ClearUserWorkMomentsCommentsMsgReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *ClearUserWorkMomentsCommentsMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ClearUserWorkMomentsCommentsMsgResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClearUserWorkMomentsCommentsMsgResp) Reset() { *m = ClearUserWorkMomentsCommentsMsgResp{} } +func (m *ClearUserWorkMomentsCommentsMsgResp) String() string { return proto.CompactTextString(m) } +func (*ClearUserWorkMomentsCommentsMsgResp) ProtoMessage() {} +func (*ClearUserWorkMomentsCommentsMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{37} +} +func (m *ClearUserWorkMomentsCommentsMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.Unmarshal(m, b) +} +func (m *ClearUserWorkMomentsCommentsMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.Marshal(b, m, deterministic) +} +func (dst *ClearUserWorkMomentsCommentsMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.Merge(dst, src) +} +func (m *ClearUserWorkMomentsCommentsMsgResp) XXX_Size() int { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.Size(m) +} +func (m *ClearUserWorkMomentsCommentsMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp proto.InternalMessageInfo + +func (m *ClearUserWorkMomentsCommentsMsgResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type SetUserWorkMomentsLevelReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Level int32 `protobuf:"varint,2,opt,name=level" json:"level,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetUserWorkMomentsLevelReq) Reset() { *m = SetUserWorkMomentsLevelReq{} } +func (m *SetUserWorkMomentsLevelReq) String() string { return proto.CompactTextString(m) } +func (*SetUserWorkMomentsLevelReq) ProtoMessage() {} +func (*SetUserWorkMomentsLevelReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{38} +} +func (m *SetUserWorkMomentsLevelReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetUserWorkMomentsLevelReq.Unmarshal(m, b) +} +func (m *SetUserWorkMomentsLevelReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetUserWorkMomentsLevelReq.Marshal(b, m, deterministic) +} +func (dst *SetUserWorkMomentsLevelReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetUserWorkMomentsLevelReq.Merge(dst, src) +} +func (m *SetUserWorkMomentsLevelReq) XXX_Size() int { + return xxx_messageInfo_SetUserWorkMomentsLevelReq.Size(m) +} +func (m *SetUserWorkMomentsLevelReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetUserWorkMomentsLevelReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetUserWorkMomentsLevelReq proto.InternalMessageInfo + +func (m *SetUserWorkMomentsLevelReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SetUserWorkMomentsLevelReq) GetLevel() int32 { + if m != nil { + return m.Level + } + return 0 +} + +func (m *SetUserWorkMomentsLevelReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetUserWorkMomentsLevelResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetUserWorkMomentsLevelResp) Reset() { *m = SetUserWorkMomentsLevelResp{} } +func (m *SetUserWorkMomentsLevelResp) String() string { return proto.CompactTextString(m) } +func (*SetUserWorkMomentsLevelResp) ProtoMessage() {} +func (*SetUserWorkMomentsLevelResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{39} +} +func (m *SetUserWorkMomentsLevelResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetUserWorkMomentsLevelResp.Unmarshal(m, b) +} +func (m *SetUserWorkMomentsLevelResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetUserWorkMomentsLevelResp.Marshal(b, m, deterministic) +} +func (dst *SetUserWorkMomentsLevelResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetUserWorkMomentsLevelResp.Merge(dst, src) +} +func (m *SetUserWorkMomentsLevelResp) XXX_Size() int { + return xxx_messageInfo_SetUserWorkMomentsLevelResp.Size(m) +} +func (m *SetUserWorkMomentsLevelResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetUserWorkMomentsLevelResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetUserWorkMomentsLevelResp proto.InternalMessageInfo + +func (m *SetUserWorkMomentsLevelResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "office.CommonResp") + proto.RegisterType((*TagUser)(nil), "office.TagUser") + proto.RegisterType((*Tag)(nil), "office.Tag") + proto.RegisterType((*GetUserTagsReq)(nil), "office.GetUserTagsReq") + proto.RegisterType((*GetUserTagsResp)(nil), "office.GetUserTagsResp") + proto.RegisterType((*CreateTagReq)(nil), "office.CreateTagReq") + proto.RegisterType((*CreateTagResp)(nil), "office.CreateTagResp") + proto.RegisterType((*DeleteTagReq)(nil), "office.DeleteTagReq") + proto.RegisterType((*DeleteTagResp)(nil), "office.DeleteTagResp") + proto.RegisterType((*SetTagReq)(nil), "office.SetTagReq") + proto.RegisterType((*SetTagResp)(nil), "office.SetTagResp") + proto.RegisterType((*SendMsg2TagReq)(nil), "office.SendMsg2TagReq") + proto.RegisterType((*SendMsg2TagResp)(nil), "office.SendMsg2TagResp") + proto.RegisterType((*GetTagSendLogsReq)(nil), "office.GetTagSendLogsReq") + proto.RegisterType((*TagSendLog)(nil), "office.TagSendLog") + proto.RegisterType((*GetTagSendLogsResp)(nil), "office.GetTagSendLogsResp") + proto.RegisterType((*GetUserTagByIDReq)(nil), "office.GetUserTagByIDReq") + proto.RegisterType((*GetUserTagByIDResp)(nil), "office.GetUserTagByIDResp") + proto.RegisterType((*LikeUser)(nil), "office.LikeUser") + proto.RegisterType((*Comment)(nil), "office.Comment") + proto.RegisterType((*WorkMoment)(nil), "office.WorkMoment") + proto.RegisterType((*CreateOneWorkMomentReq)(nil), "office.CreateOneWorkMomentReq") + proto.RegisterType((*CreateOneWorkMomentResp)(nil), "office.CreateOneWorkMomentResp") + proto.RegisterType((*DeleteOneWorkMomentReq)(nil), "office.DeleteOneWorkMomentReq") + proto.RegisterType((*DeleteOneWorkMomentResp)(nil), "office.DeleteOneWorkMomentResp") + proto.RegisterType((*LikeOneWorkMomentReq)(nil), "office.LikeOneWorkMomentReq") + proto.RegisterType((*LikeOneWorkMomentResp)(nil), "office.LikeOneWorkMomentResp") + proto.RegisterType((*CommentOneWorkMomentReq)(nil), "office.CommentOneWorkMomentReq") + proto.RegisterType((*CommentOneWorkMomentResp)(nil), "office.CommentOneWorkMomentResp") + proto.RegisterType((*GetUserWorkMomentsReq)(nil), "office.GetUserWorkMomentsReq") + proto.RegisterType((*GetUserWorkMomentsResp)(nil), "office.GetUserWorkMomentsResp") + proto.RegisterType((*GetUserFriendWorkMomentsReq)(nil), "office.GetUserFriendWorkMomentsReq") + proto.RegisterType((*GetUserFriendWorkMomentsResp)(nil), "office.GetUserFriendWorkMomentsResp") + proto.RegisterType((*CommentsMsg)(nil), "office.CommentsMsg") + proto.RegisterType((*GetUserWorkMomentsCommentsMsgReq)(nil), "office.GetUserWorkMomentsCommentsMsgReq") + proto.RegisterType((*GetUserWorkMomentsCommentsMsgResp)(nil), "office.GetUserWorkMomentsCommentsMsgResp") + proto.RegisterType((*ClearUserWorkMomentsCommentsMsgReq)(nil), "office.ClearUserWorkMomentsCommentsMsgReq") + proto.RegisterType((*ClearUserWorkMomentsCommentsMsgResp)(nil), "office.ClearUserWorkMomentsCommentsMsgResp") + proto.RegisterType((*SetUserWorkMomentsLevelReq)(nil), "office.SetUserWorkMomentsLevelReq") + proto.RegisterType((*SetUserWorkMomentsLevelResp)(nil), "office.SetUserWorkMomentsLevelResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for OfficeService service + +type OfficeServiceClient interface { + GetUserTags(ctx context.Context, in *GetUserTagsReq, opts ...grpc.CallOption) (*GetUserTagsResp, error) + CreateTag(ctx context.Context, in *CreateTagReq, opts ...grpc.CallOption) (*CreateTagResp, error) + DeleteTag(ctx context.Context, in *DeleteTagReq, opts ...grpc.CallOption) (*DeleteTagResp, error) + SetTag(ctx context.Context, in *SetTagReq, opts ...grpc.CallOption) (*SetTagResp, error) + SendMsg2Tag(ctx context.Context, in *SendMsg2TagReq, opts ...grpc.CallOption) (*SendMsg2TagResp, error) + GetTagSendLogs(ctx context.Context, in *GetTagSendLogsReq, opts ...grpc.CallOption) (*GetTagSendLogsResp, error) + GetUserTagByID(ctx context.Context, in *GetUserTagByIDReq, opts ...grpc.CallOption) (*GetUserTagByIDResp, error) + CreateOneWorkMoment(ctx context.Context, in *CreateOneWorkMomentReq, opts ...grpc.CallOption) (*CreateOneWorkMomentResp, error) + DeleteOneWorkMoment(ctx context.Context, in *DeleteOneWorkMomentReq, opts ...grpc.CallOption) (*DeleteOneWorkMomentResp, error) + LikeOneWorkMoment(ctx context.Context, in *LikeOneWorkMomentReq, opts ...grpc.CallOption) (*LikeOneWorkMomentResp, error) + CommentOneWorkMoment(ctx context.Context, in *CommentOneWorkMomentReq, opts ...grpc.CallOption) (*CommentOneWorkMomentResp, error) + // / user self + GetUserWorkMoments(ctx context.Context, in *GetUserWorkMomentsReq, opts ...grpc.CallOption) (*GetUserWorkMomentsResp, error) + // / users friend + GetUserFriendWorkMoments(ctx context.Context, in *GetUserFriendWorkMomentsReq, opts ...grpc.CallOption) (*GetUserFriendWorkMomentsResp, error) + GetUserWorkMomentsCommentsMsg(ctx context.Context, in *GetUserWorkMomentsCommentsMsgReq, opts ...grpc.CallOption) (*GetUserWorkMomentsCommentsMsgResp, error) + ClearUserWorkMomentsCommentsMsg(ctx context.Context, in *ClearUserWorkMomentsCommentsMsgReq, opts ...grpc.CallOption) (*ClearUserWorkMomentsCommentsMsgResp, error) + SetUserWorkMomentsLevel(ctx context.Context, in *SetUserWorkMomentsLevelReq, opts ...grpc.CallOption) (*SetUserWorkMomentsLevelResp, error) +} + +type officeServiceClient struct { + cc *grpc.ClientConn +} + +func NewOfficeServiceClient(cc *grpc.ClientConn) OfficeServiceClient { + return &officeServiceClient{cc} +} + +func (c *officeServiceClient) GetUserTags(ctx context.Context, in *GetUserTagsReq, opts ...grpc.CallOption) (*GetUserTagsResp, error) { + out := new(GetUserTagsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserTags", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) CreateTag(ctx context.Context, in *CreateTagReq, opts ...grpc.CallOption) (*CreateTagResp, error) { + out := new(CreateTagResp) + err := grpc.Invoke(ctx, "/office.OfficeService/CreateTag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) DeleteTag(ctx context.Context, in *DeleteTagReq, opts ...grpc.CallOption) (*DeleteTagResp, error) { + out := new(DeleteTagResp) + err := grpc.Invoke(ctx, "/office.OfficeService/DeleteTag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) SetTag(ctx context.Context, in *SetTagReq, opts ...grpc.CallOption) (*SetTagResp, error) { + out := new(SetTagResp) + err := grpc.Invoke(ctx, "/office.OfficeService/SetTag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) SendMsg2Tag(ctx context.Context, in *SendMsg2TagReq, opts ...grpc.CallOption) (*SendMsg2TagResp, error) { + out := new(SendMsg2TagResp) + err := grpc.Invoke(ctx, "/office.OfficeService/SendMsg2Tag", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetTagSendLogs(ctx context.Context, in *GetTagSendLogsReq, opts ...grpc.CallOption) (*GetTagSendLogsResp, error) { + out := new(GetTagSendLogsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetTagSendLogs", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserTagByID(ctx context.Context, in *GetUserTagByIDReq, opts ...grpc.CallOption) (*GetUserTagByIDResp, error) { + out := new(GetUserTagByIDResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserTagByID", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) CreateOneWorkMoment(ctx context.Context, in *CreateOneWorkMomentReq, opts ...grpc.CallOption) (*CreateOneWorkMomentResp, error) { + out := new(CreateOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/CreateOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) DeleteOneWorkMoment(ctx context.Context, in *DeleteOneWorkMomentReq, opts ...grpc.CallOption) (*DeleteOneWorkMomentResp, error) { + out := new(DeleteOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/DeleteOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) LikeOneWorkMoment(ctx context.Context, in *LikeOneWorkMomentReq, opts ...grpc.CallOption) (*LikeOneWorkMomentResp, error) { + out := new(LikeOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/LikeOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) CommentOneWorkMoment(ctx context.Context, in *CommentOneWorkMomentReq, opts ...grpc.CallOption) (*CommentOneWorkMomentResp, error) { + out := new(CommentOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/CommentOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserWorkMoments(ctx context.Context, in *GetUserWorkMomentsReq, opts ...grpc.CallOption) (*GetUserWorkMomentsResp, error) { + out := new(GetUserWorkMomentsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserWorkMoments", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserFriendWorkMoments(ctx context.Context, in *GetUserFriendWorkMomentsReq, opts ...grpc.CallOption) (*GetUserFriendWorkMomentsResp, error) { + out := new(GetUserFriendWorkMomentsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserFriendWorkMoments", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserWorkMomentsCommentsMsg(ctx context.Context, in *GetUserWorkMomentsCommentsMsgReq, opts ...grpc.CallOption) (*GetUserWorkMomentsCommentsMsgResp, error) { + out := new(GetUserWorkMomentsCommentsMsgResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserWorkMomentsCommentsMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) ClearUserWorkMomentsCommentsMsg(ctx context.Context, in *ClearUserWorkMomentsCommentsMsgReq, opts ...grpc.CallOption) (*ClearUserWorkMomentsCommentsMsgResp, error) { + out := new(ClearUserWorkMomentsCommentsMsgResp) + err := grpc.Invoke(ctx, "/office.OfficeService/ClearUserWorkMomentsCommentsMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) SetUserWorkMomentsLevel(ctx context.Context, in *SetUserWorkMomentsLevelReq, opts ...grpc.CallOption) (*SetUserWorkMomentsLevelResp, error) { + out := new(SetUserWorkMomentsLevelResp) + err := grpc.Invoke(ctx, "/office.OfficeService/SetUserWorkMomentsLevel", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for OfficeService service + +type OfficeServiceServer interface { + GetUserTags(context.Context, *GetUserTagsReq) (*GetUserTagsResp, error) + CreateTag(context.Context, *CreateTagReq) (*CreateTagResp, error) + DeleteTag(context.Context, *DeleteTagReq) (*DeleteTagResp, error) + SetTag(context.Context, *SetTagReq) (*SetTagResp, error) + SendMsg2Tag(context.Context, *SendMsg2TagReq) (*SendMsg2TagResp, error) + GetTagSendLogs(context.Context, *GetTagSendLogsReq) (*GetTagSendLogsResp, error) + GetUserTagByID(context.Context, *GetUserTagByIDReq) (*GetUserTagByIDResp, error) + CreateOneWorkMoment(context.Context, *CreateOneWorkMomentReq) (*CreateOneWorkMomentResp, error) + DeleteOneWorkMoment(context.Context, *DeleteOneWorkMomentReq) (*DeleteOneWorkMomentResp, error) + LikeOneWorkMoment(context.Context, *LikeOneWorkMomentReq) (*LikeOneWorkMomentResp, error) + CommentOneWorkMoment(context.Context, *CommentOneWorkMomentReq) (*CommentOneWorkMomentResp, error) + // / user self + GetUserWorkMoments(context.Context, *GetUserWorkMomentsReq) (*GetUserWorkMomentsResp, error) + // / users friend + GetUserFriendWorkMoments(context.Context, *GetUserFriendWorkMomentsReq) (*GetUserFriendWorkMomentsResp, error) + GetUserWorkMomentsCommentsMsg(context.Context, *GetUserWorkMomentsCommentsMsgReq) (*GetUserWorkMomentsCommentsMsgResp, error) + ClearUserWorkMomentsCommentsMsg(context.Context, *ClearUserWorkMomentsCommentsMsgReq) (*ClearUserWorkMomentsCommentsMsgResp, error) + SetUserWorkMomentsLevel(context.Context, *SetUserWorkMomentsLevelReq) (*SetUserWorkMomentsLevelResp, error) +} + +func RegisterOfficeServiceServer(s *grpc.Server, srv OfficeServiceServer) { + s.RegisterService(&_OfficeService_serviceDesc, srv) +} + +func _OfficeService_GetUserTags_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserTagsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserTags(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserTags", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserTags(ctx, req.(*GetUserTagsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_CreateTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateTagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).CreateTag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/CreateTag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).CreateTag(ctx, req.(*CreateTagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_DeleteTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteTagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).DeleteTag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/DeleteTag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).DeleteTag(ctx, req.(*DeleteTagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_SetTag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetTagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).SetTag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/SetTag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).SetTag(ctx, req.(*SetTagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_SendMsg2Tag_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendMsg2TagReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).SendMsg2Tag(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/SendMsg2Tag", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).SendMsg2Tag(ctx, req.(*SendMsg2TagReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetTagSendLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTagSendLogsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetTagSendLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetTagSendLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetTagSendLogs(ctx, req.(*GetTagSendLogsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserTagByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserTagByIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserTagByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserTagByID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserTagByID(ctx, req.(*GetUserTagByIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_CreateOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).CreateOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/CreateOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).CreateOneWorkMoment(ctx, req.(*CreateOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_DeleteOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).DeleteOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/DeleteOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).DeleteOneWorkMoment(ctx, req.(*DeleteOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_LikeOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LikeOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).LikeOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/LikeOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).LikeOneWorkMoment(ctx, req.(*LikeOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_CommentOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommentOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).CommentOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/CommentOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).CommentOneWorkMoment(ctx, req.(*CommentOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserWorkMoments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserWorkMomentsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserWorkMoments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserWorkMoments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserWorkMoments(ctx, req.(*GetUserWorkMomentsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserFriendWorkMoments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserFriendWorkMomentsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserFriendWorkMoments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserFriendWorkMoments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserFriendWorkMoments(ctx, req.(*GetUserFriendWorkMomentsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserWorkMomentsCommentsMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserWorkMomentsCommentsMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserWorkMomentsCommentsMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserWorkMomentsCommentsMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserWorkMomentsCommentsMsg(ctx, req.(*GetUserWorkMomentsCommentsMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_ClearUserWorkMomentsCommentsMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearUserWorkMomentsCommentsMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).ClearUserWorkMomentsCommentsMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/ClearUserWorkMomentsCommentsMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).ClearUserWorkMomentsCommentsMsg(ctx, req.(*ClearUserWorkMomentsCommentsMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_SetUserWorkMomentsLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetUserWorkMomentsLevelReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).SetUserWorkMomentsLevel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/SetUserWorkMomentsLevel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).SetUserWorkMomentsLevel(ctx, req.(*SetUserWorkMomentsLevelReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _OfficeService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "office.OfficeService", + HandlerType: (*OfficeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetUserTags", + Handler: _OfficeService_GetUserTags_Handler, + }, + { + MethodName: "CreateTag", + Handler: _OfficeService_CreateTag_Handler, + }, + { + MethodName: "DeleteTag", + Handler: _OfficeService_DeleteTag_Handler, + }, + { + MethodName: "SetTag", + Handler: _OfficeService_SetTag_Handler, + }, + { + MethodName: "SendMsg2Tag", + Handler: _OfficeService_SendMsg2Tag_Handler, + }, + { + MethodName: "GetTagSendLogs", + Handler: _OfficeService_GetTagSendLogs_Handler, + }, + { + MethodName: "GetUserTagByID", + Handler: _OfficeService_GetUserTagByID_Handler, + }, + { + MethodName: "CreateOneWorkMoment", + Handler: _OfficeService_CreateOneWorkMoment_Handler, + }, + { + MethodName: "DeleteOneWorkMoment", + Handler: _OfficeService_DeleteOneWorkMoment_Handler, + }, + { + MethodName: "LikeOneWorkMoment", + Handler: _OfficeService_LikeOneWorkMoment_Handler, + }, + { + MethodName: "CommentOneWorkMoment", + Handler: _OfficeService_CommentOneWorkMoment_Handler, + }, + { + MethodName: "GetUserWorkMoments", + Handler: _OfficeService_GetUserWorkMoments_Handler, + }, + { + MethodName: "GetUserFriendWorkMoments", + Handler: _OfficeService_GetUserFriendWorkMoments_Handler, + }, + { + MethodName: "GetUserWorkMomentsCommentsMsg", + Handler: _OfficeService_GetUserWorkMomentsCommentsMsg_Handler, + }, + { + MethodName: "ClearUserWorkMomentsCommentsMsg", + Handler: _OfficeService_ClearUserWorkMomentsCommentsMsg_Handler, + }, + { + MethodName: "SetUserWorkMomentsLevel", + Handler: _OfficeService_SetUserWorkMomentsLevel_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "office/office.proto", +} + +func init() { proto.RegisterFile("office/office.proto", fileDescriptor_office_8a5f7d4f1783db20) } + +var fileDescriptor_office_8a5f7d4f1783db20 = []byte{ + // 1494 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcd, 0x6e, 0xdb, 0xc6, + 0x13, 0x07, 0x25, 0x4b, 0xb2, 0x46, 0x4e, 0x1c, 0xaf, 0x1d, 0x5b, 0x7f, 0x26, 0xb6, 0x15, 0x26, + 0x7f, 0xc0, 0x49, 0x00, 0xa9, 0x50, 0x03, 0xb4, 0x40, 0xd1, 0xa0, 0x88, 0x94, 0x1a, 0x6e, 0xad, + 0xc4, 0xa5, 0x9c, 0x06, 0xe9, 0x21, 0x06, 0x2d, 0xad, 0x59, 0xc2, 0x12, 0xc9, 0x70, 0x69, 0x09, + 0xe9, 0xb1, 0x87, 0xbe, 0x40, 0x0f, 0x3d, 0xf5, 0xd2, 0x57, 0x28, 0xfa, 0x08, 0x3d, 0xf4, 0x54, + 0xf4, 0xd4, 0x53, 0x6f, 0x7d, 0x8f, 0x16, 0xbb, 0xfc, 0xda, 0xe5, 0x87, 0xa4, 0xd0, 0x0d, 0xd0, + 0x9e, 0xc4, 0x99, 0x9d, 0x9d, 0x9d, 0xf9, 0xcd, 0xee, 0xcc, 0xee, 0x08, 0xd6, 0xad, 0xb3, 0x33, + 0x63, 0x80, 0x5b, 0xde, 0x4f, 0xd3, 0x76, 0x2c, 0xd7, 0x42, 0x65, 0x8f, 0x92, 0x6f, 0x3d, 0xb5, + 0xb1, 0x79, 0x72, 0xd0, 0x6b, 0xd9, 0xe7, 0x7a, 0x8b, 0x0d, 0xb5, 0xc8, 0xf0, 0xfc, 0x64, 0x4a, + 0x5a, 0x53, 0xe2, 0x89, 0x2a, 0x0f, 0x01, 0x3a, 0xd6, 0x78, 0x6c, 0x99, 0x2a, 0x26, 0x36, 0xaa, + 0x43, 0x05, 0x3b, 0x4e, 0xc7, 0x1a, 0xe2, 0xba, 0xd4, 0x90, 0xf6, 0x4a, 0x6a, 0x40, 0xa2, 0x4d, + 0x28, 0x63, 0xc7, 0xe9, 0x11, 0xbd, 0x5e, 0x68, 0x48, 0x7b, 0x55, 0xd5, 0xa7, 0x94, 0x0f, 0xa1, + 0x72, 0xac, 0xe9, 0xcf, 0x08, 0x76, 0xa8, 0xc8, 0x05, 0xc1, 0xce, 0x41, 0x97, 0xcd, 0xad, 0xaa, + 0x3e, 0x85, 0x64, 0x58, 0xa6, 0x5f, 0x4f, 0xb4, 0x31, 0xf6, 0x27, 0x87, 0xb4, 0x72, 0x0a, 0xc5, + 0x63, 0x4d, 0x47, 0x1b, 0x50, 0x72, 0x35, 0x3d, 0x9c, 0xe9, 0x11, 0xd4, 0x1a, 0x57, 0xd3, 0xb9, + 0x79, 0x01, 0x89, 0xee, 0x7b, 0x2a, 0x0f, 0x0d, 0xe2, 0xd6, 0x8b, 0x8d, 0xe2, 0x5e, 0xad, 0xbd, + 0xda, 0xf4, 0x11, 0xf0, 0xad, 0x51, 0x43, 0x01, 0xe5, 0x13, 0xb8, 0xba, 0x8f, 0x5d, 0xca, 0x3c, + 0xd6, 0x74, 0xa2, 0xe2, 0x57, 0x99, 0x96, 0x36, 0xa0, 0x66, 0xd9, 0xd8, 0xd1, 0x5c, 0xc3, 0x32, + 0x0f, 0xba, 0xfe, 0xa2, 0x3c, 0x4b, 0x39, 0x83, 0x55, 0x41, 0x17, 0xb1, 0x51, 0x1b, 0x60, 0x10, + 0x22, 0xc8, 0x14, 0xd6, 0xda, 0x28, 0xb0, 0x26, 0xc2, 0x56, 0xe5, 0xa4, 0xd0, 0x2e, 0x2c, 0xb9, + 0x9a, 0x4e, 0xea, 0x05, 0x66, 0x7b, 0x8d, 0xb3, 0x5d, 0x65, 0x03, 0xca, 0xd7, 0x12, 0xac, 0x74, + 0x1c, 0xac, 0xb9, 0x98, 0xf2, 0xf0, 0x2b, 0x1e, 0x0b, 0x49, 0xc4, 0x22, 0x72, 0xa6, 0x20, 0x38, + 0xb3, 0x03, 0xe0, 0x7d, 0x85, 0x28, 0x55, 0x55, 0x8e, 0x13, 0x77, 0x76, 0x29, 0xe9, 0x6c, 0x07, + 0xae, 0x70, 0x36, 0xe4, 0x73, 0x55, 0x79, 0x09, 0x2b, 0x5d, 0x3c, 0xc2, 0xa1, 0x23, 0x59, 0xd8, + 0x87, 0x5b, 0xa0, 0xc0, 0x6f, 0x81, 0x98, 0x91, 0xc5, 0x54, 0x23, 0x39, 0xfd, 0x39, 0x8d, 0xfc, + 0x4d, 0x82, 0x6a, 0x1f, 0xbb, 0xb9, 0x4c, 0xac, 0x43, 0xc5, 0xc4, 0x53, 0x16, 0x19, 0xcf, 0xbc, + 0x80, 0x44, 0x4d, 0x40, 0x86, 0x39, 0x70, 0xb0, 0x46, 0xf0, 0xb3, 0x28, 0x12, 0x4b, 0x2c, 0x12, + 0x29, 0x23, 0xe8, 0x1e, 0x5c, 0x73, 0xf0, 0xf0, 0x62, 0xc0, 0x4b, 0x97, 0x98, 0x74, 0x82, 0x1f, + 0x07, 0xa6, 0x9c, 0x04, 0xe6, 0x23, 0x80, 0xc0, 0xa5, 0x9c, 0xa8, 0xfc, 0x29, 0xc1, 0xd5, 0x3e, + 0x36, 0x87, 0x3d, 0xa2, 0xb7, 0x85, 0x6d, 0xc8, 0x2c, 0x93, 0x98, 0x65, 0x01, 0x49, 0x4f, 0xf9, + 0xb3, 0xe0, 0x48, 0x16, 0xd8, 0x50, 0x48, 0xa3, 0x9b, 0x50, 0xdd, 0x77, 0xac, 0x0b, 0x9b, 0xdb, + 0x89, 0x11, 0x83, 0xc2, 0x4d, 0xb0, 0x39, 0x0c, 0xf7, 0xa0, 0x4f, 0x51, 0x38, 0xe8, 0x17, 0x76, + 0x8e, 0x46, 0x9a, 0x7b, 0x66, 0x39, 0xe3, 0x83, 0x6e, 0xbd, 0xc4, 0xb2, 0x52, 0x82, 0x4f, 0xed, + 0x1a, 0x58, 0xa6, 0x8b, 0x4d, 0xd7, 0x87, 0x22, 0x20, 0xe3, 0x40, 0x55, 0x92, 0x40, 0x3d, 0x86, + 0x55, 0xc1, 0xcb, 0x9c, 0x68, 0x7d, 0x2b, 0xc1, 0xda, 0x3e, 0x03, 0x9c, 0x6a, 0x3b, 0xb4, 0xbc, + 0x54, 0xd3, 0x05, 0x38, 0xd2, 0x74, 0xc3, 0x64, 0x8b, 0xf9, 0x9a, 0xee, 0x34, 0x09, 0x76, 0x26, + 0xd8, 0x39, 0xd1, 0x6c, 0xe3, 0xc4, 0xd6, 0x1c, 0x6d, 0x4c, 0x9a, 0x2a, 0x7e, 0x75, 0x81, 0x89, + 0x1b, 0xc9, 0xaa, 0xdc, 0xbc, 0xcc, 0x33, 0x3e, 0xff, 0x78, 0x58, 0x00, 0x91, 0x45, 0x42, 0xde, + 0x94, 0xe6, 0xe4, 0x4d, 0x1e, 0xd3, 0x82, 0x88, 0xa9, 0x0c, 0xcb, 0x34, 0x02, 0xc7, 0x86, 0xbf, + 0xe7, 0x8b, 0x6a, 0x48, 0x2b, 0x3f, 0x4b, 0x80, 0xe2, 0x30, 0xe4, 0xcc, 0x92, 0x8f, 0x05, 0xec, + 0x0a, 0x6c, 0xce, 0xff, 0x53, 0xb1, 0x23, 0xb6, 0x65, 0x12, 0x9c, 0x01, 0xde, 0x03, 0xa8, 0xb9, + 0x91, 0x35, 0x7e, 0xbd, 0x40, 0x9c, 0xdf, 0xfe, 0x90, 0xca, 0x8b, 0x29, 0x03, 0x16, 0x4d, 0x3f, + 0xd3, 0x3f, 0x7a, 0x7d, 0xd0, 0x7d, 0x1b, 0xc9, 0x4b, 0x67, 0x58, 0x09, 0x8b, 0xe4, 0xc4, 0x6a, + 0x1b, 0x8a, 0xae, 0xa6, 0xfb, 0x20, 0x09, 0x05, 0x85, 0xf2, 0x95, 0x87, 0xb0, 0x7c, 0x68, 0x9c, + 0xe3, 0xdc, 0x75, 0xfa, 0x0f, 0x09, 0x2a, 0x74, 0x65, 0x1a, 0xfd, 0x1c, 0xf3, 0x29, 0x14, 0x0e, + 0xb6, 0x47, 0xaf, 0xbd, 0x0c, 0x16, 0x40, 0xc1, 0xb1, 0xd0, 0x1d, 0xb8, 0x12, 0x92, 0x4c, 0x85, + 0x97, 0x0c, 0x44, 0x26, 0xcd, 0x24, 0xfe, 0x26, 0xf4, 0x93, 0x41, 0x55, 0x8d, 0x18, 0x33, 0xb2, + 0xc0, 0x0e, 0xc0, 0xc0, 0x2b, 0x65, 0x74, 0xcf, 0x56, 0x58, 0x16, 0xe1, 0x38, 0xca, 0x5f, 0x05, + 0x80, 0xe7, 0x96, 0x73, 0xde, 0xb3, 0x98, 0x8b, 0x0a, 0xac, 0x4c, 0x43, 0x2a, 0x74, 0x54, 0xe0, + 0x65, 0x9e, 0x49, 0xce, 0x88, 0xa2, 0x68, 0x44, 0x13, 0xaa, 0x23, 0x3f, 0x08, 0x84, 0x95, 0x81, + 0x5a, 0xfb, 0x5a, 0x10, 0xa9, 0x20, 0x3a, 0x6a, 0x24, 0x42, 0x4f, 0xeb, 0xc0, 0xc3, 0x9c, 0xb0, + 0x3a, 0xc0, 0x9d, 0x56, 0x3f, 0x16, 0x6a, 0x28, 0x80, 0xde, 0x81, 0xf5, 0xe9, 0x97, 0x56, 0x47, + 0x33, 0xfb, 0x98, 0xaf, 0x1f, 0x65, 0x96, 0x6d, 0xd3, 0x86, 0x50, 0x1b, 0x36, 0x3c, 0xb6, 0x2b, + 0x4e, 0xa9, 0xb0, 0x29, 0xa9, 0x63, 0x14, 0x7f, 0x83, 0x1c, 0x39, 0xc6, 0x44, 0x73, 0x71, 0x7d, + 0xb9, 0x21, 0xed, 0x2d, 0xab, 0x11, 0x83, 0xee, 0x00, 0x83, 0x1c, 0x5d, 0x9c, 0x8e, 0x8c, 0x41, + 0xbd, 0xca, 0x06, 0x43, 0x9a, 0x46, 0xa0, 0x13, 0x45, 0x00, 0xbc, 0x08, 0x44, 0x1c, 0xe5, 0x1b, + 0x09, 0x36, 0x3d, 0xf2, 0xa9, 0x89, 0xa3, 0x50, 0xd0, 0x53, 0xd7, 0x06, 0x88, 0x90, 0x8f, 0x9f, + 0x07, 0x4e, 0x94, 0x93, 0xba, 0x44, 0xc6, 0xec, 0xc1, 0x56, 0xaa, 0x1d, 0x39, 0xcb, 0xc2, 0x04, + 0x36, 0xbd, 0xfb, 0x49, 0xc2, 0xad, 0xcb, 0x6c, 0xb2, 0x85, 0xdc, 0x48, 0x5d, 0x37, 0xa7, 0x1b, + 0x2e, 0x6c, 0xd0, 0x2d, 0x9a, 0x70, 0x22, 0x2b, 0x19, 0x28, 0xb0, 0xf2, 0x9c, 0x77, 0xce, 0x33, + 0x5f, 0xe0, 0x2d, 0xe0, 0xc4, 0xa7, 0x70, 0x3d, 0x65, 0xd5, 0x9c, 0x2e, 0xfc, 0x28, 0xc1, 0x96, + 0x7f, 0x6e, 0xde, 0xc4, 0x8d, 0x69, 0x8a, 0x1b, 0xd3, 0x98, 0x1b, 0x73, 0x72, 0x1b, 0x97, 0x12, + 0x96, 0x66, 0xde, 0x4e, 0x4a, 0x49, 0x08, 0x9e, 0x40, 0x3d, 0xdd, 0xe8, 0x9c, 0x28, 0x7c, 0x27, + 0xc1, 0x75, 0xbf, 0xe6, 0x44, 0xda, 0x66, 0xbe, 0x8a, 0xba, 0x29, 0x65, 0xf8, 0xcd, 0xaf, 0x30, + 0xf3, 0x83, 0xfd, 0x8b, 0x04, 0x9b, 0x69, 0x96, 0xe5, 0xac, 0x88, 0x0f, 0xa0, 0x16, 0x85, 0x29, + 0x78, 0x6a, 0xa5, 0xa5, 0x0d, 0x5e, 0x2c, 0x76, 0xe7, 0x28, 0xe6, 0xbc, 0x73, 0x28, 0xdf, 0x4b, + 0x70, 0xc3, 0xf7, 0xe5, 0x63, 0xc7, 0xc0, 0xe6, 0xf0, 0x5f, 0x86, 0xf5, 0xaf, 0x12, 0xdc, 0xcc, + 0xb6, 0xef, 0xbf, 0x88, 0xf8, 0x04, 0x6a, 0xfe, 0x39, 0x21, 0x3d, 0xa2, 0xa3, 0xbb, 0xf4, 0xc8, + 0x8d, 0xb9, 0x82, 0x91, 0x28, 0x9d, 0xc1, 0xf8, 0x42, 0x67, 0x3c, 0xb3, 0xa8, 0x2b, 0x3f, 0x48, + 0xd0, 0x48, 0xee, 0x5a, 0xce, 0x94, 0x4b, 0x35, 0x1c, 0x62, 0x1b, 0xa2, 0x98, 0x6f, 0x43, 0x28, + 0xbf, 0x4b, 0x70, 0x6b, 0x8e, 0x91, 0x39, 0x63, 0xfe, 0x1e, 0xac, 0x0c, 0x22, 0x35, 0x41, 0xd0, + 0xd7, 0x63, 0x60, 0xb3, 0x25, 0x04, 0xc1, 0x7f, 0x2a, 0xec, 0x2f, 0x41, 0xe9, 0x8c, 0xb0, 0xe6, + 0xbc, 0x25, 0xfc, 0x95, 0x17, 0x70, 0x7b, 0xae, 0xfe, 0x9c, 0x99, 0x78, 0x04, 0x72, 0x3f, 0x11, + 0x93, 0x43, 0x3c, 0xc1, 0xa3, 0x39, 0x4f, 0x8d, 0x11, 0x95, 0x61, 0xc6, 0x96, 0x54, 0x8f, 0x58, + 0xe0, 0xc4, 0x7f, 0x06, 0x37, 0x32, 0x57, 0xcb, 0xe7, 0x40, 0xfb, 0x27, 0x80, 0x2b, 0x4f, 0x99, + 0x44, 0x1f, 0x3b, 0x13, 0x63, 0x80, 0xd1, 0x43, 0xa8, 0x71, 0xed, 0x31, 0xb4, 0x19, 0x28, 0x10, + 0xfb, 0x6f, 0xf2, 0x56, 0x2a, 0x9f, 0xd8, 0xe8, 0x7d, 0xa8, 0x86, 0x1d, 0x27, 0xb4, 0x11, 0x2e, + 0xcf, 0x35, 0xc2, 0xe4, 0xeb, 0x29, 0x5c, 0x6f, 0x66, 0xd8, 0x06, 0x8a, 0x66, 0xf2, 0x9d, 0xa7, + 0x68, 0xa6, 0xd8, 0x2f, 0x6a, 0x41, 0xd9, 0xeb, 0x93, 0xa0, 0xb5, 0x40, 0x20, 0x6c, 0x05, 0xc9, + 0x28, 0xce, 0x22, 0x36, 0x75, 0x92, 0xeb, 0x17, 0x44, 0x4e, 0x8a, 0xad, 0x92, 0xc8, 0xc9, 0x78, + 0x73, 0x61, 0x9f, 0xf5, 0x23, 0xb9, 0x07, 0x32, 0xfa, 0x1f, 0x87, 0x87, 0xd8, 0x3f, 0x90, 0xe5, + 0xac, 0xa1, 0x50, 0x11, 0xf7, 0x7a, 0x14, 0x14, 0x89, 0x4f, 0x57, 0x41, 0x51, 0xfc, 0xc1, 0xf9, + 0x39, 0xac, 0xa7, 0x5c, 0x79, 0xd1, 0x8e, 0x08, 0x75, 0xfc, 0xd2, 0x24, 0xef, 0xce, 0x1c, 0xf7, + 0xf4, 0xa6, 0xdc, 0x41, 0x23, 0xbd, 0xe9, 0x17, 0xe3, 0x48, 0x6f, 0xd6, 0x05, 0xf6, 0x08, 0xd6, + 0x12, 0xd7, 0x42, 0x74, 0x93, 0x7f, 0x4a, 0x25, 0x74, 0x6e, 0xcf, 0x18, 0x25, 0x36, 0x7a, 0x01, + 0x1b, 0x69, 0xb7, 0x2c, 0xb4, 0x1b, 0x4b, 0x64, 0x09, 0xbd, 0x8d, 0xd9, 0x02, 0xc4, 0x46, 0xfd, + 0xf0, 0x8d, 0xcf, 0x1d, 0x3c, 0xb4, 0x1d, 0x0b, 0x87, 0x78, 0x3f, 0x90, 0x77, 0x66, 0x0d, 0x13, + 0x1b, 0x61, 0xa8, 0x67, 0x95, 0x6f, 0x74, 0x3b, 0x36, 0x37, 0xed, 0x02, 0x22, 0xdf, 0x99, 0x2f, + 0x44, 0x6c, 0xe4, 0xc2, 0xf6, 0xcc, 0xb2, 0x81, 0xf6, 0xb2, 0xed, 0x14, 0x53, 0xb0, 0x7c, 0x77, + 0x41, 0x49, 0x62, 0xa3, 0xaf, 0x60, 0x77, 0x4e, 0xce, 0x45, 0xf7, 0x42, 0xd8, 0xe7, 0x26, 0x7f, + 0xf9, 0xfe, 0xc2, 0xb2, 0xc4, 0x46, 0xa7, 0xb0, 0x95, 0x91, 0x26, 0x91, 0xc2, 0xe5, 0x82, 0x8c, + 0xac, 0x2d, 0xdf, 0x9e, 0x2b, 0x43, 0xec, 0x47, 0x6b, 0x5f, 0xac, 0x36, 0xfd, 0x3f, 0x6c, 0x3e, + 0xf0, 0x7e, 0x4e, 0xcb, 0xec, 0xdf, 0x98, 0x77, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xb2, 0xc1, + 0x31, 0xd6, 0xcf, 0x19, 0x00, 0x00, +} diff --git a/pkg/proto/office/office.proto b/pkg/proto/office/office.proto new file mode 100644 index 000000000..6642f674f --- /dev/null +++ b/pkg/proto/office/office.proto @@ -0,0 +1,263 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./office;office"; +package office; + +message CommonResp{ + int32 errCode = 1; + string errMsg = 2; +} + +message TagUser { + string userID = 1; + string userName = 2; +} + +message Tag { + string tagID = 1; + string tagName = 2; + repeated TagUser userList = 3; +} + +message GetUserTagsReq{ + string userID = 1; + string operationID = 2; +} + +message GetUserTagsResp{ + CommonResp commonResp = 1; + repeated Tag tags = 2; +} + +message CreateTagReq { + string tagName = 1; + string userID = 2; + repeated string userIDList = 3; + string operationID = 4; +} + +message CreateTagResp { + CommonResp commonResp = 1; +} + +message DeleteTagReq { + string userID = 1; + string tagID = 2; + string operationID = 3; +} + +message DeleteTagResp { + CommonResp commonResp = 1; +} + +message SetTagReq { + string userID = 1; + string tagID = 2; + string newName = 3; + repeated string increaseUserIDList = 4; + repeated string reduceUserIDList = 5; + string operationID = 6; +} + +message SetTagResp { + CommonResp commonResp = 1; +} + +message SendMsg2TagReq { + repeated string tagList = 1; + repeated string UserList = 2; + repeated string GroupList = 3; + string sendID = 4; + int32 senderPlatformID = 5; + string content = 6; + string operationID = 7; +} + +message SendMsg2TagResp { + CommonResp commonResp = 1; +} + +message GetTagSendLogsReq { + server_api_params.RequestPagination Pagination = 1; + string userID = 2; + string operationID = 3; +} + +message TagSendLog { + repeated TagUser userList = 1; + string content = 2; + int64 sendTime = 3; +} + +message GetTagSendLogsResp { + CommonResp commonResp = 1; + server_api_params.ResponsePagination Pagination = 2; + repeated TagSendLog tagSendLogs = 3; +} + +message GetUserTagByIDReq { + string userID = 1; + string tagID = 2; + string operationID = 3; +} + +message GetUserTagByIDResp { + CommonResp commonResp = 1; + Tag tag = 2; +} + +/// WorkMoment + +message LikeUser { + string userID = 1; + string userName = 2; +} + +message Comment { + string userID = 1; + string userName = 2; + string replyUserID = 3; + string replyUserName = 4; + string contentID = 5; + string content = 6; + int32 createTime = 7; +} + +message WorkMoment { + string workMomentID = 1; + string userID = 2; + string content = 3; + repeated LikeUser likeUsers = 4; + repeated Comment comments = 5; + repeated string whoCanSeeUserIDList = 6; + repeated string whoCantSeeUserIDList = 7; + bool isPrivate = 8; + bool isPublic = 9; + int32 CreateTime = 10; +} + +message CreateOneWorkMomentReq { + WorkMoment workMoment = 1; + string userID = 2; + string operationID = 3; +} + +message CreateOneWorkMomentResp { + CommonResp commonResp = 1; +} + +message DeleteOneWorkMomentReq { + string workMomentID = 1; + string userID = 2; + string operationID = 3; +} + +message DeleteOneWorkMomentResp { + CommonResp commonResp = 1; +} + +message LikeOneWorkMomentReq { + string userID = 1; + string WorkMomentID = 2; + string operationID = 3; +} + +message LikeOneWorkMomentResp { + CommonResp commonResp = 1; +} + +message CommentOneWorkMomentReq { + string userID = 1; + string workMomentID = 2; + string replyUserID = 3; + string content = 4; + string operationID = 5; +} + +message CommentOneWorkMomentResp { + CommonResp commonResp = 1; +} + +message GetUserWorkMomentsReq { + string userID = 1; + server_api_params.RequestPagination Pagination = 2; + string operationID = 3; +} + +message GetUserWorkMomentsResp { + CommonResp commonResp = 1; + repeated WorkMoment workMoments = 2; + server_api_params.ResponsePagination Pagination = 3; +} + +message GetUserFriendWorkMomentsReq { + string userID = 1; + server_api_params.RequestPagination Pagination = 2; + string operationID = 3; +} + +message GetUserFriendWorkMomentsResp { + CommonResp commonResp = 1; + repeated WorkMoment workMoments = 2; + server_api_params.ResponsePagination Pagination = 3; +} + +message CommentsMsg { + Comment comment = 1; + string workMomentID = 2; + string content = 3; +} + +message GetUserWorkMomentsCommentsMsgReq { + string userID = 1; + string operationID = 2; + server_api_params.RequestPagination Pagination = 3; +} + +message GetUserWorkMomentsCommentsMsgResp { + CommonResp commonResp = 1; + repeated CommentsMsg commentsMsgs = 2; + server_api_params.ResponsePagination Pagination = 3; +} + +message ClearUserWorkMomentsCommentsMsgReq { + string userID = 1; + string operationID = 2; +} + +message ClearUserWorkMomentsCommentsMsgResp { + CommonResp commonResp = 1; +} + +message SetUserWorkMomentsLevelReq { + string userID = 1; + int32 level = 2; + string operationID = 3; +} + +message SetUserWorkMomentsLevelResp { + CommonResp commonResp = 1; +} + +service OfficeService { + rpc GetUserTags(GetUserTagsReq) returns(GetUserTagsResp); + rpc CreateTag(CreateTagReq) returns(CreateTagResp); + rpc DeleteTag(DeleteTagReq) returns(DeleteTagResp); + rpc SetTag(SetTagReq) returns(SetTagResp); + rpc SendMsg2Tag(SendMsg2TagReq) returns(SendMsg2TagResp); + rpc GetTagSendLogs(GetTagSendLogsReq) returns(GetTagSendLogsResp); + rpc GetUserTagByID(GetUserTagByIDReq) returns(GetUserTagByIDResp); + + rpc CreateOneWorkMoment(CreateOneWorkMomentReq) returns(CreateOneWorkMomentResp); + rpc DeleteOneWorkMoment(DeleteOneWorkMomentReq) returns(DeleteOneWorkMomentResp); + rpc LikeOneWorkMoment(LikeOneWorkMomentReq) returns(LikeOneWorkMomentResp); + rpc CommentOneWorkMoment(CommentOneWorkMomentReq) returns(CommentOneWorkMomentResp); + /// user self + rpc GetUserWorkMoments(GetUserWorkMomentsReq) returns(GetUserWorkMomentsResp); + /// users friend + rpc GetUserFriendWorkMoments(GetUserFriendWorkMomentsReq) returns(GetUserFriendWorkMomentsResp); + rpc GetUserWorkMomentsCommentsMsg(GetUserWorkMomentsCommentsMsgReq) returns(GetUserWorkMomentsCommentsMsgResp); + rpc ClearUserWorkMomentsCommentsMsg(ClearUserWorkMomentsCommentsMsgReq) returns(ClearUserWorkMomentsCommentsMsgResp); + rpc SetUserWorkMomentsLevel(SetUserWorkMomentsLevelReq) returns(SetUserWorkMomentsLevelResp); +} + diff --git a/pkg/proto/organization/organization.pb.go b/pkg/proto/organization/organization.pb.go new file mode 100644 index 000000000..844dfd947 --- /dev/null +++ b/pkg/proto/organization/organization.pb.go @@ -0,0 +1,1780 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: organization/organization.proto + +package organization // import "./organization" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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 CreateDepartmentReq struct { + DepartmentInfo *sdk_ws.Department `protobuf:"bytes,1,opt,name=departmentInfo" json:"departmentInfo,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateDepartmentReq) Reset() { *m = CreateDepartmentReq{} } +func (m *CreateDepartmentReq) String() string { return proto.CompactTextString(m) } +func (*CreateDepartmentReq) ProtoMessage() {} +func (*CreateDepartmentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{0} +} +func (m *CreateDepartmentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateDepartmentReq.Unmarshal(m, b) +} +func (m *CreateDepartmentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateDepartmentReq.Marshal(b, m, deterministic) +} +func (dst *CreateDepartmentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateDepartmentReq.Merge(dst, src) +} +func (m *CreateDepartmentReq) XXX_Size() int { + return xxx_messageInfo_CreateDepartmentReq.Size(m) +} +func (m *CreateDepartmentReq) XXX_DiscardUnknown() { + xxx_messageInfo_CreateDepartmentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateDepartmentReq proto.InternalMessageInfo + +func (m *CreateDepartmentReq) GetDepartmentInfo() *sdk_ws.Department { + if m != nil { + return m.DepartmentInfo + } + return nil +} + +func (m *CreateDepartmentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *CreateDepartmentReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type CreateDepartmentResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + DepartmentInfo *sdk_ws.Department `protobuf:"bytes,3,opt,name=departmentInfo" json:"departmentInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateDepartmentResp) Reset() { *m = CreateDepartmentResp{} } +func (m *CreateDepartmentResp) String() string { return proto.CompactTextString(m) } +func (*CreateDepartmentResp) ProtoMessage() {} +func (*CreateDepartmentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{1} +} +func (m *CreateDepartmentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateDepartmentResp.Unmarshal(m, b) +} +func (m *CreateDepartmentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateDepartmentResp.Marshal(b, m, deterministic) +} +func (dst *CreateDepartmentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateDepartmentResp.Merge(dst, src) +} +func (m *CreateDepartmentResp) XXX_Size() int { + return xxx_messageInfo_CreateDepartmentResp.Size(m) +} +func (m *CreateDepartmentResp) XXX_DiscardUnknown() { + xxx_messageInfo_CreateDepartmentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateDepartmentResp proto.InternalMessageInfo + +func (m *CreateDepartmentResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CreateDepartmentResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *CreateDepartmentResp) GetDepartmentInfo() *sdk_ws.Department { + if m != nil { + return m.DepartmentInfo + } + return nil +} + +type UpdateDepartmentReq struct { + DepartmentInfo *sdk_ws.Department `protobuf:"bytes,1,opt,name=departmentInfo" json:"departmentInfo,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateDepartmentReq) Reset() { *m = UpdateDepartmentReq{} } +func (m *UpdateDepartmentReq) String() string { return proto.CompactTextString(m) } +func (*UpdateDepartmentReq) ProtoMessage() {} +func (*UpdateDepartmentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{2} +} +func (m *UpdateDepartmentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateDepartmentReq.Unmarshal(m, b) +} +func (m *UpdateDepartmentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateDepartmentReq.Marshal(b, m, deterministic) +} +func (dst *UpdateDepartmentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateDepartmentReq.Merge(dst, src) +} +func (m *UpdateDepartmentReq) XXX_Size() int { + return xxx_messageInfo_UpdateDepartmentReq.Size(m) +} +func (m *UpdateDepartmentReq) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateDepartmentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateDepartmentReq proto.InternalMessageInfo + +func (m *UpdateDepartmentReq) GetDepartmentInfo() *sdk_ws.Department { + if m != nil { + return m.DepartmentInfo + } + return nil +} + +func (m *UpdateDepartmentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *UpdateDepartmentReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type UpdateDepartmentResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateDepartmentResp) Reset() { *m = UpdateDepartmentResp{} } +func (m *UpdateDepartmentResp) String() string { return proto.CompactTextString(m) } +func (*UpdateDepartmentResp) ProtoMessage() {} +func (*UpdateDepartmentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{3} +} +func (m *UpdateDepartmentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateDepartmentResp.Unmarshal(m, b) +} +func (m *UpdateDepartmentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateDepartmentResp.Marshal(b, m, deterministic) +} +func (dst *UpdateDepartmentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateDepartmentResp.Merge(dst, src) +} +func (m *UpdateDepartmentResp) XXX_Size() int { + return xxx_messageInfo_UpdateDepartmentResp.Size(m) +} +func (m *UpdateDepartmentResp) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateDepartmentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateDepartmentResp proto.InternalMessageInfo + +func (m *UpdateDepartmentResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *UpdateDepartmentResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GetSubDepartmentReq struct { + DepartmentID string `protobuf:"bytes,1,opt,name=departmentID" json:"departmentID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSubDepartmentReq) Reset() { *m = GetSubDepartmentReq{} } +func (m *GetSubDepartmentReq) String() string { return proto.CompactTextString(m) } +func (*GetSubDepartmentReq) ProtoMessage() {} +func (*GetSubDepartmentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{4} +} +func (m *GetSubDepartmentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSubDepartmentReq.Unmarshal(m, b) +} +func (m *GetSubDepartmentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSubDepartmentReq.Marshal(b, m, deterministic) +} +func (dst *GetSubDepartmentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSubDepartmentReq.Merge(dst, src) +} +func (m *GetSubDepartmentReq) XXX_Size() int { + return xxx_messageInfo_GetSubDepartmentReq.Size(m) +} +func (m *GetSubDepartmentReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetSubDepartmentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSubDepartmentReq proto.InternalMessageInfo + +func (m *GetSubDepartmentReq) GetDepartmentID() string { + if m != nil { + return m.DepartmentID + } + return "" +} + +func (m *GetSubDepartmentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetSubDepartmentReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetSubDepartmentResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + DepartmentList []*sdk_ws.Department `protobuf:"bytes,3,rep,name=departmentList" json:"departmentList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSubDepartmentResp) Reset() { *m = GetSubDepartmentResp{} } +func (m *GetSubDepartmentResp) String() string { return proto.CompactTextString(m) } +func (*GetSubDepartmentResp) ProtoMessage() {} +func (*GetSubDepartmentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{5} +} +func (m *GetSubDepartmentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSubDepartmentResp.Unmarshal(m, b) +} +func (m *GetSubDepartmentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSubDepartmentResp.Marshal(b, m, deterministic) +} +func (dst *GetSubDepartmentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSubDepartmentResp.Merge(dst, src) +} +func (m *GetSubDepartmentResp) XXX_Size() int { + return xxx_messageInfo_GetSubDepartmentResp.Size(m) +} +func (m *GetSubDepartmentResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetSubDepartmentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSubDepartmentResp proto.InternalMessageInfo + +func (m *GetSubDepartmentResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetSubDepartmentResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetSubDepartmentResp) GetDepartmentList() []*sdk_ws.Department { + if m != nil { + return m.DepartmentList + } + return nil +} + +type DeleteDepartmentReq struct { + DepartmentID string `protobuf:"bytes,1,opt,name=departmentID" json:"departmentID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteDepartmentReq) Reset() { *m = DeleteDepartmentReq{} } +func (m *DeleteDepartmentReq) String() string { return proto.CompactTextString(m) } +func (*DeleteDepartmentReq) ProtoMessage() {} +func (*DeleteDepartmentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{6} +} +func (m *DeleteDepartmentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteDepartmentReq.Unmarshal(m, b) +} +func (m *DeleteDepartmentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteDepartmentReq.Marshal(b, m, deterministic) +} +func (dst *DeleteDepartmentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteDepartmentReq.Merge(dst, src) +} +func (m *DeleteDepartmentReq) XXX_Size() int { + return xxx_messageInfo_DeleteDepartmentReq.Size(m) +} +func (m *DeleteDepartmentReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteDepartmentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteDepartmentReq proto.InternalMessageInfo + +func (m *DeleteDepartmentReq) GetDepartmentID() string { + if m != nil { + return m.DepartmentID + } + return "" +} + +func (m *DeleteDepartmentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *DeleteDepartmentReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type DeleteDepartmentResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteDepartmentResp) Reset() { *m = DeleteDepartmentResp{} } +func (m *DeleteDepartmentResp) String() string { return proto.CompactTextString(m) } +func (*DeleteDepartmentResp) ProtoMessage() {} +func (*DeleteDepartmentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{7} +} +func (m *DeleteDepartmentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteDepartmentResp.Unmarshal(m, b) +} +func (m *DeleteDepartmentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteDepartmentResp.Marshal(b, m, deterministic) +} +func (dst *DeleteDepartmentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteDepartmentResp.Merge(dst, src) +} +func (m *DeleteDepartmentResp) XXX_Size() int { + return xxx_messageInfo_DeleteDepartmentResp.Size(m) +} +func (m *DeleteDepartmentResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteDepartmentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteDepartmentResp proto.InternalMessageInfo + +func (m *DeleteDepartmentResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *DeleteDepartmentResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type CreateOrganizationUserReq struct { + OrganizationUser *sdk_ws.OrganizationUser `protobuf:"bytes,1,opt,name=organizationUser" json:"organizationUser,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateOrganizationUserReq) Reset() { *m = CreateOrganizationUserReq{} } +func (m *CreateOrganizationUserReq) String() string { return proto.CompactTextString(m) } +func (*CreateOrganizationUserReq) ProtoMessage() {} +func (*CreateOrganizationUserReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{8} +} +func (m *CreateOrganizationUserReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateOrganizationUserReq.Unmarshal(m, b) +} +func (m *CreateOrganizationUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateOrganizationUserReq.Marshal(b, m, deterministic) +} +func (dst *CreateOrganizationUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateOrganizationUserReq.Merge(dst, src) +} +func (m *CreateOrganizationUserReq) XXX_Size() int { + return xxx_messageInfo_CreateOrganizationUserReq.Size(m) +} +func (m *CreateOrganizationUserReq) XXX_DiscardUnknown() { + xxx_messageInfo_CreateOrganizationUserReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateOrganizationUserReq proto.InternalMessageInfo + +func (m *CreateOrganizationUserReq) GetOrganizationUser() *sdk_ws.OrganizationUser { + if m != nil { + return m.OrganizationUser + } + return nil +} + +func (m *CreateOrganizationUserReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *CreateOrganizationUserReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type CreateOrganizationUserResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateOrganizationUserResp) Reset() { *m = CreateOrganizationUserResp{} } +func (m *CreateOrganizationUserResp) String() string { return proto.CompactTextString(m) } +func (*CreateOrganizationUserResp) ProtoMessage() {} +func (*CreateOrganizationUserResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{9} +} +func (m *CreateOrganizationUserResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateOrganizationUserResp.Unmarshal(m, b) +} +func (m *CreateOrganizationUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateOrganizationUserResp.Marshal(b, m, deterministic) +} +func (dst *CreateOrganizationUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateOrganizationUserResp.Merge(dst, src) +} +func (m *CreateOrganizationUserResp) XXX_Size() int { + return xxx_messageInfo_CreateOrganizationUserResp.Size(m) +} +func (m *CreateOrganizationUserResp) XXX_DiscardUnknown() { + xxx_messageInfo_CreateOrganizationUserResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateOrganizationUserResp proto.InternalMessageInfo + +func (m *CreateOrganizationUserResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CreateOrganizationUserResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type UpdateOrganizationUserReq struct { + OrganizationUser *sdk_ws.OrganizationUser `protobuf:"bytes,1,opt,name=organizationUser" json:"organizationUser,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateOrganizationUserReq) Reset() { *m = UpdateOrganizationUserReq{} } +func (m *UpdateOrganizationUserReq) String() string { return proto.CompactTextString(m) } +func (*UpdateOrganizationUserReq) ProtoMessage() {} +func (*UpdateOrganizationUserReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{10} +} +func (m *UpdateOrganizationUserReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateOrganizationUserReq.Unmarshal(m, b) +} +func (m *UpdateOrganizationUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateOrganizationUserReq.Marshal(b, m, deterministic) +} +func (dst *UpdateOrganizationUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateOrganizationUserReq.Merge(dst, src) +} +func (m *UpdateOrganizationUserReq) XXX_Size() int { + return xxx_messageInfo_UpdateOrganizationUserReq.Size(m) +} +func (m *UpdateOrganizationUserReq) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateOrganizationUserReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateOrganizationUserReq proto.InternalMessageInfo + +func (m *UpdateOrganizationUserReq) GetOrganizationUser() *sdk_ws.OrganizationUser { + if m != nil { + return m.OrganizationUser + } + return nil +} + +func (m *UpdateOrganizationUserReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *UpdateOrganizationUserReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type UpdateOrganizationUserResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateOrganizationUserResp) Reset() { *m = UpdateOrganizationUserResp{} } +func (m *UpdateOrganizationUserResp) String() string { return proto.CompactTextString(m) } +func (*UpdateOrganizationUserResp) ProtoMessage() {} +func (*UpdateOrganizationUserResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{11} +} +func (m *UpdateOrganizationUserResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateOrganizationUserResp.Unmarshal(m, b) +} +func (m *UpdateOrganizationUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateOrganizationUserResp.Marshal(b, m, deterministic) +} +func (dst *UpdateOrganizationUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateOrganizationUserResp.Merge(dst, src) +} +func (m *UpdateOrganizationUserResp) XXX_Size() int { + return xxx_messageInfo_UpdateOrganizationUserResp.Size(m) +} +func (m *UpdateOrganizationUserResp) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateOrganizationUserResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateOrganizationUserResp proto.InternalMessageInfo + +func (m *UpdateOrganizationUserResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *UpdateOrganizationUserResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type CreateDepartmentMemberReq struct { + UserInDepartment *sdk_ws.UserInDepartment `protobuf:"bytes,1,opt,name=userInDepartment" json:"userInDepartment,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateDepartmentMemberReq) Reset() { *m = CreateDepartmentMemberReq{} } +func (m *CreateDepartmentMemberReq) String() string { return proto.CompactTextString(m) } +func (*CreateDepartmentMemberReq) ProtoMessage() {} +func (*CreateDepartmentMemberReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{12} +} +func (m *CreateDepartmentMemberReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateDepartmentMemberReq.Unmarshal(m, b) +} +func (m *CreateDepartmentMemberReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateDepartmentMemberReq.Marshal(b, m, deterministic) +} +func (dst *CreateDepartmentMemberReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateDepartmentMemberReq.Merge(dst, src) +} +func (m *CreateDepartmentMemberReq) XXX_Size() int { + return xxx_messageInfo_CreateDepartmentMemberReq.Size(m) +} +func (m *CreateDepartmentMemberReq) XXX_DiscardUnknown() { + xxx_messageInfo_CreateDepartmentMemberReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateDepartmentMemberReq proto.InternalMessageInfo + +func (m *CreateDepartmentMemberReq) GetUserInDepartment() *sdk_ws.UserInDepartment { + if m != nil { + return m.UserInDepartment + } + return nil +} + +func (m *CreateDepartmentMemberReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *CreateDepartmentMemberReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type CreateDepartmentMemberResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateDepartmentMemberResp) Reset() { *m = CreateDepartmentMemberResp{} } +func (m *CreateDepartmentMemberResp) String() string { return proto.CompactTextString(m) } +func (*CreateDepartmentMemberResp) ProtoMessage() {} +func (*CreateDepartmentMemberResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{13} +} +func (m *CreateDepartmentMemberResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateDepartmentMemberResp.Unmarshal(m, b) +} +func (m *CreateDepartmentMemberResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateDepartmentMemberResp.Marshal(b, m, deterministic) +} +func (dst *CreateDepartmentMemberResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateDepartmentMemberResp.Merge(dst, src) +} +func (m *CreateDepartmentMemberResp) XXX_Size() int { + return xxx_messageInfo_CreateDepartmentMemberResp.Size(m) +} +func (m *CreateDepartmentMemberResp) XXX_DiscardUnknown() { + xxx_messageInfo_CreateDepartmentMemberResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateDepartmentMemberResp proto.InternalMessageInfo + +func (m *CreateDepartmentMemberResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CreateDepartmentMemberResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GetUserInDepartmentReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserInDepartmentReq) Reset() { *m = GetUserInDepartmentReq{} } +func (m *GetUserInDepartmentReq) String() string { return proto.CompactTextString(m) } +func (*GetUserInDepartmentReq) ProtoMessage() {} +func (*GetUserInDepartmentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{14} +} +func (m *GetUserInDepartmentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserInDepartmentReq.Unmarshal(m, b) +} +func (m *GetUserInDepartmentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserInDepartmentReq.Marshal(b, m, deterministic) +} +func (dst *GetUserInDepartmentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserInDepartmentReq.Merge(dst, src) +} +func (m *GetUserInDepartmentReq) XXX_Size() int { + return xxx_messageInfo_GetUserInDepartmentReq.Size(m) +} +func (m *GetUserInDepartmentReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserInDepartmentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserInDepartmentReq proto.InternalMessageInfo + +func (m *GetUserInDepartmentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserInDepartmentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetUserInDepartmentReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetUserInDepartmentResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + UserInDepartment *sdk_ws.UserInDepartment `protobuf:"bytes,3,opt,name=userInDepartment" json:"userInDepartment,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserInDepartmentResp) Reset() { *m = GetUserInDepartmentResp{} } +func (m *GetUserInDepartmentResp) String() string { return proto.CompactTextString(m) } +func (*GetUserInDepartmentResp) ProtoMessage() {} +func (*GetUserInDepartmentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{15} +} +func (m *GetUserInDepartmentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserInDepartmentResp.Unmarshal(m, b) +} +func (m *GetUserInDepartmentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserInDepartmentResp.Marshal(b, m, deterministic) +} +func (dst *GetUserInDepartmentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserInDepartmentResp.Merge(dst, src) +} +func (m *GetUserInDepartmentResp) XXX_Size() int { + return xxx_messageInfo_GetUserInDepartmentResp.Size(m) +} +func (m *GetUserInDepartmentResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserInDepartmentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserInDepartmentResp proto.InternalMessageInfo + +func (m *GetUserInDepartmentResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetUserInDepartmentResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetUserInDepartmentResp) GetUserInDepartment() *sdk_ws.UserInDepartment { + if m != nil { + return m.UserInDepartment + } + return nil +} + +type UpdateUserInDepartmentReq struct { + DepartmentMember *sdk_ws.DepartmentMember `protobuf:"bytes,1,opt,name=departmentMember" json:"departmentMember,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateUserInDepartmentReq) Reset() { *m = UpdateUserInDepartmentReq{} } +func (m *UpdateUserInDepartmentReq) String() string { return proto.CompactTextString(m) } +func (*UpdateUserInDepartmentReq) ProtoMessage() {} +func (*UpdateUserInDepartmentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{16} +} +func (m *UpdateUserInDepartmentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateUserInDepartmentReq.Unmarshal(m, b) +} +func (m *UpdateUserInDepartmentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateUserInDepartmentReq.Marshal(b, m, deterministic) +} +func (dst *UpdateUserInDepartmentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateUserInDepartmentReq.Merge(dst, src) +} +func (m *UpdateUserInDepartmentReq) XXX_Size() int { + return xxx_messageInfo_UpdateUserInDepartmentReq.Size(m) +} +func (m *UpdateUserInDepartmentReq) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateUserInDepartmentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateUserInDepartmentReq proto.InternalMessageInfo + +func (m *UpdateUserInDepartmentReq) GetDepartmentMember() *sdk_ws.DepartmentMember { + if m != nil { + return m.DepartmentMember + } + return nil +} + +func (m *UpdateUserInDepartmentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *UpdateUserInDepartmentReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type UpdateUserInDepartmentResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateUserInDepartmentResp) Reset() { *m = UpdateUserInDepartmentResp{} } +func (m *UpdateUserInDepartmentResp) String() string { return proto.CompactTextString(m) } +func (*UpdateUserInDepartmentResp) ProtoMessage() {} +func (*UpdateUserInDepartmentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{17} +} +func (m *UpdateUserInDepartmentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateUserInDepartmentResp.Unmarshal(m, b) +} +func (m *UpdateUserInDepartmentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateUserInDepartmentResp.Marshal(b, m, deterministic) +} +func (dst *UpdateUserInDepartmentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateUserInDepartmentResp.Merge(dst, src) +} +func (m *UpdateUserInDepartmentResp) XXX_Size() int { + return xxx_messageInfo_UpdateUserInDepartmentResp.Size(m) +} +func (m *UpdateUserInDepartmentResp) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateUserInDepartmentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateUserInDepartmentResp proto.InternalMessageInfo + +func (m *UpdateUserInDepartmentResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *UpdateUserInDepartmentResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type DeleteUserInDepartmentReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + DepartmentID string `protobuf:"bytes,4,opt,name=departmentID" json:"departmentID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteUserInDepartmentReq) Reset() { *m = DeleteUserInDepartmentReq{} } +func (m *DeleteUserInDepartmentReq) String() string { return proto.CompactTextString(m) } +func (*DeleteUserInDepartmentReq) ProtoMessage() {} +func (*DeleteUserInDepartmentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{18} +} +func (m *DeleteUserInDepartmentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteUserInDepartmentReq.Unmarshal(m, b) +} +func (m *DeleteUserInDepartmentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteUserInDepartmentReq.Marshal(b, m, deterministic) +} +func (dst *DeleteUserInDepartmentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteUserInDepartmentReq.Merge(dst, src) +} +func (m *DeleteUserInDepartmentReq) XXX_Size() int { + return xxx_messageInfo_DeleteUserInDepartmentReq.Size(m) +} +func (m *DeleteUserInDepartmentReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteUserInDepartmentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteUserInDepartmentReq proto.InternalMessageInfo + +func (m *DeleteUserInDepartmentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DeleteUserInDepartmentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *DeleteUserInDepartmentReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *DeleteUserInDepartmentReq) GetDepartmentID() string { + if m != nil { + return m.DepartmentID + } + return "" +} + +type DeleteUserInDepartmentResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteUserInDepartmentResp) Reset() { *m = DeleteUserInDepartmentResp{} } +func (m *DeleteUserInDepartmentResp) String() string { return proto.CompactTextString(m) } +func (*DeleteUserInDepartmentResp) ProtoMessage() {} +func (*DeleteUserInDepartmentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{19} +} +func (m *DeleteUserInDepartmentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteUserInDepartmentResp.Unmarshal(m, b) +} +func (m *DeleteUserInDepartmentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteUserInDepartmentResp.Marshal(b, m, deterministic) +} +func (dst *DeleteUserInDepartmentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteUserInDepartmentResp.Merge(dst, src) +} +func (m *DeleteUserInDepartmentResp) XXX_Size() int { + return xxx_messageInfo_DeleteUserInDepartmentResp.Size(m) +} +func (m *DeleteUserInDepartmentResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteUserInDepartmentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteUserInDepartmentResp proto.InternalMessageInfo + +func (m *DeleteUserInDepartmentResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *DeleteUserInDepartmentResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type DeleteOrganizationUserReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteOrganizationUserReq) Reset() { *m = DeleteOrganizationUserReq{} } +func (m *DeleteOrganizationUserReq) String() string { return proto.CompactTextString(m) } +func (*DeleteOrganizationUserReq) ProtoMessage() {} +func (*DeleteOrganizationUserReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{20} +} +func (m *DeleteOrganizationUserReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteOrganizationUserReq.Unmarshal(m, b) +} +func (m *DeleteOrganizationUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteOrganizationUserReq.Marshal(b, m, deterministic) +} +func (dst *DeleteOrganizationUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteOrganizationUserReq.Merge(dst, src) +} +func (m *DeleteOrganizationUserReq) XXX_Size() int { + return xxx_messageInfo_DeleteOrganizationUserReq.Size(m) +} +func (m *DeleteOrganizationUserReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteOrganizationUserReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteOrganizationUserReq proto.InternalMessageInfo + +func (m *DeleteOrganizationUserReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DeleteOrganizationUserReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *DeleteOrganizationUserReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type DeleteOrganizationUserResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteOrganizationUserResp) Reset() { *m = DeleteOrganizationUserResp{} } +func (m *DeleteOrganizationUserResp) String() string { return proto.CompactTextString(m) } +func (*DeleteOrganizationUserResp) ProtoMessage() {} +func (*DeleteOrganizationUserResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{21} +} +func (m *DeleteOrganizationUserResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteOrganizationUserResp.Unmarshal(m, b) +} +func (m *DeleteOrganizationUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteOrganizationUserResp.Marshal(b, m, deterministic) +} +func (dst *DeleteOrganizationUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteOrganizationUserResp.Merge(dst, src) +} +func (m *DeleteOrganizationUserResp) XXX_Size() int { + return xxx_messageInfo_DeleteOrganizationUserResp.Size(m) +} +func (m *DeleteOrganizationUserResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteOrganizationUserResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteOrganizationUserResp proto.InternalMessageInfo + +func (m *DeleteOrganizationUserResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *DeleteOrganizationUserResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GetDepartmentMemberReq struct { + DepartmentID string `protobuf:"bytes,1,opt,name=departmentID" json:"departmentID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetDepartmentMemberReq) Reset() { *m = GetDepartmentMemberReq{} } +func (m *GetDepartmentMemberReq) String() string { return proto.CompactTextString(m) } +func (*GetDepartmentMemberReq) ProtoMessage() {} +func (*GetDepartmentMemberReq) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{22} +} +func (m *GetDepartmentMemberReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetDepartmentMemberReq.Unmarshal(m, b) +} +func (m *GetDepartmentMemberReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetDepartmentMemberReq.Marshal(b, m, deterministic) +} +func (dst *GetDepartmentMemberReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDepartmentMemberReq.Merge(dst, src) +} +func (m *GetDepartmentMemberReq) XXX_Size() int { + return xxx_messageInfo_GetDepartmentMemberReq.Size(m) +} +func (m *GetDepartmentMemberReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetDepartmentMemberReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDepartmentMemberReq proto.InternalMessageInfo + +func (m *GetDepartmentMemberReq) GetDepartmentID() string { + if m != nil { + return m.DepartmentID + } + return "" +} + +func (m *GetDepartmentMemberReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetDepartmentMemberReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetDepartmentMemberResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + UserInDepartmentList []*sdk_ws.UserInDepartment `protobuf:"bytes,3,rep,name=userInDepartmentList" json:"userInDepartmentList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetDepartmentMemberResp) Reset() { *m = GetDepartmentMemberResp{} } +func (m *GetDepartmentMemberResp) String() string { return proto.CompactTextString(m) } +func (*GetDepartmentMemberResp) ProtoMessage() {} +func (*GetDepartmentMemberResp) Descriptor() ([]byte, []int) { + return fileDescriptor_organization_a03f9a4144ed1081, []int{23} +} +func (m *GetDepartmentMemberResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetDepartmentMemberResp.Unmarshal(m, b) +} +func (m *GetDepartmentMemberResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetDepartmentMemberResp.Marshal(b, m, deterministic) +} +func (dst *GetDepartmentMemberResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDepartmentMemberResp.Merge(dst, src) +} +func (m *GetDepartmentMemberResp) XXX_Size() int { + return xxx_messageInfo_GetDepartmentMemberResp.Size(m) +} +func (m *GetDepartmentMemberResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetDepartmentMemberResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDepartmentMemberResp proto.InternalMessageInfo + +func (m *GetDepartmentMemberResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetDepartmentMemberResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetDepartmentMemberResp) GetUserInDepartmentList() []*sdk_ws.UserInDepartment { + if m != nil { + return m.UserInDepartmentList + } + return nil +} + +func init() { + proto.RegisterType((*CreateDepartmentReq)(nil), "organization.CreateDepartmentReq") + proto.RegisterType((*CreateDepartmentResp)(nil), "organization.CreateDepartmentResp") + proto.RegisterType((*UpdateDepartmentReq)(nil), "organization.UpdateDepartmentReq") + proto.RegisterType((*UpdateDepartmentResp)(nil), "organization.UpdateDepartmentResp") + proto.RegisterType((*GetSubDepartmentReq)(nil), "organization.GetSubDepartmentReq") + proto.RegisterType((*GetSubDepartmentResp)(nil), "organization.GetSubDepartmentResp") + proto.RegisterType((*DeleteDepartmentReq)(nil), "organization.DeleteDepartmentReq") + proto.RegisterType((*DeleteDepartmentResp)(nil), "organization.DeleteDepartmentResp") + proto.RegisterType((*CreateOrganizationUserReq)(nil), "organization.CreateOrganizationUserReq") + proto.RegisterType((*CreateOrganizationUserResp)(nil), "organization.CreateOrganizationUserResp") + proto.RegisterType((*UpdateOrganizationUserReq)(nil), "organization.UpdateOrganizationUserReq") + proto.RegisterType((*UpdateOrganizationUserResp)(nil), "organization.UpdateOrganizationUserResp") + proto.RegisterType((*CreateDepartmentMemberReq)(nil), "organization.CreateDepartmentMemberReq") + proto.RegisterType((*CreateDepartmentMemberResp)(nil), "organization.CreateDepartmentMemberResp") + proto.RegisterType((*GetUserInDepartmentReq)(nil), "organization.GetUserInDepartmentReq") + proto.RegisterType((*GetUserInDepartmentResp)(nil), "organization.GetUserInDepartmentResp") + proto.RegisterType((*UpdateUserInDepartmentReq)(nil), "organization.UpdateUserInDepartmentReq") + proto.RegisterType((*UpdateUserInDepartmentResp)(nil), "organization.UpdateUserInDepartmentResp") + proto.RegisterType((*DeleteUserInDepartmentReq)(nil), "organization.DeleteUserInDepartmentReq") + proto.RegisterType((*DeleteUserInDepartmentResp)(nil), "organization.DeleteUserInDepartmentResp") + proto.RegisterType((*DeleteOrganizationUserReq)(nil), "organization.DeleteOrganizationUserReq") + proto.RegisterType((*DeleteOrganizationUserResp)(nil), "organization.DeleteOrganizationUserResp") + proto.RegisterType((*GetDepartmentMemberReq)(nil), "organization.GetDepartmentMemberReq") + proto.RegisterType((*GetDepartmentMemberResp)(nil), "organization.GetDepartmentMemberResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Organization service + +type OrganizationClient interface { + CreateDepartment(ctx context.Context, in *CreateDepartmentReq, opts ...grpc.CallOption) (*CreateDepartmentResp, error) + UpdateDepartment(ctx context.Context, in *UpdateDepartmentReq, opts ...grpc.CallOption) (*UpdateDepartmentResp, error) + GetSubDepartment(ctx context.Context, in *GetSubDepartmentReq, opts ...grpc.CallOption) (*GetSubDepartmentResp, error) + DeleteDepartment(ctx context.Context, in *DeleteDepartmentReq, opts ...grpc.CallOption) (*DeleteDepartmentResp, error) + CreateOrganizationUser(ctx context.Context, in *CreateOrganizationUserReq, opts ...grpc.CallOption) (*CreateOrganizationUserResp, error) + UpdateOrganizationUser(ctx context.Context, in *UpdateOrganizationUserReq, opts ...grpc.CallOption) (*UpdateOrganizationUserResp, error) + DeleteOrganizationUser(ctx context.Context, in *DeleteOrganizationUserReq, opts ...grpc.CallOption) (*DeleteOrganizationUserResp, error) + CreateDepartmentMember(ctx context.Context, in *CreateDepartmentMemberReq, opts ...grpc.CallOption) (*CreateDepartmentMemberResp, error) + GetUserInDepartment(ctx context.Context, in *GetUserInDepartmentReq, opts ...grpc.CallOption) (*GetUserInDepartmentResp, error) + DeleteUserInDepartment(ctx context.Context, in *DeleteUserInDepartmentReq, opts ...grpc.CallOption) (*DeleteUserInDepartmentResp, error) + UpdateUserInDepartment(ctx context.Context, in *UpdateUserInDepartmentReq, opts ...grpc.CallOption) (*UpdateUserInDepartmentResp, error) + GetDepartmentMember(ctx context.Context, in *GetDepartmentMemberReq, opts ...grpc.CallOption) (*GetDepartmentMemberResp, error) +} + +type organizationClient struct { + cc *grpc.ClientConn +} + +func NewOrganizationClient(cc *grpc.ClientConn) OrganizationClient { + return &organizationClient{cc} +} + +func (c *organizationClient) CreateDepartment(ctx context.Context, in *CreateDepartmentReq, opts ...grpc.CallOption) (*CreateDepartmentResp, error) { + out := new(CreateDepartmentResp) + err := grpc.Invoke(ctx, "/organization.organization/CreateDepartment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) UpdateDepartment(ctx context.Context, in *UpdateDepartmentReq, opts ...grpc.CallOption) (*UpdateDepartmentResp, error) { + out := new(UpdateDepartmentResp) + err := grpc.Invoke(ctx, "/organization.organization/UpdateDepartment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) GetSubDepartment(ctx context.Context, in *GetSubDepartmentReq, opts ...grpc.CallOption) (*GetSubDepartmentResp, error) { + out := new(GetSubDepartmentResp) + err := grpc.Invoke(ctx, "/organization.organization/GetSubDepartment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) DeleteDepartment(ctx context.Context, in *DeleteDepartmentReq, opts ...grpc.CallOption) (*DeleteDepartmentResp, error) { + out := new(DeleteDepartmentResp) + err := grpc.Invoke(ctx, "/organization.organization/DeleteDepartment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) CreateOrganizationUser(ctx context.Context, in *CreateOrganizationUserReq, opts ...grpc.CallOption) (*CreateOrganizationUserResp, error) { + out := new(CreateOrganizationUserResp) + err := grpc.Invoke(ctx, "/organization.organization/CreateOrganizationUser", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) UpdateOrganizationUser(ctx context.Context, in *UpdateOrganizationUserReq, opts ...grpc.CallOption) (*UpdateOrganizationUserResp, error) { + out := new(UpdateOrganizationUserResp) + err := grpc.Invoke(ctx, "/organization.organization/UpdateOrganizationUser", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) DeleteOrganizationUser(ctx context.Context, in *DeleteOrganizationUserReq, opts ...grpc.CallOption) (*DeleteOrganizationUserResp, error) { + out := new(DeleteOrganizationUserResp) + err := grpc.Invoke(ctx, "/organization.organization/DeleteOrganizationUser", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) CreateDepartmentMember(ctx context.Context, in *CreateDepartmentMemberReq, opts ...grpc.CallOption) (*CreateDepartmentMemberResp, error) { + out := new(CreateDepartmentMemberResp) + err := grpc.Invoke(ctx, "/organization.organization/CreateDepartmentMember", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) GetUserInDepartment(ctx context.Context, in *GetUserInDepartmentReq, opts ...grpc.CallOption) (*GetUserInDepartmentResp, error) { + out := new(GetUserInDepartmentResp) + err := grpc.Invoke(ctx, "/organization.organization/GetUserInDepartment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) DeleteUserInDepartment(ctx context.Context, in *DeleteUserInDepartmentReq, opts ...grpc.CallOption) (*DeleteUserInDepartmentResp, error) { + out := new(DeleteUserInDepartmentResp) + err := grpc.Invoke(ctx, "/organization.organization/DeleteUserInDepartment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) UpdateUserInDepartment(ctx context.Context, in *UpdateUserInDepartmentReq, opts ...grpc.CallOption) (*UpdateUserInDepartmentResp, error) { + out := new(UpdateUserInDepartmentResp) + err := grpc.Invoke(ctx, "/organization.organization/UpdateUserInDepartment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *organizationClient) GetDepartmentMember(ctx context.Context, in *GetDepartmentMemberReq, opts ...grpc.CallOption) (*GetDepartmentMemberResp, error) { + out := new(GetDepartmentMemberResp) + err := grpc.Invoke(ctx, "/organization.organization/GetDepartmentMember", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Organization service + +type OrganizationServer interface { + CreateDepartment(context.Context, *CreateDepartmentReq) (*CreateDepartmentResp, error) + UpdateDepartment(context.Context, *UpdateDepartmentReq) (*UpdateDepartmentResp, error) + GetSubDepartment(context.Context, *GetSubDepartmentReq) (*GetSubDepartmentResp, error) + DeleteDepartment(context.Context, *DeleteDepartmentReq) (*DeleteDepartmentResp, error) + CreateOrganizationUser(context.Context, *CreateOrganizationUserReq) (*CreateOrganizationUserResp, error) + UpdateOrganizationUser(context.Context, *UpdateOrganizationUserReq) (*UpdateOrganizationUserResp, error) + DeleteOrganizationUser(context.Context, *DeleteOrganizationUserReq) (*DeleteOrganizationUserResp, error) + CreateDepartmentMember(context.Context, *CreateDepartmentMemberReq) (*CreateDepartmentMemberResp, error) + GetUserInDepartment(context.Context, *GetUserInDepartmentReq) (*GetUserInDepartmentResp, error) + DeleteUserInDepartment(context.Context, *DeleteUserInDepartmentReq) (*DeleteUserInDepartmentResp, error) + UpdateUserInDepartment(context.Context, *UpdateUserInDepartmentReq) (*UpdateUserInDepartmentResp, error) + GetDepartmentMember(context.Context, *GetDepartmentMemberReq) (*GetDepartmentMemberResp, error) +} + +func RegisterOrganizationServer(s *grpc.Server, srv OrganizationServer) { + s.RegisterService(&_Organization_serviceDesc, srv) +} + +func _Organization_CreateDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDepartmentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).CreateDepartment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/CreateDepartment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).CreateDepartment(ctx, req.(*CreateDepartmentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_UpdateDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateDepartmentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).UpdateDepartment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/UpdateDepartment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).UpdateDepartment(ctx, req.(*UpdateDepartmentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_GetSubDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSubDepartmentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).GetSubDepartment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/GetSubDepartment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).GetSubDepartment(ctx, req.(*GetSubDepartmentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_DeleteDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteDepartmentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).DeleteDepartment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/DeleteDepartment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).DeleteDepartment(ctx, req.(*DeleteDepartmentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_CreateOrganizationUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOrganizationUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).CreateOrganizationUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/CreateOrganizationUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).CreateOrganizationUser(ctx, req.(*CreateOrganizationUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_UpdateOrganizationUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateOrganizationUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).UpdateOrganizationUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/UpdateOrganizationUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).UpdateOrganizationUser(ctx, req.(*UpdateOrganizationUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_DeleteOrganizationUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteOrganizationUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).DeleteOrganizationUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/DeleteOrganizationUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).DeleteOrganizationUser(ctx, req.(*DeleteOrganizationUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_CreateDepartmentMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateDepartmentMemberReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).CreateDepartmentMember(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/CreateDepartmentMember", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).CreateDepartmentMember(ctx, req.(*CreateDepartmentMemberReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_GetUserInDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserInDepartmentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).GetUserInDepartment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/GetUserInDepartment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).GetUserInDepartment(ctx, req.(*GetUserInDepartmentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_DeleteUserInDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserInDepartmentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).DeleteUserInDepartment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/DeleteUserInDepartment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).DeleteUserInDepartment(ctx, req.(*DeleteUserInDepartmentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_UpdateUserInDepartment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserInDepartmentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).UpdateUserInDepartment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/UpdateUserInDepartment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).UpdateUserInDepartment(ctx, req.(*UpdateUserInDepartmentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Organization_GetDepartmentMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDepartmentMemberReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OrganizationServer).GetDepartmentMember(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/organization.organization/GetDepartmentMember", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OrganizationServer).GetDepartmentMember(ctx, req.(*GetDepartmentMemberReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _Organization_serviceDesc = grpc.ServiceDesc{ + ServiceName: "organization.organization", + HandlerType: (*OrganizationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateDepartment", + Handler: _Organization_CreateDepartment_Handler, + }, + { + MethodName: "UpdateDepartment", + Handler: _Organization_UpdateDepartment_Handler, + }, + { + MethodName: "GetSubDepartment", + Handler: _Organization_GetSubDepartment_Handler, + }, + { + MethodName: "DeleteDepartment", + Handler: _Organization_DeleteDepartment_Handler, + }, + { + MethodName: "CreateOrganizationUser", + Handler: _Organization_CreateOrganizationUser_Handler, + }, + { + MethodName: "UpdateOrganizationUser", + Handler: _Organization_UpdateOrganizationUser_Handler, + }, + { + MethodName: "DeleteOrganizationUser", + Handler: _Organization_DeleteOrganizationUser_Handler, + }, + { + MethodName: "CreateDepartmentMember", + Handler: _Organization_CreateDepartmentMember_Handler, + }, + { + MethodName: "GetUserInDepartment", + Handler: _Organization_GetUserInDepartment_Handler, + }, + { + MethodName: "DeleteUserInDepartment", + Handler: _Organization_DeleteUserInDepartment_Handler, + }, + { + MethodName: "UpdateUserInDepartment", + Handler: _Organization_UpdateUserInDepartment_Handler, + }, + { + MethodName: "GetDepartmentMember", + Handler: _Organization_GetDepartmentMember_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "organization/organization.proto", +} + +func init() { + proto.RegisterFile("organization/organization.proto", fileDescriptor_organization_a03f9a4144ed1081) +} + +var fileDescriptor_organization_a03f9a4144ed1081 = []byte{ + // 713 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x4f, 0x6f, 0x12, 0x41, + 0x14, 0xcf, 0x8a, 0x56, 0xfb, 0xda, 0x18, 0x32, 0x25, 0x48, 0xd7, 0x34, 0xd2, 0xd5, 0x46, 0x4e, + 0x90, 0xd4, 0xa3, 0x37, 0x8b, 0x69, 0x49, 0xac, 0x24, 0x18, 0x62, 0xf0, 0x42, 0x96, 0x30, 0x12, + 0x82, 0xec, 0x0e, 0x33, 0x8b, 0x24, 0xfd, 0x12, 0x9e, 0xbc, 0x18, 0x8f, 0x9e, 0xfc, 0x34, 0x7e, + 0x24, 0xb3, 0xbb, 0x94, 0x0e, 0x6f, 0xde, 0x52, 0x5c, 0x16, 0xa3, 0xc7, 0x19, 0x66, 0xde, 0xef, + 0xbd, 0xdf, 0xfb, 0x33, 0x3f, 0x16, 0x9e, 0xf8, 0x72, 0xe0, 0x7a, 0xc3, 0x2b, 0x37, 0x18, 0xfa, + 0x5e, 0x4d, 0x5f, 0x54, 0x85, 0xf4, 0x03, 0x9f, 0xed, 0xeb, 0x7b, 0xf6, 0x71, 0x53, 0x70, 0xaf, + 0xdb, 0xb8, 0xac, 0x89, 0xd1, 0xa0, 0x16, 0x1d, 0xa8, 0xa9, 0xfe, 0xa8, 0x3b, 0x53, 0xb5, 0x99, + 0x8a, 0x2f, 0x38, 0xdf, 0x2c, 0x38, 0x38, 0x93, 0xdc, 0x0d, 0x78, 0x9d, 0x0b, 0x57, 0x06, 0x63, + 0xee, 0x05, 0x2d, 0x3e, 0x61, 0xaf, 0xe1, 0x61, 0x7f, 0xb1, 0xd1, 0xf0, 0x3e, 0xfa, 0x25, 0xab, + 0x6c, 0x55, 0xf6, 0x4e, 0x8f, 0xaa, 0x8a, 0xcb, 0xcf, 0x5c, 0x76, 0x5d, 0x31, 0xec, 0x0a, 0x57, + 0xba, 0x63, 0x55, 0xd5, 0x6e, 0xa2, 0x4b, 0xac, 0x0c, 0x7b, 0xbe, 0xe0, 0x32, 0x72, 0xa7, 0x51, + 0x2f, 0xdd, 0x29, 0x5b, 0x95, 0xdd, 0x96, 0xbe, 0xc5, 0x6c, 0x78, 0xe0, 0x8b, 0xb6, 0xe2, 0xb2, + 0x51, 0x2f, 0xe5, 0xa2, 0x9f, 0x17, 0x6b, 0xe7, 0x8b, 0x05, 0x05, 0xd3, 0x39, 0x25, 0x58, 0x09, + 0xee, 0x73, 0x29, 0xcf, 0xfc, 0x3e, 0x8f, 0xdc, 0xba, 0xd7, 0xba, 0x5e, 0xb2, 0x22, 0xec, 0x70, + 0x29, 0x2f, 0xd5, 0x60, 0x8e, 0x35, 0x5f, 0x11, 0xf1, 0xe4, 0x52, 0xc4, 0x13, 0xd1, 0xd5, 0x16, + 0xfd, 0x7f, 0x93, 0xae, 0x0b, 0x28, 0x98, 0xbe, 0xa5, 0x61, 0xcb, 0x99, 0xc1, 0xc1, 0x39, 0x0f, + 0xde, 0x4d, 0x7b, 0xcb, 0x51, 0x3a, 0xb0, 0xaf, 0x39, 0x5c, 0x8f, 0xac, 0xed, 0xb6, 0x96, 0xf6, + 0x32, 0xc8, 0xb8, 0x89, 0xbc, 0x79, 0xc6, 0xdf, 0x0c, 0x55, 0x50, 0xca, 0x95, 0x73, 0x7f, 0x94, + 0x92, 0xf0, 0x52, 0x48, 0x45, 0x9d, 0x7f, 0xe2, 0x38, 0xe1, 0xdb, 0xa7, 0xe2, 0x02, 0x0a, 0x26, + 0x70, 0xaa, 0x6c, 0xfe, 0xb4, 0xe0, 0x30, 0x6e, 0xa3, 0xa6, 0x36, 0x1d, 0x42, 0x98, 0x30, 0x92, + 0x26, 0xe4, 0x7d, 0xb4, 0x3d, 0x2f, 0xde, 0xa7, 0x04, 0x53, 0x86, 0x05, 0xe3, 0xf2, 0x86, 0x61, + 0xbf, 0x05, 0x3b, 0xc9, 0xd7, 0xd4, 0xc1, 0xc7, 0x5d, 0xf1, 0x7f, 0x04, 0x9f, 0xe4, 0xeb, 0x86, + 0x99, 0xbf, 0x29, 0xa2, 0x4b, 0x3e, 0xee, 0x2d, 0x82, 0x9f, 0x86, 0xb8, 0xde, 0xcd, 0x8f, 0x2b, + 0x82, 0x6f, 0xa3, 0xa3, 0x2d, 0xe3, 0x72, 0x56, 0x99, 0x37, 0x7d, 0x4d, 0x15, 0xbc, 0x07, 0xc5, + 0x73, 0x1e, 0x18, 0x6e, 0xf3, 0x49, 0x78, 0x63, 0x1a, 0xfb, 0x10, 0xb7, 0xed, 0x7c, 0xb5, 0xa1, + 0xff, 0xdf, 0x2d, 0x78, 0x44, 0x02, 0xa6, 0x1a, 0x5f, 0x54, 0x72, 0x72, 0x1b, 0x24, 0x47, 0x6b, + 0x04, 0x8a, 0x92, 0x26, 0xe4, 0xfb, 0x88, 0xf6, 0x15, 0xb5, 0x60, 0x64, 0xc8, 0xb8, 0x9c, 0x55, + 0x23, 0x64, 0xc3, 0xa6, 0xf3, 0xd5, 0x82, 0xc3, 0x78, 0x9a, 0xfe, 0xb5, 0x7a, 0x30, 0x9e, 0x88, + 0xbb, 0xe6, 0x13, 0x11, 0xc6, 0x99, 0xe4, 0x56, 0xaa, 0x38, 0x27, 0xd7, 0x61, 0x52, 0xc3, 0x6e, + 0x3b, 0x65, 0xbf, 0x08, 0x21, 0xa3, 0x99, 0x75, 0x15, 0xb5, 0x2d, 0x35, 0xaf, 0xb6, 0xff, 0xe6, + 0xfe, 0x88, 0x5b, 0x38, 0x9b, 0x01, 0xc4, 0xde, 0x43, 0x01, 0x77, 0xa1, 0xa6, 0x43, 0xd6, 0x6a, + 0x63, 0xd2, 0xc0, 0xe9, 0xaf, 0x5d, 0x58, 0x12, 0xfa, 0xac, 0x03, 0x79, 0x3c, 0x3a, 0xd9, 0x71, + 0x75, 0xe9, 0xff, 0x01, 0x21, 0xf2, 0x6d, 0xe7, 0xb6, 0x23, 0x4a, 0x84, 0xa6, 0xb1, 0xa8, 0xc4, + 0xa6, 0x09, 0x41, 0x8c, 0x4d, 0x93, 0xba, 0xb4, 0x03, 0x79, 0xac, 0xf5, 0xb0, 0x69, 0x42, 0x85, + 0x62, 0xd3, 0xa4, 0x5c, 0xec, 0x40, 0x1e, 0x8b, 0x27, 0x6c, 0x9a, 0x50, 0x75, 0xd8, 0x34, 0xa9, + 0xbf, 0x46, 0x50, 0xa4, 0x05, 0x0a, 0x7b, 0x4e, 0xd1, 0x49, 0x34, 0xa2, 0x5d, 0x59, 0xef, 0x60, + 0x0c, 0x46, 0x0b, 0x02, 0x0c, 0x96, 0x28, 0x71, 0x30, 0xd8, 0x0a, 0x7d, 0x31, 0x82, 0x22, 0xdd, + 0xc9, 0x18, 0x2c, 0x71, 0xc4, 0x60, 0xb0, 0x15, 0x83, 0x61, 0x41, 0x23, 0x6e, 0x36, 0x9a, 0x46, + 0x62, 0x1e, 0xd0, 0x34, 0x92, 0xbd, 0xdb, 0x8b, 0xfe, 0xcf, 0xe0, 0xee, 0x62, 0xcf, 0x8c, 0x4a, + 0x22, 0x5e, 0x07, 0xfb, 0x64, 0x8d, 0x53, 0x3a, 0x7b, 0x06, 0x0c, 0xc9, 0x1e, 0x85, 0x54, 0x59, + 0xef, 0xa0, 0x5e, 0x17, 0xb7, 0x81, 0x25, 0xbe, 0xf8, 0x74, 0x5d, 0x90, 0x60, 0x31, 0x7b, 0x46, + 0x9e, 0x4c, 0xf6, 0xa8, 0x24, 0x9d, 0xac, 0x71, 0x4a, 0x89, 0x57, 0x47, 0x1f, 0x1e, 0x57, 0x97, + 0x3e, 0x68, 0xbc, 0xd4, 0x17, 0xbd, 0x9d, 0xe8, 0x6b, 0xc5, 0x8b, 0xdf, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x33, 0x0d, 0x37, 0x72, 0x01, 0x11, 0x00, 0x00, +} diff --git a/pkg/proto/organization/organization.proto b/pkg/proto/organization/organization.proto new file mode 100644 index 000000000..343ac43ea --- /dev/null +++ b/pkg/proto/organization/organization.proto @@ -0,0 +1,172 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./organization;organization"; +package organization; + + +message CreateDepartmentReq{ + server_api_params.Department departmentInfo = 1; + string operationID = 2; + string opUserID = 3; +} + +message CreateDepartmentResp{ + int32 errCode = 1; + string errMsg = 2; + server_api_params.Department departmentInfo = 3; +} + +message UpdateDepartmentReq{ + server_api_params.Department departmentInfo = 1; + string operationID = 2; + string opUserID = 3; +} + +message UpdateDepartmentResp{ + int32 errCode = 1; + string errMsg = 2; +} + + +message GetSubDepartmentReq{ + string departmentID = 1; + string operationID = 2; + string opUserID = 3; +} + +message GetSubDepartmentResp{ + int32 errCode = 1; + string errMsg = 2; + repeated server_api_params.Department departmentList = 3; +} + +message DeleteDepartmentReq{ + string departmentID = 1; + string operationID = 2; + string opUserID = 3; +} + +message DeleteDepartmentResp{ + int32 errCode = 1; + string errMsg = 2; +} + + +message CreateOrganizationUserReq{ + server_api_params.OrganizationUser organizationUser = 1; + string operationID = 2; + string opUserID = 3; +} + + +message CreateOrganizationUserResp{ + int32 errCode = 1; + string errMsg = 2; +} + + +message UpdateOrganizationUserReq{ + server_api_params.OrganizationUser organizationUser = 1; + string operationID = 2; + string opUserID = 3; +} + + +message UpdateOrganizationUserResp{ + int32 errCode = 1; + string errMsg = 2; +} + + + + +message CreateDepartmentMemberReq{ + server_api_params.UserInDepartment userInDepartment = 1; + string operationID = 2; + string opUserID = 3; +} +message CreateDepartmentMemberResp{ + int32 errCode = 1; + string errMsg = 2; +} + + +message GetUserInDepartmentReq{ + string userID = 1; + string operationID = 2; + string opUserID = 3; +} +message GetUserInDepartmentResp{ + int32 errCode = 1; + string errMsg = 2; + server_api_params.UserInDepartment userInDepartment = 3; +} + + +message UpdateUserInDepartmentReq{ + server_api_params.DepartmentMember departmentMember = 1; + string operationID = 2; + string opUserID = 3; +} +message UpdateUserInDepartmentResp{ + int32 errCode = 1; + string errMsg = 2; +} + + +message DeleteUserInDepartmentReq{ + string userID = 1; + string operationID = 2; + string opUserID = 3; + string departmentID = 4; +} +message DeleteUserInDepartmentResp{ + int32 errCode = 1; + string errMsg = 2; +} + +message DeleteOrganizationUserReq{ + string userID = 1; + string operationID = 2; + string opUserID = 3; +} +message DeleteOrganizationUserResp{ + int32 errCode = 1; + string errMsg = 2; +} + + +message GetDepartmentMemberReq{ + string departmentID = 1; + string operationID = 2; + string opUserID = 3; +} + +message GetDepartmentMemberResp{ + int32 errCode = 1; + string errMsg = 2; + repeated server_api_params.UserInDepartment userInDepartmentList = 3; +} + + +service organization{ + rpc CreateDepartment(CreateDepartmentReq) returns(CreateDepartmentResp); + rpc UpdateDepartment(UpdateDepartmentReq) returns(UpdateDepartmentResp); + rpc GetSubDepartment(GetSubDepartmentReq) returns(GetSubDepartmentResp); + rpc DeleteDepartment(DeleteDepartmentReq) returns(DeleteDepartmentResp); + + rpc CreateOrganizationUser(CreateOrganizationUserReq) returns(CreateOrganizationUserResp); + rpc UpdateOrganizationUser(UpdateOrganizationUserReq) returns(UpdateOrganizationUserResp); + rpc DeleteOrganizationUser(DeleteOrganizationUserReq) returns(DeleteOrganizationUserResp); + + + rpc CreateDepartmentMember(CreateDepartmentMemberReq) returns(CreateDepartmentMemberResp); + rpc GetUserInDepartment(GetUserInDepartmentReq) returns(GetUserInDepartmentResp); + rpc DeleteUserInDepartment(DeleteUserInDepartmentReq) returns(DeleteUserInDepartmentResp); + rpc UpdateUserInDepartment(UpdateUserInDepartmentReq) returns(UpdateUserInDepartmentResp); + rpc GetDepartmentMember(GetDepartmentMemberReq) returns(GetDepartmentMemberResp); +} + + + + diff --git a/pkg/proto/proto_dir.cfg b/pkg/proto/proto_dir.cfg new file mode 100644 index 000000000..bc7945472 --- /dev/null +++ b/pkg/proto/proto_dir.cfg @@ -0,0 +1,15 @@ + +all_proto=( + message_cms/message_cms.proto + admin_cms/admin_cms.proto + statistics/statistics.proto + auth/auth.proto + friend/friend.proto + group/group.proto + user/user.proto + rtc/rtc.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 new file mode 100644 index 000000000..e9354ae69 --- /dev/null +++ b/pkg/proto/push/push.pb.go @@ -0,0 +1,216 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: push/push.proto + +package pbPush // import "./push" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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 PushMsgReq struct { + OperationID string `protobuf:"bytes,1,opt,name=operationID" json:"operationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"` + PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_76409d0b017416ef, []int{0} +} +func (m *PushMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PushMsgReq.Unmarshal(m, b) +} +func (m *PushMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PushMsgReq.Marshal(b, m, deterministic) +} +func (dst *PushMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushMsgReq.Merge(dst, src) +} +func (m *PushMsgReq) XXX_Size() int { + return xxx_messageInfo_PushMsgReq.Size(m) +} +func (m *PushMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_PushMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_PushMsgReq proto.InternalMessageInfo + +func (m *PushMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *PushMsgReq) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +func (m *PushMsgReq) GetPushToUserID() string { + if m != nil { + return m.PushToUserID + } + return "" +} + +type PushMsgResp struct { + ResultCode int32 `protobuf:"varint,1,opt,name=ResultCode" json:"ResultCode,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_76409d0b017416ef, []int{1} +} +func (m *PushMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PushMsgResp.Unmarshal(m, b) +} +func (m *PushMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PushMsgResp.Marshal(b, m, deterministic) +} +func (dst *PushMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_PushMsgResp.Merge(dst, src) +} +func (m *PushMsgResp) XXX_Size() int { + return xxx_messageInfo_PushMsgResp.Size(m) +} +func (m *PushMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_PushMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_PushMsgResp proto.InternalMessageInfo + +func (m *PushMsgResp) GetResultCode() int32 { + if m != nil { + return m.ResultCode + } + return 0 +} + +func init() { + proto.RegisterType((*PushMsgReq)(nil), "push.PushMsgReq") + proto.RegisterType((*PushMsgResp)(nil), "push.PushMsgResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for PushMsgService service + +type PushMsgServiceClient interface { + PushMsg(ctx context.Context, in *PushMsgReq, opts ...grpc.CallOption) (*PushMsgResp, error) +} + +type pushMsgServiceClient struct { + cc *grpc.ClientConn +} + +func NewPushMsgServiceClient(cc *grpc.ClientConn) PushMsgServiceClient { + return &pushMsgServiceClient{cc} +} + +func (c *pushMsgServiceClient) PushMsg(ctx context.Context, in *PushMsgReq, opts ...grpc.CallOption) (*PushMsgResp, error) { + out := new(PushMsgResp) + err := grpc.Invoke(ctx, "/push.PushMsgService/PushMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for PushMsgService service + +type PushMsgServiceServer interface { + PushMsg(context.Context, *PushMsgReq) (*PushMsgResp, error) +} + +func RegisterPushMsgServiceServer(s *grpc.Server, srv PushMsgServiceServer) { + s.RegisterService(&_PushMsgService_serviceDesc, srv) +} + +func _PushMsgService_PushMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PushMsgServiceServer).PushMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/push.PushMsgService/PushMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PushMsgServiceServer).PushMsg(ctx, req.(*PushMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _PushMsgService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "push.PushMsgService", + HandlerType: (*PushMsgServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PushMsg", + Handler: _PushMsgService_PushMsg_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "push/push.proto", +} + +func init() { proto.RegisterFile("push/push.proto", fileDescriptor_push_76409d0b017416ef) } + +var fileDescriptor_push_76409d0b017416ef = []byte{ + // 249 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x3d, 0x4f, 0xc3, 0x30, + 0x10, 0x86, 0x15, 0xbe, 0x2a, 0x2e, 0x40, 0xc1, 0x53, 0x94, 0x01, 0x85, 0x4c, 0x5d, 0xb0, 0xa5, + 0xc2, 0xc6, 0x82, 0x20, 0x4b, 0x86, 0x08, 0x64, 0x60, 0x61, 0x89, 0x5c, 0x7a, 0x4a, 0xa3, 0xd2, + 0xfa, 0xf0, 0x25, 0xed, 0x5f, 0xe0, 0x67, 0xa3, 0xb8, 0x05, 0x02, 0x8b, 0x65, 0x3d, 0xf7, 0xe8, + 0xf4, 0xde, 0x0b, 0x43, 0x6a, 0x79, 0xa6, 0xba, 0x47, 0x92, 0xb3, 0x8d, 0x15, 0x7b, 0xdd, 0x3f, + 0xbe, 0x78, 0x20, 0x5c, 0x96, 0x79, 0xa1, 0x68, 0x5e, 0x29, 0x3f, 0x50, 0x3c, 0x9d, 0x97, 0x6b, + 0x56, 0x6b, 0xde, 0x88, 0xe9, 0x67, 0x00, 0xf0, 0xd8, 0xf2, 0xac, 0xe0, 0x4a, 0xe3, 0x87, 0x48, + 0x20, 0xb4, 0x84, 0xce, 0x34, 0xb5, 0x5d, 0xe6, 0x59, 0x14, 0x24, 0xc1, 0xe8, 0x50, 0xf7, 0x91, + 0xb8, 0x86, 0xc1, 0x82, 0xab, 0xcc, 0x34, 0x26, 0xda, 0x49, 0x82, 0x51, 0x38, 0x8e, 0x25, 0xa3, + 0x5b, 0xa1, 0x2b, 0x0d, 0xd5, 0x25, 0x19, 0x67, 0x16, 0x2c, 0x8b, 0x8d, 0xa1, 0xbf, 0x55, 0x91, + 0xc2, 0x51, 0x97, 0xe8, 0xd9, 0xbe, 0x30, 0xba, 0x3c, 0x8b, 0x76, 0xfd, 0xe2, 0x3f, 0x2c, 0xbd, + 0x84, 0xf0, 0x27, 0x09, 0x93, 0x38, 0x07, 0xd0, 0xc8, 0xed, 0x7b, 0x73, 0x6f, 0xa7, 0xe8, 0x93, + 0xec, 0xeb, 0x1e, 0x19, 0xdf, 0xc2, 0xc9, 0x56, 0x7f, 0x42, 0xb7, 0xaa, 0xdf, 0x50, 0x48, 0x18, + 0x6c, 0x89, 0x38, 0x95, 0xbe, 0x8c, 0xdf, 0xcb, 0xe2, 0xb3, 0x7f, 0x84, 0xe9, 0x6e, 0xf8, 0x7a, + 0x2c, 0x7d, 0x69, 0x37, 0x34, 0xe9, 0xf8, 0xe4, 0xc0, 0x77, 0x72, 0xf5, 0x15, 0x00, 0x00, 0xff, + 0xff, 0xbe, 0xb7, 0x7c, 0x1c, 0x4f, 0x01, 0x00, 0x00, +} diff --git a/pkg/proto/push/push.proto b/pkg/proto/push/push.proto new file mode 100644 index 000000000..5d91083b3 --- /dev/null +++ b/pkg/proto/push/push.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./push;pbPush"; +package push; + +message PushMsgReq { + string operationID = 1; + server_api_params.MsgData msgData = 2; + string pushToUserID = 3; +} +message PushMsgResp{ + int32 ResultCode = 1; +} +//message InternalPushMsgReq{ +// int32 ReqIdentifier = 1; +// string Token = 2; +// string SendID = 3; +// string OperationID = 4; +// int32 MsgIncr = 5; +// int32 PlatformID = 6; +// int32 SessionType = 7; +// int32 MsgFrom = 8; +// int32 ContentType = 9; +// string RecvID = 10; +// repeated string ForceList = 11; +// string Content = 12; +// string Options = 13; +// string ClientMsgID = 14; +// string OffLineInfo = 15; +// string Ex = 16; +// +//} + +service PushMsgService { + rpc PushMsg(PushMsgReq) returns(PushMsgResp); +// rpc InternalPushMsg(InternalPushMsgReq)returns(PushMsgResp); +} + diff --git a/pkg/proto/relay/relay.pb.go b/pkg/proto/relay/relay.pb.go new file mode 100644 index 000000000..37334a8b2 --- /dev/null +++ b/pkg/proto/relay/relay.pb.go @@ -0,0 +1,602 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: relay/relay.proto + +package pbRelay // import "./relay" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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 OnlinePushMsgReq struct { + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + MsgData *sdk_ws.MsgData `protobuf:"bytes,2,opt,name=msgData" json:"msgData,omitempty"` + PushToUserID string `protobuf:"bytes,3,opt,name=pushToUserID" json:"pushToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OnlinePushMsgReq) Reset() { *m = OnlinePushMsgReq{} } +func (m *OnlinePushMsgReq) String() string { return proto.CompactTextString(m) } +func (*OnlinePushMsgReq) ProtoMessage() {} +func (*OnlinePushMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{0} +} +func (m *OnlinePushMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OnlinePushMsgReq.Unmarshal(m, b) +} +func (m *OnlinePushMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OnlinePushMsgReq.Marshal(b, m, deterministic) +} +func (dst *OnlinePushMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_OnlinePushMsgReq.Merge(dst, src) +} +func (m *OnlinePushMsgReq) XXX_Size() int { + return xxx_messageInfo_OnlinePushMsgReq.Size(m) +} +func (m *OnlinePushMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_OnlinePushMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_OnlinePushMsgReq proto.InternalMessageInfo + +func (m *OnlinePushMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *OnlinePushMsgReq) GetMsgData() *sdk_ws.MsgData { + if m != nil { + return m.MsgData + } + return nil +} + +func (m *OnlinePushMsgReq) GetPushToUserID() string { + if m != nil { + return m.PushToUserID + } + return "" +} + +type OnlinePushMsgResp struct { + Resp []*SingleMsgToUser `protobuf:"bytes,1,rep,name=resp" json:"resp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OnlinePushMsgResp) Reset() { *m = OnlinePushMsgResp{} } +func (m *OnlinePushMsgResp) String() string { return proto.CompactTextString(m) } +func (*OnlinePushMsgResp) ProtoMessage() {} +func (*OnlinePushMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{1} +} +func (m *OnlinePushMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OnlinePushMsgResp.Unmarshal(m, b) +} +func (m *OnlinePushMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OnlinePushMsgResp.Marshal(b, m, deterministic) +} +func (dst *OnlinePushMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_OnlinePushMsgResp.Merge(dst, src) +} +func (m *OnlinePushMsgResp) XXX_Size() int { + return xxx_messageInfo_OnlinePushMsgResp.Size(m) +} +func (m *OnlinePushMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_OnlinePushMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_OnlinePushMsgResp proto.InternalMessageInfo + +func (m *OnlinePushMsgResp) GetResp() []*SingleMsgToUser { + if m != nil { + return m.Resp + } + return nil +} + +type SingleMsgToUser struct { + ResultCode int64 `protobuf:"varint,1,opt,name=ResultCode" json:"ResultCode,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=RecvID" json:"RecvID,omitempty"` + RecvPlatFormID int32 `protobuf:"varint,3,opt,name=RecvPlatFormID" json:"RecvPlatFormID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_34094e5333f6005a, []int{2} +} +func (m *SingleMsgToUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SingleMsgToUser.Unmarshal(m, b) +} +func (m *SingleMsgToUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SingleMsgToUser.Marshal(b, m, deterministic) +} +func (dst *SingleMsgToUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_SingleMsgToUser.Merge(dst, src) +} +func (m *SingleMsgToUser) XXX_Size() int { + return xxx_messageInfo_SingleMsgToUser.Size(m) +} +func (m *SingleMsgToUser) XXX_DiscardUnknown() { + xxx_messageInfo_SingleMsgToUser.DiscardUnknown(m) +} + +var xxx_messageInfo_SingleMsgToUser proto.InternalMessageInfo + +func (m *SingleMsgToUser) GetResultCode() int64 { + if m != nil { + return m.ResultCode + } + return 0 +} + +func (m *SingleMsgToUser) GetRecvID() string { + if m != nil { + return m.RecvID + } + return "" +} + +func (m *SingleMsgToUser) GetRecvPlatFormID() int32 { + if m != nil { + return m.RecvPlatFormID + } + return 0 +} + +type GetUsersOnlineStatusReq struct { + UserIDList []string `protobuf:"bytes,1,rep,name=userIDList" json:"userIDList,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=opUserID" json:"opUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusReq) Reset() { *m = GetUsersOnlineStatusReq{} } +func (m *GetUsersOnlineStatusReq) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusReq) ProtoMessage() {} +func (*GetUsersOnlineStatusReq) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{3} +} +func (m *GetUsersOnlineStatusReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusReq.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusReq.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusReq.Merge(dst, src) +} +func (m *GetUsersOnlineStatusReq) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusReq.Size(m) +} +func (m *GetUsersOnlineStatusReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusReq proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusReq) GetUserIDList() []string { + if m != nil { + return m.UserIDList + } + return nil +} + +func (m *GetUsersOnlineStatusReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetUsersOnlineStatusReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +type GetUsersOnlineStatusResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + SuccessResult []*GetUsersOnlineStatusResp_SuccessResult `protobuf:"bytes,3,rep,name=successResult" json:"successResult,omitempty"` + FailedResult []*GetUsersOnlineStatusResp_FailedDetail `protobuf:"bytes,4,rep,name=failedResult" json:"failedResult,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusResp) Reset() { *m = GetUsersOnlineStatusResp{} } +func (m *GetUsersOnlineStatusResp) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusResp) ProtoMessage() {} +func (*GetUsersOnlineStatusResp) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{4} +} +func (m *GetUsersOnlineStatusResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusResp.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusResp.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusResp.Merge(dst, src) +} +func (m *GetUsersOnlineStatusResp) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusResp.Size(m) +} +func (m *GetUsersOnlineStatusResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusResp proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetUsersOnlineStatusResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *GetUsersOnlineStatusResp) GetSuccessResult() []*GetUsersOnlineStatusResp_SuccessResult { + if m != nil { + return m.SuccessResult + } + return nil +} + +func (m *GetUsersOnlineStatusResp) GetFailedResult() []*GetUsersOnlineStatusResp_FailedDetail { + if m != nil { + return m.FailedResult + } + return nil +} + +type GetUsersOnlineStatusResp_SuccessDetail struct { + Platform string `protobuf:"bytes,1,opt,name=platform" json:"platform,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusResp_SuccessDetail) Reset() { + *m = GetUsersOnlineStatusResp_SuccessDetail{} +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusResp_SuccessDetail) ProtoMessage() {} +func (*GetUsersOnlineStatusResp_SuccessDetail) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{4, 0} +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusResp_SuccessDetail) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Merge(dst, src) +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.Size(m) +} +func (m *GetUsersOnlineStatusResp_SuccessDetail) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusResp_SuccessDetail proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusResp_SuccessDetail) GetPlatform() string { + if m != nil { + return m.Platform + } + return "" +} + +func (m *GetUsersOnlineStatusResp_SuccessDetail) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +type GetUsersOnlineStatusResp_FailedDetail struct { + UserID string `protobuf:"bytes,3,opt,name=userID" json:"userID,omitempty"` + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusResp_FailedDetail) Reset() { *m = GetUsersOnlineStatusResp_FailedDetail{} } +func (m *GetUsersOnlineStatusResp_FailedDetail) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusResp_FailedDetail) ProtoMessage() {} +func (*GetUsersOnlineStatusResp_FailedDetail) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{4, 1} +} +func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusResp_FailedDetail) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Merge(dst, src) +} +func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.Size(m) +} +func (m *GetUsersOnlineStatusResp_FailedDetail) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusResp_FailedDetail proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusResp_FailedDetail) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUsersOnlineStatusResp_FailedDetail) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *GetUsersOnlineStatusResp_FailedDetail) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type GetUsersOnlineStatusResp_SuccessResult struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status" json:"status,omitempty"` + DetailPlatformStatus []*GetUsersOnlineStatusResp_SuccessDetail `protobuf:"bytes,3,rep,name=detailPlatformStatus" json:"detailPlatformStatus,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersOnlineStatusResp_SuccessResult) Reset() { + *m = GetUsersOnlineStatusResp_SuccessResult{} +} +func (m *GetUsersOnlineStatusResp_SuccessResult) String() string { return proto.CompactTextString(m) } +func (*GetUsersOnlineStatusResp_SuccessResult) ProtoMessage() {} +func (*GetUsersOnlineStatusResp_SuccessResult) Descriptor() ([]byte, []int) { + return fileDescriptor_relay_34094e5333f6005a, []int{4, 2} +} +func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Unmarshal(m, b) +} +func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Marshal(b, m, deterministic) +} +func (dst *GetUsersOnlineStatusResp_SuccessResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Merge(dst, src) +} +func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_Size() int { + return xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.Size(m) +} +func (m *GetUsersOnlineStatusResp_SuccessResult) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersOnlineStatusResp_SuccessResult proto.InternalMessageInfo + +func (m *GetUsersOnlineStatusResp_SuccessResult) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUsersOnlineStatusResp_SuccessResult) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *GetUsersOnlineStatusResp_SuccessResult) GetDetailPlatformStatus() []*GetUsersOnlineStatusResp_SuccessDetail { + if m != nil { + return m.DetailPlatformStatus + } + return nil +} + +func init() { + proto.RegisterType((*OnlinePushMsgReq)(nil), "relay.OnlinePushMsgReq") + proto.RegisterType((*OnlinePushMsgResp)(nil), "relay.OnlinePushMsgResp") + proto.RegisterType((*SingleMsgToUser)(nil), "relay.SingleMsgToUser") + proto.RegisterType((*GetUsersOnlineStatusReq)(nil), "relay.GetUsersOnlineStatusReq") + proto.RegisterType((*GetUsersOnlineStatusResp)(nil), "relay.GetUsersOnlineStatusResp") + proto.RegisterType((*GetUsersOnlineStatusResp_SuccessDetail)(nil), "relay.GetUsersOnlineStatusResp.SuccessDetail") + proto.RegisterType((*GetUsersOnlineStatusResp_FailedDetail)(nil), "relay.GetUsersOnlineStatusResp.FailedDetail") + proto.RegisterType((*GetUsersOnlineStatusResp_SuccessResult)(nil), "relay.GetUsersOnlineStatusResp.SuccessResult") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for OnlineMessageRelayService service + +type OnlineMessageRelayServiceClient interface { + OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error) + GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error) +} + +type onlineMessageRelayServiceClient struct { + cc *grpc.ClientConn +} + +func NewOnlineMessageRelayServiceClient(cc *grpc.ClientConn) OnlineMessageRelayServiceClient { + return &onlineMessageRelayServiceClient{cc} +} + +func (c *onlineMessageRelayServiceClient) OnlinePushMsg(ctx context.Context, in *OnlinePushMsgReq, opts ...grpc.CallOption) (*OnlinePushMsgResp, error) { + out := new(OnlinePushMsgResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/OnlinePushMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *onlineMessageRelayServiceClient) GetUsersOnlineStatus(ctx context.Context, in *GetUsersOnlineStatusReq, opts ...grpc.CallOption) (*GetUsersOnlineStatusResp, error) { + out := new(GetUsersOnlineStatusResp) + err := grpc.Invoke(ctx, "/relay.OnlineMessageRelayService/GetUsersOnlineStatus", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for OnlineMessageRelayService service + +type OnlineMessageRelayServiceServer interface { + OnlinePushMsg(context.Context, *OnlinePushMsgReq) (*OnlinePushMsgResp, error) + GetUsersOnlineStatus(context.Context, *GetUsersOnlineStatusReq) (*GetUsersOnlineStatusResp, error) +} + +func RegisterOnlineMessageRelayServiceServer(s *grpc.Server, srv OnlineMessageRelayServiceServer) { + s.RegisterService(&_OnlineMessageRelayService_serviceDesc, srv) +} + +func _OnlineMessageRelayService_OnlinePushMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OnlinePushMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlineMessageRelayServiceServer).OnlinePushMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.OnlineMessageRelayService/OnlinePushMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlineMessageRelayServiceServer).OnlinePushMsg(ctx, req.(*OnlinePushMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OnlineMessageRelayService_GetUsersOnlineStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUsersOnlineStatusReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OnlineMessageRelayServiceServer).GetUsersOnlineStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/relay.OnlineMessageRelayService/GetUsersOnlineStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OnlineMessageRelayServiceServer).GetUsersOnlineStatus(ctx, req.(*GetUsersOnlineStatusReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _OnlineMessageRelayService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "relay.OnlineMessageRelayService", + HandlerType: (*OnlineMessageRelayServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "OnlinePushMsg", + Handler: _OnlineMessageRelayService_OnlinePushMsg_Handler, + }, + { + MethodName: "GetUsersOnlineStatus", + Handler: _OnlineMessageRelayService_GetUsersOnlineStatus_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "relay/relay.proto", +} + +func init() { proto.RegisterFile("relay/relay.proto", fileDescriptor_relay_34094e5333f6005a) } + +var fileDescriptor_relay_34094e5333f6005a = []byte{ + // 554 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x5d, 0x8f, 0xd2, 0x40, + 0x14, 0x4d, 0x65, 0x3f, 0xdc, 0x0b, 0xb8, 0x32, 0xd9, 0xec, 0xd6, 0x3e, 0x20, 0xf6, 0xc1, 0x10, + 0xa3, 0x25, 0x41, 0xdf, 0x7c, 0x30, 0xd9, 0x25, 0x6b, 0x48, 0x6c, 0x20, 0x83, 0x46, 0xe3, 0x0b, + 0x99, 0x85, 0xbb, 0xdd, 0x66, 0x0b, 0x1d, 0xe6, 0xb6, 0x10, 0xff, 0x84, 0x3f, 0xc2, 0x3f, 0xa1, + 0x3f, 0xcf, 0x74, 0xa6, 0x60, 0x4b, 0x58, 0x37, 0xfb, 0x42, 0x38, 0x77, 0xee, 0x3d, 0xf7, 0x9c, + 0xd3, 0x76, 0xa0, 0xa1, 0x30, 0x12, 0x3f, 0x3a, 0xfa, 0xd7, 0x93, 0x2a, 0x4e, 0x62, 0xb6, 0xaf, + 0x81, 0xf3, 0x62, 0x20, 0x71, 0x3e, 0xee, 0xfb, 0x1d, 0x79, 0x1b, 0x74, 0xf4, 0x49, 0x87, 0xa6, + 0xb7, 0xe3, 0x15, 0x75, 0x56, 0x64, 0x3a, 0xdd, 0x9f, 0x16, 0x3c, 0x1d, 0xcc, 0xa3, 0x70, 0x8e, + 0xc3, 0x94, 0x6e, 0x7c, 0x0a, 0x38, 0x2e, 0x58, 0x0b, 0xaa, 0x03, 0x89, 0x4a, 0x24, 0x61, 0x3c, + 0xef, 0xf7, 0x6c, 0xab, 0x65, 0xb5, 0x8f, 0x78, 0xb1, 0xc4, 0xde, 0xc1, 0xe1, 0x8c, 0x82, 0x9e, + 0x48, 0x84, 0xfd, 0xa8, 0x65, 0xb5, 0xab, 0x5d, 0xc7, 0x23, 0x54, 0x4b, 0x54, 0x63, 0x21, 0xc3, + 0xb1, 0x14, 0x4a, 0xcc, 0xc8, 0xf3, 0x4d, 0x07, 0x5f, 0xb7, 0x32, 0x17, 0x6a, 0x32, 0xa5, 0x9b, + 0xcf, 0xf1, 0x17, 0x42, 0xd5, 0xef, 0xd9, 0x15, 0x4d, 0x5c, 0xaa, 0xb9, 0x1f, 0xa0, 0xb1, 0xa5, + 0x87, 0x24, 0x7b, 0x05, 0x7b, 0x0a, 0x49, 0xda, 0x56, 0xab, 0xd2, 0xae, 0x76, 0x4f, 0x3d, 0xe3, + 0x75, 0x14, 0xce, 0x83, 0x08, 0x7d, 0x0a, 0xcc, 0x30, 0xd7, 0x3d, 0xee, 0x02, 0x8e, 0xb7, 0x0e, + 0x58, 0x13, 0x80, 0x23, 0xa5, 0x51, 0x72, 0x11, 0x4f, 0x51, 0xdb, 0xa9, 0xf0, 0x42, 0x85, 0x9d, + 0xc2, 0x01, 0xc7, 0xc9, 0xb2, 0xdf, 0xd3, 0x66, 0x8e, 0x78, 0x8e, 0xd8, 0x4b, 0x78, 0x92, 0xfd, + 0x1b, 0x46, 0x22, 0xb9, 0x8c, 0xd5, 0x2c, 0x57, 0xbc, 0xcf, 0xb7, 0xaa, 0xee, 0x0a, 0xce, 0x3e, + 0x62, 0x92, 0xad, 0x22, 0xa3, 0x7d, 0x94, 0x88, 0x24, 0xa5, 0x2c, 0xca, 0x26, 0x40, 0xaa, 0x8d, + 0x7d, 0x0a, 0x29, 0xd1, 0xfa, 0x8f, 0x78, 0xa1, 0x92, 0x45, 0x1d, 0x17, 0xa2, 0x36, 0xfb, 0x8b, + 0x25, 0xe6, 0xc0, 0xe3, 0x58, 0x96, 0x02, 0xdb, 0x60, 0xf7, 0xf7, 0x1e, 0xd8, 0xbb, 0x37, 0x93, + 0x64, 0x36, 0x1c, 0xa2, 0x52, 0x1b, 0xcb, 0xfb, 0x7c, 0x0d, 0x33, 0xbf, 0xa8, 0x94, 0x4f, 0xc1, + 0xda, 0xaf, 0x41, 0x6c, 0x04, 0x75, 0x4a, 0x27, 0x13, 0x24, 0x32, 0xe1, 0xd8, 0x15, 0x9d, 0xf7, + 0x9b, 0x3c, 0xef, 0xbb, 0x36, 0x79, 0xa3, 0xe2, 0x10, 0x2f, 0x73, 0xb0, 0x21, 0xd4, 0xae, 0x45, + 0x18, 0xe1, 0x34, 0xe7, 0xdc, 0xd3, 0x9c, 0xaf, 0xef, 0xe3, 0xbc, 0xd4, 0x33, 0x3d, 0x4c, 0x44, + 0x18, 0xf1, 0x12, 0x83, 0x73, 0x01, 0xf5, 0x7c, 0xa3, 0x39, 0xce, 0x22, 0x92, 0x91, 0x48, 0xae, + 0x63, 0x35, 0xcb, 0x5f, 0xd6, 0x0d, 0xce, 0xbc, 0x92, 0x66, 0x5d, 0x7b, 0x35, 0xc8, 0xf9, 0x06, + 0xb5, 0xe2, 0x8a, 0xac, 0x2f, 0x2d, 0x86, 0x9c, 0xa3, 0x87, 0xa7, 0xe8, 0xfc, 0xb2, 0x36, 0xfa, + 0xf2, 0x08, 0xfe, 0x71, 0x5b, 0x25, 0xee, 0x3b, 0xb4, 0x31, 0x01, 0x27, 0x53, 0xad, 0x6a, 0x98, + 0xbb, 0x30, 0xb9, 0x3c, 0xf0, 0x71, 0xe4, 0xd9, 0xed, 0xa4, 0xea, 0xfe, 0xb1, 0xe0, 0x99, 0x19, + 0xf4, 0x91, 0x48, 0x04, 0xc8, 0x33, 0xce, 0x11, 0xaa, 0x65, 0x38, 0x41, 0x76, 0x0e, 0xf5, 0xd2, + 0x47, 0xc8, 0xce, 0xf2, 0x9d, 0xdb, 0x57, 0x85, 0x63, 0xef, 0x3e, 0x20, 0xc9, 0xbe, 0xc2, 0xc9, + 0x2e, 0x85, 0xac, 0xf9, 0x5f, 0xf9, 0x0b, 0xe7, 0xf9, 0x3d, 0xf6, 0xce, 0x1b, 0xdf, 0x8f, 0x3d, + 0x73, 0xdb, 0xbd, 0x97, 0x57, 0x5a, 0xf6, 0xd5, 0x81, 0xbe, 0xcc, 0xde, 0xfe, 0x0d, 0x00, 0x00, + 0xff, 0xff, 0x8e, 0xdc, 0xcc, 0x70, 0x0b, 0x05, 0x00, 0x00, +} diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto new file mode 100644 index 000000000..d8c5f1b7e --- /dev/null +++ b/pkg/proto/relay/relay.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./relay;pbRelay"; +package relay; + +message OnlinePushMsgReq { + string OperationID = 1; + server_api_params.MsgData msgData = 2; + string pushToUserID = 3; +} +message OnlinePushMsgResp{ +repeated SingleMsgToUser resp = 1; +}//message SendMsgByWSReq{ +// string SendID = 1; +// string RecvID = 2; +// string Content = 3; +// int64 SendTime = 4; +// int64 MsgFrom = 5; +// int64 ContentType = 6; +// int64 SessionType = 7; +// string OperationID = 8; +// int64 PlatformID = 9; +//} + +message SingleMsgToUser{ + int64 ResultCode = 1; + string RecvID = 2; + int32 RecvPlatFormID = 3; +} +message GetUsersOnlineStatusReq{ + repeated string userIDList = 1; + string operationID = 2; + string opUserID = 3; +} +message GetUsersOnlineStatusResp{ + int32 errCode = 1; + string errMsg = 2; + repeated SuccessResult successResult = 3; + repeated FailedDetail failedResult = 4; + message SuccessDetail{ + string platform = 1; + string status = 2; + } + message FailedDetail{ + string userID = 3; + int32 errCode = 1; + string errMsg = 2; + } + message SuccessResult{ + string userID = 1; + string status = 2; + repeated SuccessDetail detailPlatformStatus = 3; + + } +} +service OnlineMessageRelayService { + rpc OnlinePushMsg(OnlinePushMsgReq) returns(OnlinePushMsgResp); + rpc GetUsersOnlineStatus(GetUsersOnlineStatusReq)returns(GetUsersOnlineStatusResp); +// rpc SendMsgByWS(SendMsgByWSReq) returns(MsgToUserResp); +} + diff --git a/pkg/proto/rtc/rtc.pb.go b/pkg/proto/rtc/rtc.pb.go new file mode 100644 index 000000000..a546f0f12 --- /dev/null +++ b/pkg/proto/rtc/rtc.pb.go @@ -0,0 +1,2990 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.15.5 +// source: proto/rtc.proto + +package proto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CommonResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` +} + +func (x *CommonResp) Reset() { + *x = CommonResp{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommonResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResp) ProtoMessage() {} + +func (x *CommonResp) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommonResp.ProtoReflect.Descriptor instead. +func (*CommonResp) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{0} +} + +func (x *CommonResp) GetErrCode() int32 { + if x != nil { + return x.ErrCode + } + return 0 +} + +func (x *CommonResp) GetErrMsg() string { + if x != nil { + return x.ErrMsg + } + return "" +} + +type MsgData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SendID string `protobuf:"bytes,1,opt,name=sendID,proto3" json:"sendID,omitempty"` + RecvID string `protobuf:"bytes,2,opt,name=recvID,proto3" json:"recvID,omitempty"` + GroupID string `protobuf:"bytes,3,opt,name=groupID,proto3" json:"groupID,omitempty"` + ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID,proto3" json:"clientMsgID,omitempty"` + ServerMsgID string `protobuf:"bytes,5,opt,name=serverMsgID,proto3" json:"serverMsgID,omitempty"` + SenderPlatformID int32 `protobuf:"varint,6,opt,name=senderPlatformID,proto3" json:"senderPlatformID,omitempty"` + SenderNickname string `protobuf:"bytes,7,opt,name=senderNickname,proto3" json:"senderNickname,omitempty"` + SenderFaceURL string `protobuf:"bytes,8,opt,name=senderFaceURL,proto3" json:"senderFaceURL,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=sessionType,proto3" json:"sessionType,omitempty"` + MsgFrom int32 `protobuf:"varint,10,opt,name=msgFrom,proto3" json:"msgFrom,omitempty"` + ContentType int32 `protobuf:"varint,11,opt,name=contentType,proto3" json:"contentType,omitempty"` + Content []byte `protobuf:"bytes,12,opt,name=content,proto3" json:"content,omitempty"` + Seq uint32 `protobuf:"varint,14,opt,name=seq,proto3" json:"seq,omitempty"` + SendTime int64 `protobuf:"varint,15,opt,name=sendTime,proto3" json:"sendTime,omitempty"` + CreateTime int64 `protobuf:"varint,16,opt,name=createTime,proto3" json:"createTime,omitempty"` + Status int32 `protobuf:"varint,17,opt,name=status,proto3" json:"status,omitempty"` + Options map[string]bool `protobuf:"bytes,18,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,19,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` +} + +func (x *MsgData) Reset() { + *x = MsgData{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgData) ProtoMessage() {} + +func (x *MsgData) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MsgData.ProtoReflect.Descriptor instead. +func (*MsgData) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{1} +} + +func (x *MsgData) GetSendID() string { + if x != nil { + return x.SendID + } + return "" +} + +func (x *MsgData) GetRecvID() string { + if x != nil { + return x.RecvID + } + return "" +} + +func (x *MsgData) GetGroupID() string { + if x != nil { + return x.GroupID + } + return "" +} + +func (x *MsgData) GetClientMsgID() string { + if x != nil { + return x.ClientMsgID + } + return "" +} + +func (x *MsgData) GetServerMsgID() string { + if x != nil { + return x.ServerMsgID + } + return "" +} + +func (x *MsgData) GetSenderPlatformID() int32 { + if x != nil { + return x.SenderPlatformID + } + return 0 +} + +func (x *MsgData) GetSenderNickname() string { + if x != nil { + return x.SenderNickname + } + return "" +} + +func (x *MsgData) GetSenderFaceURL() string { + if x != nil { + return x.SenderFaceURL + } + return "" +} + +func (x *MsgData) GetSessionType() int32 { + if x != nil { + return x.SessionType + } + return 0 +} + +func (x *MsgData) GetMsgFrom() int32 { + if x != nil { + return x.MsgFrom + } + return 0 +} + +func (x *MsgData) GetContentType() int32 { + if x != nil { + return x.ContentType + } + return 0 +} + +func (x *MsgData) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +func (x *MsgData) GetSeq() uint32 { + if x != nil { + return x.Seq + } + return 0 +} + +func (x *MsgData) GetSendTime() int64 { + if x != nil { + return x.SendTime + } + return 0 +} + +func (x *MsgData) GetCreateTime() int64 { + if x != nil { + return x.CreateTime + } + return 0 +} + +func (x *MsgData) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *MsgData) GetOptions() map[string]bool { + if x != nil { + return x.Options + } + return nil +} + +func (x *MsgData) GetOfflinePushInfo() *OfflinePushInfo { + if x != nil { + return x.OfflinePushInfo + } + return nil +} + +type GroupInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID,omitempty"` + GroupName string `protobuf:"bytes,2,opt,name=groupName,proto3" json:"groupName,omitempty"` + Notification string `protobuf:"bytes,3,opt,name=notification,proto3" json:"notification,omitempty"` + Introduction string `protobuf:"bytes,4,opt,name=introduction,proto3" json:"introduction,omitempty"` + FaceURL string `protobuf:"bytes,5,opt,name=faceURL,proto3" json:"faceURL,omitempty"` + OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID,proto3" json:"ownerUserID,omitempty"` + CreateTime uint32 `protobuf:"varint,7,opt,name=createTime,proto3" json:"createTime,omitempty"` + MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount,proto3" json:"memberCount,omitempty"` + Ex string `protobuf:"bytes,9,opt,name=ex,proto3" json:"ex,omitempty"` + Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status,omitempty"` + CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID,proto3" json:"creatorUserID,omitempty"` + GroupType int32 `protobuf:"varint,12,opt,name=groupType,proto3" json:"groupType,omitempty"` +} + +func (x *GroupInfo) Reset() { + *x = GroupInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupInfo) ProtoMessage() {} + +func (x *GroupInfo) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupInfo.ProtoReflect.Descriptor instead. +func (*GroupInfo) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{2} +} + +func (x *GroupInfo) GetGroupID() string { + if x != nil { + return x.GroupID + } + return "" +} + +func (x *GroupInfo) GetGroupName() string { + if x != nil { + return x.GroupName + } + return "" +} + +func (x *GroupInfo) GetNotification() string { + if x != nil { + return x.Notification + } + return "" +} + +func (x *GroupInfo) GetIntroduction() string { + if x != nil { + return x.Introduction + } + return "" +} + +func (x *GroupInfo) GetFaceURL() string { + if x != nil { + return x.FaceURL + } + return "" +} + +func (x *GroupInfo) GetOwnerUserID() string { + if x != nil { + return x.OwnerUserID + } + return "" +} + +func (x *GroupInfo) GetCreateTime() uint32 { + if x != nil { + return x.CreateTime + } + return 0 +} + +func (x *GroupInfo) GetMemberCount() uint32 { + if x != nil { + return x.MemberCount + } + return 0 +} + +func (x *GroupInfo) GetEx() string { + if x != nil { + return x.Ex + } + return "" +} + +func (x *GroupInfo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *GroupInfo) GetCreatorUserID() string { + if x != nil { + return x.CreatorUserID + } + return "" +} + +func (x *GroupInfo) GetGroupType() int32 { + if x != nil { + return x.GroupType + } + return 0 +} + +type GroupMemberFullInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupID string `protobuf:"bytes,1,opt,name=groupID,proto3" json:"groupID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID,proto3" json:"userID,omitempty"` + RoleLevel int32 `protobuf:"varint,3,opt,name=roleLevel,proto3" json:"roleLevel,omitempty"` + JoinTime int32 `protobuf:"varint,4,opt,name=joinTime,proto3" json:"joinTime,omitempty"` + Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,6,opt,name=faceURL,proto3" json:"faceURL,omitempty"` + AppMangerLevel int32 `protobuf:"varint,7,opt,name=appMangerLevel,proto3" json:"appMangerLevel,omitempty"` //if >0 + JoinSource int32 `protobuf:"varint,8,opt,name=joinSource,proto3" json:"joinSource,omitempty"` + OperatorUserID string `protobuf:"bytes,9,opt,name=operatorUserID,proto3" json:"operatorUserID,omitempty"` + Ex string `protobuf:"bytes,10,opt,name=ex,proto3" json:"ex,omitempty"` +} + +func (x *GroupMemberFullInfo) Reset() { + *x = GroupMemberFullInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupMemberFullInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupMemberFullInfo) ProtoMessage() {} + +func (x *GroupMemberFullInfo) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupMemberFullInfo.ProtoReflect.Descriptor instead. +func (*GroupMemberFullInfo) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{3} +} + +func (x *GroupMemberFullInfo) GetGroupID() string { + if x != nil { + return x.GroupID + } + return "" +} + +func (x *GroupMemberFullInfo) GetUserID() string { + if x != nil { + return x.UserID + } + return "" +} + +func (x *GroupMemberFullInfo) GetRoleLevel() int32 { + if x != nil { + return x.RoleLevel + } + return 0 +} + +func (x *GroupMemberFullInfo) GetJoinTime() int32 { + if x != nil { + return x.JoinTime + } + return 0 +} + +func (x *GroupMemberFullInfo) GetNickname() string { + if x != nil { + return x.Nickname + } + return "" +} + +func (x *GroupMemberFullInfo) GetFaceURL() string { + if x != nil { + return x.FaceURL + } + return "" +} + +func (x *GroupMemberFullInfo) GetAppMangerLevel() int32 { + if x != nil { + return x.AppMangerLevel + } + return 0 +} + +func (x *GroupMemberFullInfo) GetJoinSource() int32 { + if x != nil { + return x.JoinSource + } + return 0 +} + +func (x *GroupMemberFullInfo) GetOperatorUserID() string { + if x != nil { + return x.OperatorUserID + } + return "" +} + +func (x *GroupMemberFullInfo) GetEx() string { + if x != nil { + return x.Ex + } + return "" +} + +type ParticipantMetaData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupInfo *GroupInfo `protobuf:"bytes,1,opt,name=groupInfo,proto3" json:"groupInfo,omitempty"` + GroupMemberInfo *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=groupMemberInfo,proto3" json:"groupMemberInfo,omitempty"` + UserInfo *PublicUserInfo `protobuf:"bytes,3,opt,name=userInfo,proto3" json:"userInfo,omitempty"` +} + +func (x *ParticipantMetaData) Reset() { + *x = ParticipantMetaData{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ParticipantMetaData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParticipantMetaData) ProtoMessage() {} + +func (x *ParticipantMetaData) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ParticipantMetaData.ProtoReflect.Descriptor instead. +func (*ParticipantMetaData) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{4} +} + +func (x *ParticipantMetaData) GetGroupInfo() *GroupInfo { + if x != nil { + return x.GroupInfo + } + return nil +} + +func (x *ParticipantMetaData) GetGroupMemberInfo() *GroupMemberFullInfo { + if x != nil { + return x.GroupMemberInfo + } + return nil +} + +func (x *ParticipantMetaData) GetUserInfo() *PublicUserInfo { + if x != nil { + return x.UserInfo + } + return nil +} + +type PublicUserInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,3,opt,name=faceURL,proto3" json:"faceURL,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender,proto3" json:"gender,omitempty"` + Ex string `protobuf:"bytes,5,opt,name=ex,proto3" json:"ex,omitempty"` +} + +func (x *PublicUserInfo) Reset() { + *x = PublicUserInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PublicUserInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PublicUserInfo) ProtoMessage() {} + +func (x *PublicUserInfo) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PublicUserInfo.ProtoReflect.Descriptor instead. +func (*PublicUserInfo) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{5} +} + +func (x *PublicUserInfo) GetUserID() string { + if x != nil { + return x.UserID + } + return "" +} + +func (x *PublicUserInfo) GetNickname() string { + if x != nil { + return x.Nickname + } + return "" +} + +func (x *PublicUserInfo) GetFaceURL() string { + if x != nil { + return x.FaceURL + } + return "" +} + +func (x *PublicUserInfo) GetGender() int32 { + if x != nil { + return x.Gender + } + return 0 +} + +func (x *PublicUserInfo) GetEx() string { + if x != nil { + return x.Ex + } + return "" +} + +type GetJoinTokenReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"` + Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` + MetaData *ParticipantMetaData `protobuf:"bytes,3,opt,name=metaData,proto3" json:"metaData,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID,proto3" json:"operationID,omitempty"` +} + +func (x *GetJoinTokenReq) Reset() { + *x = GetJoinTokenReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetJoinTokenReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetJoinTokenReq) ProtoMessage() {} + +func (x *GetJoinTokenReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetJoinTokenReq.ProtoReflect.Descriptor instead. +func (*GetJoinTokenReq) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{6} +} + +func (x *GetJoinTokenReq) GetRoom() string { + if x != nil { + return x.Room + } + return "" +} + +func (x *GetJoinTokenReq) GetIdentity() string { + if x != nil { + return x.Identity + } + return "" +} + +func (x *GetJoinTokenReq) GetMetaData() *ParticipantMetaData { + if x != nil { + return x.MetaData + } + return nil +} + +func (x *GetJoinTokenReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetJoinTokenResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` + Jwt string `protobuf:"bytes,2,opt,name=jwt,proto3" json:"jwt,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL,proto3" json:"liveURL,omitempty"` +} + +func (x *GetJoinTokenResp) Reset() { + *x = GetJoinTokenResp{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetJoinTokenResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetJoinTokenResp) ProtoMessage() {} + +func (x *GetJoinTokenResp) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetJoinTokenResp.ProtoReflect.Descriptor instead. +func (*GetJoinTokenResp) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{7} +} + +func (x *GetJoinTokenResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *GetJoinTokenResp) GetJwt() string { + if x != nil { + return x.Jwt + } + return "" +} + +func (x *GetJoinTokenResp) GetLiveURL() string { + if x != nil { + return x.LiveURL + } + return "" +} + +type OfflinePushInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"` + Ex string `protobuf:"bytes,3,opt,name=ex,proto3" json:"ex,omitempty"` + IOSPushSound string `protobuf:"bytes,4,opt,name=iOSPushSound,proto3" json:"iOSPushSound,omitempty"` + IOSBadgeCount bool `protobuf:"varint,5,opt,name=iOSBadgeCount,proto3" json:"iOSBadgeCount,omitempty"` +} + +func (x *OfflinePushInfo) Reset() { + *x = OfflinePushInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OfflinePushInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OfflinePushInfo) ProtoMessage() {} + +func (x *OfflinePushInfo) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OfflinePushInfo.ProtoReflect.Descriptor instead. +func (*OfflinePushInfo) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{8} +} + +func (x *OfflinePushInfo) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *OfflinePushInfo) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *OfflinePushInfo) GetEx() string { + if x != nil { + return x.Ex + } + return "" +} + +func (x *OfflinePushInfo) GetIOSPushSound() string { + if x != nil { + return x.IOSPushSound + } + return "" +} + +func (x *OfflinePushInfo) GetIOSBadgeCount() bool { + if x != nil { + return x.IOSBadgeCount + } + return false +} + +type SignalReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // *SignalReq_Invite + // *SignalReq_InviteInGroup + // *SignalReq_Cancel + // *SignalReq_Accept + // *SignalReq_HungUp + // *SignalReq_Reject + Payload isSignalReq_Payload `protobuf_oneof:"payload"` +} + +func (x *SignalReq) Reset() { + *x = SignalReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalReq) ProtoMessage() {} + +func (x *SignalReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalReq.ProtoReflect.Descriptor instead. +func (*SignalReq) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{9} +} + +func (m *SignalReq) GetPayload() isSignalReq_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *SignalReq) GetInvite() *SignalInviteReq { + if x, ok := x.GetPayload().(*SignalReq_Invite); ok { + return x.Invite + } + return nil +} + +func (x *SignalReq) GetInviteInGroup() *SignalInviteInGroupReq { + if x, ok := x.GetPayload().(*SignalReq_InviteInGroup); ok { + return x.InviteInGroup + } + return nil +} + +func (x *SignalReq) GetCancel() *SignalCancelReq { + if x, ok := x.GetPayload().(*SignalReq_Cancel); ok { + return x.Cancel + } + return nil +} + +func (x *SignalReq) GetAccept() *SignalAcceptReq { + if x, ok := x.GetPayload().(*SignalReq_Accept); ok { + return x.Accept + } + return nil +} + +func (x *SignalReq) GetHungUp() *SignalHungUpReq { + if x, ok := x.GetPayload().(*SignalReq_HungUp); ok { + return x.HungUp + } + return nil +} + +func (x *SignalReq) GetReject() *SignalRejectReq { + if x, ok := x.GetPayload().(*SignalReq_Reject); ok { + return x.Reject + } + return nil +} + +type isSignalReq_Payload interface { + isSignalReq_Payload() +} + +type SignalReq_Invite struct { + Invite *SignalInviteReq `protobuf:"bytes,1,opt,name=invite,proto3,oneof"` +} + +type SignalReq_InviteInGroup struct { + InviteInGroup *SignalInviteInGroupReq `protobuf:"bytes,2,opt,name=inviteInGroup,proto3,oneof"` +} + +type SignalReq_Cancel struct { + Cancel *SignalCancelReq `protobuf:"bytes,3,opt,name=cancel,proto3,oneof"` +} + +type SignalReq_Accept struct { + Accept *SignalAcceptReq `protobuf:"bytes,4,opt,name=accept,proto3,oneof"` +} + +type SignalReq_HungUp struct { + HungUp *SignalHungUpReq `protobuf:"bytes,5,opt,name=hungUp,proto3,oneof"` +} + +type SignalReq_Reject struct { + Reject *SignalRejectReq `protobuf:"bytes,6,opt,name=reject,proto3,oneof"` +} + +func (*SignalReq_Invite) isSignalReq_Payload() {} + +func (*SignalReq_InviteInGroup) isSignalReq_Payload() {} + +func (*SignalReq_Cancel) isSignalReq_Payload() {} + +func (*SignalReq_Accept) isSignalReq_Payload() {} + +func (*SignalReq_HungUp) isSignalReq_Payload() {} + +func (*SignalReq_Reject) isSignalReq_Payload() {} + +type SignalResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // *SignalResp_Invite + // *SignalResp_InviteInGroup + // *SignalResp_Cancel + // *SignalResp_Accept + // *SignalResp_HungUp + // *SignalResp_Reject + Payload isSignalResp_Payload `protobuf_oneof:"payload"` +} + +func (x *SignalResp) Reset() { + *x = SignalResp{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalResp) ProtoMessage() {} + +func (x *SignalResp) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalResp.ProtoReflect.Descriptor instead. +func (*SignalResp) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{10} +} + +func (m *SignalResp) GetPayload() isSignalResp_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *SignalResp) GetInvite() *SignalInviteReply { + if x, ok := x.GetPayload().(*SignalResp_Invite); ok { + return x.Invite + } + return nil +} + +func (x *SignalResp) GetInviteInGroup() *SignalInviteInGroupReply { + if x, ok := x.GetPayload().(*SignalResp_InviteInGroup); ok { + return x.InviteInGroup + } + return nil +} + +func (x *SignalResp) GetCancel() *SignalCancelReply { + if x, ok := x.GetPayload().(*SignalResp_Cancel); ok { + return x.Cancel + } + return nil +} + +func (x *SignalResp) GetAccept() *SignalAcceptReply { + if x, ok := x.GetPayload().(*SignalResp_Accept); ok { + return x.Accept + } + return nil +} + +func (x *SignalResp) GetHungUp() *SignalHungUpReply { + if x, ok := x.GetPayload().(*SignalResp_HungUp); ok { + return x.HungUp + } + return nil +} + +func (x *SignalResp) GetReject() *SignalRejectReply { + if x, ok := x.GetPayload().(*SignalResp_Reject); ok { + return x.Reject + } + return nil +} + +type isSignalResp_Payload interface { + isSignalResp_Payload() +} + +type SignalResp_Invite struct { + Invite *SignalInviteReply `protobuf:"bytes,1,opt,name=invite,proto3,oneof"` +} + +type SignalResp_InviteInGroup struct { + InviteInGroup *SignalInviteInGroupReply `protobuf:"bytes,2,opt,name=inviteInGroup,proto3,oneof"` +} + +type SignalResp_Cancel struct { + Cancel *SignalCancelReply `protobuf:"bytes,3,opt,name=cancel,proto3,oneof"` +} + +type SignalResp_Accept struct { + Accept *SignalAcceptReply `protobuf:"bytes,4,opt,name=accept,proto3,oneof"` +} + +type SignalResp_HungUp struct { + HungUp *SignalHungUpReply `protobuf:"bytes,5,opt,name=hungUp,proto3,oneof"` +} + +type SignalResp_Reject struct { + Reject *SignalRejectReply `protobuf:"bytes,6,opt,name=reject,proto3,oneof"` +} + +func (*SignalResp_Invite) isSignalResp_Payload() {} + +func (*SignalResp_InviteInGroup) isSignalResp_Payload() {} + +func (*SignalResp_Cancel) isSignalResp_Payload() {} + +func (*SignalResp_Accept) isSignalResp_Payload() {} + +func (*SignalResp_HungUp) isSignalResp_Payload() {} + +func (*SignalResp_Reject) isSignalResp_Payload() {} + +type InvitationInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InviterUserID string `protobuf:"bytes,1,opt,name=inviterUserID,proto3" json:"inviterUserID,omitempty"` + InviteeUserIDList []string `protobuf:"bytes,2,rep,name=inviteeUserIDList,proto3" json:"inviteeUserIDList,omitempty"` + CustomData string `protobuf:"bytes,3,opt,name=customData,proto3" json:"customData,omitempty"` + GroupID string `protobuf:"bytes,4,opt,name=groupID,proto3" json:"groupID,omitempty"` + RoomID string `protobuf:"bytes,5,opt,name=roomID,proto3" json:"roomID,omitempty"` + Timeout int32 `protobuf:"varint,6,opt,name=timeout,proto3" json:"timeout,omitempty"` + MediaType string `protobuf:"bytes,7,opt,name=mediaType,proto3" json:"mediaType,omitempty"` + PlatformID int32 `protobuf:"varint,8,opt,name=platformID,proto3" json:"platformID,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=sessionType,proto3" json:"sessionType,omitempty"` +} + +func (x *InvitationInfo) Reset() { + *x = InvitationInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InvitationInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InvitationInfo) ProtoMessage() {} + +func (x *InvitationInfo) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InvitationInfo.ProtoReflect.Descriptor instead. +func (*InvitationInfo) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{11} +} + +func (x *InvitationInfo) GetInviterUserID() string { + if x != nil { + return x.InviterUserID + } + return "" +} + +func (x *InvitationInfo) GetInviteeUserIDList() []string { + if x != nil { + return x.InviteeUserIDList + } + return nil +} + +func (x *InvitationInfo) GetCustomData() string { + if x != nil { + return x.CustomData + } + return "" +} + +func (x *InvitationInfo) GetGroupID() string { + if x != nil { + return x.GroupID + } + return "" +} + +func (x *InvitationInfo) GetRoomID() string { + if x != nil { + return x.RoomID + } + return "" +} + +func (x *InvitationInfo) GetTimeout() int32 { + if x != nil { + return x.Timeout + } + return 0 +} + +func (x *InvitationInfo) GetMediaType() string { + if x != nil { + return x.MediaType + } + return "" +} + +func (x *InvitationInfo) GetPlatformID() int32 { + if x != nil { + return x.PlatformID + } + return 0 +} + +func (x *InvitationInfo) GetSessionType() int32 { + if x != nil { + return x.SessionType + } + return 0 +} + +type SignalInviteReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` +} + +func (x *SignalInviteReq) Reset() { + *x = SignalInviteReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalInviteReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalInviteReq) ProtoMessage() {} + +func (x *SignalInviteReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalInviteReq.ProtoReflect.Descriptor instead. +func (*SignalInviteReq) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{12} +} + +func (x *SignalInviteReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *SignalInviteReq) GetInvitation() *InvitationInfo { + if x != nil { + return x.Invitation + } + return nil +} + +func (x *SignalInviteReq) GetOfflinePushInfo() *OfflinePushInfo { + if x != nil { + return x.OfflinePushInfo + } + return nil +} + +func (x *SignalInviteReq) GetParticipant() *ParticipantMetaData { + if x != nil { + return x.Participant + } + return nil +} + +type SignalInviteReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + RoomID string `protobuf:"bytes,2,opt,name=roomID,proto3" json:"roomID,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL,proto3" json:"liveURL,omitempty"` +} + +func (x *SignalInviteReply) Reset() { + *x = SignalInviteReply{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalInviteReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalInviteReply) ProtoMessage() {} + +func (x *SignalInviteReply) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalInviteReply.ProtoReflect.Descriptor instead. +func (*SignalInviteReply) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{13} +} + +func (x *SignalInviteReply) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *SignalInviteReply) GetRoomID() string { + if x != nil { + return x.RoomID + } + return "" +} + +func (x *SignalInviteReply) GetLiveURL() string { + if x != nil { + return x.LiveURL + } + return "" +} + +type SignalInviteInGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` +} + +func (x *SignalInviteInGroupReq) Reset() { + *x = SignalInviteInGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalInviteInGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalInviteInGroupReq) ProtoMessage() {} + +func (x *SignalInviteInGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalInviteInGroupReq.ProtoReflect.Descriptor instead. +func (*SignalInviteInGroupReq) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{14} +} + +func (x *SignalInviteInGroupReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *SignalInviteInGroupReq) GetInvitation() *InvitationInfo { + if x != nil { + return x.Invitation + } + return nil +} + +func (x *SignalInviteInGroupReq) GetOfflinePushInfo() *OfflinePushInfo { + if x != nil { + return x.OfflinePushInfo + } + return nil +} + +func (x *SignalInviteInGroupReq) GetParticipant() *ParticipantMetaData { + if x != nil { + return x.Participant + } + return nil +} + +type SignalInviteInGroupReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + RoomID string `protobuf:"bytes,2,opt,name=roomID,proto3" json:"roomID,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL,proto3" json:"liveURL,omitempty"` +} + +func (x *SignalInviteInGroupReply) Reset() { + *x = SignalInviteInGroupReply{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalInviteInGroupReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalInviteInGroupReply) ProtoMessage() {} + +func (x *SignalInviteInGroupReply) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalInviteInGroupReply.ProtoReflect.Descriptor instead. +func (*SignalInviteInGroupReply) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{15} +} + +func (x *SignalInviteInGroupReply) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *SignalInviteInGroupReply) GetRoomID() string { + if x != nil { + return x.RoomID + } + return "" +} + +func (x *SignalInviteInGroupReply) GetLiveURL() string { + if x != nil { + return x.LiveURL + } + return "" +} + +type SignalCancelReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` +} + +func (x *SignalCancelReq) Reset() { + *x = SignalCancelReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalCancelReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalCancelReq) ProtoMessage() {} + +func (x *SignalCancelReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalCancelReq.ProtoReflect.Descriptor instead. +func (*SignalCancelReq) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{16} +} + +func (x *SignalCancelReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *SignalCancelReq) GetInvitation() *InvitationInfo { + if x != nil { + return x.Invitation + } + return nil +} + +func (x *SignalCancelReq) GetOfflinePushInfo() *OfflinePushInfo { + if x != nil { + return x.OfflinePushInfo + } + return nil +} + +func (x *SignalCancelReq) GetParticipant() *ParticipantMetaData { + if x != nil { + return x.Participant + } + return nil +} + +type SignalCancelReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SignalCancelReply) Reset() { + *x = SignalCancelReply{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalCancelReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalCancelReply) ProtoMessage() {} + +func (x *SignalCancelReply) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalCancelReply.ProtoReflect.Descriptor instead. +func (*SignalCancelReply) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{17} +} + +type SignalAcceptReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` + OpUserPlatformID int32 `protobuf:"varint,5,opt,name=opUserPlatformID,proto3" json:"opUserPlatformID,omitempty"` +} + +func (x *SignalAcceptReq) Reset() { + *x = SignalAcceptReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalAcceptReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalAcceptReq) ProtoMessage() {} + +func (x *SignalAcceptReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalAcceptReq.ProtoReflect.Descriptor instead. +func (*SignalAcceptReq) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{18} +} + +func (x *SignalAcceptReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *SignalAcceptReq) GetInvitation() *InvitationInfo { + if x != nil { + return x.Invitation + } + return nil +} + +func (x *SignalAcceptReq) GetOfflinePushInfo() *OfflinePushInfo { + if x != nil { + return x.OfflinePushInfo + } + return nil +} + +func (x *SignalAcceptReq) GetParticipant() *ParticipantMetaData { + if x != nil { + return x.Participant + } + return nil +} + +func (x *SignalAcceptReq) GetOpUserPlatformID() int32 { + if x != nil { + return x.OpUserPlatformID + } + return 0 +} + +type SignalAcceptReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + RoomID string `protobuf:"bytes,2,opt,name=roomID,proto3" json:"roomID,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL,proto3" json:"liveURL,omitempty"` +} + +func (x *SignalAcceptReply) Reset() { + *x = SignalAcceptReply{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalAcceptReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalAcceptReply) ProtoMessage() {} + +func (x *SignalAcceptReply) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalAcceptReply.ProtoReflect.Descriptor instead. +func (*SignalAcceptReply) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{19} +} + +func (x *SignalAcceptReply) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +func (x *SignalAcceptReply) GetRoomID() string { + if x != nil { + return x.RoomID + } + return "" +} + +func (x *SignalAcceptReply) GetLiveURL() string { + if x != nil { + return x.LiveURL + } + return "" +} + +type SignalHungUpReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` +} + +func (x *SignalHungUpReq) Reset() { + *x = SignalHungUpReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalHungUpReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalHungUpReq) ProtoMessage() {} + +func (x *SignalHungUpReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalHungUpReq.ProtoReflect.Descriptor instead. +func (*SignalHungUpReq) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{20} +} + +func (x *SignalHungUpReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *SignalHungUpReq) GetInvitation() *InvitationInfo { + if x != nil { + return x.Invitation + } + return nil +} + +func (x *SignalHungUpReq) GetOfflinePushInfo() *OfflinePushInfo { + if x != nil { + return x.OfflinePushInfo + } + return nil +} + +type SignalHungUpReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SignalHungUpReply) Reset() { + *x = SignalHungUpReply{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalHungUpReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalHungUpReply) ProtoMessage() {} + +func (x *SignalHungUpReply) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalHungUpReply.ProtoReflect.Descriptor instead. +func (*SignalHungUpReply) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{21} +} + +type SignalRejectReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpUserID string `protobuf:"bytes,1,opt,name=opUserID,proto3" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation,proto3" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo,proto3" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant,proto3" json:"participant,omitempty"` + OpUserPlatformID int32 `protobuf:"varint,5,opt,name=opUserPlatformID,proto3" json:"opUserPlatformID,omitempty"` +} + +func (x *SignalRejectReq) Reset() { + *x = SignalRejectReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalRejectReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalRejectReq) ProtoMessage() {} + +func (x *SignalRejectReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalRejectReq.ProtoReflect.Descriptor instead. +func (*SignalRejectReq) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{22} +} + +func (x *SignalRejectReq) GetOpUserID() string { + if x != nil { + return x.OpUserID + } + return "" +} + +func (x *SignalRejectReq) GetInvitation() *InvitationInfo { + if x != nil { + return x.Invitation + } + return nil +} + +func (x *SignalRejectReq) GetOfflinePushInfo() *OfflinePushInfo { + if x != nil { + return x.OfflinePushInfo + } + return nil +} + +func (x *SignalRejectReq) GetParticipant() *ParticipantMetaData { + if x != nil { + return x.Participant + } + return nil +} + +func (x *SignalRejectReq) GetOpUserPlatformID() int32 { + if x != nil { + return x.OpUserPlatformID + } + return 0 +} + +type SignalRejectReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SignalRejectReply) Reset() { + *x = SignalRejectReply{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalRejectReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalRejectReply) ProtoMessage() {} + +func (x *SignalRejectReply) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalRejectReply.ProtoReflect.Descriptor instead. +func (*SignalRejectReply) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{23} +} + +type SignalMessageAssembleReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignalReq *SignalReq `protobuf:"bytes,1,opt,name=signalReq,proto3" json:"signalReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID,proto3" json:"operationID,omitempty"` +} + +func (x *SignalMessageAssembleReq) Reset() { + *x = SignalMessageAssembleReq{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalMessageAssembleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalMessageAssembleReq) ProtoMessage() {} + +func (x *SignalMessageAssembleReq) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalMessageAssembleReq.ProtoReflect.Descriptor instead. +func (*SignalMessageAssembleReq) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{24} +} + +func (x *SignalMessageAssembleReq) GetSignalReq() *SignalReq { + if x != nil { + return x.SignalReq + } + return nil +} + +func (x *SignalMessageAssembleReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type SignalMessageAssembleResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp,proto3" json:"commonResp,omitempty"` + IsPass bool `protobuf:"varint,2,opt,name=isPass,proto3" json:"isPass,omitempty"` + SignalResp *SignalResp `protobuf:"bytes,3,opt,name=signalResp,proto3" json:"signalResp,omitempty"` + MsgData *MsgData `protobuf:"bytes,4,opt,name=msgData,proto3" json:"msgData,omitempty"` +} + +func (x *SignalMessageAssembleResp) Reset() { + *x = SignalMessageAssembleResp{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_rtc_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalMessageAssembleResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalMessageAssembleResp) ProtoMessage() {} + +func (x *SignalMessageAssembleResp) ProtoReflect() protoreflect.Message { + mi := &file_proto_rtc_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalMessageAssembleResp.ProtoReflect.Descriptor instead. +func (*SignalMessageAssembleResp) Descriptor() ([]byte, []int) { + return file_proto_rtc_proto_rawDescGZIP(), []int{25} +} + +func (x *SignalMessageAssembleResp) GetCommonResp() *CommonResp { + if x != nil { + return x.CommonResp + } + return nil +} + +func (x *SignalMessageAssembleResp) GetIsPass() bool { + if x != nil { + return x.IsPass + } + return false +} + +func (x *SignalMessageAssembleResp) GetSignalResp() *SignalResp { + if x != nil { + return x.SignalResp + } + return nil +} + +func (x *SignalMessageAssembleResp) GetMsgData() *MsgData { + if x != nil { + return x.MsgData + } + return nil +} + +var File_proto_rtc_proto protoreflect.FileDescriptor + +var file_proto_rtc_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x72, 0x74, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0xa4, 0x05, 0x0a, 0x07, 0x4d, 0x73, 0x67, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x44, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, + 0x72, 0x65, 0x63, 0x76, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, + 0x63, 0x76, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x20, + 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, + 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x73, 0x67, + 0x49, 0x44, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x12, 0x26, + 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4e, 0x69, + 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x46, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x20, 0x0a, 0x0b, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x6d, 0x73, 0x67, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x11, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, + 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, + 0x6e, 0x66, 0x6f, 0x1a, 0x3a, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0xf5, 0x02, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, + 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x74, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, + 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, + 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x65, + 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x44, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x22, 0xb7, 0x02, 0x0a, 0x13, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, + 0x1a, 0x0a, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x6a, 0x6f, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, + 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, + 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, + 0x52, 0x4c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, + 0x4c, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x70, 0x70, 0x4d, 0x61, 0x6e, 0x67, 0x65, 0x72, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x61, 0x70, 0x70, 0x4d, 0x61, + 0x6e, 0x67, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x6a, 0x6f, 0x69, + 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6a, + 0x6f, 0x69, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x44, 0x12, 0x0e, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, + 0x78, 0x22, 0xbe, 0x01, 0x0a, 0x13, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, + 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x09, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x0f, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x31, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x0e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, + 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, + 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, + 0x55, 0x52, 0x4c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x65, + 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x22, 0x9b, 0x01, 0x0a, 0x0f, + 0x47, 0x65, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x12, + 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, + 0x6f, 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, + 0x36, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x71, 0x0a, 0x10, 0x47, 0x65, 0x74, + 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, + 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x10, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6a, + 0x77, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x22, 0x95, 0x01, 0x0a, + 0x0f, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x65, 0x78, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x4f, + 0x53, 0x50, 0x75, 0x73, 0x68, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x69, 0x4f, 0x53, 0x50, 0x75, 0x73, 0x68, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x24, + 0x0a, 0x0d, 0x69, 0x4f, 0x53, 0x42, 0x61, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x4f, 0x53, 0x42, 0x61, 0x64, 0x67, 0x65, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xd7, 0x02, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, + 0x65, 0x71, 0x12, 0x30, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x12, 0x45, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x49, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x30, 0x0a, 0x06, 0x63, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x30, 0x0a, + 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x12, + 0x30, 0x0a, 0x06, 0x68, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x48, 0x75, + 0x6e, 0x67, 0x55, 0x70, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x68, 0x75, 0x6e, 0x67, 0x55, + 0x70, 0x12, 0x30, 0x0a, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x6a, + 0x65, 0x63, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xe4, + 0x02, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, + 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x12, 0x47, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x32, 0x0a, 0x06, 0x63, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x32, + 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, + 0x65, 0x70, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, + 0x70, 0x74, 0x12, 0x32, 0x0a, 0x06, 0x68, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x48, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x48, 0x00, 0x52, 0x06, + 0x68, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xb0, 0x02, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x2c, + 0x0a, 0x11, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, + 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x44, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x44, 0x12, 0x18, + 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x64, + 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x49, 0x44, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0xe4, 0x01, 0x0a, 0x0f, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, + 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, + 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, + 0x5b, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, + 0x6f, 0x6d, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, + 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x22, 0xeb, 0x01, 0x0a, + 0x16, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, + 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, + 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, + 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, + 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x0b, + 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x62, 0x0a, 0x18, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x49, 0x6e, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, + 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, + 0x6f, 0x6d, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x22, 0xe4, + 0x01, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, + 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, + 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, + 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, + 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, + 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, + 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, + 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x90, 0x02, 0x0a, 0x0f, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, + 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, + 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, + 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, + 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6f, 0x70, 0x55, + 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x22, 0x5b, 0x0a, + 0x11, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x6f, 0x6d, + 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d, 0x49, 0x44, + 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x55, 0x52, 0x4c, 0x22, 0xa6, 0x01, 0x0a, 0x0f, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x48, 0x75, 0x6e, 0x67, 0x55, 0x70, 0x52, 0x65, 0x71, 0x12, 0x1a, + 0x0a, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, + 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, + 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, + 0x6e, 0x66, 0x6f, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x48, 0x75, 0x6e, + 0x67, 0x55, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x90, 0x02, 0x0a, 0x0f, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, + 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x35, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x40, 0x0a, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, + 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0f, 0x6f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x75, 0x73, 0x68, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x3c, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, + 0x2a, 0x0a, 0x10, 0x6f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6f, 0x70, 0x55, 0x73, 0x65, + 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x44, 0x22, 0x13, 0x0a, 0x11, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x6c, 0x0a, 0x18, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x2e, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, + 0x71, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xc3, + 0x01, 0x0a, 0x19, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x0a, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x16, 0x0a, 0x06, 0x69, 0x73, 0x50, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x69, 0x73, 0x50, 0x61, 0x73, 0x73, 0x12, 0x31, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x07, 0x6d, 0x73, + 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x73, 0x67, + 0x44, 0x61, 0x74, 0x61, 0x32, 0x68, 0x0a, 0x0a, 0x52, 0x74, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x5a, 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x41, 0x73, 0x73, 0x65, 0x6d, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0b, + 0x5a, 0x09, 0x2e, 0x2f, 0x72, 0x74, 0x63, 0x3b, 0x72, 0x74, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_proto_rtc_proto_rawDescOnce sync.Once + file_proto_rtc_proto_rawDescData = file_proto_rtc_proto_rawDesc +) + +func file_proto_rtc_proto_rawDescGZIP() []byte { + file_proto_rtc_proto_rawDescOnce.Do(func() { + file_proto_rtc_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_rtc_proto_rawDescData) + }) + return file_proto_rtc_proto_rawDescData +} + +var file_proto_rtc_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_proto_rtc_proto_goTypes = []interface{}{ + (*CommonResp)(nil), // 0: proto.CommonResp + (*MsgData)(nil), // 1: proto.MsgData + (*GroupInfo)(nil), // 2: proto.GroupInfo + (*GroupMemberFullInfo)(nil), // 3: proto.GroupMemberFullInfo + (*ParticipantMetaData)(nil), // 4: proto.ParticipantMetaData + (*PublicUserInfo)(nil), // 5: proto.PublicUserInfo + (*GetJoinTokenReq)(nil), // 6: proto.GetJoinTokenReq + (*GetJoinTokenResp)(nil), // 7: proto.GetJoinTokenResp + (*OfflinePushInfo)(nil), // 8: proto.OfflinePushInfo + (*SignalReq)(nil), // 9: proto.SignalReq + (*SignalResp)(nil), // 10: proto.SignalResp + (*InvitationInfo)(nil), // 11: proto.InvitationInfo + (*SignalInviteReq)(nil), // 12: proto.SignalInviteReq + (*SignalInviteReply)(nil), // 13: proto.SignalInviteReply + (*SignalInviteInGroupReq)(nil), // 14: proto.SignalInviteInGroupReq + (*SignalInviteInGroupReply)(nil), // 15: proto.SignalInviteInGroupReply + (*SignalCancelReq)(nil), // 16: proto.SignalCancelReq + (*SignalCancelReply)(nil), // 17: proto.SignalCancelReply + (*SignalAcceptReq)(nil), // 18: proto.SignalAcceptReq + (*SignalAcceptReply)(nil), // 19: proto.SignalAcceptReply + (*SignalHungUpReq)(nil), // 20: proto.SignalHungUpReq + (*SignalHungUpReply)(nil), // 21: proto.SignalHungUpReply + (*SignalRejectReq)(nil), // 22: proto.SignalRejectReq + (*SignalRejectReply)(nil), // 23: proto.SignalRejectReply + (*SignalMessageAssembleReq)(nil), // 24: proto.SignalMessageAssembleReq + (*SignalMessageAssembleResp)(nil), // 25: proto.SignalMessageAssembleResp + nil, // 26: proto.MsgData.OptionsEntry +} +var file_proto_rtc_proto_depIdxs = []int32{ + 26, // 0: proto.MsgData.options:type_name -> proto.MsgData.OptionsEntry + 8, // 1: proto.MsgData.offlinePushInfo:type_name -> proto.OfflinePushInfo + 2, // 2: proto.ParticipantMetaData.groupInfo:type_name -> proto.GroupInfo + 3, // 3: proto.ParticipantMetaData.groupMemberInfo:type_name -> proto.GroupMemberFullInfo + 5, // 4: proto.ParticipantMetaData.userInfo:type_name -> proto.PublicUserInfo + 4, // 5: proto.GetJoinTokenReq.metaData:type_name -> proto.ParticipantMetaData + 0, // 6: proto.GetJoinTokenResp.CommonResp:type_name -> proto.CommonResp + 12, // 7: proto.SignalReq.invite:type_name -> proto.SignalInviteReq + 14, // 8: proto.SignalReq.inviteInGroup:type_name -> proto.SignalInviteInGroupReq + 16, // 9: proto.SignalReq.cancel:type_name -> proto.SignalCancelReq + 18, // 10: proto.SignalReq.accept:type_name -> proto.SignalAcceptReq + 20, // 11: proto.SignalReq.hungUp:type_name -> proto.SignalHungUpReq + 22, // 12: proto.SignalReq.reject:type_name -> proto.SignalRejectReq + 13, // 13: proto.SignalResp.invite:type_name -> proto.SignalInviteReply + 15, // 14: proto.SignalResp.inviteInGroup:type_name -> proto.SignalInviteInGroupReply + 17, // 15: proto.SignalResp.cancel:type_name -> proto.SignalCancelReply + 19, // 16: proto.SignalResp.accept:type_name -> proto.SignalAcceptReply + 21, // 17: proto.SignalResp.hungUp:type_name -> proto.SignalHungUpReply + 23, // 18: proto.SignalResp.reject:type_name -> proto.SignalRejectReply + 11, // 19: proto.SignalInviteReq.invitation:type_name -> proto.InvitationInfo + 8, // 20: proto.SignalInviteReq.offlinePushInfo:type_name -> proto.OfflinePushInfo + 4, // 21: proto.SignalInviteReq.participant:type_name -> proto.ParticipantMetaData + 11, // 22: proto.SignalInviteInGroupReq.invitation:type_name -> proto.InvitationInfo + 8, // 23: proto.SignalInviteInGroupReq.offlinePushInfo:type_name -> proto.OfflinePushInfo + 4, // 24: proto.SignalInviteInGroupReq.participant:type_name -> proto.ParticipantMetaData + 11, // 25: proto.SignalCancelReq.invitation:type_name -> proto.InvitationInfo + 8, // 26: proto.SignalCancelReq.offlinePushInfo:type_name -> proto.OfflinePushInfo + 4, // 27: proto.SignalCancelReq.participant:type_name -> proto.ParticipantMetaData + 11, // 28: proto.SignalAcceptReq.invitation:type_name -> proto.InvitationInfo + 8, // 29: proto.SignalAcceptReq.offlinePushInfo:type_name -> proto.OfflinePushInfo + 4, // 30: proto.SignalAcceptReq.participant:type_name -> proto.ParticipantMetaData + 11, // 31: proto.SignalHungUpReq.invitation:type_name -> proto.InvitationInfo + 8, // 32: proto.SignalHungUpReq.offlinePushInfo:type_name -> proto.OfflinePushInfo + 11, // 33: proto.SignalRejectReq.invitation:type_name -> proto.InvitationInfo + 8, // 34: proto.SignalRejectReq.offlinePushInfo:type_name -> proto.OfflinePushInfo + 4, // 35: proto.SignalRejectReq.participant:type_name -> proto.ParticipantMetaData + 9, // 36: proto.SignalMessageAssembleReq.signalReq:type_name -> proto.SignalReq + 0, // 37: proto.SignalMessageAssembleResp.commonResp:type_name -> proto.CommonResp + 10, // 38: proto.SignalMessageAssembleResp.signalResp:type_name -> proto.SignalResp + 1, // 39: proto.SignalMessageAssembleResp.msgData:type_name -> proto.MsgData + 24, // 40: proto.RtcService.SignalMessageAssemble:input_type -> proto.SignalMessageAssembleReq + 25, // 41: proto.RtcService.SignalMessageAssemble:output_type -> proto.SignalMessageAssembleResp + 41, // [41:42] is the sub-list for method output_type + 40, // [40:41] is the sub-list for method input_type + 40, // [40:40] is the sub-list for extension type_name + 40, // [40:40] is the sub-list for extension extendee + 0, // [0:40] is the sub-list for field type_name +} + +func init() { file_proto_rtc_proto_init() } +func file_proto_rtc_proto_init() { + if File_proto_rtc_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_rtc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommonResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMemberFullInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParticipantMetaData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PublicUserInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetJoinTokenReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetJoinTokenResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OfflinePushInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InvitationInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalInviteReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalInviteReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalInviteInGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalInviteInGroupReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalCancelReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalCancelReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalAcceptReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalAcceptReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalHungUpReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalHungUpReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalRejectReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalRejectReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalMessageAssembleReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rtc_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalMessageAssembleResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_proto_rtc_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*SignalReq_Invite)(nil), + (*SignalReq_InviteInGroup)(nil), + (*SignalReq_Cancel)(nil), + (*SignalReq_Accept)(nil), + (*SignalReq_HungUp)(nil), + (*SignalReq_Reject)(nil), + } + file_proto_rtc_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*SignalResp_Invite)(nil), + (*SignalResp_InviteInGroup)(nil), + (*SignalResp_Cancel)(nil), + (*SignalResp_Accept)(nil), + (*SignalResp_HungUp)(nil), + (*SignalResp_Reject)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_rtc_proto_rawDesc, + NumEnums: 0, + NumMessages: 27, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_rtc_proto_goTypes, + DependencyIndexes: file_proto_rtc_proto_depIdxs, + MessageInfos: file_proto_rtc_proto_msgTypes, + }.Build() + File_proto_rtc_proto = out.File + file_proto_rtc_proto_rawDesc = nil + file_proto_rtc_proto_goTypes = nil + file_proto_rtc_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// RtcServiceClient is the client API for RtcService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type RtcServiceClient interface { + SignalMessageAssemble(ctx context.Context, in *SignalMessageAssembleReq, opts ...grpc.CallOption) (*SignalMessageAssembleResp, error) +} + +type rtcServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRtcServiceClient(cc grpc.ClientConnInterface) RtcServiceClient { + return &rtcServiceClient{cc} +} + +func (c *rtcServiceClient) SignalMessageAssemble(ctx context.Context, in *SignalMessageAssembleReq, opts ...grpc.CallOption) (*SignalMessageAssembleResp, error) { + out := new(SignalMessageAssembleResp) + err := c.cc.Invoke(ctx, "/proto.RtcService/SignalMessageAssemble", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RtcServiceServer is the server API for RtcService service. +type RtcServiceServer interface { + SignalMessageAssemble(context.Context, *SignalMessageAssembleReq) (*SignalMessageAssembleResp, error) +} + +// UnimplementedRtcServiceServer can be embedded to have forward compatible implementations. +type UnimplementedRtcServiceServer struct { +} + +func (*UnimplementedRtcServiceServer) SignalMessageAssemble(context.Context, *SignalMessageAssembleReq) (*SignalMessageAssembleResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SignalMessageAssemble not implemented") +} + +func RegisterRtcServiceServer(s *grpc.Server, srv RtcServiceServer) { + s.RegisterService(&_RtcService_serviceDesc, srv) +} + +func _RtcService_SignalMessageAssemble_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignalMessageAssembleReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RtcServiceServer).SignalMessageAssemble(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.RtcService/SignalMessageAssemble", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RtcServiceServer).SignalMessageAssemble(ctx, req.(*SignalMessageAssembleReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _RtcService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "proto.RtcService", + HandlerType: (*RtcServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SignalMessageAssemble", + Handler: _RtcService_SignalMessageAssemble_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/rtc.proto", +} diff --git a/pkg/proto/rtc/rtc.proto b/pkg/proto/rtc/rtc.proto new file mode 100644 index 000000000..ce9ca472b --- /dev/null +++ b/pkg/proto/rtc/rtc.proto @@ -0,0 +1,219 @@ +syntax = "proto3"; +option go_package = "./rtc;rtc"; +package proto; + +message CommonResp{ + int32 errCode = 1; + string errMsg = 2; +} + +message MsgData { + string sendID = 1; + string recvID = 2; + string groupID = 3; + string clientMsgID = 4; + string serverMsgID = 5; + int32 senderPlatformID = 6; + string senderNickname = 7; + string senderFaceURL = 8; + int32 sessionType = 9; + int32 msgFrom = 10; + int32 contentType = 11; + bytes content = 12; + uint32 seq = 14; + int64 sendTime = 15; + int64 createTime = 16; + int32 status = 17; + map<string, bool> options = 18; + OfflinePushInfo offlinePushInfo = 19; +} + + +message GroupInfo{ + string groupID = 1; + string groupName = 2; + string notification = 3; + string introduction = 4; + string faceURL = 5; + string ownerUserID = 6; + uint32 createTime = 7; + uint32 memberCount = 8; + string ex = 9; + int32 status = 10; + string creatorUserID = 11; + int32 groupType = 12; +} + +message GroupMemberFullInfo { + string groupID = 1 ; + string userID = 2 ; + int32 roleLevel = 3; + int32 joinTime = 4; + string nickname = 5; + string faceURL = 6; + int32 appMangerLevel = 7; //if >0 + int32 joinSource = 8; + string operatorUserID = 9; + string ex = 10; +} + +message ParticipantMetaData{ + GroupInfo groupInfo = 1; + GroupMemberFullInfo groupMemberInfo = 2; + PublicUserInfo userInfo = 3; +} + +message PublicUserInfo{ + string userID = 1; + string nickname = 2; + string faceURL = 3; + int32 gender = 4; + string ex = 5; +} + +message GetJoinTokenReq{ + string room = 1; + string identity = 2; + ParticipantMetaData metaData = 3; + string operationID = 4; +} + +message GetJoinTokenResp{ + CommonResp CommonResp = 1; + string jwt = 2; + string liveURL = 3; +} + +message OfflinePushInfo{ + string title = 1; + string desc = 2; + string ex = 3; + string iOSPushSound = 4; + bool iOSBadgeCount = 5; +} + +message SignalReq { + oneof payload { + SignalInviteReq invite = 1; + SignalInviteInGroupReq inviteInGroup= 2; + SignalCancelReq cancel = 3; + SignalAcceptReq accept = 4; + SignalHungUpReq hungUp = 5; + SignalRejectReq reject = 6; + } +} + +message SignalResp { + oneof payload { + SignalInviteReply invite = 1; + SignalInviteInGroupReply inviteInGroup= 2; + SignalCancelReply cancel = 3; + SignalAcceptReply accept = 4; + SignalHungUpReply hungUp = 5; + SignalRejectReply reject = 6; + } +} + +message InvitationInfo { + string inviterUserID = 1; + repeated string inviteeUserIDList = 2; + string customData = 3; + string groupID = 4; + string roomID = 5; + int32 timeout = 6; + string mediaType = 7; + int32 platformID = 8; + int32 sessionType = 9; +} + + +message SignalInviteReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; + +} + +message SignalInviteReply { + string token = 1; + string roomID = 2; + string liveURL = 3; +} + +message SignalInviteInGroupReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; +} + +message SignalInviteInGroupReply { + string token = 1; + string roomID = 2; + string liveURL = 3; +} + +message SignalCancelReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; +} + +message SignalCancelReply { + +} + +message SignalAcceptReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; + int32 opUserPlatformID = 5; +} + +message SignalAcceptReply { + string token = 1; + string roomID = 2; + string liveURL = 3; +} + +message SignalHungUpReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; +} + +message SignalHungUpReply { + +} + + +message SignalRejectReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; + int32 opUserPlatformID = 5; +} + +message SignalRejectReply { + +} + +message SignalMessageAssembleReq { + SignalReq signalReq = 1; + string operationID = 2; +} + +message SignalMessageAssembleResp { + CommonResp commonResp = 1; + bool isPass = 2; + SignalResp signalResp = 3; + MsgData msgData = 4; +} + +service RtcService { + rpc SignalMessageAssemble(SignalMessageAssembleReq) returns(SignalMessageAssembleResp); +} diff --git a/pkg/proto/sdk_ws/ws.pb.go b/pkg/proto/sdk_ws/ws.pb.go new file mode 100644 index 000000000..27901e90f --- /dev/null +++ b/pkg/proto/sdk_ws/ws.pb.go @@ -0,0 +1,5002 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sdk_ws/ws.proto + +package server_api_params // import "Open_IM/pkg/proto/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 GroupInfo struct { + GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` + GroupName string `protobuf:"bytes,2,opt,name=groupName" json:"groupName,omitempty"` + Notification string `protobuf:"bytes,3,opt,name=notification" json:"notification,omitempty"` + Introduction string `protobuf:"bytes,4,opt,name=introduction" json:"introduction,omitempty"` + FaceURL string `protobuf:"bytes,5,opt,name=faceURL" json:"faceURL,omitempty"` + OwnerUserID string `protobuf:"bytes,6,opt,name=ownerUserID" json:"ownerUserID,omitempty"` + CreateTime uint32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"` + MemberCount uint32 `protobuf:"varint,8,opt,name=memberCount" json:"memberCount,omitempty"` + Ex string `protobuf:"bytes,9,opt,name=ex" json:"ex,omitempty"` + Status int32 `protobuf:"varint,10,opt,name=status" json:"status,omitempty"` + CreatorUserID string `protobuf:"bytes,11,opt,name=creatorUserID" json:"creatorUserID,omitempty"` + GroupType int32 `protobuf:"varint,12,opt,name=groupType" json:"groupType,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_ws_822d08ca95807876, []int{0} +} +func (m *GroupInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupInfo.Unmarshal(m, b) +} +func (m *GroupInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupInfo.Marshal(b, m, deterministic) +} +func (dst *GroupInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupInfo.Merge(dst, src) +} +func (m *GroupInfo) XXX_Size() int { + return xxx_messageInfo_GroupInfo.Size(m) +} +func (m *GroupInfo) XXX_DiscardUnknown() { + xxx_messageInfo_GroupInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupInfo proto.InternalMessageInfo + +func (m *GroupInfo) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GroupInfo) GetGroupName() string { + if m != nil { + return m.GroupName + } + return "" +} + +func (m *GroupInfo) GetNotification() string { + if m != nil { + return m.Notification + } + return "" +} + +func (m *GroupInfo) GetIntroduction() string { + if m != nil { + return m.Introduction + } + return "" +} + +func (m *GroupInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *GroupInfo) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *GroupInfo) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *GroupInfo) GetMemberCount() uint32 { + if m != nil { + return m.MemberCount + } + return 0 +} + +func (m *GroupInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +func (m *GroupInfo) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *GroupInfo) GetCreatorUserID() string { + if m != nil { + return m.CreatorUserID + } + return "" +} + +func (m *GroupInfo) GetGroupType() int32 { + if m != nil { + return m.GroupType + } + return 0 +} + +type GroupMemberFullInfo struct { + GroupID string `protobuf:"bytes,1,opt,name=groupID" json:"groupID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + RoleLevel int32 `protobuf:"varint,3,opt,name=roleLevel" json:"roleLevel,omitempty"` + JoinTime int32 `protobuf:"varint,4,opt,name=joinTime" json:"joinTime,omitempty"` + Nickname string `protobuf:"bytes,5,opt,name=nickname" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,6,opt,name=faceURL" json:"faceURL,omitempty"` + AppMangerLevel int32 `protobuf:"varint,7,opt,name=appMangerLevel" json:"appMangerLevel,omitempty"` + JoinSource int32 `protobuf:"varint,8,opt,name=joinSource" json:"joinSource,omitempty"` + OperatorUserID string `protobuf:"bytes,9,opt,name=operatorUserID" json:"operatorUserID,omitempty"` + Ex string `protobuf:"bytes,10,opt,name=ex" json:"ex,omitempty"` + MuteEndTime uint32 `protobuf:"varint,11,opt,name=muteEndTime" json:"muteEndTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_ws_822d08ca95807876, []int{1} +} +func (m *GroupMemberFullInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupMemberFullInfo.Unmarshal(m, b) +} +func (m *GroupMemberFullInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupMemberFullInfo.Marshal(b, m, deterministic) +} +func (dst *GroupMemberFullInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupMemberFullInfo.Merge(dst, src) +} +func (m *GroupMemberFullInfo) XXX_Size() int { + return xxx_messageInfo_GroupMemberFullInfo.Size(m) +} +func (m *GroupMemberFullInfo) XXX_DiscardUnknown() { + xxx_messageInfo_GroupMemberFullInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupMemberFullInfo proto.InternalMessageInfo + +func (m *GroupMemberFullInfo) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *GroupMemberFullInfo) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GroupMemberFullInfo) GetRoleLevel() int32 { + if m != nil { + return m.RoleLevel + } + return 0 +} + +func (m *GroupMemberFullInfo) GetJoinTime() int32 { + if m != nil { + return m.JoinTime + } + return 0 +} + +func (m *GroupMemberFullInfo) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *GroupMemberFullInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *GroupMemberFullInfo) GetAppMangerLevel() int32 { + if m != nil { + return m.AppMangerLevel + } + return 0 +} + +func (m *GroupMemberFullInfo) GetJoinSource() int32 { + if m != nil { + return m.JoinSource + } + return 0 +} + +func (m *GroupMemberFullInfo) GetOperatorUserID() string { + if m != nil { + return m.OperatorUserID + } + return "" +} + +func (m *GroupMemberFullInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +func (m *GroupMemberFullInfo) GetMuteEndTime() uint32 { + if m != nil { + return m.MuteEndTime + } + return 0 +} + +type PublicUserInfo struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=nickname" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,3,opt,name=faceURL" json:"faceURL,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` + Ex string `protobuf:"bytes,5,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PublicUserInfo) Reset() { *m = PublicUserInfo{} } +func (m *PublicUserInfo) String() string { return proto.CompactTextString(m) } +func (*PublicUserInfo) ProtoMessage() {} +func (*PublicUserInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{2} +} +func (m *PublicUserInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PublicUserInfo.Unmarshal(m, b) +} +func (m *PublicUserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PublicUserInfo.Marshal(b, m, deterministic) +} +func (dst *PublicUserInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_PublicUserInfo.Merge(dst, src) +} +func (m *PublicUserInfo) XXX_Size() int { + return xxx_messageInfo_PublicUserInfo.Size(m) +} +func (m *PublicUserInfo) XXX_DiscardUnknown() { + xxx_messageInfo_PublicUserInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_PublicUserInfo proto.InternalMessageInfo + +func (m *PublicUserInfo) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *PublicUserInfo) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *PublicUserInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *PublicUserInfo) GetGender() int32 { + if m != nil { + return m.Gender + } + return 0 +} + +func (m *PublicUserInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type UserInfo struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=nickname" json:"nickname,omitempty"` + FaceURL string `protobuf:"bytes,3,opt,name=faceURL" json:"faceURL,omitempty"` + Gender int32 `protobuf:"varint,4,opt,name=gender" json:"gender,omitempty"` + PhoneNumber string `protobuf:"bytes,5,opt,name=phoneNumber" json:"phoneNumber,omitempty"` + Birth uint32 `protobuf:"varint,6,opt,name=birth" json:"birth,omitempty"` + Email string `protobuf:"bytes,7,opt,name=email" json:"email,omitempty"` + Ex string `protobuf:"bytes,8,opt,name=ex" json:"ex,omitempty"` + CreateTime uint32 `protobuf:"varint,9,opt,name=createTime" json:"createTime,omitempty"` + AppMangerLevel int32 `protobuf:"varint,10,opt,name=appMangerLevel" json:"appMangerLevel,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_ws_822d08ca95807876, []int{3} +} +func (m *UserInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserInfo.Unmarshal(m, b) +} +func (m *UserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserInfo.Marshal(b, m, deterministic) +} +func (dst *UserInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserInfo.Merge(dst, src) +} +func (m *UserInfo) XXX_Size() int { + return xxx_messageInfo_UserInfo.Size(m) +} +func (m *UserInfo) XXX_DiscardUnknown() { + xxx_messageInfo_UserInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_UserInfo proto.InternalMessageInfo + +func (m *UserInfo) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *UserInfo) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *UserInfo) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *UserInfo) GetGender() int32 { + if m != nil { + return m.Gender + } + return 0 +} + +func (m *UserInfo) GetPhoneNumber() string { + if m != nil { + return m.PhoneNumber + } + return "" +} + +func (m *UserInfo) GetBirth() uint32 { + if m != nil { + return m.Birth + } + return 0 +} + +func (m *UserInfo) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *UserInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +func (m *UserInfo) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *UserInfo) GetAppMangerLevel() int32 { + if m != nil { + return m.AppMangerLevel + } + return 0 +} + +type FriendInfo struct { + OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID" json:"ownerUserID,omitempty"` + Remark string `protobuf:"bytes,2,opt,name=remark" json:"remark,omitempty"` + CreateTime uint32 `protobuf:"varint,3,opt,name=createTime" json:"createTime,omitempty"` + FriendUser *UserInfo `protobuf:"bytes,4,opt,name=friendUser" json:"friendUser,omitempty"` + AddSource int32 `protobuf:"varint,5,opt,name=addSource" json:"addSource,omitempty"` + OperatorUserID string `protobuf:"bytes,6,opt,name=operatorUserID" json:"operatorUserID,omitempty"` + Ex string `protobuf:"bytes,7,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendInfo) Reset() { *m = FriendInfo{} } +func (m *FriendInfo) String() string { return proto.CompactTextString(m) } +func (*FriendInfo) ProtoMessage() {} +func (*FriendInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{4} +} +func (m *FriendInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendInfo.Unmarshal(m, b) +} +func (m *FriendInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendInfo.Marshal(b, m, deterministic) +} +func (dst *FriendInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendInfo.Merge(dst, src) +} +func (m *FriendInfo) XXX_Size() int { + return xxx_messageInfo_FriendInfo.Size(m) +} +func (m *FriendInfo) XXX_DiscardUnknown() { + xxx_messageInfo_FriendInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendInfo proto.InternalMessageInfo + +func (m *FriendInfo) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *FriendInfo) GetRemark() string { + if m != nil { + return m.Remark + } + return "" +} + +func (m *FriendInfo) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *FriendInfo) GetFriendUser() *UserInfo { + if m != nil { + return m.FriendUser + } + return nil +} + +func (m *FriendInfo) GetAddSource() int32 { + if m != nil { + return m.AddSource + } + return 0 +} + +func (m *FriendInfo) GetOperatorUserID() string { + if m != nil { + return m.OperatorUserID + } + return "" +} + +func (m *FriendInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type BlackInfo struct { + OwnerUserID string `protobuf:"bytes,1,opt,name=ownerUserID" json:"ownerUserID,omitempty"` + CreateTime uint32 `protobuf:"varint,2,opt,name=createTime" json:"createTime,omitempty"` + BlackUserInfo *PublicUserInfo `protobuf:"bytes,3,opt,name=blackUserInfo" json:"blackUserInfo,omitempty"` + AddSource int32 `protobuf:"varint,4,opt,name=addSource" json:"addSource,omitempty"` + OperatorUserID string `protobuf:"bytes,5,opt,name=operatorUserID" json:"operatorUserID,omitempty"` + Ex string `protobuf:"bytes,6,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlackInfo) Reset() { *m = BlackInfo{} } +func (m *BlackInfo) String() string { return proto.CompactTextString(m) } +func (*BlackInfo) ProtoMessage() {} +func (*BlackInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{5} +} +func (m *BlackInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlackInfo.Unmarshal(m, b) +} +func (m *BlackInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlackInfo.Marshal(b, m, deterministic) +} +func (dst *BlackInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlackInfo.Merge(dst, src) +} +func (m *BlackInfo) XXX_Size() int { + return xxx_messageInfo_BlackInfo.Size(m) +} +func (m *BlackInfo) XXX_DiscardUnknown() { + xxx_messageInfo_BlackInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_BlackInfo proto.InternalMessageInfo + +func (m *BlackInfo) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *BlackInfo) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *BlackInfo) GetBlackUserInfo() *PublicUserInfo { + if m != nil { + return m.BlackUserInfo + } + return nil +} + +func (m *BlackInfo) GetAddSource() int32 { + if m != nil { + return m.AddSource + } + return 0 +} + +func (m *BlackInfo) GetOperatorUserID() string { + if m != nil { + return m.OperatorUserID + } + return "" +} + +func (m *BlackInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type GroupRequest struct { + UserInfo *PublicUserInfo `protobuf:"bytes,1,opt,name=userInfo" json:"userInfo,omitempty"` + GroupInfo *GroupInfo `protobuf:"bytes,2,opt,name=groupInfo" json:"groupInfo,omitempty"` + HandleResult int32 `protobuf:"varint,3,opt,name=handleResult" json:"handleResult,omitempty"` + ReqMsg string `protobuf:"bytes,4,opt,name=reqMsg" json:"reqMsg,omitempty"` + HandleMsg string `protobuf:"bytes,5,opt,name=handleMsg" json:"handleMsg,omitempty"` + ReqTime uint32 `protobuf:"varint,6,opt,name=reqTime" json:"reqTime,omitempty"` + HandleUserID string `protobuf:"bytes,7,opt,name=handleUserID" json:"handleUserID,omitempty"` + HandleTime uint32 `protobuf:"varint,8,opt,name=handleTime" json:"handleTime,omitempty"` + Ex string `protobuf:"bytes,9,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupRequest) Reset() { *m = GroupRequest{} } +func (m *GroupRequest) String() string { return proto.CompactTextString(m) } +func (*GroupRequest) ProtoMessage() {} +func (*GroupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{6} +} +func (m *GroupRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupRequest.Unmarshal(m, b) +} +func (m *GroupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupRequest.Marshal(b, m, deterministic) +} +func (dst *GroupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupRequest.Merge(dst, src) +} +func (m *GroupRequest) XXX_Size() int { + return xxx_messageInfo_GroupRequest.Size(m) +} +func (m *GroupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GroupRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupRequest proto.InternalMessageInfo + +func (m *GroupRequest) GetUserInfo() *PublicUserInfo { + if m != nil { + return m.UserInfo + } + return nil +} + +func (m *GroupRequest) GetGroupInfo() *GroupInfo { + if m != nil { + return m.GroupInfo + } + return nil +} + +func (m *GroupRequest) GetHandleResult() int32 { + if m != nil { + return m.HandleResult + } + return 0 +} + +func (m *GroupRequest) GetReqMsg() string { + if m != nil { + return m.ReqMsg + } + return "" +} + +func (m *GroupRequest) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +func (m *GroupRequest) GetReqTime() uint32 { + if m != nil { + return m.ReqTime + } + return 0 +} + +func (m *GroupRequest) GetHandleUserID() string { + if m != nil { + return m.HandleUserID + } + return "" +} + +func (m *GroupRequest) GetHandleTime() uint32 { + if m != nil { + return m.HandleTime + } + return 0 +} + +func (m *GroupRequest) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type FriendRequest struct { + FromUserID string `protobuf:"bytes,1,opt,name=fromUserID" json:"fromUserID,omitempty"` + FromNickname string `protobuf:"bytes,2,opt,name=fromNickname" json:"fromNickname,omitempty"` + FromFaceURL string `protobuf:"bytes,3,opt,name=fromFaceURL" json:"fromFaceURL,omitempty"` + FromGender int32 `protobuf:"varint,4,opt,name=fromGender" json:"fromGender,omitempty"` + ToUserID string `protobuf:"bytes,5,opt,name=toUserID" json:"toUserID,omitempty"` + ToNickname string `protobuf:"bytes,6,opt,name=toNickname" json:"toNickname,omitempty"` + ToFaceURL string `protobuf:"bytes,7,opt,name=toFaceURL" json:"toFaceURL,omitempty"` + ToGender int32 `protobuf:"varint,8,opt,name=toGender" json:"toGender,omitempty"` + HandleResult int32 `protobuf:"varint,9,opt,name=handleResult" json:"handleResult,omitempty"` + ReqMsg string `protobuf:"bytes,10,opt,name=reqMsg" json:"reqMsg,omitempty"` + CreateTime uint32 `protobuf:"varint,11,opt,name=createTime" json:"createTime,omitempty"` + HandlerUserID string `protobuf:"bytes,12,opt,name=handlerUserID" json:"handlerUserID,omitempty"` + HandleMsg string `protobuf:"bytes,13,opt,name=handleMsg" json:"handleMsg,omitempty"` + HandleTime uint32 `protobuf:"varint,14,opt,name=handleTime" json:"handleTime,omitempty"` + Ex string `protobuf:"bytes,15,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendRequest) Reset() { *m = FriendRequest{} } +func (m *FriendRequest) String() string { return proto.CompactTextString(m) } +func (*FriendRequest) ProtoMessage() {} +func (*FriendRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{7} +} +func (m *FriendRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendRequest.Unmarshal(m, b) +} +func (m *FriendRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendRequest.Marshal(b, m, deterministic) +} +func (dst *FriendRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendRequest.Merge(dst, src) +} +func (m *FriendRequest) XXX_Size() int { + return xxx_messageInfo_FriendRequest.Size(m) +} +func (m *FriendRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FriendRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendRequest proto.InternalMessageInfo + +func (m *FriendRequest) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *FriendRequest) GetFromNickname() string { + if m != nil { + return m.FromNickname + } + return "" +} + +func (m *FriendRequest) GetFromFaceURL() string { + if m != nil { + return m.FromFaceURL + } + return "" +} + +func (m *FriendRequest) GetFromGender() int32 { + if m != nil { + return m.FromGender + } + return 0 +} + +func (m *FriendRequest) GetToUserID() string { + if m != nil { + return m.ToUserID + } + return "" +} + +func (m *FriendRequest) GetToNickname() string { + if m != nil { + return m.ToNickname + } + return "" +} + +func (m *FriendRequest) GetToFaceURL() string { + if m != nil { + return m.ToFaceURL + } + return "" +} + +func (m *FriendRequest) GetToGender() int32 { + if m != nil { + return m.ToGender + } + return 0 +} + +func (m *FriendRequest) GetHandleResult() int32 { + if m != nil { + return m.HandleResult + } + return 0 +} + +func (m *FriendRequest) GetReqMsg() string { + if m != nil { + return m.ReqMsg + } + return "" +} + +func (m *FriendRequest) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *FriendRequest) GetHandlerUserID() string { + if m != nil { + return m.HandlerUserID + } + return "" +} + +func (m *FriendRequest) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +func (m *FriendRequest) GetHandleTime() uint32 { + if m != nil { + return m.HandleTime + } + return 0 +} + +func (m *FriendRequest) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type Department struct { + DepartmentID string `protobuf:"bytes,1,opt,name=departmentID" json:"departmentID,omitempty"` + FaceURL string `protobuf:"bytes,2,opt,name=faceURL" json:"faceURL,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + ParentID string `protobuf:"bytes,4,opt,name=parentID" json:"parentID,omitempty"` + Order int32 `protobuf:"varint,5,opt,name=order" json:"order,omitempty"` + DepartmentType int32 `protobuf:"varint,6,opt,name=departmentType" json:"departmentType,omitempty"` + CreateTime uint32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"` + SubDepartmentNum uint32 `protobuf:"varint,8,opt,name=subDepartmentNum" json:"subDepartmentNum,omitempty"` + MemberNum uint32 `protobuf:"varint,9,opt,name=memberNum" json:"memberNum,omitempty"` + Ex string `protobuf:"bytes,10,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Department) Reset() { *m = Department{} } +func (m *Department) String() string { return proto.CompactTextString(m) } +func (*Department) ProtoMessage() {} +func (*Department) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{8} +} +func (m *Department) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Department.Unmarshal(m, b) +} +func (m *Department) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Department.Marshal(b, m, deterministic) +} +func (dst *Department) XXX_Merge(src proto.Message) { + xxx_messageInfo_Department.Merge(dst, src) +} +func (m *Department) XXX_Size() int { + return xxx_messageInfo_Department.Size(m) +} +func (m *Department) XXX_DiscardUnknown() { + xxx_messageInfo_Department.DiscardUnknown(m) +} + +var xxx_messageInfo_Department proto.InternalMessageInfo + +func (m *Department) GetDepartmentID() string { + if m != nil { + return m.DepartmentID + } + return "" +} + +func (m *Department) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *Department) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Department) GetParentID() string { + if m != nil { + return m.ParentID + } + return "" +} + +func (m *Department) GetOrder() int32 { + if m != nil { + return m.Order + } + return 0 +} + +func (m *Department) GetDepartmentType() int32 { + if m != nil { + return m.DepartmentType + } + return 0 +} + +func (m *Department) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *Department) GetSubDepartmentNum() uint32 { + if m != nil { + return m.SubDepartmentNum + } + return 0 +} + +func (m *Department) GetMemberNum() uint32 { + if m != nil { + return m.MemberNum + } + return 0 +} + +func (m *Department) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type OrganizationUser struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=nickname" json:"nickname,omitempty"` + EnglishName string `protobuf:"bytes,3,opt,name=englishName" json:"englishName,omitempty"` + FaceURL string `protobuf:"bytes,4,opt,name=faceURL" json:"faceURL,omitempty"` + Gender int32 `protobuf:"varint,5,opt,name=gender" json:"gender,omitempty"` + Mobile string `protobuf:"bytes,6,opt,name=mobile" json:"mobile,omitempty"` + Telephone string `protobuf:"bytes,7,opt,name=telephone" json:"telephone,omitempty"` + Birth uint32 `protobuf:"varint,8,opt,name=birth" json:"birth,omitempty"` + Email string `protobuf:"bytes,9,opt,name=email" json:"email,omitempty"` + CreateTime uint32 `protobuf:"varint,10,opt,name=createTime" json:"createTime,omitempty"` + Ex string `protobuf:"bytes,11,opt,name=ex" json:"ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OrganizationUser) Reset() { *m = OrganizationUser{} } +func (m *OrganizationUser) String() string { return proto.CompactTextString(m) } +func (*OrganizationUser) ProtoMessage() {} +func (*OrganizationUser) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{9} +} +func (m *OrganizationUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OrganizationUser.Unmarshal(m, b) +} +func (m *OrganizationUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OrganizationUser.Marshal(b, m, deterministic) +} +func (dst *OrganizationUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_OrganizationUser.Merge(dst, src) +} +func (m *OrganizationUser) XXX_Size() int { + return xxx_messageInfo_OrganizationUser.Size(m) +} +func (m *OrganizationUser) XXX_DiscardUnknown() { + xxx_messageInfo_OrganizationUser.DiscardUnknown(m) +} + +var xxx_messageInfo_OrganizationUser proto.InternalMessageInfo + +func (m *OrganizationUser) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *OrganizationUser) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *OrganizationUser) GetEnglishName() string { + if m != nil { + return m.EnglishName + } + return "" +} + +func (m *OrganizationUser) GetFaceURL() string { + if m != nil { + return m.FaceURL + } + return "" +} + +func (m *OrganizationUser) GetGender() int32 { + if m != nil { + return m.Gender + } + return 0 +} + +func (m *OrganizationUser) GetMobile() string { + if m != nil { + return m.Mobile + } + return "" +} + +func (m *OrganizationUser) GetTelephone() string { + if m != nil { + return m.Telephone + } + return "" +} + +func (m *OrganizationUser) GetBirth() uint32 { + if m != nil { + return m.Birth + } + return 0 +} + +func (m *OrganizationUser) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *OrganizationUser) GetCreateTime() uint32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *OrganizationUser) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type DepartmentMember struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + DepartmentID string `protobuf:"bytes,2,opt,name=DepartmentID" json:"DepartmentID,omitempty"` + Order int32 `protobuf:"varint,3,opt,name=Order" json:"Order,omitempty"` + Position string `protobuf:"bytes,4,opt,name=Position" json:"Position,omitempty"` + Leader int32 `protobuf:"varint,5,opt,name=Leader" json:"Leader,omitempty"` + Status int32 `protobuf:"varint,6,opt,name=Status" json:"Status,omitempty"` + Ex string `protobuf:"bytes,7,opt,name=Ex" json:"Ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DepartmentMember) Reset() { *m = DepartmentMember{} } +func (m *DepartmentMember) String() string { return proto.CompactTextString(m) } +func (*DepartmentMember) ProtoMessage() {} +func (*DepartmentMember) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{10} +} +func (m *DepartmentMember) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DepartmentMember.Unmarshal(m, b) +} +func (m *DepartmentMember) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DepartmentMember.Marshal(b, m, deterministic) +} +func (dst *DepartmentMember) XXX_Merge(src proto.Message) { + xxx_messageInfo_DepartmentMember.Merge(dst, src) +} +func (m *DepartmentMember) XXX_Size() int { + return xxx_messageInfo_DepartmentMember.Size(m) +} +func (m *DepartmentMember) XXX_DiscardUnknown() { + xxx_messageInfo_DepartmentMember.DiscardUnknown(m) +} + +var xxx_messageInfo_DepartmentMember proto.InternalMessageInfo + +func (m *DepartmentMember) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DepartmentMember) GetDepartmentID() string { + if m != nil { + return m.DepartmentID + } + return "" +} + +func (m *DepartmentMember) GetOrder() int32 { + if m != nil { + return m.Order + } + return 0 +} + +func (m *DepartmentMember) GetPosition() string { + if m != nil { + return m.Position + } + return "" +} + +func (m *DepartmentMember) GetLeader() int32 { + if m != nil { + return m.Leader + } + return 0 +} + +func (m *DepartmentMember) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *DepartmentMember) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type UserInDepartment struct { + OrganizationUser *OrganizationUser `protobuf:"bytes,1,opt,name=organizationUser" json:"organizationUser,omitempty"` + DepartmentMemberList []*DepartmentMember `protobuf:"bytes,2,rep,name=departmentMemberList" json:"departmentMemberList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserInDepartment) Reset() { *m = UserInDepartment{} } +func (m *UserInDepartment) String() string { return proto.CompactTextString(m) } +func (*UserInDepartment) ProtoMessage() {} +func (*UserInDepartment) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{11} +} +func (m *UserInDepartment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserInDepartment.Unmarshal(m, b) +} +func (m *UserInDepartment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserInDepartment.Marshal(b, m, deterministic) +} +func (dst *UserInDepartment) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserInDepartment.Merge(dst, src) +} +func (m *UserInDepartment) XXX_Size() int { + return xxx_messageInfo_UserInDepartment.Size(m) +} +func (m *UserInDepartment) XXX_DiscardUnknown() { + xxx_messageInfo_UserInDepartment.DiscardUnknown(m) +} + +var xxx_messageInfo_UserInDepartment proto.InternalMessageInfo + +func (m *UserInDepartment) GetOrganizationUser() *OrganizationUser { + if m != nil { + return m.OrganizationUser + } + return nil +} + +func (m *UserInDepartment) GetDepartmentMemberList() []*DepartmentMember { + if m != nil { + return m.DepartmentMemberList + } + return nil +} + +type PullMessageBySeqListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + List []*MsgData `protobuf:"bytes,3,rep,name=list" json:"list,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_822d08ca95807876, []int{12} +} +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) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *PullMessageBySeqListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func (m *PullMessageBySeqListResp) GetList() []*MsgData { + if m != nil { + return m.List + } + return nil +} + +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 []uint32 `protobuf:"varint,3,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_822d08ca95807876, []int{13} +} +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) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *PullMessageBySeqListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *PullMessageBySeqListReq) GetSeqList() []uint32 { + 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_822d08ca95807876, []int{14} +} +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 uint32 `protobuf:"varint,1,opt,name=maxSeq" json:"maxSeq,omitempty"` + MinSeq uint32 `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_822d08ca95807876, []int{15} +} +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() uint32 { + if m != nil { + return m.MaxSeq + } + return 0 +} + +func (m *GetMaxAndMinSeqResp) GetMinSeq() uint32 { + if m != nil { + return m.MinSeq + } + return 0 +} + +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_822d08ca95807876, []int{16} +} +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"` + GroupID string `protobuf:"bytes,3,opt,name=groupID" json:"groupID,omitempty"` + ClientMsgID string `protobuf:"bytes,4,opt,name=clientMsgID" json:"clientMsgID,omitempty"` + ServerMsgID string `protobuf:"bytes,5,opt,name=serverMsgID" json:"serverMsgID,omitempty"` + SenderPlatformID int32 `protobuf:"varint,6,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"` + SenderNickname string `protobuf:"bytes,7,opt,name=senderNickname" json:"senderNickname,omitempty"` + SenderFaceURL string `protobuf:"bytes,8,opt,name=senderFaceURL" json:"senderFaceURL,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=sessionType" json:"sessionType,omitempty"` + MsgFrom int32 `protobuf:"varint,10,opt,name=msgFrom" json:"msgFrom,omitempty"` + ContentType int32 `protobuf:"varint,11,opt,name=contentType" json:"contentType,omitempty"` + Content []byte `protobuf:"bytes,12,opt,name=content,proto3" json:"content,omitempty"` + Seq uint32 `protobuf:"varint,14,opt,name=seq" json:"seq,omitempty"` + SendTime int64 `protobuf:"varint,15,opt,name=sendTime" json:"sendTime,omitempty"` + CreateTime int64 `protobuf:"varint,16,opt,name=createTime" json:"createTime,omitempty"` + Status int32 `protobuf:"varint,17,opt,name=status" json:"status,omitempty"` + Options map[string]bool `protobuf:"bytes,18,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,19,opt,name=offlinePushInfo" json:"offlinePushInfo,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_822d08ca95807876, []int{17} +} +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) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *MsgData) GetClientMsgID() string { + if m != nil { + return m.ClientMsgID + } + return "" +} + +func (m *MsgData) GetServerMsgID() string { + if m != nil { + return m.ServerMsgID + } + return "" +} + +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) 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) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func (m *MsgData) GetSeq() uint32 { + if m != nil { + return m.Seq + } + return 0 +} + +func (m *MsgData) GetSendTime() int64 { + if m != nil { + return m.SendTime + } + return 0 +} + +func (m *MsgData) GetCreateTime() int64 { + if m != nil { + return m.CreateTime + } + return 0 +} + +func (m *MsgData) GetStatus() int32 { + if m != nil { + return m.Status + } + return 0 +} + +func (m *MsgData) GetOptions() map[string]bool { + if m != nil { + return m.Options + } + return nil +} + +func (m *MsgData) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +type OfflinePushInfo struct { + Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` + Desc string `protobuf:"bytes,2,opt,name=desc" json:"desc,omitempty"` + Ex string `protobuf:"bytes,3,opt,name=ex" json:"ex,omitempty"` + IOSPushSound string `protobuf:"bytes,4,opt,name=iOSPushSound" json:"iOSPushSound,omitempty"` + IOSBadgeCount bool `protobuf:"varint,5,opt,name=iOSBadgeCount" json:"iOSBadgeCount,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OfflinePushInfo) Reset() { *m = OfflinePushInfo{} } +func (m *OfflinePushInfo) String() string { return proto.CompactTextString(m) } +func (*OfflinePushInfo) ProtoMessage() {} +func (*OfflinePushInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{18} +} +func (m *OfflinePushInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_OfflinePushInfo.Unmarshal(m, b) +} +func (m *OfflinePushInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_OfflinePushInfo.Marshal(b, m, deterministic) +} +func (dst *OfflinePushInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_OfflinePushInfo.Merge(dst, src) +} +func (m *OfflinePushInfo) XXX_Size() int { + return xxx_messageInfo_OfflinePushInfo.Size(m) +} +func (m *OfflinePushInfo) XXX_DiscardUnknown() { + xxx_messageInfo_OfflinePushInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_OfflinePushInfo proto.InternalMessageInfo + +func (m *OfflinePushInfo) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *OfflinePushInfo) GetDesc() string { + if m != nil { + return m.Desc + } + return "" +} + +func (m *OfflinePushInfo) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +func (m *OfflinePushInfo) GetIOSPushSound() string { + if m != nil { + return m.IOSPushSound + } + return "" +} + +func (m *OfflinePushInfo) GetIOSBadgeCount() bool { + if m != nil { + return m.IOSBadgeCount + } + return false +} + +type TipsComm struct { + Detail []byte `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` + DefaultTips string `protobuf:"bytes,2,opt,name=defaultTips" json:"defaultTips,omitempty"` + JsonDetail string `protobuf:"bytes,3,opt,name=jsonDetail" json:"jsonDetail,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TipsComm) Reset() { *m = TipsComm{} } +func (m *TipsComm) String() string { return proto.CompactTextString(m) } +func (*TipsComm) ProtoMessage() {} +func (*TipsComm) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{19} +} +func (m *TipsComm) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TipsComm.Unmarshal(m, b) +} +func (m *TipsComm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TipsComm.Marshal(b, m, deterministic) +} +func (dst *TipsComm) XXX_Merge(src proto.Message) { + xxx_messageInfo_TipsComm.Merge(dst, src) +} +func (m *TipsComm) XXX_Size() int { + return xxx_messageInfo_TipsComm.Size(m) +} +func (m *TipsComm) XXX_DiscardUnknown() { + xxx_messageInfo_TipsComm.DiscardUnknown(m) +} + +var xxx_messageInfo_TipsComm proto.InternalMessageInfo + +func (m *TipsComm) GetDetail() []byte { + if m != nil { + return m.Detail + } + return nil +} + +func (m *TipsComm) GetDefaultTips() string { + if m != nil { + return m.DefaultTips + } + return "" +} + +func (m *TipsComm) GetJsonDetail() string { + if m != nil { + return m.JsonDetail + } + return "" +} + +// OnGroupCreated() +type GroupCreatedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + MemberList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=memberList" json:"memberList,omitempty"` + OperationTime int64 `protobuf:"varint,4,opt,name=operationTime" json:"operationTime,omitempty"` + GroupOwnerUser *GroupMemberFullInfo `protobuf:"bytes,5,opt,name=groupOwnerUser" json:"groupOwnerUser,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupCreatedTips) Reset() { *m = GroupCreatedTips{} } +func (m *GroupCreatedTips) String() string { return proto.CompactTextString(m) } +func (*GroupCreatedTips) ProtoMessage() {} +func (*GroupCreatedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{20} +} +func (m *GroupCreatedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupCreatedTips.Unmarshal(m, b) +} +func (m *GroupCreatedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupCreatedTips.Marshal(b, m, deterministic) +} +func (dst *GroupCreatedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupCreatedTips.Merge(dst, src) +} +func (m *GroupCreatedTips) XXX_Size() int { + return xxx_messageInfo_GroupCreatedTips.Size(m) +} +func (m *GroupCreatedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupCreatedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupCreatedTips proto.InternalMessageInfo + +func (m *GroupCreatedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupCreatedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupCreatedTips) GetMemberList() []*GroupMemberFullInfo { + if m != nil { + return m.MemberList + } + return nil +} + +func (m *GroupCreatedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +func (m *GroupCreatedTips) GetGroupOwnerUser() *GroupMemberFullInfo { + if m != nil { + return m.GroupOwnerUser + } + return nil +} + +// OnGroupInfoSet() +type GroupInfoSetTips struct { + OpUser *GroupMemberFullInfo `protobuf:"bytes,1,opt,name=opUser" json:"opUser,omitempty"` + MuteTime int64 `protobuf:"varint,2,opt,name=muteTime" json:"muteTime,omitempty"` + Group *GroupInfo `protobuf:"bytes,3,opt,name=group" json:"group,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupInfoSetTips) Reset() { *m = GroupInfoSetTips{} } +func (m *GroupInfoSetTips) String() string { return proto.CompactTextString(m) } +func (*GroupInfoSetTips) ProtoMessage() {} +func (*GroupInfoSetTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{21} +} +func (m *GroupInfoSetTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupInfoSetTips.Unmarshal(m, b) +} +func (m *GroupInfoSetTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupInfoSetTips.Marshal(b, m, deterministic) +} +func (dst *GroupInfoSetTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupInfoSetTips.Merge(dst, src) +} +func (m *GroupInfoSetTips) XXX_Size() int { + return xxx_messageInfo_GroupInfoSetTips.Size(m) +} +func (m *GroupInfoSetTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupInfoSetTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupInfoSetTips proto.InternalMessageInfo + +func (m *GroupInfoSetTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupInfoSetTips) GetMuteTime() int64 { + if m != nil { + return m.MuteTime + } + return 0 +} + +func (m *GroupInfoSetTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +// OnJoinGroupApplication() +type JoinGroupApplicationTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + Applicant *PublicUserInfo `protobuf:"bytes,2,opt,name=applicant" json:"applicant,omitempty"` + ReqMsg string `protobuf:"bytes,3,opt,name=reqMsg" json:"reqMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *JoinGroupApplicationTips) Reset() { *m = JoinGroupApplicationTips{} } +func (m *JoinGroupApplicationTips) String() string { return proto.CompactTextString(m) } +func (*JoinGroupApplicationTips) ProtoMessage() {} +func (*JoinGroupApplicationTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{22} +} +func (m *JoinGroupApplicationTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_JoinGroupApplicationTips.Unmarshal(m, b) +} +func (m *JoinGroupApplicationTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_JoinGroupApplicationTips.Marshal(b, m, deterministic) +} +func (dst *JoinGroupApplicationTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_JoinGroupApplicationTips.Merge(dst, src) +} +func (m *JoinGroupApplicationTips) XXX_Size() int { + return xxx_messageInfo_JoinGroupApplicationTips.Size(m) +} +func (m *JoinGroupApplicationTips) XXX_DiscardUnknown() { + xxx_messageInfo_JoinGroupApplicationTips.DiscardUnknown(m) +} + +var xxx_messageInfo_JoinGroupApplicationTips proto.InternalMessageInfo + +func (m *JoinGroupApplicationTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *JoinGroupApplicationTips) GetApplicant() *PublicUserInfo { + if m != nil { + return m.Applicant + } + return nil +} + +func (m *JoinGroupApplicationTips) GetReqMsg() string { + if m != nil { + return m.ReqMsg + } + return "" +} + +// OnQuitGroup() +// Actively leave the group +type MemberQuitTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + QuitUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=quitUser" json:"quitUser,omitempty"` + OperationTime int64 `protobuf:"varint,3,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberQuitTips) Reset() { *m = MemberQuitTips{} } +func (m *MemberQuitTips) String() string { return proto.CompactTextString(m) } +func (*MemberQuitTips) ProtoMessage() {} +func (*MemberQuitTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{23} +} +func (m *MemberQuitTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MemberQuitTips.Unmarshal(m, b) +} +func (m *MemberQuitTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MemberQuitTips.Marshal(b, m, deterministic) +} +func (dst *MemberQuitTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberQuitTips.Merge(dst, src) +} +func (m *MemberQuitTips) XXX_Size() int { + return xxx_messageInfo_MemberQuitTips.Size(m) +} +func (m *MemberQuitTips) XXX_DiscardUnknown() { + xxx_messageInfo_MemberQuitTips.DiscardUnknown(m) +} + +var xxx_messageInfo_MemberQuitTips proto.InternalMessageInfo + +func (m *MemberQuitTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *MemberQuitTips) GetQuitUser() *GroupMemberFullInfo { + if m != nil { + return m.QuitUser + } + return nil +} + +func (m *MemberQuitTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +// OnApplicationGroupAccepted() +type GroupApplicationAcceptedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg" json:"handleMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupApplicationAcceptedTips) Reset() { *m = GroupApplicationAcceptedTips{} } +func (m *GroupApplicationAcceptedTips) String() string { return proto.CompactTextString(m) } +func (*GroupApplicationAcceptedTips) ProtoMessage() {} +func (*GroupApplicationAcceptedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{24} +} +func (m *GroupApplicationAcceptedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupApplicationAcceptedTips.Unmarshal(m, b) +} +func (m *GroupApplicationAcceptedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupApplicationAcceptedTips.Marshal(b, m, deterministic) +} +func (dst *GroupApplicationAcceptedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupApplicationAcceptedTips.Merge(dst, src) +} +func (m *GroupApplicationAcceptedTips) XXX_Size() int { + return xxx_messageInfo_GroupApplicationAcceptedTips.Size(m) +} +func (m *GroupApplicationAcceptedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupApplicationAcceptedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupApplicationAcceptedTips proto.InternalMessageInfo + +func (m *GroupApplicationAcceptedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupApplicationAcceptedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupApplicationAcceptedTips) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +// OnApplicationGroupRejected() +type GroupApplicationRejectedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + HandleMsg string `protobuf:"bytes,4,opt,name=handleMsg" json:"handleMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupApplicationRejectedTips) Reset() { *m = GroupApplicationRejectedTips{} } +func (m *GroupApplicationRejectedTips) String() string { return proto.CompactTextString(m) } +func (*GroupApplicationRejectedTips) ProtoMessage() {} +func (*GroupApplicationRejectedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{25} +} +func (m *GroupApplicationRejectedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupApplicationRejectedTips.Unmarshal(m, b) +} +func (m *GroupApplicationRejectedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupApplicationRejectedTips.Marshal(b, m, deterministic) +} +func (dst *GroupApplicationRejectedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupApplicationRejectedTips.Merge(dst, src) +} +func (m *GroupApplicationRejectedTips) XXX_Size() int { + return xxx_messageInfo_GroupApplicationRejectedTips.Size(m) +} +func (m *GroupApplicationRejectedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupApplicationRejectedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupApplicationRejectedTips proto.InternalMessageInfo + +func (m *GroupApplicationRejectedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupApplicationRejectedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupApplicationRejectedTips) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +// OnTransferGroupOwner() +type GroupOwnerTransferredTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + NewGroupOwner *GroupMemberFullInfo `protobuf:"bytes,3,opt,name=newGroupOwner" json:"newGroupOwner,omitempty"` + OperationTime int64 `protobuf:"varint,4,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupOwnerTransferredTips) Reset() { *m = GroupOwnerTransferredTips{} } +func (m *GroupOwnerTransferredTips) String() string { return proto.CompactTextString(m) } +func (*GroupOwnerTransferredTips) ProtoMessage() {} +func (*GroupOwnerTransferredTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{26} +} +func (m *GroupOwnerTransferredTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupOwnerTransferredTips.Unmarshal(m, b) +} +func (m *GroupOwnerTransferredTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupOwnerTransferredTips.Marshal(b, m, deterministic) +} +func (dst *GroupOwnerTransferredTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupOwnerTransferredTips.Merge(dst, src) +} +func (m *GroupOwnerTransferredTips) XXX_Size() int { + return xxx_messageInfo_GroupOwnerTransferredTips.Size(m) +} +func (m *GroupOwnerTransferredTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupOwnerTransferredTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupOwnerTransferredTips proto.InternalMessageInfo + +func (m *GroupOwnerTransferredTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupOwnerTransferredTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupOwnerTransferredTips) GetNewGroupOwner() *GroupMemberFullInfo { + if m != nil { + return m.NewGroupOwner + } + return nil +} + +func (m *GroupOwnerTransferredTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +// OnMemberKicked() +type MemberKickedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + KickedUserList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=kickedUserList" json:"kickedUserList,omitempty"` + OperationTime int64 `protobuf:"varint,4,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberKickedTips) Reset() { *m = MemberKickedTips{} } +func (m *MemberKickedTips) String() string { return proto.CompactTextString(m) } +func (*MemberKickedTips) ProtoMessage() {} +func (*MemberKickedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{27} +} +func (m *MemberKickedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MemberKickedTips.Unmarshal(m, b) +} +func (m *MemberKickedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MemberKickedTips.Marshal(b, m, deterministic) +} +func (dst *MemberKickedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberKickedTips.Merge(dst, src) +} +func (m *MemberKickedTips) XXX_Size() int { + return xxx_messageInfo_MemberKickedTips.Size(m) +} +func (m *MemberKickedTips) XXX_DiscardUnknown() { + xxx_messageInfo_MemberKickedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_MemberKickedTips proto.InternalMessageInfo + +func (m *MemberKickedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *MemberKickedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *MemberKickedTips) GetKickedUserList() []*GroupMemberFullInfo { + if m != nil { + return m.KickedUserList + } + return nil +} + +func (m *MemberKickedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +// OnMemberInvited() +type MemberInvitedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + InvitedUserList []*GroupMemberFullInfo `protobuf:"bytes,3,rep,name=invitedUserList" json:"invitedUserList,omitempty"` + OperationTime int64 `protobuf:"varint,4,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberInvitedTips) Reset() { *m = MemberInvitedTips{} } +func (m *MemberInvitedTips) String() string { return proto.CompactTextString(m) } +func (*MemberInvitedTips) ProtoMessage() {} +func (*MemberInvitedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{28} +} +func (m *MemberInvitedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MemberInvitedTips.Unmarshal(m, b) +} +func (m *MemberInvitedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MemberInvitedTips.Marshal(b, m, deterministic) +} +func (dst *MemberInvitedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberInvitedTips.Merge(dst, src) +} +func (m *MemberInvitedTips) XXX_Size() int { + return xxx_messageInfo_MemberInvitedTips.Size(m) +} +func (m *MemberInvitedTips) XXX_DiscardUnknown() { + xxx_messageInfo_MemberInvitedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_MemberInvitedTips proto.InternalMessageInfo + +func (m *MemberInvitedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *MemberInvitedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *MemberInvitedTips) GetInvitedUserList() []*GroupMemberFullInfo { + if m != nil { + return m.InvitedUserList + } + return nil +} + +func (m *MemberInvitedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +// Actively join the group +type MemberEnterTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + EntrantUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=entrantUser" json:"entrantUser,omitempty"` + OperationTime int64 `protobuf:"varint,3,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MemberEnterTips) Reset() { *m = MemberEnterTips{} } +func (m *MemberEnterTips) String() string { return proto.CompactTextString(m) } +func (*MemberEnterTips) ProtoMessage() {} +func (*MemberEnterTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{29} +} +func (m *MemberEnterTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MemberEnterTips.Unmarshal(m, b) +} +func (m *MemberEnterTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MemberEnterTips.Marshal(b, m, deterministic) +} +func (dst *MemberEnterTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_MemberEnterTips.Merge(dst, src) +} +func (m *MemberEnterTips) XXX_Size() int { + return xxx_messageInfo_MemberEnterTips.Size(m) +} +func (m *MemberEnterTips) XXX_DiscardUnknown() { + xxx_messageInfo_MemberEnterTips.DiscardUnknown(m) +} + +var xxx_messageInfo_MemberEnterTips proto.InternalMessageInfo + +func (m *MemberEnterTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *MemberEnterTips) GetEntrantUser() *GroupMemberFullInfo { + if m != nil { + return m.EntrantUser + } + return nil +} + +func (m *MemberEnterTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +type GroupDismissedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + OperationTime int64 `protobuf:"varint,3,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupDismissedTips) Reset() { *m = GroupDismissedTips{} } +func (m *GroupDismissedTips) String() string { return proto.CompactTextString(m) } +func (*GroupDismissedTips) ProtoMessage() {} +func (*GroupDismissedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{30} +} +func (m *GroupDismissedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupDismissedTips.Unmarshal(m, b) +} +func (m *GroupDismissedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupDismissedTips.Marshal(b, m, deterministic) +} +func (dst *GroupDismissedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupDismissedTips.Merge(dst, src) +} +func (m *GroupDismissedTips) XXX_Size() int { + return xxx_messageInfo_GroupDismissedTips.Size(m) +} +func (m *GroupDismissedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupDismissedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupDismissedTips proto.InternalMessageInfo + +func (m *GroupDismissedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupDismissedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupDismissedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +type GroupMemberMutedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + OperationTime int64 `protobuf:"varint,3,opt,name=operationTime" json:"operationTime,omitempty"` + MutedUser *GroupMemberFullInfo `protobuf:"bytes,4,opt,name=mutedUser" json:"mutedUser,omitempty"` + MutedSeconds uint32 `protobuf:"varint,5,opt,name=mutedSeconds" json:"mutedSeconds,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupMemberMutedTips) Reset() { *m = GroupMemberMutedTips{} } +func (m *GroupMemberMutedTips) String() string { return proto.CompactTextString(m) } +func (*GroupMemberMutedTips) ProtoMessage() {} +func (*GroupMemberMutedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{31} +} +func (m *GroupMemberMutedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupMemberMutedTips.Unmarshal(m, b) +} +func (m *GroupMemberMutedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupMemberMutedTips.Marshal(b, m, deterministic) +} +func (dst *GroupMemberMutedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupMemberMutedTips.Merge(dst, src) +} +func (m *GroupMemberMutedTips) XXX_Size() int { + return xxx_messageInfo_GroupMemberMutedTips.Size(m) +} +func (m *GroupMemberMutedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupMemberMutedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupMemberMutedTips proto.InternalMessageInfo + +func (m *GroupMemberMutedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupMemberMutedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupMemberMutedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +func (m *GroupMemberMutedTips) GetMutedUser() *GroupMemberFullInfo { + if m != nil { + return m.MutedUser + } + return nil +} + +func (m *GroupMemberMutedTips) GetMutedSeconds() uint32 { + if m != nil { + return m.MutedSeconds + } + return 0 +} + +type GroupMemberCancelMutedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + OperationTime int64 `protobuf:"varint,3,opt,name=operationTime" json:"operationTime,omitempty"` + MutedUser *GroupMemberFullInfo `protobuf:"bytes,4,opt,name=mutedUser" json:"mutedUser,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupMemberCancelMutedTips) Reset() { *m = GroupMemberCancelMutedTips{} } +func (m *GroupMemberCancelMutedTips) String() string { return proto.CompactTextString(m) } +func (*GroupMemberCancelMutedTips) ProtoMessage() {} +func (*GroupMemberCancelMutedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{32} +} +func (m *GroupMemberCancelMutedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupMemberCancelMutedTips.Unmarshal(m, b) +} +func (m *GroupMemberCancelMutedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupMemberCancelMutedTips.Marshal(b, m, deterministic) +} +func (dst *GroupMemberCancelMutedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupMemberCancelMutedTips.Merge(dst, src) +} +func (m *GroupMemberCancelMutedTips) XXX_Size() int { + return xxx_messageInfo_GroupMemberCancelMutedTips.Size(m) +} +func (m *GroupMemberCancelMutedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupMemberCancelMutedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupMemberCancelMutedTips proto.InternalMessageInfo + +func (m *GroupMemberCancelMutedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupMemberCancelMutedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupMemberCancelMutedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +func (m *GroupMemberCancelMutedTips) GetMutedUser() *GroupMemberFullInfo { + if m != nil { + return m.MutedUser + } + return nil +} + +type GroupMutedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + OperationTime int64 `protobuf:"varint,3,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupMutedTips) Reset() { *m = GroupMutedTips{} } +func (m *GroupMutedTips) String() string { return proto.CompactTextString(m) } +func (*GroupMutedTips) ProtoMessage() {} +func (*GroupMutedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{33} +} +func (m *GroupMutedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupMutedTips.Unmarshal(m, b) +} +func (m *GroupMutedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupMutedTips.Marshal(b, m, deterministic) +} +func (dst *GroupMutedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupMutedTips.Merge(dst, src) +} +func (m *GroupMutedTips) XXX_Size() int { + return xxx_messageInfo_GroupMutedTips.Size(m) +} +func (m *GroupMutedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupMutedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupMutedTips proto.InternalMessageInfo + +func (m *GroupMutedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupMutedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupMutedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +type GroupCancelMutedTips struct { + Group *GroupInfo `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"` + OpUser *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=opUser" json:"opUser,omitempty"` + OperationTime int64 `protobuf:"varint,3,opt,name=operationTime" json:"operationTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupCancelMutedTips) Reset() { *m = GroupCancelMutedTips{} } +func (m *GroupCancelMutedTips) String() string { return proto.CompactTextString(m) } +func (*GroupCancelMutedTips) ProtoMessage() {} +func (*GroupCancelMutedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{34} +} +func (m *GroupCancelMutedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupCancelMutedTips.Unmarshal(m, b) +} +func (m *GroupCancelMutedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupCancelMutedTips.Marshal(b, m, deterministic) +} +func (dst *GroupCancelMutedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupCancelMutedTips.Merge(dst, src) +} +func (m *GroupCancelMutedTips) XXX_Size() int { + return xxx_messageInfo_GroupCancelMutedTips.Size(m) +} +func (m *GroupCancelMutedTips) XXX_DiscardUnknown() { + xxx_messageInfo_GroupCancelMutedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupCancelMutedTips proto.InternalMessageInfo + +func (m *GroupCancelMutedTips) GetGroup() *GroupInfo { + if m != nil { + return m.Group + } + return nil +} + +func (m *GroupCancelMutedTips) GetOpUser() *GroupMemberFullInfo { + if m != nil { + return m.OpUser + } + return nil +} + +func (m *GroupCancelMutedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +type FriendApplication struct { + AddTime int64 `protobuf:"varint,1,opt,name=addTime" json:"addTime,omitempty"` + AddSource string `protobuf:"bytes,2,opt,name=addSource" json:"addSource,omitempty"` + AddWording string `protobuf:"bytes,3,opt,name=addWording" json:"addWording,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendApplication) Reset() { *m = FriendApplication{} } +func (m *FriendApplication) String() string { return proto.CompactTextString(m) } +func (*FriendApplication) ProtoMessage() {} +func (*FriendApplication) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{35} +} +func (m *FriendApplication) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendApplication.Unmarshal(m, b) +} +func (m *FriendApplication) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendApplication.Marshal(b, m, deterministic) +} +func (dst *FriendApplication) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendApplication.Merge(dst, src) +} +func (m *FriendApplication) XXX_Size() int { + return xxx_messageInfo_FriendApplication.Size(m) +} +func (m *FriendApplication) XXX_DiscardUnknown() { + xxx_messageInfo_FriendApplication.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendApplication proto.InternalMessageInfo + +func (m *FriendApplication) GetAddTime() int64 { + if m != nil { + return m.AddTime + } + return 0 +} + +func (m *FriendApplication) GetAddSource() string { + if m != nil { + return m.AddSource + } + return "" +} + +func (m *FriendApplication) GetAddWording() string { + if m != nil { + return m.AddWording + } + return "" +} + +type FromToUserID struct { + FromUserID string `protobuf:"bytes,1,opt,name=fromUserID" json:"fromUserID,omitempty"` + ToUserID string `protobuf:"bytes,2,opt,name=toUserID" json:"toUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FromToUserID) Reset() { *m = FromToUserID{} } +func (m *FromToUserID) String() string { return proto.CompactTextString(m) } +func (*FromToUserID) ProtoMessage() {} +func (*FromToUserID) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{36} +} +func (m *FromToUserID) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FromToUserID.Unmarshal(m, b) +} +func (m *FromToUserID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FromToUserID.Marshal(b, m, deterministic) +} +func (dst *FromToUserID) XXX_Merge(src proto.Message) { + xxx_messageInfo_FromToUserID.Merge(dst, src) +} +func (m *FromToUserID) XXX_Size() int { + return xxx_messageInfo_FromToUserID.Size(m) +} +func (m *FromToUserID) XXX_DiscardUnknown() { + xxx_messageInfo_FromToUserID.DiscardUnknown(m) +} + +var xxx_messageInfo_FromToUserID proto.InternalMessageInfo + +func (m *FromToUserID) GetFromUserID() string { + if m != nil { + return m.FromUserID + } + return "" +} + +func (m *FromToUserID) GetToUserID() string { + if m != nil { + return m.ToUserID + } + return "" +} + +// FromUserID apply to add ToUserID +type FriendApplicationTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendApplicationTips) Reset() { *m = FriendApplicationTips{} } +func (m *FriendApplicationTips) String() string { return proto.CompactTextString(m) } +func (*FriendApplicationTips) ProtoMessage() {} +func (*FriendApplicationTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{37} +} +func (m *FriendApplicationTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendApplicationTips.Unmarshal(m, b) +} +func (m *FriendApplicationTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendApplicationTips.Marshal(b, m, deterministic) +} +func (dst *FriendApplicationTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendApplicationTips.Merge(dst, src) +} +func (m *FriendApplicationTips) XXX_Size() int { + return xxx_messageInfo_FriendApplicationTips.Size(m) +} +func (m *FriendApplicationTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendApplicationTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendApplicationTips proto.InternalMessageInfo + +func (m *FriendApplicationTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +// FromUserID accept or reject ToUserID +type FriendApplicationApprovedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + HandleMsg string `protobuf:"bytes,2,opt,name=handleMsg" json:"handleMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendApplicationApprovedTips) Reset() { *m = FriendApplicationApprovedTips{} } +func (m *FriendApplicationApprovedTips) String() string { return proto.CompactTextString(m) } +func (*FriendApplicationApprovedTips) ProtoMessage() {} +func (*FriendApplicationApprovedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{38} +} +func (m *FriendApplicationApprovedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendApplicationApprovedTips.Unmarshal(m, b) +} +func (m *FriendApplicationApprovedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendApplicationApprovedTips.Marshal(b, m, deterministic) +} +func (dst *FriendApplicationApprovedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendApplicationApprovedTips.Merge(dst, src) +} +func (m *FriendApplicationApprovedTips) XXX_Size() int { + return xxx_messageInfo_FriendApplicationApprovedTips.Size(m) +} +func (m *FriendApplicationApprovedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendApplicationApprovedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendApplicationApprovedTips proto.InternalMessageInfo + +func (m *FriendApplicationApprovedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +func (m *FriendApplicationApprovedTips) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +// FromUserID accept or reject ToUserID +type FriendApplicationRejectedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + HandleMsg string `protobuf:"bytes,2,opt,name=handleMsg" json:"handleMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendApplicationRejectedTips) Reset() { *m = FriendApplicationRejectedTips{} } +func (m *FriendApplicationRejectedTips) String() string { return proto.CompactTextString(m) } +func (*FriendApplicationRejectedTips) ProtoMessage() {} +func (*FriendApplicationRejectedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{39} +} +func (m *FriendApplicationRejectedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendApplicationRejectedTips.Unmarshal(m, b) +} +func (m *FriendApplicationRejectedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendApplicationRejectedTips.Marshal(b, m, deterministic) +} +func (dst *FriendApplicationRejectedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendApplicationRejectedTips.Merge(dst, src) +} +func (m *FriendApplicationRejectedTips) XXX_Size() int { + return xxx_messageInfo_FriendApplicationRejectedTips.Size(m) +} +func (m *FriendApplicationRejectedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendApplicationRejectedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendApplicationRejectedTips proto.InternalMessageInfo + +func (m *FriendApplicationRejectedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +func (m *FriendApplicationRejectedTips) GetHandleMsg() string { + if m != nil { + return m.HandleMsg + } + return "" +} + +// FromUserID Added a friend ToUserID +type FriendAddedTips struct { + Friend *FriendInfo `protobuf:"bytes,1,opt,name=friend" json:"friend,omitempty"` + OperationTime int64 `protobuf:"varint,2,opt,name=operationTime" json:"operationTime,omitempty"` + OpUser *PublicUserInfo `protobuf:"bytes,3,opt,name=opUser" json:"opUser,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendAddedTips) Reset() { *m = FriendAddedTips{} } +func (m *FriendAddedTips) String() string { return proto.CompactTextString(m) } +func (*FriendAddedTips) ProtoMessage() {} +func (*FriendAddedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{40} +} +func (m *FriendAddedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendAddedTips.Unmarshal(m, b) +} +func (m *FriendAddedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendAddedTips.Marshal(b, m, deterministic) +} +func (dst *FriendAddedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendAddedTips.Merge(dst, src) +} +func (m *FriendAddedTips) XXX_Size() int { + return xxx_messageInfo_FriendAddedTips.Size(m) +} +func (m *FriendAddedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendAddedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendAddedTips proto.InternalMessageInfo + +func (m *FriendAddedTips) GetFriend() *FriendInfo { + if m != nil { + return m.Friend + } + return nil +} + +func (m *FriendAddedTips) GetOperationTime() int64 { + if m != nil { + return m.OperationTime + } + return 0 +} + +func (m *FriendAddedTips) GetOpUser() *PublicUserInfo { + if m != nil { + return m.OpUser + } + return nil +} + +// FromUserID deleted a friend ToUserID +type FriendDeletedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendDeletedTips) Reset() { *m = FriendDeletedTips{} } +func (m *FriendDeletedTips) String() string { return proto.CompactTextString(m) } +func (*FriendDeletedTips) ProtoMessage() {} +func (*FriendDeletedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{41} +} +func (m *FriendDeletedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendDeletedTips.Unmarshal(m, b) +} +func (m *FriendDeletedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendDeletedTips.Marshal(b, m, deterministic) +} +func (dst *FriendDeletedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendDeletedTips.Merge(dst, src) +} +func (m *FriendDeletedTips) XXX_Size() int { + return xxx_messageInfo_FriendDeletedTips.Size(m) +} +func (m *FriendDeletedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendDeletedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendDeletedTips proto.InternalMessageInfo + +func (m *FriendDeletedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +type BlackAddedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlackAddedTips) Reset() { *m = BlackAddedTips{} } +func (m *BlackAddedTips) String() string { return proto.CompactTextString(m) } +func (*BlackAddedTips) ProtoMessage() {} +func (*BlackAddedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{42} +} +func (m *BlackAddedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlackAddedTips.Unmarshal(m, b) +} +func (m *BlackAddedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlackAddedTips.Marshal(b, m, deterministic) +} +func (dst *BlackAddedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlackAddedTips.Merge(dst, src) +} +func (m *BlackAddedTips) XXX_Size() int { + return xxx_messageInfo_BlackAddedTips.Size(m) +} +func (m *BlackAddedTips) XXX_DiscardUnknown() { + xxx_messageInfo_BlackAddedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_BlackAddedTips proto.InternalMessageInfo + +func (m *BlackAddedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +type BlackDeletedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlackDeletedTips) Reset() { *m = BlackDeletedTips{} } +func (m *BlackDeletedTips) String() string { return proto.CompactTextString(m) } +func (*BlackDeletedTips) ProtoMessage() {} +func (*BlackDeletedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{43} +} +func (m *BlackDeletedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlackDeletedTips.Unmarshal(m, b) +} +func (m *BlackDeletedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlackDeletedTips.Marshal(b, m, deterministic) +} +func (dst *BlackDeletedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlackDeletedTips.Merge(dst, src) +} +func (m *BlackDeletedTips) XXX_Size() int { + return xxx_messageInfo_BlackDeletedTips.Size(m) +} +func (m *BlackDeletedTips) XXX_DiscardUnknown() { + xxx_messageInfo_BlackDeletedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_BlackDeletedTips proto.InternalMessageInfo + +func (m *BlackDeletedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +type FriendInfoChangedTips struct { + FromToUserID *FromToUserID `protobuf:"bytes,1,opt,name=fromToUserID" json:"fromToUserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FriendInfoChangedTips) Reset() { *m = FriendInfoChangedTips{} } +func (m *FriendInfoChangedTips) String() string { return proto.CompactTextString(m) } +func (*FriendInfoChangedTips) ProtoMessage() {} +func (*FriendInfoChangedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{44} +} +func (m *FriendInfoChangedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FriendInfoChangedTips.Unmarshal(m, b) +} +func (m *FriendInfoChangedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FriendInfoChangedTips.Marshal(b, m, deterministic) +} +func (dst *FriendInfoChangedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_FriendInfoChangedTips.Merge(dst, src) +} +func (m *FriendInfoChangedTips) XXX_Size() int { + return xxx_messageInfo_FriendInfoChangedTips.Size(m) +} +func (m *FriendInfoChangedTips) XXX_DiscardUnknown() { + xxx_messageInfo_FriendInfoChangedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_FriendInfoChangedTips proto.InternalMessageInfo + +func (m *FriendInfoChangedTips) GetFromToUserID() *FromToUserID { + if m != nil { + return m.FromToUserID + } + return nil +} + +// ////////////////////user///////////////////// +type UserInfoUpdatedTips struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserInfoUpdatedTips) Reset() { *m = UserInfoUpdatedTips{} } +func (m *UserInfoUpdatedTips) String() string { return proto.CompactTextString(m) } +func (*UserInfoUpdatedTips) ProtoMessage() {} +func (*UserInfoUpdatedTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{45} +} +func (m *UserInfoUpdatedTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserInfoUpdatedTips.Unmarshal(m, b) +} +func (m *UserInfoUpdatedTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserInfoUpdatedTips.Marshal(b, m, deterministic) +} +func (dst *UserInfoUpdatedTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserInfoUpdatedTips.Merge(dst, src) +} +func (m *UserInfoUpdatedTips) XXX_Size() int { + return xxx_messageInfo_UserInfoUpdatedTips.Size(m) +} +func (m *UserInfoUpdatedTips) XXX_DiscardUnknown() { + xxx_messageInfo_UserInfoUpdatedTips.DiscardUnknown(m) +} + +var xxx_messageInfo_UserInfoUpdatedTips proto.InternalMessageInfo + +func (m *UserInfoUpdatedTips) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +// ////////////////////conversation///////////////////// +type ConversationUpdateTips struct { + UserID string `protobuf:"bytes,1,opt,name=UserID" json:"UserID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConversationUpdateTips) Reset() { *m = ConversationUpdateTips{} } +func (m *ConversationUpdateTips) String() string { return proto.CompactTextString(m) } +func (*ConversationUpdateTips) ProtoMessage() {} +func (*ConversationUpdateTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{46} +} +func (m *ConversationUpdateTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConversationUpdateTips.Unmarshal(m, b) +} +func (m *ConversationUpdateTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConversationUpdateTips.Marshal(b, m, deterministic) +} +func (dst *ConversationUpdateTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConversationUpdateTips.Merge(dst, src) +} +func (m *ConversationUpdateTips) XXX_Size() int { + return xxx_messageInfo_ConversationUpdateTips.Size(m) +} +func (m *ConversationUpdateTips) XXX_DiscardUnknown() { + xxx_messageInfo_ConversationUpdateTips.DiscardUnknown(m) +} + +var xxx_messageInfo_ConversationUpdateTips proto.InternalMessageInfo + +func (m *ConversationUpdateTips) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +type ConversationSetPrivateTips struct { + RecvID string `protobuf:"bytes,1,opt,name=recvID" json:"recvID,omitempty"` + SendID string `protobuf:"bytes,2,opt,name=sendID" json:"sendID,omitempty"` + IsPrivate bool `protobuf:"varint,3,opt,name=isPrivate" json:"isPrivate,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConversationSetPrivateTips) Reset() { *m = ConversationSetPrivateTips{} } +func (m *ConversationSetPrivateTips) String() string { return proto.CompactTextString(m) } +func (*ConversationSetPrivateTips) ProtoMessage() {} +func (*ConversationSetPrivateTips) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{47} +} +func (m *ConversationSetPrivateTips) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ConversationSetPrivateTips.Unmarshal(m, b) +} +func (m *ConversationSetPrivateTips) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ConversationSetPrivateTips.Marshal(b, m, deterministic) +} +func (dst *ConversationSetPrivateTips) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConversationSetPrivateTips.Merge(dst, src) +} +func (m *ConversationSetPrivateTips) XXX_Size() int { + return xxx_messageInfo_ConversationSetPrivateTips.Size(m) +} +func (m *ConversationSetPrivateTips) XXX_DiscardUnknown() { + xxx_messageInfo_ConversationSetPrivateTips.DiscardUnknown(m) +} + +var xxx_messageInfo_ConversationSetPrivateTips proto.InternalMessageInfo + +func (m *ConversationSetPrivateTips) GetRecvID() string { + if m != nil { + return m.RecvID + } + return "" +} + +func (m *ConversationSetPrivateTips) GetSendID() string { + if m != nil { + return m.SendID + } + return "" +} + +func (m *ConversationSetPrivateTips) GetIsPrivate() bool { + if m != nil { + return m.IsPrivate + } + return false +} + +// /cms +type RequestPagination struct { + PageNumber int32 `protobuf:"varint,1,opt,name=pageNumber" json:"pageNumber,omitempty"` + ShowNumber int32 `protobuf:"varint,2,opt,name=showNumber" json:"showNumber,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RequestPagination) Reset() { *m = RequestPagination{} } +func (m *RequestPagination) String() string { return proto.CompactTextString(m) } +func (*RequestPagination) ProtoMessage() {} +func (*RequestPagination) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{48} +} +func (m *RequestPagination) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RequestPagination.Unmarshal(m, b) +} +func (m *RequestPagination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RequestPagination.Marshal(b, m, deterministic) +} +func (dst *RequestPagination) XXX_Merge(src proto.Message) { + xxx_messageInfo_RequestPagination.Merge(dst, src) +} +func (m *RequestPagination) XXX_Size() int { + return xxx_messageInfo_RequestPagination.Size(m) +} +func (m *RequestPagination) XXX_DiscardUnknown() { + xxx_messageInfo_RequestPagination.DiscardUnknown(m) +} + +var xxx_messageInfo_RequestPagination proto.InternalMessageInfo + +func (m *RequestPagination) GetPageNumber() int32 { + if m != nil { + return m.PageNumber + } + return 0 +} + +func (m *RequestPagination) GetShowNumber() int32 { + if m != nil { + return m.ShowNumber + } + return 0 +} + +type ResponsePagination struct { + CurrentPage int32 `protobuf:"varint,5,opt,name=CurrentPage" json:"CurrentPage,omitempty"` + ShowNumber int32 `protobuf:"varint,6,opt,name=ShowNumber" json:"ShowNumber,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResponsePagination) Reset() { *m = ResponsePagination{} } +func (m *ResponsePagination) String() string { return proto.CompactTextString(m) } +func (*ResponsePagination) ProtoMessage() {} +func (*ResponsePagination) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{49} +} +func (m *ResponsePagination) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ResponsePagination.Unmarshal(m, b) +} +func (m *ResponsePagination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ResponsePagination.Marshal(b, m, deterministic) +} +func (dst *ResponsePagination) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResponsePagination.Merge(dst, src) +} +func (m *ResponsePagination) XXX_Size() int { + return xxx_messageInfo_ResponsePagination.Size(m) +} +func (m *ResponsePagination) XXX_DiscardUnknown() { + xxx_messageInfo_ResponsePagination.DiscardUnknown(m) +} + +var xxx_messageInfo_ResponsePagination proto.InternalMessageInfo + +func (m *ResponsePagination) GetCurrentPage() int32 { + if m != nil { + return m.CurrentPage + } + return 0 +} + +func (m *ResponsePagination) GetShowNumber() int32 { + if m != nil { + return m.ShowNumber + } + return 0 +} + +// /////////////////signal////////////// +type SignalReq struct { + // Types that are valid to be assigned to Payload: + // *SignalReq_Invite + // *SignalReq_InviteInGroup + // *SignalReq_Cancel + // *SignalReq_Accept + // *SignalReq_HungUp + // *SignalReq_Reject + Payload isSignalReq_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalReq) Reset() { *m = SignalReq{} } +func (m *SignalReq) String() string { return proto.CompactTextString(m) } +func (*SignalReq) ProtoMessage() {} +func (*SignalReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{50} +} +func (m *SignalReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalReq.Unmarshal(m, b) +} +func (m *SignalReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalReq.Marshal(b, m, deterministic) +} +func (dst *SignalReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalReq.Merge(dst, src) +} +func (m *SignalReq) XXX_Size() int { + return xxx_messageInfo_SignalReq.Size(m) +} +func (m *SignalReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalReq proto.InternalMessageInfo + +type isSignalReq_Payload interface { + isSignalReq_Payload() +} + +type SignalReq_Invite struct { + Invite *SignalInviteReq `protobuf:"bytes,1,opt,name=invite,oneof"` +} +type SignalReq_InviteInGroup struct { + InviteInGroup *SignalInviteInGroupReq `protobuf:"bytes,2,opt,name=inviteInGroup,oneof"` +} +type SignalReq_Cancel struct { + Cancel *SignalCancelReq `protobuf:"bytes,3,opt,name=cancel,oneof"` +} +type SignalReq_Accept struct { + Accept *SignalAcceptReq `protobuf:"bytes,4,opt,name=accept,oneof"` +} +type SignalReq_HungUp struct { + HungUp *SignalHungUpReq `protobuf:"bytes,5,opt,name=hungUp,oneof"` +} +type SignalReq_Reject struct { + Reject *SignalRejectReq `protobuf:"bytes,6,opt,name=reject,oneof"` +} + +func (*SignalReq_Invite) isSignalReq_Payload() {} +func (*SignalReq_InviteInGroup) isSignalReq_Payload() {} +func (*SignalReq_Cancel) isSignalReq_Payload() {} +func (*SignalReq_Accept) isSignalReq_Payload() {} +func (*SignalReq_HungUp) isSignalReq_Payload() {} +func (*SignalReq_Reject) isSignalReq_Payload() {} + +func (m *SignalReq) GetPayload() isSignalReq_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *SignalReq) GetInvite() *SignalInviteReq { + if x, ok := m.GetPayload().(*SignalReq_Invite); ok { + return x.Invite + } + return nil +} + +func (m *SignalReq) GetInviteInGroup() *SignalInviteInGroupReq { + if x, ok := m.GetPayload().(*SignalReq_InviteInGroup); ok { + return x.InviteInGroup + } + return nil +} + +func (m *SignalReq) GetCancel() *SignalCancelReq { + if x, ok := m.GetPayload().(*SignalReq_Cancel); ok { + return x.Cancel + } + return nil +} + +func (m *SignalReq) GetAccept() *SignalAcceptReq { + if x, ok := m.GetPayload().(*SignalReq_Accept); ok { + return x.Accept + } + return nil +} + +func (m *SignalReq) GetHungUp() *SignalHungUpReq { + if x, ok := m.GetPayload().(*SignalReq_HungUp); ok { + return x.HungUp + } + return nil +} + +func (m *SignalReq) GetReject() *SignalRejectReq { + if x, ok := m.GetPayload().(*SignalReq_Reject); ok { + return x.Reject + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SignalReq) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SignalReq_OneofMarshaler, _SignalReq_OneofUnmarshaler, _SignalReq_OneofSizer, []interface{}{ + (*SignalReq_Invite)(nil), + (*SignalReq_InviteInGroup)(nil), + (*SignalReq_Cancel)(nil), + (*SignalReq_Accept)(nil), + (*SignalReq_HungUp)(nil), + (*SignalReq_Reject)(nil), + } +} + +func _SignalReq_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SignalReq) + // payload + switch x := m.Payload.(type) { + case *SignalReq_Invite: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Invite); err != nil { + return err + } + case *SignalReq_InviteInGroup: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InviteInGroup); err != nil { + return err + } + case *SignalReq_Cancel: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Cancel); err != nil { + return err + } + case *SignalReq_Accept: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Accept); err != nil { + return err + } + case *SignalReq_HungUp: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.HungUp); err != nil { + return err + } + case *SignalReq_Reject: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Reject); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SignalReq.Payload has unexpected type %T", x) + } + return nil +} + +func _SignalReq_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SignalReq) + switch tag { + case 1: // payload.invite + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalInviteReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_Invite{msg} + return true, err + case 2: // payload.inviteInGroup + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalInviteInGroupReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_InviteInGroup{msg} + return true, err + case 3: // payload.cancel + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalCancelReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_Cancel{msg} + return true, err + case 4: // payload.accept + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalAcceptReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_Accept{msg} + return true, err + case 5: // payload.hungUp + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalHungUpReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_HungUp{msg} + return true, err + case 6: // payload.reject + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalRejectReq) + err := b.DecodeMessage(msg) + m.Payload = &SignalReq_Reject{msg} + return true, err + default: + return false, nil + } +} + +func _SignalReq_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SignalReq) + // payload + switch x := m.Payload.(type) { + case *SignalReq_Invite: + s := proto.Size(x.Invite) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_InviteInGroup: + s := proto.Size(x.InviteInGroup) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_Cancel: + s := proto.Size(x.Cancel) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_Accept: + s := proto.Size(x.Accept) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_HungUp: + s := proto.Size(x.HungUp) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalReq_Reject: + s := proto.Size(x.Reject) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type SignalResp struct { + // Types that are valid to be assigned to Payload: + // *SignalResp_Invite + // *SignalResp_InviteInGroup + // *SignalResp_Cancel + // *SignalResp_Accept + // *SignalResp_HungUp + // *SignalResp_Reject + Payload isSignalResp_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalResp) Reset() { *m = SignalResp{} } +func (m *SignalResp) String() string { return proto.CompactTextString(m) } +func (*SignalResp) ProtoMessage() {} +func (*SignalResp) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{51} +} +func (m *SignalResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalResp.Unmarshal(m, b) +} +func (m *SignalResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalResp.Marshal(b, m, deterministic) +} +func (dst *SignalResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalResp.Merge(dst, src) +} +func (m *SignalResp) XXX_Size() int { + return xxx_messageInfo_SignalResp.Size(m) +} +func (m *SignalResp) XXX_DiscardUnknown() { + xxx_messageInfo_SignalResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalResp proto.InternalMessageInfo + +type isSignalResp_Payload interface { + isSignalResp_Payload() +} + +type SignalResp_Invite struct { + Invite *SignalInviteReply `protobuf:"bytes,1,opt,name=invite,oneof"` +} +type SignalResp_InviteInGroup struct { + InviteInGroup *SignalInviteInGroupReply `protobuf:"bytes,2,opt,name=inviteInGroup,oneof"` +} +type SignalResp_Cancel struct { + Cancel *SignalCancelReply `protobuf:"bytes,3,opt,name=cancel,oneof"` +} +type SignalResp_Accept struct { + Accept *SignalAcceptReply `protobuf:"bytes,4,opt,name=accept,oneof"` +} +type SignalResp_HungUp struct { + HungUp *SignalHungUpReply `protobuf:"bytes,5,opt,name=hungUp,oneof"` +} +type SignalResp_Reject struct { + Reject *SignalRejectReply `protobuf:"bytes,6,opt,name=reject,oneof"` +} + +func (*SignalResp_Invite) isSignalResp_Payload() {} +func (*SignalResp_InviteInGroup) isSignalResp_Payload() {} +func (*SignalResp_Cancel) isSignalResp_Payload() {} +func (*SignalResp_Accept) isSignalResp_Payload() {} +func (*SignalResp_HungUp) isSignalResp_Payload() {} +func (*SignalResp_Reject) isSignalResp_Payload() {} + +func (m *SignalResp) GetPayload() isSignalResp_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *SignalResp) GetInvite() *SignalInviteReply { + if x, ok := m.GetPayload().(*SignalResp_Invite); ok { + return x.Invite + } + return nil +} + +func (m *SignalResp) GetInviteInGroup() *SignalInviteInGroupReply { + if x, ok := m.GetPayload().(*SignalResp_InviteInGroup); ok { + return x.InviteInGroup + } + return nil +} + +func (m *SignalResp) GetCancel() *SignalCancelReply { + if x, ok := m.GetPayload().(*SignalResp_Cancel); ok { + return x.Cancel + } + return nil +} + +func (m *SignalResp) GetAccept() *SignalAcceptReply { + if x, ok := m.GetPayload().(*SignalResp_Accept); ok { + return x.Accept + } + return nil +} + +func (m *SignalResp) GetHungUp() *SignalHungUpReply { + if x, ok := m.GetPayload().(*SignalResp_HungUp); ok { + return x.HungUp + } + return nil +} + +func (m *SignalResp) GetReject() *SignalRejectReply { + if x, ok := m.GetPayload().(*SignalResp_Reject); ok { + return x.Reject + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*SignalResp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _SignalResp_OneofMarshaler, _SignalResp_OneofUnmarshaler, _SignalResp_OneofSizer, []interface{}{ + (*SignalResp_Invite)(nil), + (*SignalResp_InviteInGroup)(nil), + (*SignalResp_Cancel)(nil), + (*SignalResp_Accept)(nil), + (*SignalResp_HungUp)(nil), + (*SignalResp_Reject)(nil), + } +} + +func _SignalResp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*SignalResp) + // payload + switch x := m.Payload.(type) { + case *SignalResp_Invite: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Invite); err != nil { + return err + } + case *SignalResp_InviteInGroup: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.InviteInGroup); err != nil { + return err + } + case *SignalResp_Cancel: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Cancel); err != nil { + return err + } + case *SignalResp_Accept: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Accept); err != nil { + return err + } + case *SignalResp_HungUp: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.HungUp); err != nil { + return err + } + case *SignalResp_Reject: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Reject); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("SignalResp.Payload has unexpected type %T", x) + } + return nil +} + +func _SignalResp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*SignalResp) + switch tag { + case 1: // payload.invite + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalInviteReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_Invite{msg} + return true, err + case 2: // payload.inviteInGroup + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalInviteInGroupReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_InviteInGroup{msg} + return true, err + case 3: // payload.cancel + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalCancelReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_Cancel{msg} + return true, err + case 4: // payload.accept + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalAcceptReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_Accept{msg} + return true, err + case 5: // payload.hungUp + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalHungUpReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_HungUp{msg} + return true, err + case 6: // payload.reject + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SignalRejectReply) + err := b.DecodeMessage(msg) + m.Payload = &SignalResp_Reject{msg} + return true, err + default: + return false, nil + } +} + +func _SignalResp_OneofSizer(msg proto.Message) (n int) { + m := msg.(*SignalResp) + // payload + switch x := m.Payload.(type) { + case *SignalResp_Invite: + s := proto.Size(x.Invite) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_InviteInGroup: + s := proto.Size(x.InviteInGroup) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_Cancel: + s := proto.Size(x.Cancel) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_Accept: + s := proto.Size(x.Accept) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_HungUp: + s := proto.Size(x.HungUp) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *SignalResp_Reject: + s := proto.Size(x.Reject) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type InvitationInfo struct { + InviterUserID string `protobuf:"bytes,1,opt,name=inviterUserID" json:"inviterUserID,omitempty"` + InviteeUserIDList []string `protobuf:"bytes,2,rep,name=inviteeUserIDList" json:"inviteeUserIDList,omitempty"` + CustomData string `protobuf:"bytes,3,opt,name=customData" json:"customData,omitempty"` + GroupID string `protobuf:"bytes,4,opt,name=groupID" json:"groupID,omitempty"` + RoomID string `protobuf:"bytes,5,opt,name=roomID" json:"roomID,omitempty"` + Timeout int32 `protobuf:"varint,6,opt,name=timeout" json:"timeout,omitempty"` + MediaType string `protobuf:"bytes,7,opt,name=mediaType" json:"mediaType,omitempty"` + PlatformID int32 `protobuf:"varint,8,opt,name=platformID" json:"platformID,omitempty"` + SessionType int32 `protobuf:"varint,9,opt,name=sessionType" json:"sessionType,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InvitationInfo) Reset() { *m = InvitationInfo{} } +func (m *InvitationInfo) String() string { return proto.CompactTextString(m) } +func (*InvitationInfo) ProtoMessage() {} +func (*InvitationInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{52} +} +func (m *InvitationInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InvitationInfo.Unmarshal(m, b) +} +func (m *InvitationInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InvitationInfo.Marshal(b, m, deterministic) +} +func (dst *InvitationInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_InvitationInfo.Merge(dst, src) +} +func (m *InvitationInfo) XXX_Size() int { + return xxx_messageInfo_InvitationInfo.Size(m) +} +func (m *InvitationInfo) XXX_DiscardUnknown() { + xxx_messageInfo_InvitationInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_InvitationInfo proto.InternalMessageInfo + +func (m *InvitationInfo) GetInviterUserID() string { + if m != nil { + return m.InviterUserID + } + return "" +} + +func (m *InvitationInfo) GetInviteeUserIDList() []string { + if m != nil { + return m.InviteeUserIDList + } + return nil +} + +func (m *InvitationInfo) GetCustomData() string { + if m != nil { + return m.CustomData + } + return "" +} + +func (m *InvitationInfo) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *InvitationInfo) GetRoomID() string { + if m != nil { + return m.RoomID + } + return "" +} + +func (m *InvitationInfo) GetTimeout() int32 { + if m != nil { + return m.Timeout + } + return 0 +} + +func (m *InvitationInfo) GetMediaType() string { + if m != nil { + return m.MediaType + } + return "" +} + +func (m *InvitationInfo) GetPlatformID() int32 { + if m != nil { + return m.PlatformID + } + return 0 +} + +func (m *InvitationInfo) GetSessionType() int32 { + if m != nil { + return m.SessionType + } + return 0 +} + +type ParticipantMetaData struct { + GroupInfo *GroupInfo `protobuf:"bytes,1,opt,name=groupInfo" json:"groupInfo,omitempty"` + GroupMemberInfo *GroupMemberFullInfo `protobuf:"bytes,2,opt,name=groupMemberInfo" json:"groupMemberInfo,omitempty"` + UserInfo *PublicUserInfo `protobuf:"bytes,3,opt,name=userInfo" json:"userInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ParticipantMetaData) Reset() { *m = ParticipantMetaData{} } +func (m *ParticipantMetaData) String() string { return proto.CompactTextString(m) } +func (*ParticipantMetaData) ProtoMessage() {} +func (*ParticipantMetaData) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{53} +} +func (m *ParticipantMetaData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ParticipantMetaData.Unmarshal(m, b) +} +func (m *ParticipantMetaData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ParticipantMetaData.Marshal(b, m, deterministic) +} +func (dst *ParticipantMetaData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ParticipantMetaData.Merge(dst, src) +} +func (m *ParticipantMetaData) XXX_Size() int { + return xxx_messageInfo_ParticipantMetaData.Size(m) +} +func (m *ParticipantMetaData) XXX_DiscardUnknown() { + xxx_messageInfo_ParticipantMetaData.DiscardUnknown(m) +} + +var xxx_messageInfo_ParticipantMetaData proto.InternalMessageInfo + +func (m *ParticipantMetaData) GetGroupInfo() *GroupInfo { + if m != nil { + return m.GroupInfo + } + return nil +} + +func (m *ParticipantMetaData) GetGroupMemberInfo() *GroupMemberFullInfo { + if m != nil { + return m.GroupMemberInfo + } + return nil +} + +func (m *ParticipantMetaData) GetUserInfo() *PublicUserInfo { + if m != nil { + return m.UserInfo + } + return nil +} + +type SignalInviteReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalInviteReq) Reset() { *m = SignalInviteReq{} } +func (m *SignalInviteReq) String() string { return proto.CompactTextString(m) } +func (*SignalInviteReq) ProtoMessage() {} +func (*SignalInviteReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{54} +} +func (m *SignalInviteReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalInviteReq.Unmarshal(m, b) +} +func (m *SignalInviteReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalInviteReq.Marshal(b, m, deterministic) +} +func (dst *SignalInviteReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalInviteReq.Merge(dst, src) +} +func (m *SignalInviteReq) XXX_Size() int { + return xxx_messageInfo_SignalInviteReq.Size(m) +} +func (m *SignalInviteReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalInviteReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalInviteReq proto.InternalMessageInfo + +func (m *SignalInviteReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalInviteReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalInviteReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalInviteReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +type SignalInviteReply struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + RoomID string `protobuf:"bytes,2,opt,name=roomID" json:"roomID,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL" json:"liveURL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalInviteReply) Reset() { *m = SignalInviteReply{} } +func (m *SignalInviteReply) String() string { return proto.CompactTextString(m) } +func (*SignalInviteReply) ProtoMessage() {} +func (*SignalInviteReply) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{55} +} +func (m *SignalInviteReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalInviteReply.Unmarshal(m, b) +} +func (m *SignalInviteReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalInviteReply.Marshal(b, m, deterministic) +} +func (dst *SignalInviteReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalInviteReply.Merge(dst, src) +} +func (m *SignalInviteReply) XXX_Size() int { + return xxx_messageInfo_SignalInviteReply.Size(m) +} +func (m *SignalInviteReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalInviteReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalInviteReply proto.InternalMessageInfo + +func (m *SignalInviteReply) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *SignalInviteReply) GetRoomID() string { + if m != nil { + return m.RoomID + } + return "" +} + +func (m *SignalInviteReply) GetLiveURL() string { + if m != nil { + return m.LiveURL + } + return "" +} + +type SignalInviteInGroupReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalInviteInGroupReq) Reset() { *m = SignalInviteInGroupReq{} } +func (m *SignalInviteInGroupReq) String() string { return proto.CompactTextString(m) } +func (*SignalInviteInGroupReq) ProtoMessage() {} +func (*SignalInviteInGroupReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{56} +} +func (m *SignalInviteInGroupReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalInviteInGroupReq.Unmarshal(m, b) +} +func (m *SignalInviteInGroupReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalInviteInGroupReq.Marshal(b, m, deterministic) +} +func (dst *SignalInviteInGroupReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalInviteInGroupReq.Merge(dst, src) +} +func (m *SignalInviteInGroupReq) XXX_Size() int { + return xxx_messageInfo_SignalInviteInGroupReq.Size(m) +} +func (m *SignalInviteInGroupReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalInviteInGroupReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalInviteInGroupReq proto.InternalMessageInfo + +func (m *SignalInviteInGroupReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalInviteInGroupReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalInviteInGroupReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalInviteInGroupReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +type SignalInviteInGroupReply struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + RoomID string `protobuf:"bytes,2,opt,name=roomID" json:"roomID,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL" json:"liveURL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalInviteInGroupReply) Reset() { *m = SignalInviteInGroupReply{} } +func (m *SignalInviteInGroupReply) String() string { return proto.CompactTextString(m) } +func (*SignalInviteInGroupReply) ProtoMessage() {} +func (*SignalInviteInGroupReply) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{57} +} +func (m *SignalInviteInGroupReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalInviteInGroupReply.Unmarshal(m, b) +} +func (m *SignalInviteInGroupReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalInviteInGroupReply.Marshal(b, m, deterministic) +} +func (dst *SignalInviteInGroupReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalInviteInGroupReply.Merge(dst, src) +} +func (m *SignalInviteInGroupReply) XXX_Size() int { + return xxx_messageInfo_SignalInviteInGroupReply.Size(m) +} +func (m *SignalInviteInGroupReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalInviteInGroupReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalInviteInGroupReply proto.InternalMessageInfo + +func (m *SignalInviteInGroupReply) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *SignalInviteInGroupReply) GetRoomID() string { + if m != nil { + return m.RoomID + } + return "" +} + +func (m *SignalInviteInGroupReply) GetLiveURL() string { + if m != nil { + return m.LiveURL + } + return "" +} + +type SignalCancelReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalCancelReq) Reset() { *m = SignalCancelReq{} } +func (m *SignalCancelReq) String() string { return proto.CompactTextString(m) } +func (*SignalCancelReq) ProtoMessage() {} +func (*SignalCancelReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{58} +} +func (m *SignalCancelReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalCancelReq.Unmarshal(m, b) +} +func (m *SignalCancelReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalCancelReq.Marshal(b, m, deterministic) +} +func (dst *SignalCancelReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalCancelReq.Merge(dst, src) +} +func (m *SignalCancelReq) XXX_Size() int { + return xxx_messageInfo_SignalCancelReq.Size(m) +} +func (m *SignalCancelReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalCancelReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalCancelReq proto.InternalMessageInfo + +func (m *SignalCancelReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalCancelReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalCancelReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalCancelReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +type SignalCancelReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalCancelReply) Reset() { *m = SignalCancelReply{} } +func (m *SignalCancelReply) String() string { return proto.CompactTextString(m) } +func (*SignalCancelReply) ProtoMessage() {} +func (*SignalCancelReply) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{59} +} +func (m *SignalCancelReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalCancelReply.Unmarshal(m, b) +} +func (m *SignalCancelReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalCancelReply.Marshal(b, m, deterministic) +} +func (dst *SignalCancelReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalCancelReply.Merge(dst, src) +} +func (m *SignalCancelReply) XXX_Size() int { + return xxx_messageInfo_SignalCancelReply.Size(m) +} +func (m *SignalCancelReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalCancelReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalCancelReply proto.InternalMessageInfo + +type SignalAcceptReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + OpUserPlatformID int32 `protobuf:"varint,5,opt,name=opUserPlatformID" json:"opUserPlatformID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalAcceptReq) Reset() { *m = SignalAcceptReq{} } +func (m *SignalAcceptReq) String() string { return proto.CompactTextString(m) } +func (*SignalAcceptReq) ProtoMessage() {} +func (*SignalAcceptReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{60} +} +func (m *SignalAcceptReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalAcceptReq.Unmarshal(m, b) +} +func (m *SignalAcceptReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalAcceptReq.Marshal(b, m, deterministic) +} +func (dst *SignalAcceptReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalAcceptReq.Merge(dst, src) +} +func (m *SignalAcceptReq) XXX_Size() int { + return xxx_messageInfo_SignalAcceptReq.Size(m) +} +func (m *SignalAcceptReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalAcceptReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalAcceptReq proto.InternalMessageInfo + +func (m *SignalAcceptReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalAcceptReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalAcceptReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalAcceptReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +func (m *SignalAcceptReq) GetOpUserPlatformID() int32 { + if m != nil { + return m.OpUserPlatformID + } + return 0 +} + +type SignalAcceptReply struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + RoomID string `protobuf:"bytes,2,opt,name=roomID" json:"roomID,omitempty"` + LiveURL string `protobuf:"bytes,3,opt,name=liveURL" json:"liveURL,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalAcceptReply) Reset() { *m = SignalAcceptReply{} } +func (m *SignalAcceptReply) String() string { return proto.CompactTextString(m) } +func (*SignalAcceptReply) ProtoMessage() {} +func (*SignalAcceptReply) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{61} +} +func (m *SignalAcceptReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalAcceptReply.Unmarshal(m, b) +} +func (m *SignalAcceptReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalAcceptReply.Marshal(b, m, deterministic) +} +func (dst *SignalAcceptReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalAcceptReply.Merge(dst, src) +} +func (m *SignalAcceptReply) XXX_Size() int { + return xxx_messageInfo_SignalAcceptReply.Size(m) +} +func (m *SignalAcceptReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalAcceptReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalAcceptReply proto.InternalMessageInfo + +func (m *SignalAcceptReply) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +func (m *SignalAcceptReply) GetRoomID() string { + if m != nil { + return m.RoomID + } + return "" +} + +func (m *SignalAcceptReply) GetLiveURL() string { + if m != nil { + return m.LiveURL + } + return "" +} + +type SignalHungUpReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalHungUpReq) Reset() { *m = SignalHungUpReq{} } +func (m *SignalHungUpReq) String() string { return proto.CompactTextString(m) } +func (*SignalHungUpReq) ProtoMessage() {} +func (*SignalHungUpReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{62} +} +func (m *SignalHungUpReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalHungUpReq.Unmarshal(m, b) +} +func (m *SignalHungUpReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalHungUpReq.Marshal(b, m, deterministic) +} +func (dst *SignalHungUpReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalHungUpReq.Merge(dst, src) +} +func (m *SignalHungUpReq) XXX_Size() int { + return xxx_messageInfo_SignalHungUpReq.Size(m) +} +func (m *SignalHungUpReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalHungUpReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalHungUpReq proto.InternalMessageInfo + +func (m *SignalHungUpReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalHungUpReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalHungUpReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +type SignalHungUpReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalHungUpReply) Reset() { *m = SignalHungUpReply{} } +func (m *SignalHungUpReply) String() string { return proto.CompactTextString(m) } +func (*SignalHungUpReply) ProtoMessage() {} +func (*SignalHungUpReply) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{63} +} +func (m *SignalHungUpReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalHungUpReply.Unmarshal(m, b) +} +func (m *SignalHungUpReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalHungUpReply.Marshal(b, m, deterministic) +} +func (dst *SignalHungUpReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalHungUpReply.Merge(dst, src) +} +func (m *SignalHungUpReply) XXX_Size() int { + return xxx_messageInfo_SignalHungUpReply.Size(m) +} +func (m *SignalHungUpReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalHungUpReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalHungUpReply proto.InternalMessageInfo + +type SignalRejectReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + Invitation *InvitationInfo `protobuf:"bytes,2,opt,name=invitation" json:"invitation,omitempty"` + OfflinePushInfo *OfflinePushInfo `protobuf:"bytes,3,opt,name=offlinePushInfo" json:"offlinePushInfo,omitempty"` + Participant *ParticipantMetaData `protobuf:"bytes,4,opt,name=participant" json:"participant,omitempty"` + OpUserPlatformID int32 `protobuf:"varint,5,opt,name=opUserPlatformID" json:"opUserPlatformID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalRejectReq) Reset() { *m = SignalRejectReq{} } +func (m *SignalRejectReq) String() string { return proto.CompactTextString(m) } +func (*SignalRejectReq) ProtoMessage() {} +func (*SignalRejectReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{64} +} +func (m *SignalRejectReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalRejectReq.Unmarshal(m, b) +} +func (m *SignalRejectReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalRejectReq.Marshal(b, m, deterministic) +} +func (dst *SignalRejectReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalRejectReq.Merge(dst, src) +} +func (m *SignalRejectReq) XXX_Size() int { + return xxx_messageInfo_SignalRejectReq.Size(m) +} +func (m *SignalRejectReq) XXX_DiscardUnknown() { + xxx_messageInfo_SignalRejectReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalRejectReq proto.InternalMessageInfo + +func (m *SignalRejectReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *SignalRejectReq) GetInvitation() *InvitationInfo { + if m != nil { + return m.Invitation + } + return nil +} + +func (m *SignalRejectReq) GetOfflinePushInfo() *OfflinePushInfo { + if m != nil { + return m.OfflinePushInfo + } + return nil +} + +func (m *SignalRejectReq) GetParticipant() *ParticipantMetaData { + if m != nil { + return m.Participant + } + return nil +} + +func (m *SignalRejectReq) GetOpUserPlatformID() int32 { + if m != nil { + return m.OpUserPlatformID + } + return 0 +} + +type SignalRejectReply struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignalRejectReply) Reset() { *m = SignalRejectReply{} } +func (m *SignalRejectReply) String() string { return proto.CompactTextString(m) } +func (*SignalRejectReply) ProtoMessage() {} +func (*SignalRejectReply) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{65} +} +func (m *SignalRejectReply) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignalRejectReply.Unmarshal(m, b) +} +func (m *SignalRejectReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignalRejectReply.Marshal(b, m, deterministic) +} +func (dst *SignalRejectReply) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignalRejectReply.Merge(dst, src) +} +func (m *SignalRejectReply) XXX_Size() int { + return xxx_messageInfo_SignalRejectReply.Size(m) +} +func (m *SignalRejectReply) XXX_DiscardUnknown() { + xxx_messageInfo_SignalRejectReply.DiscardUnknown(m) +} + +var xxx_messageInfo_SignalRejectReply proto.InternalMessageInfo + +type DelMsgListReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + SeqList []uint32 `protobuf:"varint,3,rep,packed,name=seqList" json:"seqList,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DelMsgListReq) Reset() { *m = DelMsgListReq{} } +func (m *DelMsgListReq) String() string { return proto.CompactTextString(m) } +func (*DelMsgListReq) ProtoMessage() {} +func (*DelMsgListReq) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{66} +} +func (m *DelMsgListReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DelMsgListReq.Unmarshal(m, b) +} +func (m *DelMsgListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DelMsgListReq.Marshal(b, m, deterministic) +} +func (dst *DelMsgListReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelMsgListReq.Merge(dst, src) +} +func (m *DelMsgListReq) XXX_Size() int { + return xxx_messageInfo_DelMsgListReq.Size(m) +} +func (m *DelMsgListReq) XXX_DiscardUnknown() { + xxx_messageInfo_DelMsgListReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DelMsgListReq proto.InternalMessageInfo + +func (m *DelMsgListReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *DelMsgListReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DelMsgListReq) GetSeqList() []uint32 { + if m != nil { + return m.SeqList + } + return nil +} + +func (m *DelMsgListReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type DelMsgListResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DelMsgListResp) Reset() { *m = DelMsgListResp{} } +func (m *DelMsgListResp) String() string { return proto.CompactTextString(m) } +func (*DelMsgListResp) ProtoMessage() {} +func (*DelMsgListResp) Descriptor() ([]byte, []int) { + return fileDescriptor_ws_822d08ca95807876, []int{67} +} +func (m *DelMsgListResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DelMsgListResp.Unmarshal(m, b) +} +func (m *DelMsgListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DelMsgListResp.Marshal(b, m, deterministic) +} +func (dst *DelMsgListResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelMsgListResp.Merge(dst, src) +} +func (m *DelMsgListResp) XXX_Size() int { + return xxx_messageInfo_DelMsgListResp.Size(m) +} +func (m *DelMsgListResp) XXX_DiscardUnknown() { + xxx_messageInfo_DelMsgListResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DelMsgListResp proto.InternalMessageInfo + +func (m *DelMsgListResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *DelMsgListResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +func init() { + proto.RegisterType((*GroupInfo)(nil), "server_api_params.GroupInfo") + proto.RegisterType((*GroupMemberFullInfo)(nil), "server_api_params.GroupMemberFullInfo") + proto.RegisterType((*PublicUserInfo)(nil), "server_api_params.PublicUserInfo") + proto.RegisterType((*UserInfo)(nil), "server_api_params.UserInfo") + proto.RegisterType((*FriendInfo)(nil), "server_api_params.FriendInfo") + proto.RegisterType((*BlackInfo)(nil), "server_api_params.BlackInfo") + proto.RegisterType((*GroupRequest)(nil), "server_api_params.GroupRequest") + proto.RegisterType((*FriendRequest)(nil), "server_api_params.FriendRequest") + proto.RegisterType((*Department)(nil), "server_api_params.Department") + proto.RegisterType((*OrganizationUser)(nil), "server_api_params.OrganizationUser") + proto.RegisterType((*DepartmentMember)(nil), "server_api_params.DepartmentMember") + proto.RegisterType((*UserInDepartment)(nil), "server_api_params.UserInDepartment") + proto.RegisterType((*PullMessageBySeqListResp)(nil), "server_api_params.PullMessageBySeqListResp") + proto.RegisterType((*PullMessageBySeqListReq)(nil), "server_api_params.PullMessageBySeqListReq") + proto.RegisterType((*GetMaxAndMinSeqReq)(nil), "server_api_params.GetMaxAndMinSeqReq") + proto.RegisterType((*GetMaxAndMinSeqResp)(nil), "server_api_params.GetMaxAndMinSeqResp") + proto.RegisterType((*UserSendMsgResp)(nil), "server_api_params.UserSendMsgResp") + proto.RegisterType((*MsgData)(nil), "server_api_params.MsgData") + proto.RegisterMapType((map[string]bool)(nil), "server_api_params.MsgData.OptionsEntry") + proto.RegisterType((*OfflinePushInfo)(nil), "server_api_params.OfflinePushInfo") + proto.RegisterType((*TipsComm)(nil), "server_api_params.TipsComm") + proto.RegisterType((*GroupCreatedTips)(nil), "server_api_params.GroupCreatedTips") + proto.RegisterType((*GroupInfoSetTips)(nil), "server_api_params.GroupInfoSetTips") + proto.RegisterType((*JoinGroupApplicationTips)(nil), "server_api_params.JoinGroupApplicationTips") + proto.RegisterType((*MemberQuitTips)(nil), "server_api_params.MemberQuitTips") + proto.RegisterType((*GroupApplicationAcceptedTips)(nil), "server_api_params.GroupApplicationAcceptedTips") + proto.RegisterType((*GroupApplicationRejectedTips)(nil), "server_api_params.GroupApplicationRejectedTips") + proto.RegisterType((*GroupOwnerTransferredTips)(nil), "server_api_params.GroupOwnerTransferredTips") + proto.RegisterType((*MemberKickedTips)(nil), "server_api_params.MemberKickedTips") + proto.RegisterType((*MemberInvitedTips)(nil), "server_api_params.MemberInvitedTips") + proto.RegisterType((*MemberEnterTips)(nil), "server_api_params.MemberEnterTips") + proto.RegisterType((*GroupDismissedTips)(nil), "server_api_params.GroupDismissedTips") + proto.RegisterType((*GroupMemberMutedTips)(nil), "server_api_params.GroupMemberMutedTips") + proto.RegisterType((*GroupMemberCancelMutedTips)(nil), "server_api_params.GroupMemberCancelMutedTips") + proto.RegisterType((*GroupMutedTips)(nil), "server_api_params.GroupMutedTips") + proto.RegisterType((*GroupCancelMutedTips)(nil), "server_api_params.GroupCancelMutedTips") + proto.RegisterType((*FriendApplication)(nil), "server_api_params.FriendApplication") + proto.RegisterType((*FromToUserID)(nil), "server_api_params.FromToUserID") + proto.RegisterType((*FriendApplicationTips)(nil), "server_api_params.FriendApplicationTips") + proto.RegisterType((*FriendApplicationApprovedTips)(nil), "server_api_params.FriendApplicationApprovedTips") + proto.RegisterType((*FriendApplicationRejectedTips)(nil), "server_api_params.FriendApplicationRejectedTips") + proto.RegisterType((*FriendAddedTips)(nil), "server_api_params.FriendAddedTips") + proto.RegisterType((*FriendDeletedTips)(nil), "server_api_params.FriendDeletedTips") + proto.RegisterType((*BlackAddedTips)(nil), "server_api_params.BlackAddedTips") + proto.RegisterType((*BlackDeletedTips)(nil), "server_api_params.BlackDeletedTips") + proto.RegisterType((*FriendInfoChangedTips)(nil), "server_api_params.FriendInfoChangedTips") + proto.RegisterType((*UserInfoUpdatedTips)(nil), "server_api_params.UserInfoUpdatedTips") + proto.RegisterType((*ConversationUpdateTips)(nil), "server_api_params.ConversationUpdateTips") + proto.RegisterType((*ConversationSetPrivateTips)(nil), "server_api_params.ConversationSetPrivateTips") + proto.RegisterType((*RequestPagination)(nil), "server_api_params.RequestPagination") + proto.RegisterType((*ResponsePagination)(nil), "server_api_params.ResponsePagination") + proto.RegisterType((*SignalReq)(nil), "server_api_params.SignalReq") + proto.RegisterType((*SignalResp)(nil), "server_api_params.SignalResp") + proto.RegisterType((*InvitationInfo)(nil), "server_api_params.InvitationInfo") + proto.RegisterType((*ParticipantMetaData)(nil), "server_api_params.ParticipantMetaData") + proto.RegisterType((*SignalInviteReq)(nil), "server_api_params.SignalInviteReq") + proto.RegisterType((*SignalInviteReply)(nil), "server_api_params.SignalInviteReply") + proto.RegisterType((*SignalInviteInGroupReq)(nil), "server_api_params.SignalInviteInGroupReq") + proto.RegisterType((*SignalInviteInGroupReply)(nil), "server_api_params.SignalInviteInGroupReply") + proto.RegisterType((*SignalCancelReq)(nil), "server_api_params.SignalCancelReq") + proto.RegisterType((*SignalCancelReply)(nil), "server_api_params.SignalCancelReply") + proto.RegisterType((*SignalAcceptReq)(nil), "server_api_params.SignalAcceptReq") + proto.RegisterType((*SignalAcceptReply)(nil), "server_api_params.SignalAcceptReply") + proto.RegisterType((*SignalHungUpReq)(nil), "server_api_params.SignalHungUpReq") + proto.RegisterType((*SignalHungUpReply)(nil), "server_api_params.SignalHungUpReply") + proto.RegisterType((*SignalRejectReq)(nil), "server_api_params.SignalRejectReq") + proto.RegisterType((*SignalRejectReply)(nil), "server_api_params.SignalRejectReply") + proto.RegisterType((*DelMsgListReq)(nil), "server_api_params.DelMsgListReq") + proto.RegisterType((*DelMsgListResp)(nil), "server_api_params.DelMsgListResp") +} + +func init() { proto.RegisterFile("sdk_ws/ws.proto", fileDescriptor_ws_822d08ca95807876) } + +var fileDescriptor_ws_822d08ca95807876 = []byte{ + // 2985 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x5b, 0xcd, 0x6f, 0x24, 0x47, + 0x15, 0xa7, 0x7b, 0x3c, 0x63, 0xcf, 0x1b, 0x8f, 0x3f, 0x7a, 0x17, 0x33, 0x98, 0xcd, 0x62, 0x1a, + 0x2b, 0x84, 0x00, 0x1b, 0x14, 0x84, 0x04, 0x09, 0x2c, 0xf2, 0xd7, 0x7e, 0x04, 0x8f, 0xed, 0xf4, + 0xec, 0x12, 0x04, 0x48, 0x51, 0x7b, 0xba, 0x3c, 0xee, 0xb8, 0xa7, 0xab, 0xa7, 0x3f, 0xbc, 0x6b, + 0x84, 0x84, 0x04, 0x12, 0xe2, 0xc6, 0x09, 0x0e, 0x5c, 0x90, 0xb8, 0x20, 0x50, 0x14, 0x45, 0x08, + 0x6e, 0x11, 0xe2, 0xc0, 0x3f, 0xc0, 0x11, 0x71, 0xe3, 0xcc, 0x95, 0x03, 0x12, 0x12, 0xa8, 0xea, + 0x55, 0x57, 0x57, 0x75, 0xcf, 0xd8, 0x13, 0xcb, 0xca, 0x6e, 0xb4, 0xdc, 0xfc, 0xde, 0xd4, 0x7b, + 0xf5, 0xea, 0xf7, 0x5e, 0xbd, 0xf7, 0xaa, 0xaa, 0x0d, 0x8b, 0x89, 0x77, 0xf2, 0xe6, 0xa3, 0xe4, + 0xa5, 0x47, 0xc9, 0xad, 0x28, 0xa6, 0x29, 0xb5, 0x96, 0x13, 0x12, 0x9f, 0x92, 0xf8, 0x4d, 0x37, + 0xf2, 0xdf, 0x8c, 0xdc, 0xd8, 0x1d, 0x26, 0xf6, 0xbf, 0x4c, 0x68, 0xde, 0x8d, 0x69, 0x16, 0xdd, + 0x0f, 0x8f, 0xa8, 0xd5, 0x81, 0xd9, 0x01, 0x27, 0xb6, 0x3b, 0xc6, 0x9a, 0xf1, 0x42, 0xd3, 0xc9, + 0x49, 0xeb, 0x06, 0x34, 0xf9, 0x9f, 0x7b, 0xee, 0x90, 0x74, 0x4c, 0xfe, 0x5b, 0xc1, 0xb0, 0x6c, + 0x98, 0x0f, 0x69, 0xea, 0x1f, 0xf9, 0x7d, 0x37, 0xf5, 0x69, 0xd8, 0xa9, 0xf1, 0x01, 0x1a, 0x8f, + 0x8d, 0xf1, 0xc3, 0x34, 0xa6, 0x5e, 0xd6, 0xe7, 0x63, 0x66, 0x70, 0x8c, 0xca, 0x63, 0xf3, 0x1f, + 0xb9, 0x7d, 0xf2, 0xd0, 0xd9, 0xed, 0xd4, 0x71, 0x7e, 0x41, 0x5a, 0x6b, 0xd0, 0xa2, 0x8f, 0x42, + 0x12, 0x3f, 0x4c, 0x48, 0x7c, 0x7f, 0xbb, 0xd3, 0xe0, 0xbf, 0xaa, 0x2c, 0xeb, 0x26, 0x40, 0x3f, + 0x26, 0x6e, 0x4a, 0x1e, 0xf8, 0x43, 0xd2, 0x99, 0x5d, 0x33, 0x5e, 0x68, 0x3b, 0x0a, 0x87, 0x69, + 0x18, 0x92, 0xe1, 0x21, 0x89, 0xb7, 0x68, 0x16, 0xa6, 0x9d, 0x39, 0x3e, 0x40, 0x65, 0x59, 0x0b, + 0x60, 0x92, 0xc7, 0x9d, 0x26, 0x57, 0x6d, 0x92, 0xc7, 0xd6, 0x0a, 0x34, 0x92, 0xd4, 0x4d, 0xb3, + 0xa4, 0x03, 0x6b, 0xc6, 0x0b, 0x75, 0x47, 0x50, 0xd6, 0x3a, 0xb4, 0xb9, 0x5e, 0x9a, 0x5b, 0xd3, + 0xe2, 0x22, 0x3a, 0x53, 0x22, 0xf6, 0xe0, 0x2c, 0x22, 0x9d, 0x79, 0xae, 0xa0, 0x60, 0xd8, 0x7f, + 0x33, 0xe1, 0x1a, 0xc7, 0xbd, 0xcb, 0x0d, 0xb8, 0x93, 0x05, 0xc1, 0x05, 0x1e, 0x58, 0x81, 0x46, + 0x86, 0xd3, 0x21, 0xfc, 0x82, 0x62, 0xf3, 0xc4, 0x34, 0x20, 0xbb, 0xe4, 0x94, 0x04, 0x1c, 0xf8, + 0xba, 0x53, 0x30, 0xac, 0x55, 0x98, 0x7b, 0x8b, 0xfa, 0x21, 0xc7, 0x64, 0x86, 0xff, 0x28, 0x69, + 0xf6, 0x5b, 0xe8, 0xf7, 0x4f, 0x42, 0xe6, 0x52, 0x84, 0x5b, 0xd2, 0xaa, 0x27, 0x1a, 0xba, 0x27, + 0x9e, 0x87, 0x05, 0x37, 0x8a, 0xba, 0x6e, 0x38, 0x20, 0x31, 0x4e, 0x3a, 0xcb, 0xf5, 0x96, 0xb8, + 0xcc, 0x1f, 0x6c, 0xa6, 0x1e, 0xcd, 0xe2, 0x3e, 0xe1, 0x70, 0xd7, 0x1d, 0x85, 0xc3, 0xf4, 0xd0, + 0x88, 0xc4, 0x0a, 0x8c, 0x88, 0x7c, 0x89, 0x2b, 0xbc, 0x02, 0xd2, 0x2b, 0xcc, 0x8f, 0x59, 0x4a, + 0x76, 0x42, 0x8f, 0x2f, 0xaa, 0x25, 0xfc, 0x58, 0xb0, 0xec, 0x9f, 0x18, 0xb0, 0x70, 0x90, 0x1d, + 0x06, 0x7e, 0x9f, 0xab, 0x60, 0xb0, 0x16, 0xe0, 0x19, 0x1a, 0x78, 0x2a, 0x04, 0xe6, 0x64, 0x08, + 0x6a, 0x3a, 0x04, 0x2b, 0xd0, 0x18, 0x90, 0xd0, 0x23, 0xb1, 0x80, 0x54, 0x50, 0xc2, 0xd4, 0x7a, + 0x6e, 0xaa, 0xfd, 0x0b, 0x13, 0xe6, 0x3e, 0x60, 0x13, 0xd6, 0xa0, 0x15, 0x1d, 0xd3, 0x90, 0xec, + 0x65, 0x2c, 0xac, 0x84, 0x2d, 0x2a, 0xcb, 0xba, 0x0e, 0xf5, 0x43, 0x3f, 0x4e, 0x8f, 0xb9, 0x5f, + 0xdb, 0x0e, 0x12, 0x8c, 0x4b, 0x86, 0xae, 0x8f, 0xce, 0x6c, 0x3a, 0x48, 0x88, 0x05, 0xcd, 0x49, + 0xec, 0xf5, 0x3d, 0xd6, 0xac, 0xec, 0xb1, 0x6a, 0x6c, 0xc0, 0xb8, 0xd8, 0xb0, 0xff, 0x6d, 0x00, + 0xdc, 0x89, 0x7d, 0x12, 0x7a, 0x1c, 0x9a, 0xd2, 0xe6, 0x36, 0xaa, 0x9b, 0x7b, 0x05, 0x1a, 0x31, + 0x19, 0xba, 0xf1, 0x49, 0x1e, 0xfc, 0x48, 0x95, 0x0c, 0xaa, 0x55, 0x0c, 0x7a, 0x15, 0xe0, 0x88, + 0xcf, 0xc3, 0xf4, 0x70, 0xa8, 0x5a, 0x2f, 0x7f, 0xe2, 0x56, 0x25, 0x0d, 0xde, 0xca, 0xbd, 0xe4, + 0x28, 0xc3, 0xd9, 0xce, 0x72, 0x3d, 0x4f, 0x04, 0x70, 0x1d, 0x77, 0x96, 0x64, 0x8c, 0x89, 0xdf, + 0xc6, 0x39, 0xf1, 0x3b, 0x2b, 0x83, 0xe2, 0x9f, 0x06, 0x34, 0x37, 0x03, 0xb7, 0x7f, 0x32, 0xe5, + 0xd2, 0xf5, 0x25, 0x9a, 0x95, 0x25, 0xde, 0x85, 0xf6, 0x21, 0x53, 0x97, 0x2f, 0x81, 0xa3, 0xd0, + 0x7a, 0xf9, 0x53, 0x63, 0x56, 0xa9, 0x6f, 0x0a, 0x47, 0x97, 0xd3, 0x97, 0x3b, 0x73, 0xf1, 0x72, + 0xeb, 0xe7, 0x2c, 0xb7, 0x21, 0x97, 0xfb, 0x57, 0x13, 0xe6, 0x79, 0xa2, 0x73, 0xc8, 0x28, 0x23, + 0x49, 0x6a, 0x7d, 0x1d, 0xe6, 0xb2, 0xdc, 0x54, 0x63, 0x5a, 0x53, 0xa5, 0x88, 0xf5, 0x8a, 0x48, + 0xab, 0x5c, 0xde, 0xe4, 0xf2, 0x37, 0xc6, 0xc8, 0xcb, 0x9a, 0xe6, 0x14, 0xc3, 0x59, 0x09, 0x3a, + 0x76, 0x43, 0x2f, 0x20, 0x0e, 0x49, 0xb2, 0x20, 0x15, 0xd9, 0x52, 0xe3, 0x61, 0xa4, 0x8d, 0xba, + 0xc9, 0x40, 0x14, 0x28, 0x41, 0x31, 0x74, 0x70, 0x1c, 0xfb, 0x09, 0x97, 0x5e, 0x30, 0xd8, 0x46, + 0x8d, 0xc9, 0x88, 0x7b, 0x08, 0xb7, 0x55, 0x4e, 0x16, 0x73, 0x0a, 0xd4, 0x30, 0x10, 0x34, 0x1e, + 0x73, 0x31, 0xd2, 0x5c, 0x01, 0x56, 0x26, 0x85, 0x53, 0x2e, 0x4c, 0xf6, 0xdf, 0x6b, 0xd0, 0xc6, + 0xed, 0x93, 0x83, 0x7a, 0x93, 0xc5, 0x39, 0x1d, 0x6a, 0x51, 0xa4, 0x70, 0x98, 0x15, 0x8c, 0xda, + 0xd3, 0x13, 0x8d, 0xc6, 0x63, 0xa1, 0xc8, 0xe8, 0x3b, 0x5a, 0xc2, 0x51, 0x59, 0xf9, 0x2c, 0x77, + 0xd5, 0xc4, 0xa3, 0x70, 0x58, 0x2a, 0x4b, 0xa9, 0x16, 0x1d, 0x92, 0x66, 0xb2, 0x29, 0x95, 0xf3, + 0x63, 0x7c, 0x28, 0x1c, 0x86, 0x6f, 0x4a, 0xf3, 0xb9, 0x11, 0xa4, 0x82, 0x81, 0x9a, 0xc5, 0xbc, + 0x58, 0x4a, 0x24, 0x5d, 0xf1, 0x6a, 0xf3, 0x5c, 0xaf, 0x82, 0xe6, 0x55, 0x7d, 0x73, 0xb5, 0x2a, + 0x9b, 0x6b, 0x1d, 0xda, 0xa8, 0x27, 0x0f, 0xfa, 0x79, 0x2c, 0xf5, 0x1a, 0x53, 0x8f, 0x8d, 0x76, + 0x39, 0x36, 0x74, 0xef, 0x2e, 0x4c, 0xf0, 0xee, 0xa2, 0xf4, 0xee, 0xef, 0x4d, 0x80, 0x6d, 0x12, + 0xb9, 0x71, 0x3a, 0x24, 0x61, 0xca, 0x96, 0xe7, 0x49, 0x4a, 0x3a, 0x57, 0xe3, 0xa9, 0x75, 0xc2, + 0xd4, 0xeb, 0x84, 0x05, 0x33, 0x1c, 0x70, 0xf4, 0x26, 0xff, 0x9b, 0x81, 0x19, 0xb9, 0x31, 0x6a, + 0xc3, 0x20, 0x97, 0x34, 0xab, 0x03, 0x34, 0xf6, 0x44, 0xe5, 0xa8, 0x3b, 0x48, 0xb0, 0xcd, 0x5f, + 0xcc, 0xc7, 0x1b, 0x9a, 0x06, 0xe6, 0x75, 0x9d, 0x7b, 0x61, 0x0f, 0xf6, 0x22, 0x2c, 0x25, 0xd9, + 0x61, 0xb1, 0xb8, 0xbd, 0x6c, 0x28, 0xc2, 0xbd, 0xc2, 0x67, 0xa0, 0x62, 0x73, 0xc6, 0x06, 0x61, + 0xa9, 0x29, 0x18, 0xe5, 0xae, 0xc0, 0x7e, 0xdb, 0x84, 0xa5, 0xfd, 0x78, 0xe0, 0x86, 0xfe, 0xf7, + 0x79, 0xbb, 0xc9, 0x13, 0xf8, 0x65, 0x4a, 0xee, 0x1a, 0xb4, 0x48, 0x38, 0x08, 0xfc, 0xe4, 0x78, + 0xaf, 0xc0, 0x4d, 0x65, 0xa9, 0x60, 0xcf, 0x4c, 0x2a, 0xca, 0x75, 0xad, 0x28, 0xaf, 0x40, 0x63, + 0x48, 0x0f, 0xfd, 0x20, 0x8f, 0x7b, 0x41, 0xf1, 0x98, 0x27, 0x01, 0xe1, 0xd5, 0x59, 0xc6, 0x7c, + 0xce, 0x28, 0x0a, 0xf5, 0xdc, 0xd8, 0x42, 0xdd, 0x54, 0x0b, 0xb5, 0x0e, 0x3c, 0x54, 0x80, 0x47, + 0xb8, 0x5a, 0x12, 0xae, 0x3f, 0x1b, 0xb0, 0x54, 0xc0, 0x8d, 0x3d, 0xe8, 0x44, 0xb8, 0x6c, 0x98, + 0xdf, 0x56, 0x23, 0x50, 0x24, 0x0f, 0x95, 0xc7, 0xcc, 0xda, 0xe7, 0x71, 0x83, 0x39, 0x15, 0x09, + 0x06, 0xf4, 0x01, 0x4d, 0x7c, 0xa5, 0xdf, 0x97, 0x34, 0x9b, 0x6d, 0x97, 0xb8, 0x0a, 0x58, 0x48, + 0x31, 0x7e, 0x0f, 0xbb, 0x6e, 0x8c, 0x31, 0x41, 0xb1, 0x25, 0xec, 0xc8, 0x3a, 0xba, 0xf3, 0xd8, + 0x7e, 0xcf, 0x80, 0x25, 0xac, 0x0f, 0xca, 0x66, 0xd9, 0x87, 0x25, 0x5a, 0x8a, 0x02, 0x51, 0x64, + 0x3e, 0x3d, 0xa6, 0x48, 0x94, 0x03, 0xc6, 0xa9, 0x08, 0x5b, 0x6f, 0xc0, 0x75, 0xaf, 0x84, 0xd3, + 0xae, 0x9f, 0xa4, 0x1d, 0x73, 0xad, 0x36, 0x41, 0x69, 0x19, 0x56, 0x67, 0xac, 0x02, 0xfb, 0x07, + 0xd0, 0x39, 0xc8, 0x82, 0xa0, 0x4b, 0x92, 0xc4, 0x1d, 0x90, 0xcd, 0xb3, 0x1e, 0x19, 0x31, 0xbe, + 0x43, 0x92, 0x88, 0x45, 0x18, 0x89, 0xe3, 0x2d, 0xea, 0x11, 0x6e, 0x7c, 0xdd, 0xc9, 0x49, 0x06, + 0x0e, 0x89, 0x63, 0x96, 0x66, 0x44, 0x1f, 0x84, 0x94, 0x75, 0x0b, 0x66, 0x02, 0x66, 0x56, 0x8d, + 0x9b, 0xb5, 0x3a, 0xc6, 0xac, 0x6e, 0x32, 0xd8, 0x76, 0x53, 0xd7, 0xe1, 0xe3, 0xec, 0x21, 0x7c, + 0x6c, 0xfc, 0xec, 0xa3, 0x89, 0x51, 0xc0, 0x3a, 0x15, 0x5e, 0xea, 0x7d, 0x1a, 0xca, 0x20, 0x50, + 0x59, 0xcc, 0xec, 0x04, 0xf5, 0x70, 0x3b, 0xda, 0x4e, 0x4e, 0xda, 0xd7, 0xc1, 0xba, 0x4b, 0xd2, + 0xae, 0xfb, 0x78, 0x23, 0xf4, 0xba, 0x7e, 0xd8, 0x23, 0x23, 0x87, 0x8c, 0xec, 0x1d, 0xb8, 0x56, + 0xe1, 0x26, 0x11, 0xdf, 0x2d, 0xee, 0xe3, 0x1e, 0x19, 0x71, 0x03, 0xda, 0x8e, 0xa0, 0x38, 0x9f, + 0x8f, 0x12, 0x4d, 0x90, 0xa0, 0xec, 0x11, 0x2c, 0x32, 0x57, 0xf5, 0x48, 0xe8, 0x75, 0x93, 0x01, + 0x57, 0xb1, 0x06, 0x2d, 0x44, 0xa0, 0x9b, 0x0c, 0x8a, 0xae, 0x4a, 0x61, 0xb1, 0x11, 0xfd, 0xc0, + 0x67, 0x2e, 0xe1, 0x23, 0xc4, 0x6a, 0x14, 0x16, 0x8b, 0xdd, 0x84, 0x88, 0x43, 0x06, 0x0b, 0xea, + 0x9a, 0x23, 0x69, 0xfb, 0xbd, 0x3a, 0xcc, 0x0a, 0x40, 0xf9, 0x29, 0x91, 0x35, 0xb2, 0x12, 0x2f, + 0xa4, 0xb0, 0xe4, 0xf4, 0x4f, 0x8b, 0xf3, 0x1a, 0x52, 0xea, 0x09, 0xaf, 0xa6, 0x9f, 0xf0, 0x4a, + 0x36, 0xcd, 0x54, 0x6d, 0x2a, 0xad, 0xab, 0x5e, 0x5d, 0x17, 0xcb, 0xb0, 0x3c, 0xe9, 0x1c, 0x04, + 0x6e, 0x7a, 0x44, 0xe3, 0xa1, 0xe8, 0x4b, 0xeb, 0x4e, 0x85, 0xcf, 0xb2, 0x3a, 0xf2, 0x64, 0x59, + 0xc6, 0xdd, 0x55, 0xe2, 0xb2, 0x22, 0x88, 0x9c, 0xbc, 0x3c, 0xe3, 0x81, 0x40, 0x67, 0xa2, 0x6d, + 0x49, 0xe2, 0xd3, 0x90, 0x17, 0x08, 0xac, 0xc2, 0x2a, 0x8b, 0xad, 0x7c, 0x98, 0x0c, 0xee, 0xc4, + 0x74, 0x28, 0x8e, 0x05, 0x39, 0xc9, 0x57, 0x4e, 0xc3, 0x34, 0x2f, 0x2e, 0x2d, 0x94, 0x55, 0x58, + 0x4c, 0x56, 0x90, 0xbc, 0x04, 0xcf, 0x3b, 0x39, 0x69, 0x2d, 0x41, 0x2d, 0x21, 0x23, 0x51, 0x57, + 0xd9, 0x9f, 0x9a, 0xe7, 0x16, 0x75, 0xcf, 0x95, 0x12, 0xe5, 0x12, 0xff, 0x55, 0x4d, 0x94, 0xc5, + 0x99, 0x7f, 0x59, 0x3b, 0xf3, 0x6f, 0xc0, 0x2c, 0x8d, 0x58, 0x9c, 0x27, 0x1d, 0x8b, 0xef, 0xb1, + 0xcf, 0x4c, 0xde, 0x63, 0xb7, 0xf6, 0x71, 0xe4, 0x4e, 0x98, 0xc6, 0x67, 0x4e, 0x2e, 0x67, 0xed, + 0xc2, 0x22, 0x3d, 0x3a, 0x0a, 0xfc, 0x90, 0x1c, 0x64, 0xc9, 0x31, 0xef, 0x5f, 0xaf, 0xf1, 0xd4, + 0x64, 0x8f, 0x4b, 0x4d, 0xfa, 0x48, 0xa7, 0x2c, 0xba, 0xfa, 0x0a, 0xcc, 0xab, 0xd3, 0x30, 0x18, + 0x4e, 0xc8, 0x99, 0x88, 0x41, 0xf6, 0x27, 0x4b, 0xc9, 0xa7, 0x6e, 0x90, 0x61, 0x89, 0x9b, 0x73, + 0x90, 0x78, 0xc5, 0xfc, 0x8a, 0x61, 0xff, 0xdc, 0x80, 0xc5, 0xd2, 0x04, 0x6c, 0x74, 0xea, 0xa7, + 0x01, 0x11, 0x1a, 0x90, 0x60, 0xed, 0x83, 0x47, 0x92, 0xbe, 0x08, 0x61, 0xfe, 0xb7, 0xa8, 0x25, + 0x35, 0x79, 0x28, 0xb4, 0x61, 0xde, 0xdf, 0xef, 0x31, 0x45, 0x3d, 0x9a, 0x85, 0x9e, 0xbc, 0xd8, + 0x51, 0x78, 0x2c, 0x84, 0xfc, 0xfd, 0xde, 0xa6, 0xeb, 0x0d, 0x08, 0x5e, 0xbf, 0xd4, 0xb9, 0x4d, + 0x3a, 0xd3, 0xf6, 0x60, 0xee, 0x81, 0x1f, 0x25, 0x5b, 0x74, 0x38, 0x64, 0x8e, 0xf0, 0x48, 0xca, + 0x0a, 0x9d, 0xc1, 0xfd, 0x2d, 0x28, 0x16, 0x2a, 0x1e, 0x39, 0x72, 0xb3, 0x20, 0x65, 0x43, 0xf3, + 0x8d, 0xab, 0xb0, 0xf8, 0xc5, 0x43, 0x42, 0xc3, 0x6d, 0x94, 0x46, 0x3b, 0x15, 0x8e, 0xfd, 0x17, + 0x13, 0x96, 0xf8, 0xf1, 0x60, 0x8b, 0xbb, 0xdd, 0xe3, 0x42, 0x2f, 0x43, 0x9d, 0x6f, 0x43, 0x51, + 0x2d, 0xce, 0x3f, 0x52, 0xe0, 0x50, 0xeb, 0x36, 0x34, 0x68, 0xc4, 0x4b, 0x0c, 0x9e, 0x43, 0x9e, + 0x9f, 0x24, 0xa4, 0xdf, 0xf1, 0x38, 0x42, 0xca, 0xba, 0x03, 0x30, 0x2c, 0x2a, 0x0a, 0xa6, 0xee, + 0x69, 0x75, 0x28, 0x92, 0x0c, 0x5c, 0x99, 0x86, 0xe5, 0x45, 0x4f, 0xcd, 0xd1, 0x99, 0xd6, 0x1e, + 0x2c, 0x70, 0xb3, 0xf7, 0xf3, 0xb3, 0x25, 0xf7, 0xc1, 0xf4, 0x33, 0x96, 0xa4, 0xed, 0x5f, 0x1b, + 0x02, 0x46, 0xf6, 0x6b, 0x8f, 0x20, 0xf6, 0x05, 0x24, 0xc6, 0xa5, 0x20, 0x59, 0x85, 0xb9, 0x61, + 0xa6, 0x1c, 0x75, 0x6b, 0x8e, 0xa4, 0x0b, 0x17, 0xd5, 0xa6, 0x76, 0x91, 0xfd, 0x1b, 0x03, 0x3a, + 0xaf, 0x51, 0x3f, 0xe4, 0x3f, 0x6c, 0x44, 0x51, 0x20, 0x6e, 0x23, 0x2f, 0xed, 0xf3, 0x6f, 0x40, + 0xd3, 0x45, 0x35, 0x61, 0x2a, 0xdc, 0x3e, 0xc5, 0xf1, 0xb5, 0x90, 0x51, 0x4e, 0x22, 0x35, 0xf5, + 0x24, 0x62, 0xbf, 0x63, 0xc0, 0x02, 0x82, 0xf2, 0x7a, 0xe6, 0xa7, 0x97, 0xb6, 0x6f, 0x13, 0xe6, + 0x46, 0x99, 0x9f, 0x5e, 0x22, 0x2a, 0xa5, 0x5c, 0x35, 0x9e, 0x6a, 0x63, 0xe2, 0xc9, 0x7e, 0xd7, + 0x80, 0x1b, 0x65, 0x58, 0x37, 0xfa, 0x7d, 0x12, 0x3d, 0xc9, 0x2d, 0xa5, 0x9d, 0xc4, 0x66, 0x4a, + 0x27, 0xb1, 0xb1, 0x26, 0x3b, 0xe4, 0x2d, 0xd2, 0x7f, 0x7a, 0x4d, 0xfe, 0xb1, 0x09, 0x1f, 0xbf, + 0x2b, 0x37, 0xde, 0x83, 0xd8, 0x0d, 0x93, 0x23, 0x12, 0xc7, 0x4f, 0xd0, 0xde, 0x5d, 0x68, 0x87, + 0xe4, 0x51, 0x61, 0x93, 0xd8, 0x8e, 0xd3, 0xaa, 0xd1, 0x85, 0xa7, 0xcb, 0x5d, 0xf6, 0x7f, 0x0c, + 0x58, 0x42, 0x3d, 0xdf, 0xf4, 0xfb, 0x27, 0x4f, 0x70, 0xf1, 0x7b, 0xb0, 0x70, 0xc2, 0x2d, 0x60, + 0xd4, 0x25, 0xd2, 0x76, 0x49, 0x7a, 0xca, 0xe5, 0xff, 0xd7, 0x80, 0x65, 0x54, 0x74, 0x3f, 0x3c, + 0xf5, 0x9f, 0x64, 0xb0, 0x1e, 0xc0, 0xa2, 0x8f, 0x26, 0x5c, 0x12, 0x80, 0xb2, 0xf8, 0x94, 0x08, + 0xfc, 0xd1, 0x80, 0x45, 0xd4, 0xb4, 0x13, 0xa6, 0x24, 0xbe, 0xf4, 0xfa, 0xef, 0xb1, 0xd3, 0x7d, + 0x1a, 0xbb, 0xe1, 0x65, 0x32, 0xa4, 0x2a, 0x3a, 0x65, 0x92, 0x7c, 0xc7, 0x00, 0x8b, 0xab, 0xda, + 0xf6, 0x93, 0xa1, 0x9f, 0x24, 0x4f, 0xd0, 0x75, 0xd3, 0x19, 0xfc, 0x4b, 0x13, 0xae, 0x2b, 0x5a, + 0xba, 0x59, 0xfa, 0xb4, 0x9b, 0x6c, 0x6d, 0x43, 0x93, 0xf5, 0x08, 0xea, 0x15, 0xff, 0xb4, 0x13, + 0x15, 0x82, 0xac, 0x8b, 0xe5, 0x44, 0x8f, 0xf4, 0x69, 0xe8, 0x25, 0xbc, 0x39, 0x6a, 0x3b, 0x1a, + 0x8f, 0xa5, 0xa1, 0x55, 0x45, 0xcd, 0x96, 0x1b, 0xf6, 0x49, 0xf0, 0xcc, 0x40, 0x64, 0xff, 0xce, + 0x80, 0x05, 0x1c, 0xf2, 0xf4, 0x2f, 0x99, 0xd5, 0x7a, 0x0c, 0xe4, 0x0f, 0x8d, 0x97, 0xec, 0x13, + 0x58, 0xc6, 0x5b, 0x7d, 0xa5, 0x3d, 0x61, 0x07, 0x5f, 0xd7, 0xc3, 0xb3, 0xac, 0xc1, 0x85, 0x72, + 0x52, 0x7f, 0xaf, 0x11, 0x4f, 0xf2, 0xc5, 0x7b, 0xcd, 0x4d, 0x00, 0xd7, 0xf3, 0xde, 0xa0, 0xb1, + 0xe7, 0x87, 0x79, 0xaf, 0xa9, 0x70, 0xec, 0xd7, 0x60, 0x9e, 0x1d, 0xbd, 0x1f, 0x28, 0xf7, 0xf3, + 0xe7, 0xbe, 0x20, 0xa8, 0x77, 0xfb, 0xa6, 0x7e, 0xb7, 0x6f, 0x7f, 0x0f, 0x3e, 0x5a, 0x31, 0x9c, + 0x63, 0xbd, 0x85, 0xcf, 0x0e, 0xf9, 0x24, 0x02, 0xf2, 0x4f, 0x8e, 0x41, 0x4f, 0xb5, 0xc5, 0xd1, + 0x84, 0xec, 0x1f, 0x19, 0xf0, 0x5c, 0x45, 0xfd, 0x46, 0x14, 0xc5, 0xf4, 0x54, 0xb8, 0xf4, 0x2a, + 0xa6, 0xd1, 0xfb, 0x30, 0xb3, 0xdc, 0x87, 0x8d, 0x35, 0x42, 0xeb, 0x1d, 0x3f, 0x00, 0x23, 0x7e, + 0x6b, 0xc0, 0xa2, 0x30, 0xc2, 0xf3, 0xc4, 0xb4, 0x5f, 0x86, 0x06, 0x3e, 0x59, 0x8a, 0x09, 0x9f, + 0x1b, 0x3b, 0x61, 0xfe, 0xd4, 0xea, 0x88, 0xc1, 0xd5, 0x88, 0x34, 0xc7, 0xe5, 0x8d, 0xaf, 0xca, + 0xb8, 0x9f, 0xfa, 0x51, 0x51, 0x08, 0xd8, 0xdf, 0xce, 0x83, 0x79, 0x9b, 0x04, 0xe4, 0x2a, 0x31, + 0xb2, 0x1f, 0xc2, 0x02, 0x7f, 0x3f, 0x2d, 0x30, 0xb8, 0x12, 0xb5, 0x6f, 0xc0, 0x12, 0x57, 0x7b, + 0xe5, 0xf6, 0xca, 0xdd, 0xc1, 0xf0, 0xd9, 0x3a, 0x76, 0xc3, 0xc1, 0x55, 0x6a, 0xff, 0x02, 0x5c, + 0xcb, 0xb1, 0x7f, 0x18, 0x79, 0xf2, 0x3e, 0x63, 0xc2, 0x2d, 0xae, 0xfd, 0x45, 0x58, 0xd9, 0xa2, + 0xe1, 0x29, 0x89, 0x13, 0xbc, 0xe3, 0xe6, 0x22, 0xb9, 0x84, 0xb6, 0xf9, 0x05, 0x65, 0xbf, 0x05, + 0xab, 0xaa, 0x44, 0x8f, 0xa4, 0x07, 0xb1, 0x7f, 0xaa, 0x48, 0x89, 0x5b, 0x4e, 0x43, 0xbb, 0xe5, + 0x2c, 0x6e, 0x45, 0x4d, 0xed, 0x56, 0xf4, 0x06, 0x34, 0xfd, 0x44, 0x28, 0xe0, 0x41, 0x35, 0xe7, + 0x14, 0x0c, 0xbb, 0x07, 0xcb, 0xe2, 0x45, 0xf3, 0xc0, 0x1d, 0xf8, 0x21, 0x66, 0xc0, 0x9b, 0x00, + 0x91, 0x3b, 0xc8, 0xbf, 0x68, 0xc0, 0x0b, 0x71, 0x85, 0xc3, 0x7e, 0x4f, 0x8e, 0xe9, 0x23, 0xf1, + 0xbb, 0x89, 0xbf, 0x17, 0x1c, 0xfb, 0x5b, 0x60, 0x39, 0x24, 0x89, 0x68, 0x98, 0x10, 0x45, 0xeb, + 0x1a, 0xb4, 0xb6, 0xb2, 0x38, 0x26, 0x21, 0x9b, 0x2a, 0x7f, 0xde, 0x57, 0x59, 0x4c, 0x6f, 0xaf, + 0xd0, 0x8b, 0x97, 0xa8, 0x0a, 0xc7, 0xfe, 0x55, 0x0d, 0x9a, 0x3d, 0x7f, 0x10, 0xba, 0x81, 0x43, + 0x46, 0xd6, 0xd7, 0xa0, 0x81, 0xad, 0xad, 0x70, 0xe3, 0xb8, 0x4b, 0x3d, 0x1c, 0x8d, 0x3d, 0xbc, + 0x43, 0x46, 0xf7, 0x3e, 0xe2, 0x08, 0x19, 0xeb, 0x75, 0x68, 0xe3, 0x5f, 0xf7, 0xf1, 0xaa, 0x42, + 0xd4, 0x99, 0xcf, 0x5e, 0xa0, 0x44, 0x8c, 0x46, 0x5d, 0xba, 0x06, 0x66, 0x50, 0x9f, 0x97, 0x3e, + 0xb1, 0x77, 0x27, 0x1b, 0x84, 0x15, 0x52, 0x18, 0x84, 0x32, 0x4c, 0xda, 0xe5, 0x87, 0x79, 0xd1, + 0x2e, 0x4c, 0x96, 0xc6, 0x33, 0xbf, 0x90, 0x46, 0x19, 0x26, 0x7d, 0x9c, 0x85, 0x83, 0x87, 0x91, + 0xb8, 0x63, 0x9a, 0x2c, 0x7d, 0x8f, 0x0f, 0x13, 0xd2, 0x28, 0xc3, 0xa4, 0x63, 0x9e, 0x59, 0x39, + 0xe8, 0xe7, 0x49, 0x63, 0x02, 0x16, 0xd2, 0x28, 0xb3, 0xd9, 0x84, 0xd9, 0xc8, 0x3d, 0x0b, 0xa8, + 0xeb, 0xd9, 0x6f, 0xd7, 0x00, 0xf2, 0x81, 0x09, 0xaf, 0xe2, 0x9a, 0x8b, 0xd6, 0x2f, 0x74, 0x51, + 0x14, 0x9c, 0x29, 0x4e, 0xea, 0x8d, 0x77, 0xd2, 0xe7, 0xa6, 0x75, 0x12, 0x6a, 0x2b, 0xb9, 0xe9, + 0x76, 0xc9, 0x4d, 0xeb, 0x17, 0xba, 0x49, 0x18, 0x25, 0x1c, 0x75, 0xbb, 0xe4, 0xa8, 0xf5, 0x0b, + 0x1d, 0x25, 0xe4, 0x85, 0xab, 0x6e, 0x97, 0x5c, 0xb5, 0x7e, 0xa1, 0xab, 0x84, 0xbc, 0x70, 0xd6, + 0xed, 0x92, 0xb3, 0xd6, 0x2f, 0x74, 0x96, 0x90, 0xaf, 0xba, 0xeb, 0x5d, 0x13, 0x16, 0x38, 0x64, + 0xf8, 0xa0, 0x14, 0x1e, 0x51, 0x7e, 0x6f, 0xcc, 0xe1, 0xd2, 0x3f, 0x90, 0xd1, 0x99, 0xd6, 0xe7, + 0x61, 0x19, 0x19, 0xe2, 0x83, 0x0a, 0xf9, 0x42, 0xd7, 0x74, 0xaa, 0x3f, 0xf0, 0x27, 0x80, 0x2c, + 0x49, 0xe9, 0x70, 0xdb, 0x4d, 0xdd, 0xbc, 0x33, 0x2a, 0x38, 0xea, 0x03, 0xcd, 0x4c, 0xe5, 0x13, + 0xbc, 0x98, 0xd2, 0xa1, 0x7c, 0x79, 0x11, 0x14, 0x93, 0x48, 0xfd, 0x21, 0xa1, 0x59, 0x2a, 0xd2, + 0x44, 0x4e, 0xe2, 0x23, 0xb6, 0xe7, 0xbb, 0xfc, 0x59, 0x43, 0xbc, 0xf0, 0x4a, 0x06, 0xcf, 0x6c, + 0xc5, 0x33, 0x8d, 0xf8, 0x44, 0xae, 0xe0, 0x5c, 0xfc, 0xa4, 0x62, 0xff, 0xc3, 0x80, 0x6b, 0x07, + 0x6e, 0x9c, 0xfa, 0x7d, 0x3f, 0x72, 0xc3, 0xb4, 0x4b, 0x52, 0x97, 0xaf, 0x41, 0xfb, 0x4a, 0xc6, + 0x78, 0x7f, 0x5f, 0xc9, 0x1c, 0xc0, 0xe2, 0xa0, 0xe8, 0x65, 0x95, 0xef, 0x6c, 0xa6, 0x3e, 0xe3, + 0x97, 0xc4, 0xb5, 0x4f, 0x7e, 0x6a, 0xef, 0xfb, 0x93, 0x1f, 0xfb, 0xa7, 0x26, 0x2c, 0x96, 0x52, + 0x27, 0x6b, 0x47, 0xb1, 0xd1, 0x90, 0x31, 0x21, 0x69, 0x6b, 0x03, 0xc0, 0x97, 0x61, 0x74, 0xce, + 0x25, 0xad, 0x1e, 0x6b, 0x8e, 0x22, 0x34, 0xee, 0xad, 0xa6, 0x76, 0xe9, 0xb7, 0x1a, 0xeb, 0x1e, + 0xb4, 0xa2, 0xc2, 0x49, 0xe7, 0x1c, 0xc0, 0xc6, 0xb8, 0xd2, 0x51, 0x45, 0xed, 0xef, 0xc2, 0x72, + 0x25, 0x43, 0xf1, 0xa7, 0x1b, 0x7a, 0x42, 0x42, 0xf9, 0x74, 0xc3, 0x08, 0x25, 0x58, 0xcd, 0x72, + 0xb0, 0x06, 0xfe, 0xa9, 0xfa, 0x4d, 0xa1, 0x20, 0xed, 0x9f, 0x99, 0xb0, 0x32, 0xbe, 0xba, 0x3c, + 0xab, 0x70, 0x1f, 0x42, 0x67, 0x52, 0x26, 0xbf, 0x32, 0xd4, 0x8b, 0xe8, 0x96, 0x75, 0xf8, 0x59, + 0x85, 0xfb, 0x5a, 0x1e, 0xdd, 0x4a, 0xa9, 0xb3, 0xff, 0x20, 0xf1, 0x91, 0x9d, 0xc6, 0x33, 0x8a, + 0x8f, 0xf5, 0x22, 0x2c, 0xe1, 0x32, 0x95, 0xc7, 0x7d, 0x6c, 0x5c, 0x2b, 0xfc, 0x22, 0x53, 0x28, + 0x65, 0xff, 0xca, 0x62, 0xf6, 0x4f, 0x46, 0xee, 0x13, 0xd9, 0xbf, 0x7d, 0xa8, 0x7c, 0x52, 0x44, + 0x9a, 0xd2, 0xd4, 0x28, 0x91, 0x26, 0xfb, 0xca, 0xff, 0x47, 0xda, 0xc5, 0x91, 0x26, 0xb1, 0x54, + 0x1a, 0x3c, 0xfb, 0x87, 0xd0, 0xde, 0x26, 0x41, 0x37, 0x19, 0xe4, 0x9f, 0x15, 0x9d, 0x07, 0xe4, + 0xa4, 0x7f, 0x6d, 0x98, 0xf8, 0x41, 0x51, 0xf9, 0x63, 0xa4, 0x99, 0xca, 0xc7, 0x48, 0xf6, 0x26, + 0x2c, 0xa8, 0x06, 0x5c, 0xe6, 0xab, 0xaa, 0xcd, 0x1b, 0xdf, 0x59, 0xbd, 0xf5, 0x12, 0xfe, 0x13, + 0xcd, 0xab, 0x15, 0x10, 0x0f, 0x1b, 0xfc, 0x9f, 0x6a, 0xbe, 0xf4, 0xbf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x6c, 0xa8, 0x04, 0xcf, 0x67, 0x33, 0x00, 0x00, +} diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto new file mode 100644 index 000000000..ad4de4737 --- /dev/null +++ b/pkg/proto/sdk_ws/ws.proto @@ -0,0 +1,571 @@ +syntax = "proto3"; +option go_package = "./sdk_ws;server_api_params"; +package server_api_params; + +////////////////////////////////base/////////////////////////////// + + +message GroupInfo{ + string groupID = 1; + string groupName = 2; + string notification = 3; + string introduction = 4; + string faceURL = 5; + string ownerUserID = 6; + uint32 createTime = 7; + uint32 memberCount = 8; + string ex = 9; + int32 status = 10; + string creatorUserID = 11; + int32 groupType = 12; +} + + +message GroupMemberFullInfo { + string groupID = 1 ; + string userID = 2 ; + int32 roleLevel = 3; + int32 joinTime = 4; + string nickname = 5; + string faceURL = 6; + int32 appMangerLevel = 7; //if >0 + int32 joinSource = 8; + string operatorUserID = 9; + string ex = 10; + uint32 muteEndTime = 11; +} + +message PublicUserInfo{ + string userID = 1; + string nickname = 2; + string faceURL = 3; + int32 gender = 4; + string ex = 5; +} + +message UserInfo{ + string userID = 1; + string nickname = 2; + string faceURL = 3; + int32 gender = 4; + string phoneNumber = 5; + uint32 birth = 6; + string email = 7; + string ex = 8; + uint32 createTime = 9; + int32 appMangerLevel = 10; +} + +message FriendInfo{ + string ownerUserID = 1; + string remark = 2; + uint32 createTime = 3; + UserInfo friendUser = 4; + int32 addSource = 5; + string operatorUserID = 6; + string ex = 7; +} + +message BlackInfo{ + string ownerUserID = 1; + uint32 createTime = 2; + PublicUserInfo blackUserInfo = 3; + int32 addSource = 4; + string operatorUserID = 5; + string ex = 6; +} + +message GroupRequest{ + PublicUserInfo userInfo = 1; + GroupInfo groupInfo = 2; + int32 handleResult = 3; + string reqMsg = 4; + string handleMsg = 5; + uint32 reqTime = 6; + string handleUserID = 7; + uint32 handleTime = 8; + string ex = 9; +} + +message FriendRequest{ + string fromUserID = 1; + string fromNickname = 2; + string fromFaceURL = 3; + int32 fromGender = 4; + string toUserID = 5; + string toNickname = 6; + string toFaceURL = 7; + int32 toGender = 8; + int32 handleResult = 9; + string reqMsg = 10; + uint32 createTime = 11; + string handlerUserID = 12; + string handleMsg = 13; + uint32 handleTime = 14; + string ex = 15; +} + +///////////////////////////////////organization///////////////////////////////////// + +message Department { + string departmentID = 1; + string faceURL = 2; + string name = 3; + string parentID = 4; + int32 order = 5; + int32 departmentType = 6; + uint32 createTime = 7; + uint32 subDepartmentNum = 8; + uint32 memberNum = 9; + string ex = 10; +} + + + +message OrganizationUser { + string userID = 1; + string nickname = 2; + string englishName = 3; + string faceURL = 4; + int32 gender = 5; + string mobile = 6; + string telephone = 7; + uint32 birth = 8; + string email = 9; + uint32 createTime = 10; + string ex = 11; +} + +message DepartmentMember { + string userID = 1; + string DepartmentID = 2; + int32 Order = 3; + string Position = 4; + int32 Leader = 5; + int32 Status = 6; + string Ex = 7; +} + + + +message UserInDepartment { + OrganizationUser organizationUser = 1; + repeated DepartmentMember departmentMemberList = 2; +} + + + + + +///////////////////////////////////organization end////////////////////////////////// + + + + + + +///////////////////////////////////base end///////////////////////////////////// + +message PullMessageBySeqListResp { + int32 errCode = 1; + string errMsg = 2; + repeated MsgData list = 3; +} +message PullMessageBySeqListReq{ + string userID = 1; + string operationID = 2; + repeated uint32 seqList = 3; +} +message GetMaxAndMinSeqReq { +} +message GetMaxAndMinSeqResp { + uint32 maxSeq = 1; + uint32 minSeq = 2; +} + +message UserSendMsgResp { + string serverMsgID = 1; + string clientMsgID = 2; + int64 sendTime = 3; + +} +message MsgData { + string sendID = 1; + string recvID = 2; + string groupID = 3; + string clientMsgID = 4; + string serverMsgID = 5; + int32 senderPlatformID = 6; + string senderNickname = 7; + string senderFaceURL = 8; + int32 sessionType = 9; + int32 msgFrom = 10; + int32 contentType = 11; + bytes content = 12; + uint32 seq = 14; + int64 sendTime = 15; + int64 createTime = 16; + int32 status = 17; + map<string, bool> options = 18; + OfflinePushInfo offlinePushInfo = 19; +} + +message OfflinePushInfo{ + string title = 1; + string desc = 2; + string ex = 3; + string iOSPushSound = 4; + bool iOSBadgeCount = 5; +} + + + + + + + + + +message TipsComm{ + bytes detail = 1; + string defaultTips = 2; + string jsonDetail = 3; +} + +//////////////////////group///////////////////// + + +// OnGroupCreated() +message GroupCreatedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + repeated GroupMemberFullInfo memberList = 3; + int64 operationTime = 4; + GroupMemberFullInfo groupOwnerUser = 5; +} + +// OnGroupInfoSet() +message GroupInfoSetTips{ + GroupMemberFullInfo opUser = 1; //who do this + int64 muteTime = 2; + GroupInfo group = 3; +} + +// OnJoinGroupApplication() +message JoinGroupApplicationTips{ + GroupInfo group = 1; + PublicUserInfo applicant = 2; + string reqMsg = 3; +} + +// OnQuitGroup() +//Actively leave the group +message MemberQuitTips{ + GroupInfo group = 1; + GroupMemberFullInfo quitUser = 2; + int64 operationTime = 3; +} + + +// OnApplicationGroupAccepted() +message GroupApplicationAcceptedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + string handleMsg = 4; +} + +// OnApplicationGroupRejected() +message GroupApplicationRejectedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + string handleMsg = 4; +} + +// OnTransferGroupOwner() +message GroupOwnerTransferredTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + GroupMemberFullInfo newGroupOwner = 3; + int64 operationTime = 4; +} + + +// OnMemberKicked() +message MemberKickedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + repeated GroupMemberFullInfo kickedUserList = 3; + int64 operationTime = 4; +} + +// OnMemberInvited() +message MemberInvitedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + repeated GroupMemberFullInfo invitedUserList = 3; + int64 operationTime = 4; +} + +//Actively join the group +message MemberEnterTips{ + GroupInfo group = 1; + GroupMemberFullInfo entrantUser = 2; + int64 operationTime = 3; +} + +message GroupDismissedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + int64 operationTime = 3; +} + +message GroupMemberMutedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + int64 operationTime = 3; + GroupMemberFullInfo mutedUser = 4; + uint32 mutedSeconds = 5; +} + +message GroupMemberCancelMutedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + int64 operationTime = 3; + GroupMemberFullInfo mutedUser = 4; +} + +message GroupMutedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + int64 operationTime = 3; +} + +message GroupCancelMutedTips{ + GroupInfo group = 1; + GroupMemberFullInfo opUser = 2; + int64 operationTime = 3; +} + + +//////////////////////friend///////////////////// +//message FriendInfo{ +// UserInfo OwnerUser = 1; +// string Remark = 2; +// uint64 CreateTime = 3; +// UserInfo FriendUser = 4; +//} + +message FriendApplication{ + int64 addTime = 1; + string addSource = 2; + string addWording = 3; +} + +message FromToUserID{ + string fromUserID = 1; + string toUserID = 2; +} + +//FromUserID apply to add ToUserID +message FriendApplicationTips{ + FromToUserID fromToUserID = 1; +} + +//FromUserID accept or reject ToUserID +message FriendApplicationApprovedTips{ + FromToUserID fromToUserID = 1; + string handleMsg = 2; +} + +//FromUserID accept or reject ToUserID +message FriendApplicationRejectedTips{ + FromToUserID fromToUserID = 1; + string handleMsg = 2; +} + + +// FromUserID Added a friend ToUserID +message FriendAddedTips{ + FriendInfo friend = 1; + int64 operationTime = 2; + PublicUserInfo opUser = 3; //who do this + +} + +// FromUserID deleted a friend ToUserID +message FriendDeletedTips{ + FromToUserID fromToUserID = 1; +} + + + +message BlackAddedTips{ + FromToUserID fromToUserID = 1; +} + +message BlackDeletedTips{ + FromToUserID fromToUserID = 1; +} + +message FriendInfoChangedTips{ + FromToUserID fromToUserID = 1; +} +//////////////////////user///////////////////// +message UserInfoUpdatedTips{ + string userID = 1; +} + +//////////////////////conversation///////////////////// +message ConversationUpdateTips{ + string UserID = 1; +} + +message ConversationSetPrivateTips{ + string recvID = 1; + string sendID = 2; + bool isPrivate = 3; +} + + +///cms +message RequestPagination { + int32 pageNumber = 1; + int32 showNumber = 2; +} + +message ResponsePagination { + int32 CurrentPage = 5; + int32 ShowNumber = 6; +} + + +///////////////////signal////////////// +message SignalReq { + oneof payload { + SignalInviteReq invite = 1; + SignalInviteInGroupReq inviteInGroup= 2; + SignalCancelReq cancel = 3; + SignalAcceptReq accept = 4; + SignalHungUpReq hungUp = 5; + SignalRejectReq reject = 6; + } +} + +message SignalResp { + oneof payload { + SignalInviteReply invite = 1; + SignalInviteInGroupReply inviteInGroup= 2; + SignalCancelReply cancel = 3; + SignalAcceptReply accept = 4; + SignalHungUpReply hungUp = 5; + SignalRejectReply reject = 6; + } +} + +message InvitationInfo { + string inviterUserID = 1; + repeated string inviteeUserIDList = 2; + string customData = 3; + string groupID = 4; + string roomID = 5; + int32 timeout = 6; + string mediaType = 7; + int32 platformID = 8; + int32 sessionType = 9; +} + +message ParticipantMetaData{ + GroupInfo groupInfo = 1; + GroupMemberFullInfo groupMemberInfo = 2; + PublicUserInfo userInfo = 3; +} + +message SignalInviteReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; + +} + +message SignalInviteReply { + string token = 1; + string roomID = 2; + string liveURL = 3; +} + +message SignalInviteInGroupReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; +} + +message SignalInviteInGroupReply { + string token = 1; + string roomID = 2; + string liveURL = 3; +} + +message SignalCancelReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; +} + +message SignalCancelReply { + +} + +message SignalAcceptReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; + int32 opUserPlatformID = 5; +} + +message SignalAcceptReply { + string token = 1; + string roomID = 2; + string liveURL = 3; +} + +message SignalHungUpReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; +} + +message SignalHungUpReply { + +} + + +message SignalRejectReq { + string opUserID = 1; + InvitationInfo invitation = 2; + OfflinePushInfo offlinePushInfo = 3; + ParticipantMetaData participant = 4; + int32 opUserPlatformID = 5; +} + +message SignalRejectReply { + +} + + +message DelMsgListReq{ + string opUserID = 1; + string userID = 2; + repeated uint32 seqList = 3; + string operationID = 4; +} + +message DelMsgListResp{ + int32 errCode = 1; + string errMsg = 2; +} + + diff --git a/pkg/proto/statistics/statistics.pb.go b/pkg/proto/statistics/statistics.pb.go new file mode 100644 index 000000000..5fd528d97 --- /dev/null +++ b/pkg/proto/statistics/statistics.pb.go @@ -0,0 +1,1498 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.26.0 +// protoc v3.19.3 +// source: statistics/statistics.proto + +package statistics + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type StatisticsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` +} + +func (x *StatisticsReq) Reset() { + *x = StatisticsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatisticsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatisticsReq) ProtoMessage() {} + +func (x *StatisticsReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatisticsReq.ProtoReflect.Descriptor instead. +func (*StatisticsReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{0} +} + +func (x *StatisticsReq) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *StatisticsReq) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +type GetActiveUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetActiveUserReq) Reset() { + *x = GetActiveUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetActiveUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveUserReq) ProtoMessage() {} + +func (x *GetActiveUserReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveUserReq.ProtoReflect.Descriptor instead. +func (*GetActiveUserReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{1} +} + +func (x *GetActiveUserReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetActiveUserReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type UserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NickName string `protobuf:"bytes,1,opt,name=NickName,proto3" json:"NickName,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=UserId,proto3" json:"UserId,omitempty"` + MessageNum int32 `protobuf:"varint,3,opt,name=MessageNum,proto3" json:"MessageNum,omitempty"` +} + +func (x *UserResp) Reset() { + *x = UserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserResp) ProtoMessage() {} + +func (x *UserResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserResp.ProtoReflect.Descriptor instead. +func (*UserResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{2} +} + +func (x *UserResp) GetNickName() string { + if x != nil { + return x.NickName + } + return "" +} + +func (x *UserResp) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UserResp) GetMessageNum() int32 { + if x != nil { + return x.MessageNum + } + return 0 +} + +type GetActiveUserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Users []*UserResp `protobuf:"bytes,1,rep,name=Users,proto3" json:"Users,omitempty"` +} + +func (x *GetActiveUserResp) Reset() { + *x = GetActiveUserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetActiveUserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveUserResp) ProtoMessage() {} + +func (x *GetActiveUserResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveUserResp.ProtoReflect.Descriptor instead. +func (*GetActiveUserResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{3} +} + +func (x *GetActiveUserResp) GetUsers() []*UserResp { + if x != nil { + return x.Users + } + return nil +} + +type GetActiveGroupReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetActiveGroupReq) Reset() { + *x = GetActiveGroupReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetActiveGroupReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveGroupReq) ProtoMessage() {} + +func (x *GetActiveGroupReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveGroupReq.ProtoReflect.Descriptor instead. +func (*GetActiveGroupReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{4} +} + +func (x *GetActiveGroupReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetActiveGroupReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupName string `protobuf:"bytes,1,opt,name=GroupName,proto3" json:"GroupName,omitempty"` + GroupId string `protobuf:"bytes,2,opt,name=GroupId,proto3" json:"GroupId,omitempty"` + MessageNum int32 `protobuf:"varint,3,opt,name=MessageNum,proto3" json:"MessageNum,omitempty"` +} + +func (x *GroupResp) Reset() { + *x = GroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupResp) ProtoMessage() {} + +func (x *GroupResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupResp.ProtoReflect.Descriptor instead. +func (*GroupResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{5} +} + +func (x *GroupResp) GetGroupName() string { + if x != nil { + return x.GroupName + } + return "" +} + +func (x *GroupResp) GetGroupId() string { + if x != nil { + return x.GroupId + } + return "" +} + +func (x *GroupResp) GetMessageNum() int32 { + if x != nil { + return x.MessageNum + } + return 0 +} + +type GetActiveGroupResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Groups []*GroupResp `protobuf:"bytes,1,rep,name=Groups,proto3" json:"Groups,omitempty"` +} + +func (x *GetActiveGroupResp) Reset() { + *x = GetActiveGroupResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetActiveGroupResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActiveGroupResp) ProtoMessage() {} + +func (x *GetActiveGroupResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetActiveGroupResp.ProtoReflect.Descriptor instead. +func (*GetActiveGroupResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{6} +} + +func (x *GetActiveGroupResp) GetGroups() []*GroupResp { + if x != nil { + return x.Groups + } + return nil +} + +type DateNumList struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Date string `protobuf:"bytes,1,opt,name=Date,proto3" json:"Date,omitempty"` + Num int32 `protobuf:"varint,2,opt,name=Num,proto3" json:"Num,omitempty"` +} + +func (x *DateNumList) Reset() { + *x = DateNumList{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DateNumList) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DateNumList) ProtoMessage() {} + +func (x *DateNumList) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DateNumList.ProtoReflect.Descriptor instead. +func (*DateNumList) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{7} +} + +func (x *DateNumList) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *DateNumList) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +type GetMessageStatisticsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetMessageStatisticsReq) Reset() { + *x = GetMessageStatisticsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMessageStatisticsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMessageStatisticsReq) ProtoMessage() {} + +func (x *GetMessageStatisticsReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMessageStatisticsReq.ProtoReflect.Descriptor instead. +func (*GetMessageStatisticsReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{8} +} + +func (x *GetMessageStatisticsReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetMessageStatisticsReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetMessageStatisticsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PrivateMessageNum int32 `protobuf:"varint,1,opt,name=PrivateMessageNum,proto3" json:"PrivateMessageNum,omitempty"` + GroupMessageNum int32 `protobuf:"varint,2,opt,name=GroupMessageNum,proto3" json:"GroupMessageNum,omitempty"` + PrivateMessageNumList []*DateNumList `protobuf:"bytes,3,rep,name=PrivateMessageNumList,proto3" json:"PrivateMessageNumList,omitempty"` + GroupMessageNumList []*DateNumList `protobuf:"bytes,4,rep,name=GroupMessageNumList,proto3" json:"GroupMessageNumList,omitempty"` +} + +func (x *GetMessageStatisticsResp) Reset() { + *x = GetMessageStatisticsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMessageStatisticsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMessageStatisticsResp) ProtoMessage() {} + +func (x *GetMessageStatisticsResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMessageStatisticsResp.ProtoReflect.Descriptor instead. +func (*GetMessageStatisticsResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{9} +} + +func (x *GetMessageStatisticsResp) GetPrivateMessageNum() int32 { + if x != nil { + return x.PrivateMessageNum + } + return 0 +} + +func (x *GetMessageStatisticsResp) GetGroupMessageNum() int32 { + if x != nil { + return x.GroupMessageNum + } + return 0 +} + +func (x *GetMessageStatisticsResp) GetPrivateMessageNumList() []*DateNumList { + if x != nil { + return x.PrivateMessageNumList + } + return nil +} + +func (x *GetMessageStatisticsResp) GetGroupMessageNumList() []*DateNumList { + if x != nil { + return x.GroupMessageNumList + } + return nil +} + +type GetGroupStatisticsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetGroupStatisticsReq) Reset() { + *x = GetGroupStatisticsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupStatisticsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupStatisticsReq) ProtoMessage() {} + +func (x *GetGroupStatisticsReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupStatisticsReq.ProtoReflect.Descriptor instead. +func (*GetGroupStatisticsReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{10} +} + +func (x *GetGroupStatisticsReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetGroupStatisticsReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetGroupStatisticsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IncreaseGroupNum int32 `protobuf:"varint,1,opt,name=IncreaseGroupNum,proto3" json:"IncreaseGroupNum,omitempty"` + TotalGroupNum int32 `protobuf:"varint,2,opt,name=TotalGroupNum,proto3" json:"TotalGroupNum,omitempty"` + IncreaseGroupNumList []*DateNumList `protobuf:"bytes,3,rep,name=IncreaseGroupNumList,proto3" json:"IncreaseGroupNumList,omitempty"` + TotalGroupNumList []*DateNumList `protobuf:"bytes,4,rep,name=TotalGroupNumList,proto3" json:"TotalGroupNumList,omitempty"` +} + +func (x *GetGroupStatisticsResp) Reset() { + *x = GetGroupStatisticsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupStatisticsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupStatisticsResp) ProtoMessage() {} + +func (x *GetGroupStatisticsResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupStatisticsResp.ProtoReflect.Descriptor instead. +func (*GetGroupStatisticsResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{11} +} + +func (x *GetGroupStatisticsResp) GetIncreaseGroupNum() int32 { + if x != nil { + return x.IncreaseGroupNum + } + return 0 +} + +func (x *GetGroupStatisticsResp) GetTotalGroupNum() int32 { + if x != nil { + return x.TotalGroupNum + } + return 0 +} + +func (x *GetGroupStatisticsResp) GetIncreaseGroupNumList() []*DateNumList { + if x != nil { + return x.IncreaseGroupNumList + } + return nil +} + +func (x *GetGroupStatisticsResp) GetTotalGroupNumList() []*DateNumList { + if x != nil { + return x.TotalGroupNumList + } + return nil +} + +type GetUserStatisticsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StatisticsReq *StatisticsReq `protobuf:"bytes,1,opt,name=StatisticsReq,proto3" json:"StatisticsReq,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` +} + +func (x *GetUserStatisticsReq) Reset() { + *x = GetUserStatisticsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserStatisticsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserStatisticsReq) ProtoMessage() {} + +func (x *GetUserStatisticsReq) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserStatisticsReq.ProtoReflect.Descriptor instead. +func (*GetUserStatisticsReq) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{12} +} + +func (x *GetUserStatisticsReq) GetStatisticsReq() *StatisticsReq { + if x != nil { + return x.StatisticsReq + } + return nil +} + +func (x *GetUserStatisticsReq) GetOperationID() string { + if x != nil { + return x.OperationID + } + return "" +} + +type GetUserStatisticsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IncreaseUserNum int32 `protobuf:"varint,1,opt,name=IncreaseUserNum,proto3" json:"IncreaseUserNum,omitempty"` + ActiveUserNum int32 `protobuf:"varint,2,opt,name=ActiveUserNum,proto3" json:"ActiveUserNum,omitempty"` + TotalUserNum int32 `protobuf:"varint,3,opt,name=TotalUserNum,proto3" json:"TotalUserNum,omitempty"` + IncreaseUserNumList []*DateNumList `protobuf:"bytes,4,rep,name=IncreaseUserNumList,proto3" json:"IncreaseUserNumList,omitempty"` + ActiveUserNumList []*DateNumList `protobuf:"bytes,5,rep,name=ActiveUserNumList,proto3" json:"ActiveUserNumList,omitempty"` + TotalUserNumList []*DateNumList `protobuf:"bytes,6,rep,name=TotalUserNumList,proto3" json:"TotalUserNumList,omitempty"` +} + +func (x *GetUserStatisticsResp) Reset() { + *x = GetUserStatisticsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_statistics_statistics_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserStatisticsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserStatisticsResp) ProtoMessage() {} + +func (x *GetUserStatisticsResp) ProtoReflect() protoreflect.Message { + mi := &file_statistics_statistics_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserStatisticsResp.ProtoReflect.Descriptor instead. +func (*GetUserStatisticsResp) Descriptor() ([]byte, []int) { + return file_statistics_statistics_proto_rawDescGZIP(), []int{13} +} + +func (x *GetUserStatisticsResp) GetIncreaseUserNum() int32 { + if x != nil { + return x.IncreaseUserNum + } + return 0 +} + +func (x *GetUserStatisticsResp) GetActiveUserNum() int32 { + if x != nil { + return x.ActiveUserNum + } + return 0 +} + +func (x *GetUserStatisticsResp) GetTotalUserNum() int32 { + if x != nil { + return x.TotalUserNum + } + return 0 +} + +func (x *GetUserStatisticsResp) GetIncreaseUserNumList() []*DateNumList { + if x != nil { + return x.IncreaseUserNumList + } + return nil +} + +func (x *GetUserStatisticsResp) GetActiveUserNumList() []*DateNumList { + if x != nil { + return x.ActiveUserNumList + } + return nil +} + +func (x *GetUserStatisticsResp) GetTotalUserNumList() []*DateNumList { + if x != nil { + return x.TotalUserNumList + } + return nil +} + +var File_statistics_statistics_proto protoreflect.FileDescriptor + +var file_statistics_statistics_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0x33, 0x0a, 0x0d, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, + 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, + 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x22, 0x75, + 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, + 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x52, 0x65, 0x71, 0x52, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, + 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x5e, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0x3f, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x05, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x52, + 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x22, 0x76, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0d, 0x53, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x52, 0x0d, 0x53, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x63, + 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, + 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4e, 0x75, 0x6d, 0x22, 0x43, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x06, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x52, 0x06, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x33, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x65, + 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4e, + 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x22, 0x7c, 0x0a, + 0x17, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x52, 0x0d, 0x53, 0x74, 0x61, 0x74, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x8c, 0x02, 0x0a, 0x18, + 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x11, 0x50, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x11, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x28, 0x0a, 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, + 0x12, 0x4d, 0x0a, 0x15, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, + 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x15, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x49, 0x0a, 0x13, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, + 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x75, + 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x13, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x7a, 0x0a, 0x15, 0x47, 0x65, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, + 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x52, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, + 0x63, 0x73, 0x52, 0x65, 0x71, 0x52, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0xfe, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x2a, 0x0a, 0x10, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x49, 0x6e, 0x63, + 0x72, 0x65, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, + 0x0d, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4e, 0x75, 0x6d, 0x12, 0x4b, 0x0a, 0x14, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, + 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x14, 0x49, 0x6e, 0x63, 0x72, + 0x65, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x45, 0x0a, 0x11, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x75, + 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x11, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x79, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x12, + 0x3f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, + 0x71, 0x52, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, + 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x44, 0x22, 0xe2, 0x02, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x28, 0x0a, 0x0f, + 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0d, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x22, 0x0a, 0x0c, + 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0c, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, + 0x12, 0x49, 0x0a, 0x13, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, + 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x13, 0x49, 0x6e, 0x63, 0x72, 0x65, 0x61, 0x73, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x11, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x11, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x4c, 0x69, + 0x73, 0x74, 0x12, 0x43, 0x0a, 0x10, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x4e, + 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x4e, 0x75, + 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x10, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, + 0x4e, 0x75, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x32, 0xbf, 0x03, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x12, 0x4c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x1c, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, + 0x1d, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4f, + 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x12, 0x1d, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, + 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, + 0x1e, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x61, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x23, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x5b, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x21, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x73, 0x12, 0x20, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x73, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, + 0x69, 0x63, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, + 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x19, 0x5a, 0x17, 0x2e, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, + 0x74, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_statistics_statistics_proto_rawDescOnce sync.Once + file_statistics_statistics_proto_rawDescData = file_statistics_statistics_proto_rawDesc +) + +func file_statistics_statistics_proto_rawDescGZIP() []byte { + file_statistics_statistics_proto_rawDescOnce.Do(func() { + file_statistics_statistics_proto_rawDescData = protoimpl.X.CompressGZIP(file_statistics_statistics_proto_rawDescData) + }) + return file_statistics_statistics_proto_rawDescData +} + +var file_statistics_statistics_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_statistics_statistics_proto_goTypes = []interface{}{ + (*StatisticsReq)(nil), // 0: statistics.StatisticsReq + (*GetActiveUserReq)(nil), // 1: statistics.GetActiveUserReq + (*UserResp)(nil), // 2: statistics.UserResp + (*GetActiveUserResp)(nil), // 3: statistics.GetActiveUserResp + (*GetActiveGroupReq)(nil), // 4: statistics.GetActiveGroupReq + (*GroupResp)(nil), // 5: statistics.GroupResp + (*GetActiveGroupResp)(nil), // 6: statistics.GetActiveGroupResp + (*DateNumList)(nil), // 7: statistics.DateNumList + (*GetMessageStatisticsReq)(nil), // 8: statistics.GetMessageStatisticsReq + (*GetMessageStatisticsResp)(nil), // 9: statistics.GetMessageStatisticsResp + (*GetGroupStatisticsReq)(nil), // 10: statistics.GetGroupStatisticsReq + (*GetGroupStatisticsResp)(nil), // 11: statistics.GetGroupStatisticsResp + (*GetUserStatisticsReq)(nil), // 12: statistics.GetUserStatisticsReq + (*GetUserStatisticsResp)(nil), // 13: statistics.GetUserStatisticsResp +} +var file_statistics_statistics_proto_depIdxs = []int32{ + 0, // 0: statistics.GetActiveUserReq.StatisticsReq:type_name -> statistics.StatisticsReq + 2, // 1: statistics.GetActiveUserResp.Users:type_name -> statistics.UserResp + 0, // 2: statistics.GetActiveGroupReq.StatisticsReq:type_name -> statistics.StatisticsReq + 5, // 3: statistics.GetActiveGroupResp.Groups:type_name -> statistics.GroupResp + 0, // 4: statistics.GetMessageStatisticsReq.StatisticsReq:type_name -> statistics.StatisticsReq + 7, // 5: statistics.GetMessageStatisticsResp.PrivateMessageNumList:type_name -> statistics.DateNumList + 7, // 6: statistics.GetMessageStatisticsResp.GroupMessageNumList:type_name -> statistics.DateNumList + 0, // 7: statistics.GetGroupStatisticsReq.StatisticsReq:type_name -> statistics.StatisticsReq + 7, // 8: statistics.GetGroupStatisticsResp.IncreaseGroupNumList:type_name -> statistics.DateNumList + 7, // 9: statistics.GetGroupStatisticsResp.TotalGroupNumList:type_name -> statistics.DateNumList + 0, // 10: statistics.GetUserStatisticsReq.StatisticsReq:type_name -> statistics.StatisticsReq + 7, // 11: statistics.GetUserStatisticsResp.IncreaseUserNumList:type_name -> statistics.DateNumList + 7, // 12: statistics.GetUserStatisticsResp.ActiveUserNumList:type_name -> statistics.DateNumList + 7, // 13: statistics.GetUserStatisticsResp.TotalUserNumList:type_name -> statistics.DateNumList + 1, // 14: statistics.user.GetActiveUser:input_type -> statistics.GetActiveUserReq + 4, // 15: statistics.user.GetActiveGroup:input_type -> statistics.GetActiveGroupReq + 8, // 16: statistics.user.GetMessageStatistics:input_type -> statistics.GetMessageStatisticsReq + 10, // 17: statistics.user.GetGroupStatistics:input_type -> statistics.GetGroupStatisticsReq + 12, // 18: statistics.user.GetUserStatistics:input_type -> statistics.GetUserStatisticsReq + 3, // 19: statistics.user.GetActiveUser:output_type -> statistics.GetActiveUserResp + 6, // 20: statistics.user.GetActiveGroup:output_type -> statistics.GetActiveGroupResp + 9, // 21: statistics.user.GetMessageStatistics:output_type -> statistics.GetMessageStatisticsResp + 11, // 22: statistics.user.GetGroupStatistics:output_type -> statistics.GetGroupStatisticsResp + 13, // 23: statistics.user.GetUserStatistics:output_type -> statistics.GetUserStatisticsResp + 19, // [19:24] is the sub-list for method output_type + 14, // [14:19] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_statistics_statistics_proto_init() } +func file_statistics_statistics_proto_init() { + if File_statistics_statistics_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_statistics_statistics_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatisticsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetActiveUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetActiveUserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetActiveGroupReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetActiveGroupResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DateNumList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMessageStatisticsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMessageStatisticsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupStatisticsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupStatisticsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserStatisticsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_statistics_statistics_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserStatisticsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_statistics_statistics_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_statistics_statistics_proto_goTypes, + DependencyIndexes: file_statistics_statistics_proto_depIdxs, + MessageInfos: file_statistics_statistics_proto_msgTypes, + }.Build() + File_statistics_statistics_proto = out.File + file_statistics_statistics_proto_rawDesc = nil + file_statistics_statistics_proto_goTypes = nil + file_statistics_statistics_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// UserClient is the client API for User service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type UserClient interface { + GetActiveUser(ctx context.Context, in *GetActiveUserReq, opts ...grpc.CallOption) (*GetActiveUserResp, error) + GetActiveGroup(ctx context.Context, in *GetActiveGroupReq, opts ...grpc.CallOption) (*GetActiveGroupResp, error) + GetMessageStatistics(ctx context.Context, in *GetMessageStatisticsReq, opts ...grpc.CallOption) (*GetMessageStatisticsResp, error) + GetGroupStatistics(ctx context.Context, in *GetGroupStatisticsReq, opts ...grpc.CallOption) (*GetGroupStatisticsResp, error) + GetUserStatistics(ctx context.Context, in *GetUserStatisticsReq, opts ...grpc.CallOption) (*GetUserStatisticsResp, error) +} + +type userClient struct { + cc grpc.ClientConnInterface +} + +func NewUserClient(cc grpc.ClientConnInterface) UserClient { + return &userClient{cc} +} + +func (c *userClient) GetActiveUser(ctx context.Context, in *GetActiveUserReq, opts ...grpc.CallOption) (*GetActiveUserResp, error) { + out := new(GetActiveUserResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetActiveUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetActiveGroup(ctx context.Context, in *GetActiveGroupReq, opts ...grpc.CallOption) (*GetActiveGroupResp, error) { + out := new(GetActiveGroupResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetActiveGroup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetMessageStatistics(ctx context.Context, in *GetMessageStatisticsReq, opts ...grpc.CallOption) (*GetMessageStatisticsResp, error) { + out := new(GetMessageStatisticsResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetMessageStatistics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetGroupStatistics(ctx context.Context, in *GetGroupStatisticsReq, opts ...grpc.CallOption) (*GetGroupStatisticsResp, error) { + out := new(GetGroupStatisticsResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetGroupStatistics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetUserStatistics(ctx context.Context, in *GetUserStatisticsReq, opts ...grpc.CallOption) (*GetUserStatisticsResp, error) { + out := new(GetUserStatisticsResp) + err := c.cc.Invoke(ctx, "/statistics.user/GetUserStatistics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServer is the server API for User service. +type UserServer interface { + GetActiveUser(context.Context, *GetActiveUserReq) (*GetActiveUserResp, error) + GetActiveGroup(context.Context, *GetActiveGroupReq) (*GetActiveGroupResp, error) + GetMessageStatistics(context.Context, *GetMessageStatisticsReq) (*GetMessageStatisticsResp, error) + GetGroupStatistics(context.Context, *GetGroupStatisticsReq) (*GetGroupStatisticsResp, error) + GetUserStatistics(context.Context, *GetUserStatisticsReq) (*GetUserStatisticsResp, error) +} + +// UnimplementedUserServer can be embedded to have forward compatible implementations. +type UnimplementedUserServer struct { +} + +func (*UnimplementedUserServer) GetActiveUser(context.Context, *GetActiveUserReq) (*GetActiveUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetActiveUser not implemented") +} +func (*UnimplementedUserServer) GetActiveGroup(context.Context, *GetActiveGroupReq) (*GetActiveGroupResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetActiveGroup not implemented") +} +func (*UnimplementedUserServer) GetMessageStatistics(context.Context, *GetMessageStatisticsReq) (*GetMessageStatisticsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMessageStatistics not implemented") +} +func (*UnimplementedUserServer) GetGroupStatistics(context.Context, *GetGroupStatisticsReq) (*GetGroupStatisticsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGroupStatistics not implemented") +} +func (*UnimplementedUserServer) GetUserStatistics(context.Context, *GetUserStatisticsReq) (*GetUserStatisticsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserStatistics not implemented") +} + +func RegisterUserServer(s *grpc.Server, srv UserServer) { + s.RegisterService(&_User_serviceDesc, srv) +} + +func _User_GetActiveUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetActiveUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetActiveUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetActiveUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetActiveUser(ctx, req.(*GetActiveUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetActiveGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetActiveGroupReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetActiveGroup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetActiveGroup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetActiveGroup(ctx, req.(*GetActiveGroupReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetMessageStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMessageStatisticsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetMessageStatistics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetMessageStatistics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetMessageStatistics(ctx, req.(*GetMessageStatisticsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetGroupStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetGroupStatisticsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetGroupStatistics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetGroupStatistics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetGroupStatistics(ctx, req.(*GetGroupStatisticsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetUserStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserStatisticsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetUserStatistics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/statistics.user/GetUserStatistics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetUserStatistics(ctx, req.(*GetUserStatisticsReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _User_serviceDesc = grpc.ServiceDesc{ + ServiceName: "statistics.user", + HandlerType: (*UserServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetActiveUser", + Handler: _User_GetActiveUser_Handler, + }, + { + MethodName: "GetActiveGroup", + Handler: _User_GetActiveGroup_Handler, + }, + { + MethodName: "GetMessageStatistics", + Handler: _User_GetMessageStatistics_Handler, + }, + { + MethodName: "GetGroupStatistics", + Handler: _User_GetGroupStatistics_Handler, + }, + { + MethodName: "GetUserStatistics", + Handler: _User_GetUserStatistics_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "statistics/statistics.proto", +} diff --git a/pkg/proto/statistics/statistics.proto b/pkg/proto/statistics/statistics.proto new file mode 100644 index 000000000..3c72e4bc5 --- /dev/null +++ b/pkg/proto/statistics/statistics.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; +// import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./statistics;statistics"; +package statistics; + +message StatisticsReq { + string from = 1; + string to = 2; +} + +message GetActiveUserReq{ + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + +message UserResp{ + string NickName = 1; + string UserId = 2; + int32 MessageNum = 3; +} + +message GetActiveUserResp { + repeated UserResp Users = 1; +} + +message GetActiveGroupReq{ + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + +message GroupResp { + string GroupName = 1; + string GroupId = 2; + int32 MessageNum = 3; +} + +message GetActiveGroupResp { + repeated GroupResp Groups = 1; +} + +message DateNumList { + string Date = 1; + int32 Num = 2; +} + + +message GetMessageStatisticsReq { + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + + +message GetMessageStatisticsResp { + int32 PrivateMessageNum = 1; + int32 GroupMessageNum = 2; + repeated DateNumList PrivateMessageNumList = 3; + repeated DateNumList GroupMessageNumList = 4; +} + +message GetGroupStatisticsReq { + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + + +message GetGroupStatisticsResp { + int32 IncreaseGroupNum = 1; + int32 TotalGroupNum = 2; + repeated DateNumList IncreaseGroupNumList = 3; + repeated DateNumList TotalGroupNumList = 4; +} + +message GetUserStatisticsReq { + StatisticsReq StatisticsReq = 1; + string OperationID = 2; +} + +message GetUserStatisticsResp { + int32 IncreaseUserNum = 1; + int32 ActiveUserNum = 2; + int32 TotalUserNum = 3; + repeated DateNumList IncreaseUserNumList = 4; + repeated DateNumList ActiveUserNumList = 5; + repeated DateNumList TotalUserNumList = 6; +} + +service user { + rpc GetActiveUser(GetActiveUserReq) returns(GetActiveUserResp); + rpc GetActiveGroup(GetActiveGroupReq) returns(GetActiveGroupResp); + rpc GetMessageStatistics(GetMessageStatisticsReq) returns(GetMessageStatisticsResp); + rpc GetGroupStatistics(GetGroupStatisticsReq) returns(GetGroupStatisticsResp); + rpc GetUserStatistics(GetUserStatisticsReq) returns(GetUserStatisticsResp); +} \ No newline at end of file diff --git a/pkg/proto/user/user.pb.go b/pkg/proto/user/user.pb.go new file mode 100644 index 000000000..1c8b88653 --- /dev/null +++ b/pkg/proto/user/user.pb.go @@ -0,0 +1,3505 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: user/user.proto + +package user // import "./user" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// 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 CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_6133bd34462fbb1a, []int{0} +} +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) +} +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) +} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) +} +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo + +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode + } + return 0 +} + +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg + } + return "" +} + +type DeleteUsersReq struct { + DeleteUserIDList []string `protobuf:"bytes,2,rep,name=DeleteUserIDList" json:"DeleteUserIDList,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_6133bd34462fbb1a, []int{1} +} +func (m *DeleteUsersReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteUsersReq.Unmarshal(m, b) +} +func (m *DeleteUsersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteUsersReq.Marshal(b, m, deterministic) +} +func (dst *DeleteUsersReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteUsersReq.Merge(dst, src) +} +func (m *DeleteUsersReq) XXX_Size() int { + return xxx_messageInfo_DeleteUsersReq.Size(m) +} +func (m *DeleteUsersReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteUsersReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteUsersReq proto.InternalMessageInfo + +func (m *DeleteUsersReq) GetDeleteUserIDList() []string { + if m != nil { + return m.DeleteUserIDList + } + return nil +} + +func (m *DeleteUsersReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *DeleteUsersReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type DeleteUsersResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + FailedUserIDList []string `protobuf:"bytes,2,rep,name=FailedUserIDList" json:"FailedUserIDList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_6133bd34462fbb1a, []int{2} +} +func (m *DeleteUsersResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteUsersResp.Unmarshal(m, b) +} +func (m *DeleteUsersResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteUsersResp.Marshal(b, m, deterministic) +} +func (dst *DeleteUsersResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteUsersResp.Merge(dst, src) +} +func (m *DeleteUsersResp) XXX_Size() int { + return xxx_messageInfo_DeleteUsersResp.Size(m) +} +func (m *DeleteUsersResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteUsersResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteUsersResp proto.InternalMessageInfo + +func (m *DeleteUsersResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *DeleteUsersResp) GetFailedUserIDList() []string { + if m != nil { + return m.FailedUserIDList + } + return nil +} + +type GetAllUserIDReq struct { + OpUserID string `protobuf:"bytes,1,opt,name=opUserID" json:"opUserID,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 *GetAllUserIDReq) Reset() { *m = GetAllUserIDReq{} } +func (m *GetAllUserIDReq) String() string { return proto.CompactTextString(m) } +func (*GetAllUserIDReq) ProtoMessage() {} +func (*GetAllUserIDReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{3} +} +func (m *GetAllUserIDReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllUserIDReq.Unmarshal(m, b) +} +func (m *GetAllUserIDReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllUserIDReq.Marshal(b, m, deterministic) +} +func (dst *GetAllUserIDReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllUserIDReq.Merge(dst, src) +} +func (m *GetAllUserIDReq) XXX_Size() int { + return xxx_messageInfo_GetAllUserIDReq.Size(m) +} +func (m *GetAllUserIDReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllUserIDReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllUserIDReq proto.InternalMessageInfo + +func (m *GetAllUserIDReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetAllUserIDReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetAllUserIDResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + UserIDList []string `protobuf:"bytes,2,rep,name=UserIDList" json:"UserIDList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAllUserIDResp) Reset() { *m = GetAllUserIDResp{} } +func (m *GetAllUserIDResp) String() string { return proto.CompactTextString(m) } +func (*GetAllUserIDResp) ProtoMessage() {} +func (*GetAllUserIDResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{4} +} +func (m *GetAllUserIDResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllUserIDResp.Unmarshal(m, b) +} +func (m *GetAllUserIDResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllUserIDResp.Marshal(b, m, deterministic) +} +func (dst *GetAllUserIDResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllUserIDResp.Merge(dst, src) +} +func (m *GetAllUserIDResp) XXX_Size() int { + return xxx_messageInfo_GetAllUserIDResp.Size(m) +} +func (m *GetAllUserIDResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllUserIDResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllUserIDResp proto.InternalMessageInfo + +func (m *GetAllUserIDResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetAllUserIDResp) GetUserIDList() []string { + if m != nil { + return m.UserIDList + } + return nil +} + +type AccountCheckReq struct { + CheckUserIDList []string `protobuf:"bytes,1,rep,name=CheckUserIDList" json:"CheckUserIDList,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AccountCheckReq) Reset() { *m = AccountCheckReq{} } +func (m *AccountCheckReq) String() string { return proto.CompactTextString(m) } +func (*AccountCheckReq) ProtoMessage() {} +func (*AccountCheckReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{5} +} +func (m *AccountCheckReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AccountCheckReq.Unmarshal(m, b) +} +func (m *AccountCheckReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AccountCheckReq.Marshal(b, m, deterministic) +} +func (dst *AccountCheckReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountCheckReq.Merge(dst, src) +} +func (m *AccountCheckReq) XXX_Size() int { + return xxx_messageInfo_AccountCheckReq.Size(m) +} +func (m *AccountCheckReq) XXX_DiscardUnknown() { + xxx_messageInfo_AccountCheckReq.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountCheckReq proto.InternalMessageInfo + +func (m *AccountCheckReq) GetCheckUserIDList() []string { + if m != nil { + return m.CheckUserIDList + } + return nil +} + +func (m *AccountCheckReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *AccountCheckReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type AccountCheckResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + ResultList []*AccountCheckResp_SingleUserStatus `protobuf:"bytes,2,rep,name=ResultList" json:"ResultList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AccountCheckResp) Reset() { *m = AccountCheckResp{} } +func (m *AccountCheckResp) String() string { return proto.CompactTextString(m) } +func (*AccountCheckResp) ProtoMessage() {} +func (*AccountCheckResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{6} +} +func (m *AccountCheckResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AccountCheckResp.Unmarshal(m, b) +} +func (m *AccountCheckResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AccountCheckResp.Marshal(b, m, deterministic) +} +func (dst *AccountCheckResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountCheckResp.Merge(dst, src) +} +func (m *AccountCheckResp) XXX_Size() int { + return xxx_messageInfo_AccountCheckResp.Size(m) +} +func (m *AccountCheckResp) XXX_DiscardUnknown() { + xxx_messageInfo_AccountCheckResp.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountCheckResp proto.InternalMessageInfo + +func (m *AccountCheckResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *AccountCheckResp) GetResultList() []*AccountCheckResp_SingleUserStatus { + if m != nil { + return m.ResultList + } + return nil +} + +type AccountCheckResp_SingleUserStatus struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + AccountStatus string `protobuf:"bytes,2,opt,name=accountStatus" json:"accountStatus,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AccountCheckResp_SingleUserStatus) Reset() { *m = AccountCheckResp_SingleUserStatus{} } +func (m *AccountCheckResp_SingleUserStatus) String() string { return proto.CompactTextString(m) } +func (*AccountCheckResp_SingleUserStatus) ProtoMessage() {} +func (*AccountCheckResp_SingleUserStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{6, 0} +} +func (m *AccountCheckResp_SingleUserStatus) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AccountCheckResp_SingleUserStatus.Unmarshal(m, b) +} +func (m *AccountCheckResp_SingleUserStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AccountCheckResp_SingleUserStatus.Marshal(b, m, deterministic) +} +func (dst *AccountCheckResp_SingleUserStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountCheckResp_SingleUserStatus.Merge(dst, src) +} +func (m *AccountCheckResp_SingleUserStatus) XXX_Size() int { + return xxx_messageInfo_AccountCheckResp_SingleUserStatus.Size(m) +} +func (m *AccountCheckResp_SingleUserStatus) XXX_DiscardUnknown() { + xxx_messageInfo_AccountCheckResp_SingleUserStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountCheckResp_SingleUserStatus proto.InternalMessageInfo + +func (m *AccountCheckResp_SingleUserStatus) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *AccountCheckResp_SingleUserStatus) GetAccountStatus() string { + if m != nil { + return m.AccountStatus + } + return "" +} + +type GetUserInfoReq struct { + UserIDList []string `protobuf:"bytes,1,rep,name=userIDList" json:"userIDList,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_6133bd34462fbb1a, []int{7} +} +func (m *GetUserInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserInfoReq.Unmarshal(m, b) +} +func (m *GetUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserInfoReq.Marshal(b, m, deterministic) +} +func (dst *GetUserInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserInfoReq.Merge(dst, src) +} +func (m *GetUserInfoReq) XXX_Size() int { + return xxx_messageInfo_GetUserInfoReq.Size(m) +} +func (m *GetUserInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserInfoReq proto.InternalMessageInfo + +func (m *GetUserInfoReq) GetUserIDList() []string { + if m != nil { + return m.UserIDList + } + return nil +} + +func (m *GetUserInfoReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *GetUserInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + UserInfoList []*sdk_ws.UserInfo `protobuf:"bytes,3,rep,name=UserInfoList" json:"UserInfoList,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_6133bd34462fbb1a, []int{8} +} +func (m *GetUserInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserInfoResp.Unmarshal(m, b) +} +func (m *GetUserInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserInfoResp.Marshal(b, m, deterministic) +} +func (dst *GetUserInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserInfoResp.Merge(dst, src) +} +func (m *GetUserInfoResp) XXX_Size() int { + return xxx_messageInfo_GetUserInfoResp.Size(m) +} +func (m *GetUserInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserInfoResp proto.InternalMessageInfo + +func (m *GetUserInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserInfoResp) GetUserInfoList() []*sdk_ws.UserInfo { + if m != nil { + return m.UserInfoList + } + return nil +} + +type UpdateUserInfoReq struct { + UserInfo *sdk_ws.UserInfo `protobuf:"bytes,1,opt,name=UserInfo" json:"UserInfo,omitempty"` + OpUserID string `protobuf:"bytes,2,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +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_6133bd34462fbb1a, []int{9} +} +func (m *UpdateUserInfoReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateUserInfoReq.Unmarshal(m, b) +} +func (m *UpdateUserInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateUserInfoReq.Marshal(b, m, deterministic) +} +func (dst *UpdateUserInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateUserInfoReq.Merge(dst, src) +} +func (m *UpdateUserInfoReq) XXX_Size() int { + return xxx_messageInfo_UpdateUserInfoReq.Size(m) +} +func (m *UpdateUserInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateUserInfoReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateUserInfoReq proto.InternalMessageInfo + +func (m *UpdateUserInfoReq) GetUserInfo() *sdk_ws.UserInfo { + if m != nil { + return m.UserInfo + } + return nil +} + +func (m *UpdateUserInfoReq) GetOpUserID() string { + if m != nil { + return m.OpUserID + } + return "" +} + +func (m *UpdateUserInfoReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type UpdateUserInfoResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UpdateUserInfoResp) Reset() { *m = UpdateUserInfoResp{} } +func (m *UpdateUserInfoResp) String() string { return proto.CompactTextString(m) } +func (*UpdateUserInfoResp) ProtoMessage() {} +func (*UpdateUserInfoResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{10} +} +func (m *UpdateUserInfoResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UpdateUserInfoResp.Unmarshal(m, b) +} +func (m *UpdateUserInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UpdateUserInfoResp.Marshal(b, m, deterministic) +} +func (dst *UpdateUserInfoResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpdateUserInfoResp.Merge(dst, src) +} +func (m *UpdateUserInfoResp) XXX_Size() int { + return xxx_messageInfo_UpdateUserInfoResp.Size(m) +} +func (m *UpdateUserInfoResp) XXX_DiscardUnknown() { + xxx_messageInfo_UpdateUserInfoResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UpdateUserInfoResp proto.InternalMessageInfo + +func (m *UpdateUserInfoResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type Conversation struct { + OwnerUserID string `protobuf:"bytes,1,opt,name=OwnerUserID" json:"OwnerUserID,omitempty"` + ConversationID string `protobuf:"bytes,2,opt,name=ConversationID" json:"ConversationID,omitempty"` + RecvMsgOpt int32 `protobuf:"varint,3,opt,name=RecvMsgOpt" json:"RecvMsgOpt,omitempty"` + ConversationType int32 `protobuf:"varint,4,opt,name=ConversationType" json:"ConversationType,omitempty"` + UserID string `protobuf:"bytes,5,opt,name=UserID" json:"UserID,omitempty"` + GroupID string `protobuf:"bytes,6,opt,name=GroupID" json:"GroupID,omitempty"` + UnreadCount int32 `protobuf:"varint,7,opt,name=UnreadCount" json:"UnreadCount,omitempty"` + DraftTextTime int64 `protobuf:"varint,8,opt,name=DraftTextTime" json:"DraftTextTime,omitempty"` + IsPinned bool `protobuf:"varint,9,opt,name=IsPinned" json:"IsPinned,omitempty"` + AttachedInfo string `protobuf:"bytes,10,opt,name=AttachedInfo" json:"AttachedInfo,omitempty"` + IsPrivateChat bool `protobuf:"varint,11,opt,name=IsPrivateChat" json:"IsPrivateChat,omitempty"` + Ex string `protobuf:"bytes,12,opt,name=Ex" json:"Ex,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Conversation) Reset() { *m = Conversation{} } +func (m *Conversation) String() string { return proto.CompactTextString(m) } +func (*Conversation) ProtoMessage() {} +func (*Conversation) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{11} +} +func (m *Conversation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Conversation.Unmarshal(m, b) +} +func (m *Conversation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Conversation.Marshal(b, m, deterministic) +} +func (dst *Conversation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Conversation.Merge(dst, src) +} +func (m *Conversation) XXX_Size() int { + return xxx_messageInfo_Conversation.Size(m) +} +func (m *Conversation) XXX_DiscardUnknown() { + xxx_messageInfo_Conversation.DiscardUnknown(m) +} + +var xxx_messageInfo_Conversation proto.InternalMessageInfo + +func (m *Conversation) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *Conversation) GetConversationID() string { + if m != nil { + return m.ConversationID + } + return "" +} + +func (m *Conversation) GetRecvMsgOpt() int32 { + if m != nil { + return m.RecvMsgOpt + } + return 0 +} + +func (m *Conversation) GetConversationType() int32 { + if m != nil { + return m.ConversationType + } + return 0 +} + +func (m *Conversation) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *Conversation) GetGroupID() string { + if m != nil { + return m.GroupID + } + return "" +} + +func (m *Conversation) GetUnreadCount() int32 { + if m != nil { + return m.UnreadCount + } + return 0 +} + +func (m *Conversation) GetDraftTextTime() int64 { + if m != nil { + return m.DraftTextTime + } + return 0 +} + +func (m *Conversation) GetIsPinned() bool { + if m != nil { + return m.IsPinned + } + return false +} + +func (m *Conversation) GetAttachedInfo() string { + if m != nil { + return m.AttachedInfo + } + return "" +} + +func (m *Conversation) GetIsPrivateChat() bool { + if m != nil { + return m.IsPrivateChat + } + return false +} + +func (m *Conversation) GetEx() string { + if m != nil { + return m.Ex + } + return "" +} + +type SetConversationReq struct { + Conversation *Conversation `protobuf:"bytes,1,opt,name=Conversation" json:"Conversation,omitempty"` + NotificationType int32 `protobuf:"varint,2,opt,name=notificationType" json:"notificationType,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetConversationReq) Reset() { *m = SetConversationReq{} } +func (m *SetConversationReq) String() string { return proto.CompactTextString(m) } +func (*SetConversationReq) ProtoMessage() {} +func (*SetConversationReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{12} +} +func (m *SetConversationReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetConversationReq.Unmarshal(m, b) +} +func (m *SetConversationReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetConversationReq.Marshal(b, m, deterministic) +} +func (dst *SetConversationReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetConversationReq.Merge(dst, src) +} +func (m *SetConversationReq) XXX_Size() int { + return xxx_messageInfo_SetConversationReq.Size(m) +} +func (m *SetConversationReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetConversationReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetConversationReq proto.InternalMessageInfo + +func (m *SetConversationReq) GetConversation() *Conversation { + if m != nil { + return m.Conversation + } + return nil +} + +func (m *SetConversationReq) GetNotificationType() int32 { + if m != nil { + return m.NotificationType + } + return 0 +} + +func (m *SetConversationReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetConversationResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetConversationResp) Reset() { *m = SetConversationResp{} } +func (m *SetConversationResp) String() string { return proto.CompactTextString(m) } +func (*SetConversationResp) ProtoMessage() {} +func (*SetConversationResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{13} +} +func (m *SetConversationResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetConversationResp.Unmarshal(m, b) +} +func (m *SetConversationResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetConversationResp.Marshal(b, m, deterministic) +} +func (dst *SetConversationResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetConversationResp.Merge(dst, src) +} +func (m *SetConversationResp) XXX_Size() int { + return xxx_messageInfo_SetConversationResp.Size(m) +} +func (m *SetConversationResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetConversationResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetConversationResp proto.InternalMessageInfo + +func (m *SetConversationResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type SetRecvMsgOptReq struct { + OwnerUserID string `protobuf:"bytes,1,opt,name=OwnerUserID" json:"OwnerUserID,omitempty"` + ConversationID string `protobuf:"bytes,2,opt,name=ConversationID" json:"ConversationID,omitempty"` + RecvMsgOpt int32 `protobuf:"varint,3,opt,name=RecvMsgOpt" json:"RecvMsgOpt,omitempty"` + NotificationType int32 `protobuf:"varint,4,opt,name=notificationType" json:"notificationType,omitempty"` + OperationID string `protobuf:"bytes,5,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetRecvMsgOptReq) Reset() { *m = SetRecvMsgOptReq{} } +func (m *SetRecvMsgOptReq) String() string { return proto.CompactTextString(m) } +func (*SetRecvMsgOptReq) ProtoMessage() {} +func (*SetRecvMsgOptReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{14} +} +func (m *SetRecvMsgOptReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetRecvMsgOptReq.Unmarshal(m, b) +} +func (m *SetRecvMsgOptReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetRecvMsgOptReq.Marshal(b, m, deterministic) +} +func (dst *SetRecvMsgOptReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetRecvMsgOptReq.Merge(dst, src) +} +func (m *SetRecvMsgOptReq) XXX_Size() int { + return xxx_messageInfo_SetRecvMsgOptReq.Size(m) +} +func (m *SetRecvMsgOptReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetRecvMsgOptReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetRecvMsgOptReq proto.InternalMessageInfo + +func (m *SetRecvMsgOptReq) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *SetRecvMsgOptReq) GetConversationID() string { + if m != nil { + return m.ConversationID + } + return "" +} + +func (m *SetRecvMsgOptReq) GetRecvMsgOpt() int32 { + if m != nil { + return m.RecvMsgOpt + } + return 0 +} + +func (m *SetRecvMsgOptReq) GetNotificationType() int32 { + if m != nil { + return m.NotificationType + } + return 0 +} + +func (m *SetRecvMsgOptReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetRecvMsgOptResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetRecvMsgOptResp) Reset() { *m = SetRecvMsgOptResp{} } +func (m *SetRecvMsgOptResp) String() string { return proto.CompactTextString(m) } +func (*SetRecvMsgOptResp) ProtoMessage() {} +func (*SetRecvMsgOptResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{15} +} +func (m *SetRecvMsgOptResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetRecvMsgOptResp.Unmarshal(m, b) +} +func (m *SetRecvMsgOptResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetRecvMsgOptResp.Marshal(b, m, deterministic) +} +func (dst *SetRecvMsgOptResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetRecvMsgOptResp.Merge(dst, src) +} +func (m *SetRecvMsgOptResp) XXX_Size() int { + return xxx_messageInfo_SetRecvMsgOptResp.Size(m) +} +func (m *SetRecvMsgOptResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetRecvMsgOptResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetRecvMsgOptResp proto.InternalMessageInfo + +func (m *SetRecvMsgOptResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetConversationReq struct { + ConversationID string `protobuf:"bytes,1,opt,name=ConversationID" json:"ConversationID,omitempty"` + OwnerUserID string `protobuf:"bytes,2,opt,name=OwnerUserID" json:"OwnerUserID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetConversationReq) Reset() { *m = GetConversationReq{} } +func (m *GetConversationReq) String() string { return proto.CompactTextString(m) } +func (*GetConversationReq) ProtoMessage() {} +func (*GetConversationReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{16} +} +func (m *GetConversationReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetConversationReq.Unmarshal(m, b) +} +func (m *GetConversationReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetConversationReq.Marshal(b, m, deterministic) +} +func (dst *GetConversationReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetConversationReq.Merge(dst, src) +} +func (m *GetConversationReq) XXX_Size() int { + return xxx_messageInfo_GetConversationReq.Size(m) +} +func (m *GetConversationReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetConversationReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetConversationReq proto.InternalMessageInfo + +func (m *GetConversationReq) GetConversationID() string { + if m != nil { + return m.ConversationID + } + return "" +} + +func (m *GetConversationReq) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *GetConversationReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetConversationResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Conversation *Conversation `protobuf:"bytes,2,opt,name=Conversation" json:"Conversation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetConversationResp) Reset() { *m = GetConversationResp{} } +func (m *GetConversationResp) String() string { return proto.CompactTextString(m) } +func (*GetConversationResp) ProtoMessage() {} +func (*GetConversationResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{17} +} +func (m *GetConversationResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetConversationResp.Unmarshal(m, b) +} +func (m *GetConversationResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetConversationResp.Marshal(b, m, deterministic) +} +func (dst *GetConversationResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetConversationResp.Merge(dst, src) +} +func (m *GetConversationResp) XXX_Size() int { + return xxx_messageInfo_GetConversationResp.Size(m) +} +func (m *GetConversationResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetConversationResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetConversationResp proto.InternalMessageInfo + +func (m *GetConversationResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetConversationResp) GetConversation() *Conversation { + if m != nil { + return m.Conversation + } + return nil +} + +type GetConversationsReq struct { + OwnerUserID string `protobuf:"bytes,1,opt,name=OwnerUserID" json:"OwnerUserID,omitempty"` + ConversationIDs []string `protobuf:"bytes,2,rep,name=ConversationIDs" json:"ConversationIDs,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetConversationsReq) Reset() { *m = GetConversationsReq{} } +func (m *GetConversationsReq) String() string { return proto.CompactTextString(m) } +func (*GetConversationsReq) ProtoMessage() {} +func (*GetConversationsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{18} +} +func (m *GetConversationsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetConversationsReq.Unmarshal(m, b) +} +func (m *GetConversationsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetConversationsReq.Marshal(b, m, deterministic) +} +func (dst *GetConversationsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetConversationsReq.Merge(dst, src) +} +func (m *GetConversationsReq) XXX_Size() int { + return xxx_messageInfo_GetConversationsReq.Size(m) +} +func (m *GetConversationsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetConversationsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetConversationsReq proto.InternalMessageInfo + +func (m *GetConversationsReq) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *GetConversationsReq) GetConversationIDs() []string { + if m != nil { + return m.ConversationIDs + } + return nil +} + +func (m *GetConversationsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetConversationsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Conversations []*Conversation `protobuf:"bytes,2,rep,name=Conversations" json:"Conversations,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetConversationsResp) Reset() { *m = GetConversationsResp{} } +func (m *GetConversationsResp) String() string { return proto.CompactTextString(m) } +func (*GetConversationsResp) ProtoMessage() {} +func (*GetConversationsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{19} +} +func (m *GetConversationsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetConversationsResp.Unmarshal(m, b) +} +func (m *GetConversationsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetConversationsResp.Marshal(b, m, deterministic) +} +func (dst *GetConversationsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetConversationsResp.Merge(dst, src) +} +func (m *GetConversationsResp) XXX_Size() int { + return xxx_messageInfo_GetConversationsResp.Size(m) +} +func (m *GetConversationsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetConversationsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetConversationsResp proto.InternalMessageInfo + +func (m *GetConversationsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetConversationsResp) GetConversations() []*Conversation { + if m != nil { + return m.Conversations + } + return nil +} + +type GetAllConversationsReq struct { + OwnerUserID string `protobuf:"bytes,1,opt,name=OwnerUserID" json:"OwnerUserID,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 *GetAllConversationsReq) Reset() { *m = GetAllConversationsReq{} } +func (m *GetAllConversationsReq) String() string { return proto.CompactTextString(m) } +func (*GetAllConversationsReq) ProtoMessage() {} +func (*GetAllConversationsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{20} +} +func (m *GetAllConversationsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllConversationsReq.Unmarshal(m, b) +} +func (m *GetAllConversationsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllConversationsReq.Marshal(b, m, deterministic) +} +func (dst *GetAllConversationsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllConversationsReq.Merge(dst, src) +} +func (m *GetAllConversationsReq) XXX_Size() int { + return xxx_messageInfo_GetAllConversationsReq.Size(m) +} +func (m *GetAllConversationsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllConversationsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllConversationsReq proto.InternalMessageInfo + +func (m *GetAllConversationsReq) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *GetAllConversationsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetAllConversationsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Conversations []*Conversation `protobuf:"bytes,2,rep,name=Conversations" json:"Conversations,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAllConversationsResp) Reset() { *m = GetAllConversationsResp{} } +func (m *GetAllConversationsResp) String() string { return proto.CompactTextString(m) } +func (*GetAllConversationsResp) ProtoMessage() {} +func (*GetAllConversationsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{21} +} +func (m *GetAllConversationsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllConversationsResp.Unmarshal(m, b) +} +func (m *GetAllConversationsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllConversationsResp.Marshal(b, m, deterministic) +} +func (dst *GetAllConversationsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllConversationsResp.Merge(dst, src) +} +func (m *GetAllConversationsResp) XXX_Size() int { + return xxx_messageInfo_GetAllConversationsResp.Size(m) +} +func (m *GetAllConversationsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllConversationsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllConversationsResp proto.InternalMessageInfo + +func (m *GetAllConversationsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetAllConversationsResp) GetConversations() []*Conversation { + if m != nil { + return m.Conversations + } + return nil +} + +type BatchSetConversationsReq struct { + Conversations []*Conversation `protobuf:"bytes,1,rep,name=Conversations" json:"Conversations,omitempty"` + OwnerUserID string `protobuf:"bytes,2,opt,name=OwnerUserID" json:"OwnerUserID,omitempty"` + NotificationType int32 `protobuf:"varint,3,opt,name=notificationType" json:"notificationType,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BatchSetConversationsReq) Reset() { *m = BatchSetConversationsReq{} } +func (m *BatchSetConversationsReq) String() string { return proto.CompactTextString(m) } +func (*BatchSetConversationsReq) ProtoMessage() {} +func (*BatchSetConversationsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{22} +} +func (m *BatchSetConversationsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BatchSetConversationsReq.Unmarshal(m, b) +} +func (m *BatchSetConversationsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BatchSetConversationsReq.Marshal(b, m, deterministic) +} +func (dst *BatchSetConversationsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchSetConversationsReq.Merge(dst, src) +} +func (m *BatchSetConversationsReq) XXX_Size() int { + return xxx_messageInfo_BatchSetConversationsReq.Size(m) +} +func (m *BatchSetConversationsReq) XXX_DiscardUnknown() { + xxx_messageInfo_BatchSetConversationsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchSetConversationsReq proto.InternalMessageInfo + +func (m *BatchSetConversationsReq) GetConversations() []*Conversation { + if m != nil { + return m.Conversations + } + return nil +} + +func (m *BatchSetConversationsReq) GetOwnerUserID() string { + if m != nil { + return m.OwnerUserID + } + return "" +} + +func (m *BatchSetConversationsReq) GetNotificationType() int32 { + if m != nil { + return m.NotificationType + } + return 0 +} + +func (m *BatchSetConversationsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type BatchSetConversationsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + Success []string `protobuf:"bytes,2,rep,name=Success" json:"Success,omitempty"` + Failed []string `protobuf:"bytes,3,rep,name=Failed" json:"Failed,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BatchSetConversationsResp) Reset() { *m = BatchSetConversationsResp{} } +func (m *BatchSetConversationsResp) String() string { return proto.CompactTextString(m) } +func (*BatchSetConversationsResp) ProtoMessage() {} +func (*BatchSetConversationsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{23} +} +func (m *BatchSetConversationsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BatchSetConversationsResp.Unmarshal(m, b) +} +func (m *BatchSetConversationsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BatchSetConversationsResp.Marshal(b, m, deterministic) +} +func (dst *BatchSetConversationsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_BatchSetConversationsResp.Merge(dst, src) +} +func (m *BatchSetConversationsResp) XXX_Size() int { + return xxx_messageInfo_BatchSetConversationsResp.Size(m) +} +func (m *BatchSetConversationsResp) XXX_DiscardUnknown() { + xxx_messageInfo_BatchSetConversationsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_BatchSetConversationsResp proto.InternalMessageInfo + +func (m *BatchSetConversationsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *BatchSetConversationsResp) GetSuccess() []string { + if m != nil { + return m.Success + } + return nil +} + +func (m *BatchSetConversationsResp) GetFailed() []string { + if m != nil { + return m.Failed + } + return nil +} + +type ResignUserReq 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 *ResignUserReq) Reset() { *m = ResignUserReq{} } +func (m *ResignUserReq) String() string { return proto.CompactTextString(m) } +func (*ResignUserReq) ProtoMessage() {} +func (*ResignUserReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{24} +} +func (m *ResignUserReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ResignUserReq.Unmarshal(m, b) +} +func (m *ResignUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ResignUserReq.Marshal(b, m, deterministic) +} +func (dst *ResignUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResignUserReq.Merge(dst, src) +} +func (m *ResignUserReq) XXX_Size() int { + return xxx_messageInfo_ResignUserReq.Size(m) +} +func (m *ResignUserReq) XXX_DiscardUnknown() { + xxx_messageInfo_ResignUserReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ResignUserReq proto.InternalMessageInfo + +func (m *ResignUserReq) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *ResignUserReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ResignUserResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResignUserResp) Reset() { *m = ResignUserResp{} } +func (m *ResignUserResp) String() string { return proto.CompactTextString(m) } +func (*ResignUserResp) ProtoMessage() {} +func (*ResignUserResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{25} +} +func (m *ResignUserResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ResignUserResp.Unmarshal(m, b) +} +func (m *ResignUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ResignUserResp.Marshal(b, m, deterministic) +} +func (dst *ResignUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResignUserResp.Merge(dst, src) +} +func (m *ResignUserResp) XXX_Size() int { + return xxx_messageInfo_ResignUserResp.Size(m) +} +func (m *ResignUserResp) XXX_DiscardUnknown() { + xxx_messageInfo_ResignUserResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ResignUserResp proto.InternalMessageInfo + +func (m *ResignUserResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetUserByIdReq 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 *GetUserByIdReq) Reset() { *m = GetUserByIdReq{} } +func (m *GetUserByIdReq) String() string { return proto.CompactTextString(m) } +func (*GetUserByIdReq) ProtoMessage() {} +func (*GetUserByIdReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{26} +} +func (m *GetUserByIdReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserByIdReq.Unmarshal(m, b) +} +func (m *GetUserByIdReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserByIdReq.Marshal(b, m, deterministic) +} +func (dst *GetUserByIdReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserByIdReq.Merge(dst, src) +} +func (m *GetUserByIdReq) XXX_Size() int { + return xxx_messageInfo_GetUserByIdReq.Size(m) +} +func (m *GetUserByIdReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserByIdReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserByIdReq proto.InternalMessageInfo + +func (m *GetUserByIdReq) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *GetUserByIdReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type User struct { + ProfilePhoto string `protobuf:"bytes,1,opt,name=ProfilePhoto" json:"ProfilePhoto,omitempty"` + Nickname string `protobuf:"bytes,2,opt,name=Nickname" json:"Nickname,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=UserId" json:"UserId,omitempty"` + CreateTime string `protobuf:"bytes,4,opt,name=CreateTime" json:"CreateTime,omitempty"` + IsBlock bool `protobuf:"varint,5,opt,name=IsBlock" json:"IsBlock,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *User) Reset() { *m = User{} } +func (m *User) String() string { return proto.CompactTextString(m) } +func (*User) ProtoMessage() {} +func (*User) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{27} +} +func (m *User) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_User.Unmarshal(m, b) +} +func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_User.Marshal(b, m, deterministic) +} +func (dst *User) XXX_Merge(src proto.Message) { + xxx_messageInfo_User.Merge(dst, src) +} +func (m *User) XXX_Size() int { + return xxx_messageInfo_User.Size(m) +} +func (m *User) XXX_DiscardUnknown() { + xxx_messageInfo_User.DiscardUnknown(m) +} + +var xxx_messageInfo_User proto.InternalMessageInfo + +func (m *User) GetProfilePhoto() string { + if m != nil { + return m.ProfilePhoto + } + return "" +} + +func (m *User) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *User) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *User) GetCreateTime() string { + if m != nil { + return m.CreateTime + } + return "" +} + +func (m *User) GetIsBlock() bool { + if m != nil { + return m.IsBlock + } + return false +} + +type GetUserByIdResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user" json:"user,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserByIdResp) Reset() { *m = GetUserByIdResp{} } +func (m *GetUserByIdResp) String() string { return proto.CompactTextString(m) } +func (*GetUserByIdResp) ProtoMessage() {} +func (*GetUserByIdResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{28} +} +func (m *GetUserByIdResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserByIdResp.Unmarshal(m, b) +} +func (m *GetUserByIdResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserByIdResp.Marshal(b, m, deterministic) +} +func (dst *GetUserByIdResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserByIdResp.Merge(dst, src) +} +func (m *GetUserByIdResp) XXX_Size() int { + return xxx_messageInfo_GetUserByIdResp.Size(m) +} +func (m *GetUserByIdResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserByIdResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserByIdResp proto.InternalMessageInfo + +func (m *GetUserByIdResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserByIdResp) GetUser() *User { + if m != nil { + return m.User + } + return nil +} + +type GetUsersByNameReq struct { + UserName string `protobuf:"bytes,1,opt,name=UserName" json:"UserName,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersByNameReq) Reset() { *m = GetUsersByNameReq{} } +func (m *GetUsersByNameReq) String() string { return proto.CompactTextString(m) } +func (*GetUsersByNameReq) ProtoMessage() {} +func (*GetUsersByNameReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{29} +} +func (m *GetUsersByNameReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersByNameReq.Unmarshal(m, b) +} +func (m *GetUsersByNameReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersByNameReq.Marshal(b, m, deterministic) +} +func (dst *GetUsersByNameReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersByNameReq.Merge(dst, src) +} +func (m *GetUsersByNameReq) XXX_Size() int { + return xxx_messageInfo_GetUsersByNameReq.Size(m) +} +func (m *GetUsersByNameReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersByNameReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersByNameReq proto.InternalMessageInfo + +func (m *GetUsersByNameReq) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +func (m *GetUsersByNameReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUsersByNameReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUsersByNameResp struct { + Users []*User `protobuf:"bytes,1,rep,name=users" json:"users,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + UserNums int32 `protobuf:"varint,3,opt,name=UserNums" json:"UserNums,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersByNameResp) Reset() { *m = GetUsersByNameResp{} } +func (m *GetUsersByNameResp) String() string { return proto.CompactTextString(m) } +func (*GetUsersByNameResp) ProtoMessage() {} +func (*GetUsersByNameResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{30} +} +func (m *GetUsersByNameResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersByNameResp.Unmarshal(m, b) +} +func (m *GetUsersByNameResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersByNameResp.Marshal(b, m, deterministic) +} +func (dst *GetUsersByNameResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersByNameResp.Merge(dst, src) +} +func (m *GetUsersByNameResp) XXX_Size() int { + return xxx_messageInfo_GetUsersByNameResp.Size(m) +} +func (m *GetUsersByNameResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersByNameResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersByNameResp proto.InternalMessageInfo + +func (m *GetUsersByNameResp) GetUsers() []*User { + if m != nil { + return m.Users + } + return nil +} + +func (m *GetUsersByNameResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUsersByNameResp) GetUserNums() int32 { + if m != nil { + return m.UserNums + } + return 0 +} + +type AlterUserReq struct { + UserId string `protobuf:"bytes,1,opt,name=UserId" json:"UserId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + PhoneNumber int64 `protobuf:"varint,3,opt,name=PhoneNumber" json:"PhoneNumber,omitempty"` + Nickname string `protobuf:"bytes,4,opt,name=Nickname" json:"Nickname,omitempty"` + Email string `protobuf:"bytes,5,opt,name=Email" json:"Email,omitempty"` + OpUserId string `protobuf:"bytes,6,opt,name=OpUserId" json:"OpUserId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AlterUserReq) Reset() { *m = AlterUserReq{} } +func (m *AlterUserReq) String() string { return proto.CompactTextString(m) } +func (*AlterUserReq) ProtoMessage() {} +func (*AlterUserReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{31} +} +func (m *AlterUserReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AlterUserReq.Unmarshal(m, b) +} +func (m *AlterUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AlterUserReq.Marshal(b, m, deterministic) +} +func (dst *AlterUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AlterUserReq.Merge(dst, src) +} +func (m *AlterUserReq) XXX_Size() int { + return xxx_messageInfo_AlterUserReq.Size(m) +} +func (m *AlterUserReq) XXX_DiscardUnknown() { + xxx_messageInfo_AlterUserReq.DiscardUnknown(m) +} + +var xxx_messageInfo_AlterUserReq proto.InternalMessageInfo + +func (m *AlterUserReq) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *AlterUserReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *AlterUserReq) GetPhoneNumber() int64 { + if m != nil { + return m.PhoneNumber + } + return 0 +} + +func (m *AlterUserReq) GetNickname() string { + if m != nil { + return m.Nickname + } + return "" +} + +func (m *AlterUserReq) GetEmail() string { + if m != nil { + return m.Email + } + return "" +} + +func (m *AlterUserReq) GetOpUserId() string { + if m != nil { + return m.OpUserId + } + return "" +} + +type AlterUserResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AlterUserResp) Reset() { *m = AlterUserResp{} } +func (m *AlterUserResp) String() string { return proto.CompactTextString(m) } +func (*AlterUserResp) ProtoMessage() {} +func (*AlterUserResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{32} +} +func (m *AlterUserResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AlterUserResp.Unmarshal(m, b) +} +func (m *AlterUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AlterUserResp.Marshal(b, m, deterministic) +} +func (dst *AlterUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AlterUserResp.Merge(dst, src) +} +func (m *AlterUserResp) XXX_Size() int { + return xxx_messageInfo_AlterUserResp.Size(m) +} +func (m *AlterUserResp) XXX_DiscardUnknown() { + xxx_messageInfo_AlterUserResp.DiscardUnknown(m) +} + +var xxx_messageInfo_AlterUserResp proto.InternalMessageInfo + +func (m *AlterUserResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetUsersReq struct { + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + UserName string `protobuf:"bytes,3,opt,name=UserName" json:"UserName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersReq) Reset() { *m = GetUsersReq{} } +func (m *GetUsersReq) String() string { return proto.CompactTextString(m) } +func (*GetUsersReq) ProtoMessage() {} +func (*GetUsersReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{33} +} +func (m *GetUsersReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersReq.Unmarshal(m, b) +} +func (m *GetUsersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersReq.Marshal(b, m, deterministic) +} +func (dst *GetUsersReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersReq.Merge(dst, src) +} +func (m *GetUsersReq) XXX_Size() int { + return xxx_messageInfo_GetUsersReq.Size(m) +} +func (m *GetUsersReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersReq proto.InternalMessageInfo + +func (m *GetUsersReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetUsersReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUsersReq) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +type GetUsersResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + User []*User `protobuf:"bytes,2,rep,name=user" json:"user,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + UserNums int32 `protobuf:"varint,4,opt,name=UserNums" json:"UserNums,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUsersResp) Reset() { *m = GetUsersResp{} } +func (m *GetUsersResp) String() string { return proto.CompactTextString(m) } +func (*GetUsersResp) ProtoMessage() {} +func (*GetUsersResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{34} +} +func (m *GetUsersResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUsersResp.Unmarshal(m, b) +} +func (m *GetUsersResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUsersResp.Marshal(b, m, deterministic) +} +func (dst *GetUsersResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUsersResp.Merge(dst, src) +} +func (m *GetUsersResp) XXX_Size() int { + return xxx_messageInfo_GetUsersResp.Size(m) +} +func (m *GetUsersResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUsersResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUsersResp proto.InternalMessageInfo + +func (m *GetUsersResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUsersResp) GetUser() []*User { + if m != nil { + return m.User + } + return nil +} + +func (m *GetUsersResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUsersResp) GetUserNums() int32 { + if m != nil { + return m.UserNums + } + return 0 +} + +type AddUserReq struct { + OperationID string `protobuf:"bytes,1,opt,name=OperationID" json:"OperationID,omitempty"` + PhoneNumber string `protobuf:"bytes,2,opt,name=PhoneNumber" json:"PhoneNumber,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=UserId" json:"UserId,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` + OpUserId string `protobuf:"bytes,5,opt,name=OpUserId" json:"OpUserId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddUserReq) Reset() { *m = AddUserReq{} } +func (m *AddUserReq) String() string { return proto.CompactTextString(m) } +func (*AddUserReq) ProtoMessage() {} +func (*AddUserReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{35} +} +func (m *AddUserReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddUserReq.Unmarshal(m, b) +} +func (m *AddUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddUserReq.Marshal(b, m, deterministic) +} +func (dst *AddUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddUserReq.Merge(dst, src) +} +func (m *AddUserReq) XXX_Size() int { + return xxx_messageInfo_AddUserReq.Size(m) +} +func (m *AddUserReq) XXX_DiscardUnknown() { + xxx_messageInfo_AddUserReq.DiscardUnknown(m) +} + +var xxx_messageInfo_AddUserReq proto.InternalMessageInfo + +func (m *AddUserReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *AddUserReq) GetPhoneNumber() string { + if m != nil { + return m.PhoneNumber + } + return "" +} + +func (m *AddUserReq) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *AddUserReq) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *AddUserReq) GetOpUserId() string { + if m != nil { + return m.OpUserId + } + return "" +} + +type AddUserResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddUserResp) Reset() { *m = AddUserResp{} } +func (m *AddUserResp) String() string { return proto.CompactTextString(m) } +func (*AddUserResp) ProtoMessage() {} +func (*AddUserResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{36} +} +func (m *AddUserResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddUserResp.Unmarshal(m, b) +} +func (m *AddUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddUserResp.Marshal(b, m, deterministic) +} +func (dst *AddUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddUserResp.Merge(dst, src) +} +func (m *AddUserResp) XXX_Size() int { + return xxx_messageInfo_AddUserResp.Size(m) +} +func (m *AddUserResp) XXX_DiscardUnknown() { + xxx_messageInfo_AddUserResp.DiscardUnknown(m) +} + +var xxx_messageInfo_AddUserResp proto.InternalMessageInfo + +func (m *AddUserResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type BlockUserReq struct { + UserId string `protobuf:"bytes,1,opt,name=UserId" json:"UserId,omitempty"` + EndDisableTime string `protobuf:"bytes,2,opt,name=EndDisableTime" json:"EndDisableTime,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserId string `protobuf:"bytes,4,opt,name=OpUserId" json:"OpUserId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlockUserReq) Reset() { *m = BlockUserReq{} } +func (m *BlockUserReq) String() string { return proto.CompactTextString(m) } +func (*BlockUserReq) ProtoMessage() {} +func (*BlockUserReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{37} +} +func (m *BlockUserReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockUserReq.Unmarshal(m, b) +} +func (m *BlockUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockUserReq.Marshal(b, m, deterministic) +} +func (dst *BlockUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockUserReq.Merge(dst, src) +} +func (m *BlockUserReq) XXX_Size() int { + return xxx_messageInfo_BlockUserReq.Size(m) +} +func (m *BlockUserReq) XXX_DiscardUnknown() { + xxx_messageInfo_BlockUserReq.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockUserReq proto.InternalMessageInfo + +func (m *BlockUserReq) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *BlockUserReq) GetEndDisableTime() string { + if m != nil { + return m.EndDisableTime + } + return "" +} + +func (m *BlockUserReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *BlockUserReq) GetOpUserId() string { + if m != nil { + return m.OpUserId + } + return "" +} + +type BlockUserResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlockUserResp) Reset() { *m = BlockUserResp{} } +func (m *BlockUserResp) String() string { return proto.CompactTextString(m) } +func (*BlockUserResp) ProtoMessage() {} +func (*BlockUserResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{38} +} +func (m *BlockUserResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockUserResp.Unmarshal(m, b) +} +func (m *BlockUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockUserResp.Marshal(b, m, deterministic) +} +func (dst *BlockUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockUserResp.Merge(dst, src) +} +func (m *BlockUserResp) XXX_Size() int { + return xxx_messageInfo_BlockUserResp.Size(m) +} +func (m *BlockUserResp) XXX_DiscardUnknown() { + xxx_messageInfo_BlockUserResp.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockUserResp proto.InternalMessageInfo + +func (m *BlockUserResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type UnBlockUserReq struct { + UserId string `protobuf:"bytes,1,opt,name=UserId" json:"UserId,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserId string `protobuf:"bytes,3,opt,name=OpUserId" json:"OpUserId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UnBlockUserReq) Reset() { *m = UnBlockUserReq{} } +func (m *UnBlockUserReq) String() string { return proto.CompactTextString(m) } +func (*UnBlockUserReq) ProtoMessage() {} +func (*UnBlockUserReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{39} +} +func (m *UnBlockUserReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UnBlockUserReq.Unmarshal(m, b) +} +func (m *UnBlockUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UnBlockUserReq.Marshal(b, m, deterministic) +} +func (dst *UnBlockUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnBlockUserReq.Merge(dst, src) +} +func (m *UnBlockUserReq) XXX_Size() int { + return xxx_messageInfo_UnBlockUserReq.Size(m) +} +func (m *UnBlockUserReq) XXX_DiscardUnknown() { + xxx_messageInfo_UnBlockUserReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UnBlockUserReq proto.InternalMessageInfo + +func (m *UnBlockUserReq) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *UnBlockUserReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *UnBlockUserReq) GetOpUserId() string { + if m != nil { + return m.OpUserId + } + return "" +} + +type UnBlockUserResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UnBlockUserResp) Reset() { *m = UnBlockUserResp{} } +func (m *UnBlockUserResp) String() string { return proto.CompactTextString(m) } +func (*UnBlockUserResp) ProtoMessage() {} +func (*UnBlockUserResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{40} +} +func (m *UnBlockUserResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UnBlockUserResp.Unmarshal(m, b) +} +func (m *UnBlockUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UnBlockUserResp.Marshal(b, m, deterministic) +} +func (dst *UnBlockUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UnBlockUserResp.Merge(dst, src) +} +func (m *UnBlockUserResp) XXX_Size() int { + return xxx_messageInfo_UnBlockUserResp.Size(m) +} +func (m *UnBlockUserResp) XXX_DiscardUnknown() { + xxx_messageInfo_UnBlockUserResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UnBlockUserResp proto.InternalMessageInfo + +func (m *UnBlockUserResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetBlockUsersReq struct { + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,1,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + BlockUserNum int32 `protobuf:"varint,3,opt,name=BlockUserNum" json:"BlockUserNum,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetBlockUsersReq) Reset() { *m = GetBlockUsersReq{} } +func (m *GetBlockUsersReq) String() string { return proto.CompactTextString(m) } +func (*GetBlockUsersReq) ProtoMessage() {} +func (*GetBlockUsersReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{41} +} +func (m *GetBlockUsersReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBlockUsersReq.Unmarshal(m, b) +} +func (m *GetBlockUsersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBlockUsersReq.Marshal(b, m, deterministic) +} +func (dst *GetBlockUsersReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockUsersReq.Merge(dst, src) +} +func (m *GetBlockUsersReq) XXX_Size() int { + return xxx_messageInfo_GetBlockUsersReq.Size(m) +} +func (m *GetBlockUsersReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlockUsersReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlockUsersReq proto.InternalMessageInfo + +func (m *GetBlockUsersReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetBlockUsersReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetBlockUsersReq) GetBlockUserNum() int32 { + if m != nil { + return m.BlockUserNum + } + return 0 +} + +type BlockUser struct { + User *User `protobuf:"bytes,1,opt,name=User" json:"User,omitempty"` + BeginDisableTime string `protobuf:"bytes,2,opt,name=BeginDisableTime" json:"BeginDisableTime,omitempty"` + EndDisableTime string `protobuf:"bytes,3,opt,name=EndDisableTime" json:"EndDisableTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlockUser) Reset() { *m = BlockUser{} } +func (m *BlockUser) String() string { return proto.CompactTextString(m) } +func (*BlockUser) ProtoMessage() {} +func (*BlockUser) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{42} +} +func (m *BlockUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockUser.Unmarshal(m, b) +} +func (m *BlockUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockUser.Marshal(b, m, deterministic) +} +func (dst *BlockUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockUser.Merge(dst, src) +} +func (m *BlockUser) XXX_Size() int { + return xxx_messageInfo_BlockUser.Size(m) +} +func (m *BlockUser) XXX_DiscardUnknown() { + xxx_messageInfo_BlockUser.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockUser proto.InternalMessageInfo + +func (m *BlockUser) GetUser() *User { + if m != nil { + return m.User + } + return nil +} + +func (m *BlockUser) GetBeginDisableTime() string { + if m != nil { + return m.BeginDisableTime + } + return "" +} + +func (m *BlockUser) GetEndDisableTime() string { + if m != nil { + return m.EndDisableTime + } + return "" +} + +type GetBlockUsersResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + BlockUsers []*BlockUser `protobuf:"bytes,2,rep,name=BlockUsers" json:"BlockUsers,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + UserNums int32 `protobuf:"varint,4,opt,name=UserNums" json:"UserNums,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetBlockUsersResp) Reset() { *m = GetBlockUsersResp{} } +func (m *GetBlockUsersResp) String() string { return proto.CompactTextString(m) } +func (*GetBlockUsersResp) ProtoMessage() {} +func (*GetBlockUsersResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{43} +} +func (m *GetBlockUsersResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBlockUsersResp.Unmarshal(m, b) +} +func (m *GetBlockUsersResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBlockUsersResp.Marshal(b, m, deterministic) +} +func (dst *GetBlockUsersResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockUsersResp.Merge(dst, src) +} +func (m *GetBlockUsersResp) XXX_Size() int { + return xxx_messageInfo_GetBlockUsersResp.Size(m) +} +func (m *GetBlockUsersResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlockUsersResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlockUsersResp proto.InternalMessageInfo + +func (m *GetBlockUsersResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetBlockUsersResp) GetBlockUsers() []*BlockUser { + if m != nil { + return m.BlockUsers + } + return nil +} + +func (m *GetBlockUsersResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetBlockUsersResp) GetUserNums() int32 { + if m != nil { + return m.UserNums + } + return 0 +} + +type GetBlockUserByIdReq struct { + UserId string `protobuf:"bytes,1,opt,name=User_id,json=UserId" json:"User_id,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 *GetBlockUserByIdReq) Reset() { *m = GetBlockUserByIdReq{} } +func (m *GetBlockUserByIdReq) String() string { return proto.CompactTextString(m) } +func (*GetBlockUserByIdReq) ProtoMessage() {} +func (*GetBlockUserByIdReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{44} +} +func (m *GetBlockUserByIdReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBlockUserByIdReq.Unmarshal(m, b) +} +func (m *GetBlockUserByIdReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBlockUserByIdReq.Marshal(b, m, deterministic) +} +func (dst *GetBlockUserByIdReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockUserByIdReq.Merge(dst, src) +} +func (m *GetBlockUserByIdReq) XXX_Size() int { + return xxx_messageInfo_GetBlockUserByIdReq.Size(m) +} +func (m *GetBlockUserByIdReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlockUserByIdReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlockUserByIdReq proto.InternalMessageInfo + +func (m *GetBlockUserByIdReq) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *GetBlockUserByIdReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetBlockUserByIdResp struct { + BlockUser *BlockUser `protobuf:"bytes,2,opt,name=BlockUser" json:"BlockUser,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetBlockUserByIdResp) Reset() { *m = GetBlockUserByIdResp{} } +func (m *GetBlockUserByIdResp) String() string { return proto.CompactTextString(m) } +func (*GetBlockUserByIdResp) ProtoMessage() {} +func (*GetBlockUserByIdResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{45} +} +func (m *GetBlockUserByIdResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBlockUserByIdResp.Unmarshal(m, b) +} +func (m *GetBlockUserByIdResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBlockUserByIdResp.Marshal(b, m, deterministic) +} +func (dst *GetBlockUserByIdResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockUserByIdResp.Merge(dst, src) +} +func (m *GetBlockUserByIdResp) XXX_Size() int { + return xxx_messageInfo_GetBlockUserByIdResp.Size(m) +} +func (m *GetBlockUserByIdResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlockUserByIdResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlockUserByIdResp proto.InternalMessageInfo + +func (m *GetBlockUserByIdResp) GetBlockUser() *BlockUser { + if m != nil { + return m.BlockUser + } + return nil +} + +type DeleteUserReq struct { + UserId string `protobuf:"bytes,1,opt,name=User_id,json=UserId" json:"User_id,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + OpUserId string `protobuf:"bytes,3,opt,name=OpUserId" json:"OpUserId,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteUserReq) Reset() { *m = DeleteUserReq{} } +func (m *DeleteUserReq) String() string { return proto.CompactTextString(m) } +func (*DeleteUserReq) ProtoMessage() {} +func (*DeleteUserReq) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{46} +} +func (m *DeleteUserReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteUserReq.Unmarshal(m, b) +} +func (m *DeleteUserReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteUserReq.Marshal(b, m, deterministic) +} +func (dst *DeleteUserReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteUserReq.Merge(dst, src) +} +func (m *DeleteUserReq) XXX_Size() int { + return xxx_messageInfo_DeleteUserReq.Size(m) +} +func (m *DeleteUserReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteUserReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteUserReq proto.InternalMessageInfo + +func (m *DeleteUserReq) GetUserId() string { + if m != nil { + return m.UserId + } + return "" +} + +func (m *DeleteUserReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *DeleteUserReq) GetOpUserId() string { + if m != nil { + return m.OpUserId + } + return "" +} + +type DeleteUserResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteUserResp) Reset() { *m = DeleteUserResp{} } +func (m *DeleteUserResp) String() string { return proto.CompactTextString(m) } +func (*DeleteUserResp) ProtoMessage() {} +func (*DeleteUserResp) Descriptor() ([]byte, []int) { + return fileDescriptor_user_6133bd34462fbb1a, []int{47} +} +func (m *DeleteUserResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteUserResp.Unmarshal(m, b) +} +func (m *DeleteUserResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteUserResp.Marshal(b, m, deterministic) +} +func (dst *DeleteUserResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteUserResp.Merge(dst, src) +} +func (m *DeleteUserResp) XXX_Size() int { + return xxx_messageInfo_DeleteUserResp.Size(m) +} +func (m *DeleteUserResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteUserResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteUserResp proto.InternalMessageInfo + +func (m *DeleteUserResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func init() { + proto.RegisterType((*CommonResp)(nil), "user.CommonResp") + proto.RegisterType((*DeleteUsersReq)(nil), "user.DeleteUsersReq") + proto.RegisterType((*DeleteUsersResp)(nil), "user.DeleteUsersResp") + proto.RegisterType((*GetAllUserIDReq)(nil), "user.GetAllUserIDReq") + proto.RegisterType((*GetAllUserIDResp)(nil), "user.GetAllUserIDResp") + proto.RegisterType((*AccountCheckReq)(nil), "user.AccountCheckReq") + proto.RegisterType((*AccountCheckResp)(nil), "user.AccountCheckResp") + proto.RegisterType((*AccountCheckResp_SingleUserStatus)(nil), "user.AccountCheckResp.SingleUserStatus") + proto.RegisterType((*GetUserInfoReq)(nil), "user.GetUserInfoReq") + proto.RegisterType((*GetUserInfoResp)(nil), "user.GetUserInfoResp") + proto.RegisterType((*UpdateUserInfoReq)(nil), "user.UpdateUserInfoReq") + proto.RegisterType((*UpdateUserInfoResp)(nil), "user.UpdateUserInfoResp") + proto.RegisterType((*Conversation)(nil), "user.Conversation") + proto.RegisterType((*SetConversationReq)(nil), "user.SetConversationReq") + proto.RegisterType((*SetConversationResp)(nil), "user.SetConversationResp") + proto.RegisterType((*SetRecvMsgOptReq)(nil), "user.SetRecvMsgOptReq") + proto.RegisterType((*SetRecvMsgOptResp)(nil), "user.SetRecvMsgOptResp") + proto.RegisterType((*GetConversationReq)(nil), "user.GetConversationReq") + proto.RegisterType((*GetConversationResp)(nil), "user.GetConversationResp") + proto.RegisterType((*GetConversationsReq)(nil), "user.GetConversationsReq") + proto.RegisterType((*GetConversationsResp)(nil), "user.GetConversationsResp") + proto.RegisterType((*GetAllConversationsReq)(nil), "user.GetAllConversationsReq") + proto.RegisterType((*GetAllConversationsResp)(nil), "user.GetAllConversationsResp") + proto.RegisterType((*BatchSetConversationsReq)(nil), "user.BatchSetConversationsReq") + proto.RegisterType((*BatchSetConversationsResp)(nil), "user.BatchSetConversationsResp") + proto.RegisterType((*ResignUserReq)(nil), "user.ResignUserReq") + proto.RegisterType((*ResignUserResp)(nil), "user.ResignUserResp") + proto.RegisterType((*GetUserByIdReq)(nil), "user.GetUserByIdReq") + proto.RegisterType((*User)(nil), "user.User") + proto.RegisterType((*GetUserByIdResp)(nil), "user.GetUserByIdResp") + proto.RegisterType((*GetUsersByNameReq)(nil), "user.GetUsersByNameReq") + proto.RegisterType((*GetUsersByNameResp)(nil), "user.GetUsersByNameResp") + proto.RegisterType((*AlterUserReq)(nil), "user.AlterUserReq") + proto.RegisterType((*AlterUserResp)(nil), "user.AlterUserResp") + proto.RegisterType((*GetUsersReq)(nil), "user.GetUsersReq") + proto.RegisterType((*GetUsersResp)(nil), "user.GetUsersResp") + proto.RegisterType((*AddUserReq)(nil), "user.AddUserReq") + proto.RegisterType((*AddUserResp)(nil), "user.AddUserResp") + proto.RegisterType((*BlockUserReq)(nil), "user.BlockUserReq") + proto.RegisterType((*BlockUserResp)(nil), "user.BlockUserResp") + proto.RegisterType((*UnBlockUserReq)(nil), "user.UnBlockUserReq") + proto.RegisterType((*UnBlockUserResp)(nil), "user.UnBlockUserResp") + proto.RegisterType((*GetBlockUsersReq)(nil), "user.GetBlockUsersReq") + proto.RegisterType((*BlockUser)(nil), "user.BlockUser") + proto.RegisterType((*GetBlockUsersResp)(nil), "user.GetBlockUsersResp") + proto.RegisterType((*GetBlockUserByIdReq)(nil), "user.GetBlockUserByIdReq") + proto.RegisterType((*GetBlockUserByIdResp)(nil), "user.GetBlockUserByIdResp") + proto.RegisterType((*DeleteUserReq)(nil), "user.DeleteUserReq") + proto.RegisterType((*DeleteUserResp)(nil), "user.DeleteUserResp") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for User service + +type UserClient interface { + GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) + UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) + DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) + GetAllUserID(ctx context.Context, in *GetAllUserIDReq, opts ...grpc.CallOption) (*GetAllUserIDResp, error) + AccountCheck(ctx context.Context, in *AccountCheckReq, opts ...grpc.CallOption) (*AccountCheckResp, error) + GetConversation(ctx context.Context, in *GetConversationReq, opts ...grpc.CallOption) (*GetConversationResp, error) + GetAllConversations(ctx context.Context, in *GetAllConversationsReq, opts ...grpc.CallOption) (*GetAllConversationsResp, error) + GetConversations(ctx context.Context, in *GetConversationsReq, opts ...grpc.CallOption) (*GetConversationsResp, error) + BatchSetConversations(ctx context.Context, in *BatchSetConversationsReq, opts ...grpc.CallOption) (*BatchSetConversationsResp, error) + SetConversation(ctx context.Context, in *SetConversationReq, opts ...grpc.CallOption) (*SetConversationResp, error) + SetRecvMsgOpt(ctx context.Context, in *SetRecvMsgOptReq, opts ...grpc.CallOption) (*SetRecvMsgOptResp, error) + GetUserById(ctx context.Context, in *GetUserByIdReq, opts ...grpc.CallOption) (*GetUserByIdResp, error) + GetUsersByName(ctx context.Context, in *GetUsersByNameReq, opts ...grpc.CallOption) (*GetUsersByNameResp, error) + ResignUser(ctx context.Context, in *ResignUserReq, opts ...grpc.CallOption) (*ResignUserResp, error) + AlterUser(ctx context.Context, in *AlterUserReq, opts ...grpc.CallOption) (*AlterUserResp, error) + GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersResp, error) + AddUser(ctx context.Context, in *AddUserReq, opts ...grpc.CallOption) (*AddUserResp, error) + BlockUser(ctx context.Context, in *BlockUserReq, opts ...grpc.CallOption) (*BlockUserResp, error) + UnBlockUser(ctx context.Context, in *UnBlockUserReq, opts ...grpc.CallOption) (*UnBlockUserResp, error) + GetBlockUsers(ctx context.Context, in *GetBlockUsersReq, opts ...grpc.CallOption) (*GetBlockUsersResp, error) + GetBlockUserById(ctx context.Context, in *GetBlockUserByIdReq, opts ...grpc.CallOption) (*GetBlockUserByIdResp, error) + DeleteUser(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*DeleteUserResp, error) +} + +type userClient struct { + cc *grpc.ClientConn +} + +func NewUserClient(cc *grpc.ClientConn) UserClient { + return &userClient{cc} +} + +func (c *userClient) GetUserInfo(ctx context.Context, in *GetUserInfoReq, opts ...grpc.CallOption) (*GetUserInfoResp, error) { + out := new(GetUserInfoResp) + err := grpc.Invoke(ctx, "/user.user/GetUserInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UpdateUserInfoResp, error) { + out := new(UpdateUserInfoResp) + err := grpc.Invoke(ctx, "/user.user/UpdateUserInfo", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) DeleteUsers(ctx context.Context, in *DeleteUsersReq, opts ...grpc.CallOption) (*DeleteUsersResp, error) { + out := new(DeleteUsersResp) + err := grpc.Invoke(ctx, "/user.user/DeleteUsers", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetAllUserID(ctx context.Context, in *GetAllUserIDReq, opts ...grpc.CallOption) (*GetAllUserIDResp, error) { + out := new(GetAllUserIDResp) + err := grpc.Invoke(ctx, "/user.user/GetAllUserID", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) AccountCheck(ctx context.Context, in *AccountCheckReq, opts ...grpc.CallOption) (*AccountCheckResp, error) { + out := new(AccountCheckResp) + err := grpc.Invoke(ctx, "/user.user/AccountCheck", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetConversation(ctx context.Context, in *GetConversationReq, opts ...grpc.CallOption) (*GetConversationResp, error) { + out := new(GetConversationResp) + err := grpc.Invoke(ctx, "/user.user/GetConversation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetAllConversations(ctx context.Context, in *GetAllConversationsReq, opts ...grpc.CallOption) (*GetAllConversationsResp, error) { + out := new(GetAllConversationsResp) + err := grpc.Invoke(ctx, "/user.user/GetAllConversations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetConversations(ctx context.Context, in *GetConversationsReq, opts ...grpc.CallOption) (*GetConversationsResp, error) { + out := new(GetConversationsResp) + err := grpc.Invoke(ctx, "/user.user/GetConversations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) BatchSetConversations(ctx context.Context, in *BatchSetConversationsReq, opts ...grpc.CallOption) (*BatchSetConversationsResp, error) { + out := new(BatchSetConversationsResp) + err := grpc.Invoke(ctx, "/user.user/BatchSetConversations", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) SetConversation(ctx context.Context, in *SetConversationReq, opts ...grpc.CallOption) (*SetConversationResp, error) { + out := new(SetConversationResp) + err := grpc.Invoke(ctx, "/user.user/SetConversation", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) SetRecvMsgOpt(ctx context.Context, in *SetRecvMsgOptReq, opts ...grpc.CallOption) (*SetRecvMsgOptResp, error) { + out := new(SetRecvMsgOptResp) + err := grpc.Invoke(ctx, "/user.user/SetRecvMsgOpt", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetUserById(ctx context.Context, in *GetUserByIdReq, opts ...grpc.CallOption) (*GetUserByIdResp, error) { + out := new(GetUserByIdResp) + err := grpc.Invoke(ctx, "/user.user/GetUserById", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetUsersByName(ctx context.Context, in *GetUsersByNameReq, opts ...grpc.CallOption) (*GetUsersByNameResp, error) { + out := new(GetUsersByNameResp) + err := grpc.Invoke(ctx, "/user.user/GetUsersByName", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) ResignUser(ctx context.Context, in *ResignUserReq, opts ...grpc.CallOption) (*ResignUserResp, error) { + out := new(ResignUserResp) + err := grpc.Invoke(ctx, "/user.user/ResignUser", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) AlterUser(ctx context.Context, in *AlterUserReq, opts ...grpc.CallOption) (*AlterUserResp, error) { + out := new(AlterUserResp) + err := grpc.Invoke(ctx, "/user.user/AlterUser", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*GetUsersResp, error) { + out := new(GetUsersResp) + err := grpc.Invoke(ctx, "/user.user/GetUsers", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) AddUser(ctx context.Context, in *AddUserReq, opts ...grpc.CallOption) (*AddUserResp, error) { + out := new(AddUserResp) + err := grpc.Invoke(ctx, "/user.user/AddUser", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) BlockUser(ctx context.Context, in *BlockUserReq, opts ...grpc.CallOption) (*BlockUserResp, error) { + out := new(BlockUserResp) + err := grpc.Invoke(ctx, "/user.user/BlockUser", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) UnBlockUser(ctx context.Context, in *UnBlockUserReq, opts ...grpc.CallOption) (*UnBlockUserResp, error) { + out := new(UnBlockUserResp) + err := grpc.Invoke(ctx, "/user.user/UnBlockUser", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetBlockUsers(ctx context.Context, in *GetBlockUsersReq, opts ...grpc.CallOption) (*GetBlockUsersResp, error) { + out := new(GetBlockUsersResp) + err := grpc.Invoke(ctx, "/user.user/GetBlockUsers", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) GetBlockUserById(ctx context.Context, in *GetBlockUserByIdReq, opts ...grpc.CallOption) (*GetBlockUserByIdResp, error) { + out := new(GetBlockUserByIdResp) + err := grpc.Invoke(ctx, "/user.user/GetBlockUserById", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userClient) DeleteUser(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*DeleteUserResp, error) { + out := new(DeleteUserResp) + err := grpc.Invoke(ctx, "/user.user/DeleteUser", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for User service + +type UserServer interface { + GetUserInfo(context.Context, *GetUserInfoReq) (*GetUserInfoResp, error) + UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*UpdateUserInfoResp, error) + DeleteUsers(context.Context, *DeleteUsersReq) (*DeleteUsersResp, error) + GetAllUserID(context.Context, *GetAllUserIDReq) (*GetAllUserIDResp, error) + AccountCheck(context.Context, *AccountCheckReq) (*AccountCheckResp, error) + GetConversation(context.Context, *GetConversationReq) (*GetConversationResp, error) + GetAllConversations(context.Context, *GetAllConversationsReq) (*GetAllConversationsResp, error) + GetConversations(context.Context, *GetConversationsReq) (*GetConversationsResp, error) + BatchSetConversations(context.Context, *BatchSetConversationsReq) (*BatchSetConversationsResp, error) + SetConversation(context.Context, *SetConversationReq) (*SetConversationResp, error) + SetRecvMsgOpt(context.Context, *SetRecvMsgOptReq) (*SetRecvMsgOptResp, error) + GetUserById(context.Context, *GetUserByIdReq) (*GetUserByIdResp, error) + GetUsersByName(context.Context, *GetUsersByNameReq) (*GetUsersByNameResp, error) + ResignUser(context.Context, *ResignUserReq) (*ResignUserResp, error) + AlterUser(context.Context, *AlterUserReq) (*AlterUserResp, error) + GetUsers(context.Context, *GetUsersReq) (*GetUsersResp, error) + AddUser(context.Context, *AddUserReq) (*AddUserResp, error) + BlockUser(context.Context, *BlockUserReq) (*BlockUserResp, error) + UnBlockUser(context.Context, *UnBlockUserReq) (*UnBlockUserResp, error) + GetBlockUsers(context.Context, *GetBlockUsersReq) (*GetBlockUsersResp, error) + GetBlockUserById(context.Context, *GetBlockUserByIdReq) (*GetBlockUserByIdResp, error) + DeleteUser(context.Context, *DeleteUserReq) (*DeleteUserResp, error) +} + +func RegisterUserServer(s *grpc.Server, srv UserServer) { + s.RegisterService(&_User_serviceDesc, srv) +} + +func _User_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetUserInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetUserInfo(ctx, req.(*GetUserInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).UpdateUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/UpdateUserInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).UpdateUserInfo(ctx, req.(*UpdateUserInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_DeleteUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUsersReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).DeleteUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/DeleteUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).DeleteUsers(ctx, req.(*DeleteUsersReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetAllUserID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllUserIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetAllUserID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetAllUserID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetAllUserID(ctx, req.(*GetAllUserIDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_AccountCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AccountCheckReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).AccountCheck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/AccountCheck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).AccountCheck(ctx, req.(*AccountCheckReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetConversationReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetConversation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetConversation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetConversation(ctx, req.(*GetConversationReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetAllConversations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllConversationsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetAllConversations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetAllConversations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetAllConversations(ctx, req.(*GetAllConversationsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetConversations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetConversationsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetConversations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetConversations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetConversations(ctx, req.(*GetConversationsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_BatchSetConversations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BatchSetConversationsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).BatchSetConversations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/BatchSetConversations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).BatchSetConversations(ctx, req.(*BatchSetConversationsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_SetConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetConversationReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).SetConversation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/SetConversation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).SetConversation(ctx, req.(*SetConversationReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_SetRecvMsgOpt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetRecvMsgOptReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).SetRecvMsgOpt(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/SetRecvMsgOpt", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).SetRecvMsgOpt(ctx, req.(*SetRecvMsgOptReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserByIdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetUserById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetUserById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetUserById(ctx, req.(*GetUserByIdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetUsersByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUsersByNameReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetUsersByName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetUsersByName", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetUsersByName(ctx, req.(*GetUsersByNameReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_ResignUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ResignUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).ResignUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/ResignUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).ResignUser(ctx, req.(*ResignUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_AlterUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AlterUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).AlterUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/AlterUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).AlterUser(ctx, req.(*AlterUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUsersReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetUsers(ctx, req.(*GetUsersReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_AddUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).AddUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/AddUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).AddUser(ctx, req.(*AddUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_BlockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BlockUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).BlockUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/BlockUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).BlockUser(ctx, req.(*BlockUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_UnBlockUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnBlockUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).UnBlockUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/UnBlockUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).UnBlockUser(ctx, req.(*UnBlockUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetBlockUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlockUsersReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetBlockUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetBlockUsers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetBlockUsers(ctx, req.(*GetBlockUsersReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_GetBlockUserById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlockUserByIdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).GetBlockUserById(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/GetBlockUserById", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).GetBlockUserById(ctx, req.(*GetBlockUserByIdReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _User_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/user.user/DeleteUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).DeleteUser(ctx, req.(*DeleteUserReq)) + } + return interceptor(ctx, in, info, handler) +} + +var _User_serviceDesc = grpc.ServiceDesc{ + ServiceName: "user.user", + HandlerType: (*UserServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetUserInfo", + Handler: _User_GetUserInfo_Handler, + }, + { + MethodName: "UpdateUserInfo", + Handler: _User_UpdateUserInfo_Handler, + }, + { + MethodName: "DeleteUsers", + Handler: _User_DeleteUsers_Handler, + }, + { + MethodName: "GetAllUserID", + Handler: _User_GetAllUserID_Handler, + }, + { + MethodName: "AccountCheck", + Handler: _User_AccountCheck_Handler, + }, + { + MethodName: "GetConversation", + Handler: _User_GetConversation_Handler, + }, + { + MethodName: "GetAllConversations", + Handler: _User_GetAllConversations_Handler, + }, + { + MethodName: "GetConversations", + Handler: _User_GetConversations_Handler, + }, + { + MethodName: "BatchSetConversations", + Handler: _User_BatchSetConversations_Handler, + }, + { + MethodName: "SetConversation", + Handler: _User_SetConversation_Handler, + }, + { + MethodName: "SetRecvMsgOpt", + Handler: _User_SetRecvMsgOpt_Handler, + }, + { + MethodName: "GetUserById", + Handler: _User_GetUserById_Handler, + }, + { + MethodName: "GetUsersByName", + Handler: _User_GetUsersByName_Handler, + }, + { + MethodName: "ResignUser", + Handler: _User_ResignUser_Handler, + }, + { + MethodName: "AlterUser", + Handler: _User_AlterUser_Handler, + }, + { + MethodName: "GetUsers", + Handler: _User_GetUsers_Handler, + }, + { + MethodName: "AddUser", + Handler: _User_AddUser_Handler, + }, + { + MethodName: "BlockUser", + Handler: _User_BlockUser_Handler, + }, + { + MethodName: "UnBlockUser", + Handler: _User_UnBlockUser_Handler, + }, + { + MethodName: "GetBlockUsers", + Handler: _User_GetBlockUsers_Handler, + }, + { + MethodName: "GetBlockUserById", + Handler: _User_GetBlockUserById_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _User_DeleteUser_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user/user.proto", +} + +func init() { proto.RegisterFile("user/user.proto", fileDescriptor_user_6133bd34462fbb1a) } + +var fileDescriptor_user_6133bd34462fbb1a = []byte{ + // 1835 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0x5f, 0x6f, 0xdc, 0xc6, + 0x11, 0x07, 0xef, 0x8f, 0x25, 0xcd, 0xe9, 0x4e, 0xa7, 0x95, 0x2c, 0xd1, 0x6c, 0xab, 0xaa, 0x84, + 0xeb, 0x0a, 0x02, 0x2a, 0xb5, 0x6e, 0x51, 0x17, 0x2e, 0x5a, 0x5b, 0x77, 0x92, 0x85, 0x2b, 0x62, + 0xe9, 0xc0, 0xb3, 0x80, 0x20, 0x08, 0x20, 0xd0, 0x77, 0x2b, 0x89, 0xd0, 0x1d, 0x49, 0x73, 0x79, + 0xb2, 0x95, 0x17, 0x07, 0xf9, 0xf3, 0x12, 0xe4, 0x25, 0x40, 0x00, 0x3b, 0x79, 0xc8, 0xe7, 0xc8, + 0x7b, 0xf2, 0x94, 0x6f, 0x90, 0xa7, 0x7c, 0x95, 0x60, 0x97, 0x4b, 0x72, 0x77, 0x49, 0x49, 0x17, + 0x4a, 0xf0, 0x8b, 0xad, 0x9d, 0xdd, 0x1d, 0xfe, 0x66, 0xe6, 0x37, 0xb3, 0xb3, 0x7b, 0x30, 0x37, + 0x26, 0x38, 0xd8, 0xa4, 0xff, 0x6c, 0xf8, 0x81, 0x17, 0x7a, 0xa8, 0x42, 0xff, 0x36, 0xfe, 0xb4, + 0xef, 0x63, 0xf7, 0xb0, 0xf3, 0x74, 0xd3, 0x3f, 0x3d, 0xde, 0x64, 0x13, 0x9b, 0x64, 0x70, 0x7a, + 0xf8, 0x92, 0x6c, 0xbe, 0x24, 0xd1, 0x42, 0xf3, 0x7f, 0x00, 0x6d, 0x6f, 0x34, 0xf2, 0x5c, 0x0b, + 0x13, 0x1f, 0xe9, 0x30, 0x85, 0x83, 0xa0, 0xed, 0x0d, 0xb0, 0xae, 0xad, 0x6a, 0x6b, 0x55, 0x2b, + 0x1e, 0xa2, 0x25, 0xb8, 0x85, 0x83, 0xe0, 0x29, 0x39, 0xd6, 0x4b, 0xab, 0xda, 0xda, 0x8c, 0xc5, + 0x47, 0xe6, 0x47, 0xd0, 0xd8, 0xc6, 0x43, 0x1c, 0xe2, 0x03, 0x82, 0x03, 0x62, 0xe1, 0x17, 0x68, + 0x1d, 0x9a, 0xa9, 0xa4, 0xb3, 0xfd, 0x9e, 0x43, 0x42, 0xbd, 0xb4, 0x5a, 0x5e, 0x9b, 0xb1, 0x32, + 0x72, 0x64, 0xc0, 0xf4, 0xbe, 0x1f, 0x8d, 0xf5, 0x32, 0xd3, 0x9b, 0x8c, 0xd1, 0x2a, 0xd4, 0xf6, + 0x7d, 0x1c, 0xd8, 0xa1, 0xe3, 0xb9, 0x9d, 0x6d, 0xbd, 0xc2, 0xa6, 0x45, 0x91, 0xe9, 0xc1, 0x9c, + 0xf4, 0x6d, 0xe2, 0xa3, 0xbf, 0x89, 0xe6, 0x30, 0x1b, 0x6a, 0xf7, 0x9b, 0x1b, 0xcc, 0x31, 0xa9, + 0xdc, 0x12, 0x4d, 0x5e, 0x87, 0xe6, 0x13, 0xdb, 0x19, 0xe2, 0x41, 0x16, 0xae, 0x2a, 0x37, 0xf7, + 0x61, 0x6e, 0x17, 0x87, 0x5b, 0xc3, 0x61, 0x24, 0xa3, 0xd6, 0x1a, 0x30, 0xed, 0xc5, 0x16, 0x68, + 0x91, 0x05, 0x9e, 0x60, 0x81, 0x27, 0x58, 0x10, 0x39, 0x4e, 0x14, 0x99, 0x03, 0x68, 0xca, 0x0a, + 0x0b, 0x99, 0xb0, 0x02, 0x90, 0x01, 0x2f, 0x48, 0xcc, 0x73, 0x98, 0xdb, 0xea, 0xf7, 0xbd, 0xb1, + 0x1b, 0xb6, 0x4f, 0x70, 0xff, 0x94, 0xc2, 0x5e, 0x83, 0x39, 0xf6, 0xb7, 0xb0, 0x4f, 0x63, 0xfb, + 0x54, 0xb1, 0x14, 0xa2, 0xd2, 0xe5, 0x21, 0x2a, 0x67, 0x43, 0xf4, 0x8b, 0x06, 0x4d, 0xf9, 0xdb, + 0x91, 0x85, 0xfd, 0x09, 0x2c, 0x4c, 0xd7, 0xa0, 0x5d, 0x00, 0x0b, 0x93, 0xf1, 0x30, 0x4c, 0x2c, + 0xac, 0xdd, 0xff, 0x4b, 0xb4, 0x43, 0xd5, 0xbe, 0xd1, 0x73, 0xdc, 0xe3, 0x21, 0xa3, 0x44, 0x2f, + 0xb4, 0xc3, 0x31, 0xb1, 0x84, 0xad, 0x46, 0x17, 0x9a, 0xea, 0x3c, 0xa5, 0xf6, 0x58, 0x0c, 0x20, + 0x1f, 0xa1, 0xbb, 0x50, 0xb7, 0x23, 0xe5, 0xd1, 0x42, 0x6e, 0xbe, 0x2c, 0x34, 0x5d, 0x68, 0xec, + 0xe2, 0x90, 0x39, 0xc4, 0x3d, 0xf2, 0xa8, 0x6f, 0x57, 0x00, 0xc6, 0xaa, 0x5b, 0x05, 0xc9, 0x35, + 0x3d, 0xfa, 0x99, 0xc6, 0x48, 0x98, 0x7e, 0xb0, 0x90, 0x43, 0x1f, 0xc1, 0x6c, 0xac, 0x81, 0xa1, + 0x2c, 0x33, 0x97, 0xfe, 0x6e, 0x83, 0xe0, 0xe0, 0x0c, 0x07, 0x87, 0xb6, 0xef, 0x1c, 0xfa, 0x76, + 0x60, 0x8f, 0xc8, 0x46, 0xf2, 0x21, 0x69, 0x83, 0xf9, 0x85, 0x06, 0xf3, 0x07, 0xfe, 0xc0, 0xe6, + 0xe9, 0xcc, 0x4d, 0x7f, 0x00, 0xd3, 0xf1, 0x90, 0xc3, 0xb8, 0x54, 0x65, 0xb2, 0xf8, 0x2a, 0x9f, + 0x78, 0x59, 0x9f, 0x88, 0x69, 0xf4, 0x04, 0x90, 0x8a, 0xa5, 0x88, 0x57, 0xcc, 0xaf, 0xcb, 0x30, + 0xdb, 0xf6, 0xdc, 0x33, 0x1c, 0x10, 0xa6, 0x9a, 0x85, 0xe3, 0xa5, 0x8b, 0x03, 0x29, 0xc1, 0x45, + 0x11, 0xba, 0x07, 0x0d, 0x71, 0x47, 0x02, 0x5f, 0x91, 0x52, 0x52, 0x58, 0xb8, 0x7f, 0xf6, 0x94, + 0x1c, 0xef, 0xfb, 0x21, 0xb3, 0xa1, 0x6a, 0x09, 0x12, 0x5a, 0x86, 0xc4, 0x1d, 0xcf, 0xce, 0x7d, + 0xcc, 0x4a, 0x5e, 0xd5, 0xca, 0xc8, 0x29, 0x61, 0x39, 0xa0, 0x6a, 0x44, 0x58, 0x8e, 0x45, 0x87, + 0xa9, 0xdd, 0xc0, 0x1b, 0xfb, 0x9d, 0x6d, 0xfd, 0x16, 0x9b, 0x88, 0x87, 0xd4, 0x8e, 0x03, 0x37, + 0xc0, 0xf6, 0xa0, 0x4d, 0x99, 0xab, 0x4f, 0x31, 0xc5, 0xa2, 0x88, 0x92, 0x7d, 0x3b, 0xb0, 0x8f, + 0xc2, 0x67, 0xf8, 0x55, 0xf8, 0xcc, 0x19, 0x61, 0x7d, 0x7a, 0x55, 0x5b, 0x2b, 0x5b, 0xb2, 0x90, + 0x86, 0xa9, 0x43, 0xba, 0x8e, 0xeb, 0xe2, 0x81, 0x3e, 0xb3, 0xaa, 0xad, 0x4d, 0x5b, 0xc9, 0x18, + 0x99, 0x30, 0xbb, 0x15, 0x86, 0x76, 0xff, 0x04, 0x0f, 0x58, 0xfc, 0x81, 0x41, 0x90, 0x64, 0xf4, + 0x2b, 0x1d, 0xd2, 0x0d, 0x9c, 0x33, 0x3b, 0xc4, 0xed, 0x13, 0x3b, 0xd4, 0x6b, 0x4c, 0x89, 0x2c, + 0x44, 0x0d, 0x28, 0xed, 0xbc, 0xd2, 0x67, 0xd9, 0xfe, 0xd2, 0xce, 0x2b, 0xf3, 0x5b, 0x0d, 0x50, + 0x0f, 0x87, 0xa2, 0x1f, 0x28, 0xd9, 0xfe, 0x25, 0x07, 0x8b, 0x47, 0x18, 0xc5, 0x11, 0x16, 0x16, + 0xcb, 0x41, 0x5d, 0x87, 0xa6, 0xeb, 0x85, 0xce, 0x91, 0xd3, 0x4f, 0x5d, 0x5d, 0x8a, 0x5c, 0xad, + 0xca, 0x27, 0xc8, 0xc7, 0x5d, 0x58, 0xc8, 0x60, 0x2b, 0x44, 0xbe, 0x9f, 0x34, 0x68, 0xf6, 0x70, + 0x98, 0x72, 0x82, 0xda, 0xf8, 0x4e, 0x09, 0x98, 0xf1, 0x4a, 0x65, 0x32, 0xaf, 0x54, 0xb3, 0x5e, + 0xd9, 0x81, 0x79, 0xc5, 0x96, 0x42, 0x3e, 0xf9, 0x58, 0x03, 0xb4, 0x9b, 0x8d, 0x7c, 0xd6, 0x66, + 0x2d, 0xd7, 0x66, 0xc5, 0x7b, 0xa5, 0xac, 0xf7, 0xae, 0x8e, 0xef, 0x6b, 0x58, 0xd8, 0xbd, 0x89, + 0xf8, 0x66, 0xe8, 0x5a, 0x9a, 0x8c, 0xae, 0xe6, 0xa7, 0x5a, 0x06, 0x01, 0x99, 0x8c, 0x1a, 0xf4, + 0x90, 0x97, 0x1c, 0x42, 0x78, 0x73, 0xa0, 0x8a, 0x27, 0x70, 0xc3, 0x27, 0x1a, 0x2c, 0x66, 0x51, + 0x14, 0x72, 0xc4, 0xbf, 0xa1, 0x2e, 0xa9, 0xe1, 0xe7, 0x79, 0x9e, 0x27, 0xe4, 0x85, 0xe6, 0x87, + 0xb0, 0x14, 0xb5, 0x4b, 0x05, 0x9c, 0xa1, 0x98, 0x58, 0xca, 0x9a, 0xf8, 0xb9, 0x06, 0xcb, 0xb9, + 0xea, 0xdf, 0xb1, 0x95, 0x3f, 0x6a, 0xa0, 0xb7, 0xec, 0xb0, 0x7f, 0xd2, 0xcb, 0x89, 0x7a, 0x46, + 0xad, 0x36, 0xa1, 0xda, 0x09, 0x92, 0x21, 0xaf, 0x04, 0x94, 0x27, 0x2b, 0x01, 0x95, 0xbc, 0xc4, + 0xb9, 0x73, 0x81, 0x15, 0x85, 0xfc, 0xa9, 0xc3, 0x54, 0x6f, 0xdc, 0xef, 0x63, 0x12, 0x93, 0x38, + 0x1e, 0xd2, 0xe3, 0x30, 0xea, 0xd4, 0x59, 0x17, 0x33, 0x63, 0xf1, 0x91, 0xd9, 0x81, 0xba, 0x85, + 0x89, 0x73, 0xec, 0x52, 0xf3, 0xa8, 0xef, 0xe2, 0x73, 0x73, 0x10, 0x37, 0x7a, 0xd1, 0x68, 0x02, + 0x6a, 0xb4, 0xa0, 0x21, 0xaa, 0x2a, 0x54, 0xcb, 0xfe, 0x9f, 0x34, 0x8a, 0xad, 0xf3, 0xce, 0xe0, + 0x7a, 0x78, 0xde, 0x6a, 0x50, 0xa1, 0x8b, 0xe9, 0xa1, 0xdb, 0x0d, 0xbc, 0x23, 0x67, 0x88, 0xbb, + 0x27, 0x5e, 0xe8, 0x71, 0x45, 0x92, 0x8c, 0x1e, 0xda, 0x7b, 0x4e, 0xff, 0xd4, 0xb5, 0x47, 0x38, + 0xee, 0xad, 0xe2, 0xb1, 0x00, 0xa1, 0x2c, 0x41, 0x58, 0x01, 0x68, 0x07, 0xd8, 0x0e, 0x31, 0xeb, + 0x05, 0xa2, 0xe8, 0x0a, 0x12, 0x1a, 0x8d, 0x0e, 0x69, 0x0d, 0xbd, 0xfe, 0x29, 0xab, 0xfe, 0xd3, + 0x56, 0x3c, 0x34, 0xfb, 0x49, 0x7b, 0x1a, 0x99, 0x59, 0xf0, 0x46, 0xc3, 0x2e, 0xb0, 0xbc, 0x46, + 0x42, 0xb4, 0x96, 0xf9, 0x9e, 0xc9, 0xcd, 0x37, 0x1a, 0xcc, 0xf3, 0xaf, 0x90, 0xd6, 0xf9, 0x9e, + 0x3d, 0xc2, 0xfc, 0x2e, 0x46, 0x25, 0x74, 0x18, 0xdf, 0xc5, 0xe2, 0x31, 0xda, 0x06, 0xe8, 0xda, + 0xc7, 0x8e, 0x2b, 0xd6, 0xde, 0xbb, 0x39, 0xbd, 0xa9, 0x85, 0x5f, 0x8c, 0x31, 0x09, 0xd3, 0xb5, + 0x96, 0xb0, 0x6f, 0x82, 0x3a, 0xf9, 0x4d, 0x74, 0x62, 0x49, 0xc8, 0x88, 0x8f, 0x56, 0xa1, 0x4a, + 0x81, 0xc7, 0xe9, 0x2a, 0x5a, 0x14, 0x4d, 0xa0, 0x9d, 0x1c, 0x80, 0x7f, 0xce, 0x05, 0x48, 0x7c, + 0xcf, 0x25, 0xf8, 0x02, 0x84, 0xb1, 0x0f, 0xc6, 0x23, 0xc2, 0x73, 0x37, 0x19, 0x9b, 0xdf, 0x6b, + 0x30, 0xbb, 0x35, 0x0c, 0xa3, 0x7c, 0xbf, 0x16, 0x01, 0xe9, 0x8a, 0xee, 0x89, 0xe7, 0xe2, 0xbd, + 0xf1, 0xe8, 0x39, 0x0e, 0xd8, 0x97, 0xca, 0x96, 0x28, 0x92, 0x58, 0x57, 0x51, 0x58, 0xb7, 0x08, + 0xd5, 0x9d, 0x91, 0xed, 0x0c, 0x79, 0xe7, 0x10, 0x0d, 0x84, 0x3b, 0xc0, 0x80, 0xf7, 0xaf, 0xc9, + 0xd8, 0xdc, 0x82, 0xba, 0x80, 0xbc, 0x08, 0xa7, 0xcc, 0xaf, 0x34, 0xa8, 0xc5, 0x91, 0x89, 0x8f, + 0x0c, 0xc1, 0x48, 0x2d, 0x6b, 0xe4, 0xcd, 0x70, 0x46, 0x64, 0x65, 0x59, 0x66, 0xa5, 0xf9, 0x83, + 0x06, 0xb3, 0x29, 0xa6, 0x6b, 0xa6, 0x4a, 0x39, 0x2f, 0x55, 0x14, 0x5e, 0x95, 0x6f, 0x82, 0x57, + 0x15, 0x85, 0x57, 0x6f, 0x35, 0x80, 0xad, 0xc1, 0x20, 0x66, 0xd5, 0xd5, 0x8e, 0x55, 0xd8, 0xc3, + 0xf9, 0x25, 0xb2, 0xe7, 0xa2, 0xba, 0x84, 0xa0, 0x22, 0x30, 0x8a, 0xfd, 0x2d, 0xf1, 0xa6, 0xaa, + 0xf0, 0xe6, 0x11, 0xd4, 0x12, 0x64, 0x85, 0x58, 0xf3, 0xa5, 0x06, 0xb3, 0xac, 0xb0, 0x5d, 0x95, + 0x33, 0xf7, 0xa0, 0xb1, 0xe3, 0x0e, 0xb6, 0x1d, 0x62, 0x3f, 0x1f, 0x46, 0x55, 0x93, 0xf7, 0xe1, + 0xb2, 0xf4, 0xea, 0x12, 0x22, 0xd9, 0x53, 0xc9, 0xe6, 0x81, 0x80, 0xa6, 0x90, 0x45, 0x47, 0xd0, + 0x38, 0x70, 0x27, 0x32, 0xe9, 0xea, 0x32, 0x20, 0x42, 0x2d, 0x2b, 0x50, 0xdb, 0x30, 0x27, 0x7d, + 0xa7, 0x10, 0xd8, 0xef, 0x34, 0xf6, 0x42, 0x96, 0xa8, 0x61, 0x99, 0x2b, 0xe7, 0xa5, 0x76, 0x33, + 0xb5, 0x3c, 0xc7, 0x3a, 0x53, 0x08, 0xfd, 0xde, 0x78, 0xc4, 0xeb, 0xa9, 0x24, 0x33, 0x5f, 0xc3, + 0x4c, 0x32, 0xa6, 0xb9, 0x48, 0xff, 0xe7, 0x90, 0xa4, 0x5c, 0x64, 0xf3, 0xeb, 0xd0, 0x6c, 0xe1, + 0x63, 0xc7, 0xcd, 0xb2, 0x24, 0x23, 0xcf, 0xe1, 0x53, 0x39, 0x8f, 0x4f, 0xe6, 0xcf, 0xd1, 0x51, + 0x28, 0x7a, 0xa8, 0x50, 0x1d, 0xd9, 0x04, 0x48, 0x75, 0xf0, 0x6a, 0x32, 0x17, 0xed, 0x48, 0x83, + 0x28, 0x2c, 0x79, 0x17, 0x85, 0xa5, 0xcb, 0x6e, 0x3e, 0xc9, 0x37, 0xe3, 0xbe, 0x69, 0x19, 0xa6, + 0xe8, 0xf0, 0xd0, 0xf9, 0xed, 0x8d, 0xd3, 0x0e, 0xbb, 0xc5, 0x28, 0x1a, 0x89, 0x8f, 0xfe, 0x2a, + 0x84, 0x91, 0x57, 0xfa, 0x8c, 0xf1, 0xe9, 0x0a, 0xf3, 0x08, 0xea, 0xe9, 0xcb, 0xf3, 0xf5, 0x20, + 0x5d, 0x9a, 0x43, 0x2d, 0xf1, 0x75, 0xbd, 0x58, 0x60, 0xef, 0xbf, 0xa9, 0x45, 0x27, 0x04, 0x7a, + 0x98, 0x9c, 0x7f, 0xec, 0x2d, 0x66, 0x31, 0xda, 0x25, 0x3f, 0x5e, 0x1a, 0xb7, 0x73, 0xa4, 0xc4, + 0x47, 0x6d, 0x68, 0xc8, 0x2f, 0x6c, 0x68, 0x99, 0xb3, 0x5b, 0x7d, 0x03, 0x34, 0xf4, 0xfc, 0x09, + 0xe2, 0x53, 0x00, 0xc2, 0x7b, 0x7d, 0x0c, 0x40, 0xfe, 0xf9, 0x20, 0x06, 0xa0, 0x3e, 0xec, 0xff, + 0x97, 0x1d, 0x94, 0xc9, 0x4b, 0x39, 0x4a, 0x71, 0x8a, 0xcf, 0xf1, 0xc6, 0x52, 0x9e, 0x38, 0xda, + 0x2e, 0x3e, 0x14, 0xc7, 0xdb, 0x95, 0x67, 0xf1, 0x78, 0x7b, 0xe6, 0xc5, 0xfa, 0x09, 0x6b, 0x6a, + 0xa5, 0x57, 0x24, 0x3d, 0xf9, 0x92, 0xf2, 0x3a, 0x61, 0xdc, 0xb9, 0x60, 0x86, 0xf8, 0xc8, 0x62, + 0x84, 0x56, 0x6f, 0x98, 0xe8, 0xf7, 0x22, 0x6a, 0xf5, 0xca, 0x67, 0xfc, 0xe1, 0x92, 0x59, 0xe2, + 0xa3, 0x0e, 0xab, 0x90, 0xb2, 0xc2, 0x7c, 0x08, 0x4c, 0x9b, 0x71, 0xd1, 0x14, 0xf1, 0xd1, 0xfb, + 0x70, 0x3b, 0xf7, 0xca, 0x86, 0x56, 0x78, 0x2e, 0x5c, 0x70, 0x2b, 0x35, 0xfe, 0x78, 0xe9, 0x7c, + 0xe4, 0xc0, 0x5e, 0xbe, 0x03, 0x7b, 0x17, 0x3a, 0x30, 0xef, 0x59, 0xed, 0x31, 0xd4, 0xa5, 0x77, + 0x25, 0xb4, 0x94, 0xac, 0x95, 0x1e, 0xce, 0x8c, 0xe5, 0x5c, 0x79, 0x44, 0x42, 0xe1, 0x7e, 0xa2, + 0x64, 0x01, 0xaf, 0x30, 0x4a, 0x16, 0x24, 0x55, 0xa2, 0x9d, 0x5c, 0xe1, 0x78, 0x6f, 0x1f, 0x67, + 0x41, 0xe6, 0x2e, 0x62, 0xe8, 0xf9, 0x13, 0xc4, 0x47, 0x0f, 0xd8, 0x6f, 0x19, 0xfc, 0x2e, 0x89, + 0x16, 0xa2, 0x75, 0xd2, 0x45, 0xd5, 0x58, 0xcc, 0x0a, 0x89, 0x8f, 0xfe, 0x09, 0x33, 0x49, 0x0f, + 0x8c, 0xf8, 0x85, 0x5f, 0x6c, 0xe7, 0x8d, 0x85, 0x8c, 0x8c, 0xf8, 0xe8, 0xef, 0x30, 0x1d, 0x83, + 0x40, 0xf3, 0x32, 0x28, 0xba, 0x07, 0xa9, 0x22, 0xe2, 0xa3, 0x0d, 0x98, 0xe2, 0x4d, 0x13, 0xe2, + 0xa5, 0x25, 0xed, 0xee, 0x8c, 0x79, 0x45, 0x12, 0x01, 0x4b, 0xcf, 0x40, 0xa4, 0x96, 0xcd, 0x14, + 0x98, 0xdc, 0x0c, 0x3c, 0x84, 0x9a, 0xd0, 0x1f, 0xc4, 0x81, 0x90, 0x5b, 0x93, 0x38, 0x10, 0x6a, + 0x23, 0xf1, 0x18, 0xea, 0xd2, 0x99, 0x87, 0xd2, 0xbc, 0x97, 0x5a, 0x05, 0x63, 0x39, 0x57, 0x9e, + 0x64, 0x8d, 0x74, 0x10, 0x08, 0x59, 0xa3, 0x1e, 0x39, 0x42, 0xd6, 0x64, 0xcf, 0x8e, 0x07, 0x00, + 0x69, 0xb5, 0x8a, 0x03, 0x2a, 0x1d, 0x0f, 0xc6, 0x62, 0x56, 0x48, 0xfc, 0x56, 0xfd, 0x83, 0xda, + 0x06, 0xfb, 0xd1, 0xf6, 0x3f, 0xf4, 0x9f, 0xe7, 0xb7, 0xd8, 0x2f, 0xb2, 0xff, 0xf8, 0x35, 0x00, + 0x00, 0xff, 0xff, 0x10, 0x04, 0x45, 0x5d, 0xcd, 0x1d, 0x00, 0x00, +} diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto new file mode 100644 index 000000000..c6dad658c --- /dev/null +++ b/pkg/proto/user/user.proto @@ -0,0 +1,316 @@ +syntax = "proto3"; +import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +option go_package = "./user;user"; +package user; + +message CommonResp{ + int32 errCode = 1; + string errMsg = 2; +} + +message DeleteUsersReq{ + repeated string DeleteUserIDList = 2; + string OpUserID = 3; + string OperationID = 4; +} + +message DeleteUsersResp{ + CommonResp CommonResp = 1; + repeated string FailedUserIDList = 2; +} + + +message GetAllUserIDReq{ + string opUserID = 1; + string operationID = 2; +} +message GetAllUserIDResp{ + CommonResp CommonResp = 1; + repeated string UserIDList = 2; +} + + +message AccountCheckReq{ + repeated string CheckUserIDList = 1; + string OpUserID = 2; + string OperationID = 3; + +} +message AccountCheckResp{ + CommonResp commonResp = 1; + message SingleUserStatus { + string userID = 1; + string accountStatus = 2; + } + repeated SingleUserStatus ResultList = 2; +} + + +message GetUserInfoReq{ + repeated string userIDList = 1; + string OpUserID = 2; + string OperationID = 3; +} +message GetUserInfoResp{ + CommonResp commonResp = 1; + repeated server_api_params.UserInfo UserInfoList = 3; +} + + + +message UpdateUserInfoReq{ + server_api_params.UserInfo UserInfo = 1; + string OpUserID = 2; + string operationID = 3; +} +message UpdateUserInfoResp{ + CommonResp commonResp = 1; +} + +message Conversation{ + string OwnerUserID = 1; + string ConversationID = 2; + int32 RecvMsgOpt = 3; + int32 ConversationType = 4; + string UserID = 5; + string GroupID = 6; + int32 UnreadCount = 7; + int64 DraftTextTime = 8; + bool IsPinned = 9; + string AttachedInfo = 10; + bool IsPrivateChat = 11; + string Ex = 12; +} + +message SetConversationReq{ + Conversation Conversation = 1; + int32 notificationType = 2; + string OperationID = 3; +} + +message SetConversationResp{ + CommonResp commonResp = 1; +} + +message SetRecvMsgOptReq { + string OwnerUserID = 1; + string ConversationID = 2; + int32 RecvMsgOpt = 3; + int32 notificationType = 4; + string OperationID = 5; +} + +message SetRecvMsgOptResp { + CommonResp commonResp = 1; +} + +message GetConversationReq{ + string ConversationID = 1; + string OwnerUserID = 2; + string OperationID = 3; +} + +message GetConversationResp{ + CommonResp commonResp = 1; + Conversation Conversation = 2; +} + +message GetConversationsReq{ + string OwnerUserID = 1; + repeated string ConversationIDs = 2; + string OperationID = 3; +} + +message GetConversationsResp{ + CommonResp commonResp = 1; + repeated Conversation Conversations = 2; +} + +message GetAllConversationsReq{ + string OwnerUserID = 1; + string OperationID = 2; +} + +message GetAllConversationsResp{ + CommonResp commonResp = 1; + repeated Conversation Conversations = 2; +} + +message BatchSetConversationsReq{ + repeated Conversation Conversations = 1; + string OwnerUserID = 2; + int32 notificationType = 3; + string OperationID = 4; +} + +message BatchSetConversationsResp{ + CommonResp commonResp = 1; + repeated string Success = 2; + repeated string Failed = 3; +} + +message ResignUserReq{ + string UserId = 1; + string OperationID = 2; +} + +message ResignUserResp{ + CommonResp commonResp = 1; +} + +message GetUserByIdReq{ + string UserId = 1; + string OperationID = 2; +} + +message User{ + string ProfilePhoto = 1; + string Nickname = 2; + string UserId = 3; + string CreateTime = 4; + bool IsBlock = 5; +} + +message GetUserByIdResp{ + CommonResp CommonResp = 1; + User user = 2; +} + +message GetUsersByNameReq { + string UserName = 1; + server_api_params.RequestPagination Pagination =2; + string OperationID = 3; +} + +message GetUsersByNameResp { + repeated User users = 1; + server_api_params.ResponsePagination Pagination = 2; + int32 UserNums = 3; +} + +message AlterUserReq{ + string UserId = 1; + string OperationID = 2; + int64 PhoneNumber = 3; + string Nickname = 4; + string Email = 5; + string OpUserId = 6; +} + +message AlterUserResp{ + CommonResp CommonResp = 1; +} + +message GetUsersReq { + string OperationID = 1; + server_api_params.RequestPagination Pagination = 2; + string UserName = 3; +} + +message GetUsersResp{ + CommonResp CommonResp = 1; + repeated User user = 2; + server_api_params.ResponsePagination Pagination = 3; + int32 UserNums = 4; +} + +message AddUserReq{ + string OperationID = 1; + string PhoneNumber = 2; + string UserId = 3; + string name = 4; + string OpUserId = 5; +} + +message AddUserResp{ + CommonResp CommonResp = 1; +} + + +message BlockUserReq{ + string UserId = 1; + string EndDisableTime = 2; + string OperationID = 3; + string OpUserId = 4; +} + +message BlockUserResp{ + CommonResp CommonResp = 1; +} + +message UnBlockUserReq{ + string UserId = 1; + string OperationID = 2; + string OpUserId = 3; +} + +message UnBlockUserResp{ + CommonResp CommonResp = 1; +} + +message GetBlockUsersReq{ + server_api_params.RequestPagination Pagination =1; + string OperationID = 2; + int32 BlockUserNum = 3; +} + +message BlockUser { + User User = 1; + string BeginDisableTime = 2; + string EndDisableTime = 3; +} + +message GetBlockUsersResp{ + CommonResp CommonResp = 1; + repeated BlockUser BlockUsers = 2; + server_api_params.ResponsePagination Pagination = 3; + int32 UserNums = 4; +} + +message GetBlockUserByIdReq { + string User_id = 1; + string OperationID = 2; +} + +message GetBlockUserByIdResp { + BlockUser BlockUser = 2; +} + +message DeleteUserReq { + string User_id = 1; + string OperationID = 2; + string OpUserId = 3; +} + +message DeleteUserResp { + CommonResp CommonResp = 1; +} + + + +service user { + rpc GetUserInfo(GetUserInfoReq) returns(GetUserInfoResp); + rpc UpdateUserInfo(UpdateUserInfoReq) returns(UpdateUserInfoResp); + rpc DeleteUsers(DeleteUsersReq)returns(DeleteUsersResp); + rpc GetAllUserID(GetAllUserIDReq)returns(GetAllUserIDResp); + + rpc AccountCheck(AccountCheckReq)returns(AccountCheckResp); + rpc GetConversation(GetConversationReq)returns(GetConversationResp); + rpc GetAllConversations(GetAllConversationsReq)returns(GetAllConversationsResp); + rpc GetConversations(GetConversationsReq)returns(GetConversationsResp); + rpc BatchSetConversations(BatchSetConversationsReq)returns(BatchSetConversationsResp); + rpc SetConversation(SetConversationReq)returns(SetConversationResp); + rpc SetRecvMsgOpt(SetRecvMsgOptReq)returns(SetRecvMsgOptResp); + + rpc GetUserById(GetUserByIdReq) returns (GetUserByIdResp); + rpc GetUsersByName(GetUsersByNameReq) returns (GetUsersByNameResp); + rpc ResignUser(ResignUserReq) returns (ResignUserResp); + rpc AlterUser(AlterUserReq) returns (AlterUserResp); + rpc GetUsers(GetUsersReq) returns (GetUsersResp); + rpc AddUser(AddUserReq) returns (AddUserResp); + rpc BlockUser(BlockUserReq) returns (BlockUserResp); + rpc UnBlockUser(UnBlockUserReq) returns (UnBlockUserResp); + rpc GetBlockUsers(GetBlockUsersReq) returns (GetBlockUsersResp); + rpc GetBlockUserById(GetBlockUserByIdReq) returns (GetBlockUserByIdResp); + rpc DeleteUser(DeleteUserReq) returns (DeleteUserResp); +} diff --git a/pkg/statistics/statistics.go b/pkg/statistics/statistics.go new file mode 100644 index 000000000..bea4479bd --- /dev/null +++ b/pkg/statistics/statistics.go @@ -0,0 +1,32 @@ +package statistics + +import ( + "Open_IM/pkg/common/log" + "time" +) + +type Statistics struct { + Count *uint64 + ModuleName string + PrintArgs string + SleepTime int +} + +func (s *Statistics) output() { + t := time.NewTicker(time.Duration(s.SleepTime) * time.Second) + defer t.Stop() + var sum uint64 + for { + sum = *s.Count + select { + case <-t.C: + } + log.NewWarn("", " system stat ", s.ModuleName, s.PrintArgs, *s.Count-sum, "total:", *s.Count) + } +} + +func NewStatistics(count *uint64, moduleName, printArgs string, sleepTime int) *Statistics { + p := &Statistics{Count: count, ModuleName: moduleName, SleepTime: sleepTime, PrintArgs: printArgs} + go p.output() + return p +} diff --git a/pkg/utils/cors_middleware.go b/pkg/utils/cors_middleware.go new file mode 100644 index 000000000..6809d786d --- /dev/null +++ b/pkg/utils/cors_middleware.go @@ -0,0 +1,24 @@ +package utils + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +func CorsHandler() gin.HandlerFunc { + return func(context *gin.Context) { + context.Writer.Header().Set("Access-Control-Allow-Origin", "*") + context.Header("Access-Control-Allow-Methods", "*") + context.Header("Access-Control-Allow-Headers", "*") + context.Header("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") // 跨域关键设置 让浏览器可以解析 + context.Header("Access-Control-Max-Age", "172800") // 缓存请求信息 单位为秒 + context.Header("Access-Control-Allow-Credentials", "false") // 跨域请求是否需要带cookie信息 默认设置为true + context.Header("content-type", "application/json") // 设置返回格式是json + //Release all option pre-requests + if context.Request.Method == http.MethodOptions { + context.JSON(http.StatusOK, "Options Request!") + } + context.Next() + } +} diff --git a/pkg/utils/file.go b/pkg/utils/file.go new file mode 100644 index 000000000..e46050516 --- /dev/null +++ b/pkg/utils/file.go @@ -0,0 +1,39 @@ +package utils + +import ( + "Open_IM/pkg/common/constant" + "fmt" + "math/rand" + "os" + "path" + "time" +) + +// Determine whether the given path is a folder +func IsDir(path string) bool { + s, err := os.Stat(path) + if err != nil { + return false + } + return s.IsDir() +} + +// Determine whether the given path is a file +func IsFile(path string) bool { + return !IsDir(path) +} + +// Create a directory +func MkDir(path string) error { + return os.MkdirAll(path, os.ModePerm) +} + +func GetNewFileNameAndContentType(fileName string, fileType int) (string, string) { + suffix := path.Ext(fileName) + newName := fmt.Sprintf("%d-%d%s", time.Now().UnixNano(), rand.Int(), fileName) + contentType := "" + if fileType == constant.ImageType { + contentType = "image/" + suffix[1:] + } + return newName, contentType +} diff --git a/pkg/utils/get_server_ip.go b/pkg/utils/get_server_ip.go new file mode 100644 index 000000000..239c75a19 --- /dev/null +++ b/pkg/utils/get_server_ip.go @@ -0,0 +1,26 @@ +package utils + +import ( + "Open_IM/pkg/common/config" + "net" +) + +var ServerIP = "" + +func init() { + //fixme In the configuration file, ip takes precedence, if not, get the valid network card ip of the machine + if config.Config.ServerIP != "" { + ServerIP = config.Config.ServerIP + return + } + + // see https://gist.github.com/jniltinho/9787946#gistcomment-3019898 + conn, err := net.Dial("udp", "8.8.8.8:80") + if err != nil { + panic(err.Error()) + } + + defer conn.Close() + localAddr := conn.LocalAddr().(*net.UDPAddr) + ServerIP = localAddr.IP.String() +} diff --git a/pkg/utils/image.go b/pkg/utils/image.go new file mode 100644 index 000000000..393136e63 --- /dev/null +++ b/pkg/utils/image.go @@ -0,0 +1,56 @@ +package utils + +import ( + "errors" + "github.com/nfnt/resize" + "golang.org/x/image/bmp" + "image" + "image/gif" + "image/jpeg" + "image/png" + "io" + "os" +) + +func GenSmallImage(src, dst string) error { + fIn, _ := os.Open(src) + defer fIn.Close() + + fOut, _ := os.Create(dst) + defer fOut.Close() + + if err := scale(fIn, fOut, 0, 0, 0); err != nil { + return err + } + return nil +} + +func scale(in io.Reader, out io.Writer, width, height, quality int) error { + origin, fm, err := image.Decode(in) + if err != nil { + return err + } + if width == 0 || height == 0 { + width = origin.Bounds().Max.X / 2 + height = origin.Bounds().Max.Y / 2 + } + if quality == 0 { + quality = 25 + } + canvas := resize.Thumbnail(uint(width), uint(height), origin, resize.Lanczos3) + + switch fm { + case "jpeg": + return jpeg.Encode(out, canvas, &jpeg.Options{quality}) + case "png": + return png.Encode(out, canvas) + case "gif": + return gif.Encode(out, canvas, &gif.Options{}) + case "bmp": + return bmp.Encode(out, canvas) + default: + return errors.New("ERROR FORMAT") + } + + return nil +} diff --git a/pkg/utils/map.go b/pkg/utils/map.go new file mode 100644 index 000000000..fc24cc87d --- /dev/null +++ b/pkg/utils/map.go @@ -0,0 +1,129 @@ +package utils + +import ( + "encoding/json" + "sync" +) + +type Map struct { + sync.RWMutex + m map[interface{}]interface{} +} + +func (m *Map) init() { + if m.m == nil { + m.m = make(map[interface{}]interface{}) + } +} + +func (m *Map) UnsafeGet(key interface{}) interface{} { + if m.m == nil { + return nil + } else { + return m.m[key] + } +} + +func (m *Map) Get(key interface{}) interface{} { + m.RLock() + defer m.RUnlock() + return m.UnsafeGet(key) +} + +func (m *Map) UnsafeSet(key interface{}, value interface{}) { + m.init() + m.m[key] = value +} + +func (m *Map) Set(key interface{}, value interface{}) { + m.Lock() + defer m.Unlock() + m.UnsafeSet(key, value) +} + +func (m *Map) TestAndSet(key interface{}, value interface{}) interface{} { + m.Lock() + defer m.Unlock() + + m.init() + + if v, ok := m.m[key]; ok { + return v + } else { + m.m[key] = value + return nil + } +} + +func (m *Map) UnsafeDel(key interface{}) { + m.init() + delete(m.m, key) +} + +func (m *Map) Del(key interface{}) { + m.Lock() + defer m.Unlock() + m.UnsafeDel(key) +} + +func (m *Map) UnsafeLen() int { + if m.m == nil { + return 0 + } else { + return len(m.m) + } +} + +func (m *Map) Len() int { + m.RLock() + defer m.RUnlock() + return m.UnsafeLen() +} + +func (m *Map) UnsafeRange(f func(interface{}, interface{})) { + if m.m == nil { + return + } + for k, v := range m.m { + f(k, v) + } +} + +func (m *Map) RLockRange(f func(interface{}, interface{})) { + m.RLock() + defer m.RUnlock() + m.UnsafeRange(f) +} + +func (m *Map) LockRange(f func(interface{}, interface{})) { + m.Lock() + defer m.Unlock() + m.UnsafeRange(f) +} + +func MapToJsonString(param map[string]interface{}) string { + dataType, _ := json.Marshal(param) + 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]int32) { + _ = json.Unmarshal([]byte(str), &tempMap) + return tempMap +} +func GetSwitchFromOptions(Options map[string]bool, key string) (result bool) { + if flag, ok := Options[key]; !ok || flag { + return true + } + return false +} +func SetSwitchFromOptions(options map[string]bool, key string, value bool) { + if options == nil { + options = make(map[string]bool, 5) + } + options[key] = value +} diff --git a/pkg/utils/md5.go b/pkg/utils/md5.go new file mode 100644 index 000000000..8e3531668 --- /dev/null +++ b/pkg/utils/md5.go @@ -0,0 +1,13 @@ +package utils + +import ( + "crypto/md5" + "encoding/hex" +) + +func Md5(s string) string { + h := md5.New() + h.Write([]byte(s)) + cipher := h.Sum(nil) + return hex.EncodeToString(cipher) +} diff --git a/pkg/utils/strings.go b/pkg/utils/strings.go new file mode 100644 index 000000000..49d883f7c --- /dev/null +++ b/pkg/utils/strings.go @@ -0,0 +1,96 @@ +/* +** description(""). +** copyright('tuoyun,www.tuoyun.net'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/4/8 15:09). + */ +package utils + +import ( + "Open_IM/pkg/common/constant" + "encoding/json" + "math/rand" + "strconv" +) + +func IntToString(i int) string { + return strconv.FormatInt(int64(i), 10) +} + +func StringToInt(i string) int { + j, _ := strconv.Atoi(i) + return j +} +func StringToInt64(i string) int64 { + j, _ := strconv.ParseInt(i, 10, 64) + return j +} +func StringToInt32(i string) int32 { + j, _ := strconv.ParseInt(i, 10, 64) + return int32(j) +} +func Int32ToString(i int32) string { + return strconv.FormatInt(int64(i), 10) +} + +//judge a string whether in the string list +func IsContain(target string, List []string) bool { + for _, element := range List { + + if target == element { + return true + } + } + return false +} +func IsContainInt32(target int32, List []int32) bool { + for _, element := range List { + if target == element { + return true + } + } + return false +} + +func InterfaceArrayToStringArray(data []interface{}) (i []string) { + for _, param := range data { + i = append(i, param.(string)) + } + return i +} +func StructToJsonString(param interface{}) string { + dataType, _ := json.Marshal(param) + dataString := string(dataType) + return dataString +} + +func StructToJsonBytes(param interface{}) []byte { + dataType, _ := json.Marshal(param) + return dataType +} + +//The incoming parameter must be a pointer +func JsonStringToStruct(s string, args interface{}) error { + err := json.Unmarshal([]byte(s), args) + return err +} + +func GetMsgID(sendID string) string { + t := int64ToString(GetCurrentTimestampByNano()) + return Md5(t + sendID + int64ToString(rand.Int63n(GetCurrentTimestampByNano()))) +} +func GetConversationIDBySessionType(sourceID string, sessionType int) string { + switch sessionType { + case constant.SingleChatType: + return "single_" + sourceID + case constant.GroupChatType: + return "group_" + sourceID + } + return "" +} +func int64ToString(i int64) string { + return strconv.FormatInt(i, 10) +} +func Int64ToString(i int64) string { + return strconv.FormatInt(i, 10) +} diff --git a/pkg/utils/time_format.go b/pkg/utils/time_format.go new file mode 100644 index 000000000..c8f6e21fa --- /dev/null +++ b/pkg/utils/time_format.go @@ -0,0 +1,85 @@ +/* +** description(""). +** copyright('tuoyun,www.tuoyun.net'). +** author("fg,Gordon@tuoyun.net"). +** time(2021/2/22 11:52). + */ +package utils + +import ( + "strconv" + "time" +) + +const ( + TimeOffset = 8 * 3600 //8 hour offset + HalfOffset = 12 * 3600 //Half-day hourly offset +) + +//Get the current timestamp by Second +func GetCurrentTimestampBySecond() int64 { + return time.Now().Unix() +} + +//Convert timestamp to time.Time type +func UnixSecondToTime(second int64) time.Time { + return time.Unix(second, 0) +} + +//Convert nano timestamp to time.Time type +func UnixNanoSecondToTime(nanoSecond int64) time.Time { + return time.Unix(0, nanoSecond) +} +func UnixMillSecondToTime(millSecond int64) time.Time { + return time.Unix(0, millSecond*1e6) +} + +//Get the current timestamp by Nano +func GetCurrentTimestampByNano() int64 { + return time.Now().UnixNano() +} + +//Get the current timestamp by Mill +func GetCurrentTimestampByMill() int64 { + return time.Now().UnixNano() / 1e6 +} + +//Get the timestamp at 0 o'clock of the day +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() + return strconv.FormatInt(timestamp, 10) +} + +func TimeStringFormatTimeUnix(timeFormat string, timeSrc string) int64 { + tm, _ := time.Parse(timeFormat, timeSrc) + return tm.Unix() +} + +func TimeStringToTime(timeString string) (time.Time, error) { + t, err := time.Parse("2006-01-02", timeString) + return t, err +} diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go new file mode 100644 index 000000000..8f0b52d72 --- /dev/null +++ b/pkg/utils/utils.go @@ -0,0 +1,95 @@ +package utils + +import ( + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "math/rand" + "runtime" + "strconv" + "strings" + "time" +) + +// copy a by b b->a +func CopyStructFields(a interface{}, b interface{}, fields ...string) (err error) { + return copier.Copy(a, b) +} + +func Wrap(err error, message string) error { + return errors.Wrap(err, "==> "+printCallerNameAndLine()+message) +} + +func WithMessage(err error, message string) error { + return errors.WithMessage(err, "==> "+printCallerNameAndLine()+message) +} + +func printCallerNameAndLine() string { + pc, _, line, _ := runtime.Caller(2) + return runtime.FuncForPC(pc).Name() + "()@" + strconv.Itoa(line) + ": " +} + +func GetSelfFuncName() string { + pc, _, _, _ := runtime.Caller(1) + return cleanUpFuncName(runtime.FuncForPC(pc).Name()) +} +func cleanUpFuncName(funcName string) string { + end := strings.LastIndex(funcName, ".") + if end == -1 { + return "" + } + return funcName[end+1:] +} + +//Get the intersection of two slices +func Intersect(slice1, slice2 []uint32) []uint32 { + m := make(map[uint32]bool) + n := make([]uint32, 0) + for _, v := range slice1 { + m[v] = true + } + for _, v := range slice2 { + flag, _ := m[v] + if flag { + n = append(n, v) + } + } + return n +} + +//Get the diff of two slices +func Difference(slice1, slice2 []uint32) []uint32 { + m := make(map[uint32]bool) + n := make([]uint32, 0) + inter := Intersect(slice1, slice2) + for _, v := range inter { + m[v] = true + } + for _, v := range slice1 { + if !m[v] { + n = append(n, v) + } + } + + for _, v := range slice2 { + if !m[v] { + n = append(n, v) + } + } + return n +} +func OperationIDGenerator() string { + return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10) +} + +func RemoveRepeatedStringInList(slc []string) []string { + var result []string + tempMap := map[string]byte{} + for _, e := range slc { + l := len(tempMap) + tempMap[e] = 0 + if len(tempMap) != l { + result = append(result, e) + } + } + return result +} diff --git a/script/build_all_service.sh b/script/build_all_service.sh new file mode 100644 index 000000000..0d9814bec --- /dev/null +++ b/script/build_all_service.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh + +bin_dir="../bin" +logs_dir="../logs" +sdk_db_dir="../db/sdk/" +#Automatically created when there is no bin, logs folder +if [ ! -d $bin_dir ]; then + mkdir -p $bin_dir +fi +if [ ! -d $logs_dir ]; then + mkdir -p $logs_dir +fi +if [ ! -d $sdk_db_dir ]; then + mkdir -p $sdk_db_dir +fi + +#begin path +begin_path=$PWD + +for ((i = 0; i < ${#service_source_root[*]}; i++)); do + cd $begin_path + service_path=${service_source_root[$i]} + cd $service_path + make install + if [ $? -ne 0 ]; then + echo -e "${RED_PREFIX}${service_names[$i]} build failed ${COLOR_SUFFIX}\n" + exit -1 + else + echo -e "${GREEN_PREFIX}${service_names[$i]} successfully be built ${COLOR_SUFFIX}\n" + fi +done +echo -e ${YELLOW_PREFIX}"all services build success"${COLOR_SUFFIX} diff --git a/script/build_images.sh b/script/build_images.sh new file mode 100644 index 000000000..ad37e24e4 --- /dev/null +++ b/script/build_images.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +image=openim/open_im_server:v1.0.5 +rm Open-IM-Server -rf +git clone https://github.com/OpenIMSDK/Open-IM-Server.git --recursive +cd Open-IM-Server +git checkout tuoyun +cd cmd/Open-IM-SDK-Core/ +git checkout tuoyun +cd ../../ +docker build -t $image . -f deploy.Dockerfile +docker push $image \ No newline at end of file diff --git a/script/check_all.sh b/script/check_all.sh new file mode 100644 index 000000000..c434c65d2 --- /dev/null +++ b/script/check_all.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash + +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh +service_port_name=( + openImCmsApiPort + openImApiPort + openImUserPort + openImFriendPort + openImOfflineMessagePort + openImOnlineRelayPort + openImGroupPort + openImAuthPort + openImPushPort + openImWsPort + openImSdkWsPort + openImDemoPort + openImAdminCmsPort + openImMessageCmsPort + openImStatisticsPort + openImOfficePort + openImOrganizationPort +) +switch=$(cat $config_path | grep demoswitch |awk -F '[:]' '{print $NF}') +for i in ${service_port_name[*]}; do + if [ ${switch} != "true" ]; then + if [ ${i} == "openImDemoPort"]; then + continue + fi + fi + 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 +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/demo_svr_start.sh b/script/demo_svr_start.sh new file mode 100644 index 000000000..85b36ab25 --- /dev/null +++ b/script/demo_svr_start.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +#Include shell font styles and some basic information +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh +switch=$(cat $config_path | grep demoswitch |awk -F '[:]' '{print $NF}') +if [ ${switch} != "true" ]; then + echo -e ${YELLOW_PREFIX}" demo service switch is false not start demo "${COLOR_SUFFIX} + exit 0 +fi +list1=$(cat $config_path | grep openImDemoPort | awk -F '[:]' '{print $NF}') +list_to_string $list1 +api_ports=($ports_array) + +#Check if the service exists +#If it is exists,kill this process +check=$(ps aux | grep -w ./${demo_server_name} | grep -v grep | wc -l) +if [ $check -ge 1 ]; then + oldPid=$(ps aux | grep -w ./${demo_server_name} | grep -v grep | awk '{print $2}') + kill -9 $oldPid +fi +#Waiting port recycling +sleep 1 +cd ${demo_server_binary_root} + +for ((i = 0; i < ${#api_ports[@]}; i++)); do + nohup ./${demo_server_name} -port ${api_ports[$i]} >>../logs/openIM.log 2>&1 & +done + +sleep 3 +#Check launched service process +check=$(ps aux | grep -w ./${demo_server_name} | grep -v grep | wc -l) +if [ $check -ge 1 ]; then + newPid=$(ps aux | grep -w ./${demo_server_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}${demo_server_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}${demo_server_name}${COLOR_SUFFIX}${RED_PREFIX}"SERVICE START ERROR, PLEASE CHECK openIM.log"${COLOR_SUFFIX} +fi \ No newline at end of file diff --git a/script/docker_check_service.sh b/script/docker_check_service.sh new file mode 100644 index 000000000..6236712ba --- /dev/null +++ b/script/docker_check_service.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +echo "docker-compose ps..........................." +docker-compose ps + +echo "check OpenIM, waiting 30s...................." +sleep 30 + +echo "check OpenIM................................" +./check_all.sh + + diff --git a/script/docker_start_all.sh b/script/docker_start_all.sh new file mode 100644 index 000000000..42ee81992 --- /dev/null +++ b/script/docker_start_all.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +#fixme This script is the total startup script +#fixme The full name of the shell script that needs to be started is placed in the need_to_start_server_shell array + +#fixme Put the shell script name here +need_to_start_server_shell=( + start_rpc_service.sh + msg_gateway_start.sh + push_start.sh + msg_transfer_start.sh + sdk_svr_start.sh + demo_svr_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 + +sleep 10 +time=`date +"%Y-%m-%d %H:%M:%S"` +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========server start time:${time}===========">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +for i in ${need_to_start_server_shell[*]}; do + chmod +x $i + ./$i +done + +sleep 15 + +#fixme prevents the openIM service exit after execution in the docker container +tail -f /dev/null diff --git a/script/env_check.sh b/script/env_check.sh new file mode 100644 index 000000000..2d81390f7 --- /dev/null +++ b/script/env_check.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +source ./style_info.cfg + +echo -e "check login user........................................" +user=`whoami` +if [ $user == "root" ] ; then + echo -e ${GREEN_PREFIX} "ok: login user is root" ${COLOR_SUFFIX} +else + echo -e ${RED_PREFIX}"Warning: The current user is not root "${COLOR_SUFFIX} +fi + + + +echo -e "check docker............................................" +docker_running=`systemctl status docker | grep running | grep active | wc -l` + +docker_version=`docker-compose -v; docker -v` + +if [ $docker_running -gt 0 ]; then + echo -e ${GREEN_PREFIX} "ok: docker is running" ${COLOR_SUFFIX} + echo -e ${GREEN_PREFIX} $docker_version ${COLOR_SUFFIX} + +else + echo -e ${RED_PREFIX}"docker not running"${COLOR_SUFFIX} +fi + + +echo -e "check environment......................................." +SYSTEM=`uname -s` +if [ $SYSTEM != "Linux" ] ; then + echo -e ${RED_PREFIX}"Warning: Currently only Linux is supported"${COLOR_SUFFIX} +else + echo -e ${GREEN_PREFIX} "ok: system is linux"${COLOR_SUFFIX} +fi + +echo -e "check memory............................................" +available=`free -m | grep Mem | awk '{print $NF}'` +if [ $available -lt 2000 ] ; then + echo -e ${RED_PREFIX}"Warning: Your memory not enough, available is: " "$available"m${COLOR_SUFFIX}"\c" + echo -e ${RED_PREFIX}", must be greater than 2000m"${COLOR_SUFFIX} +else + echo -e ${GREEN_PREFIX} "ok: available memory is: "$available"m${COLOR_SUFFIX}" +fi diff --git a/script/function.sh b/script/function.sh new file mode 100644 index 000000000..97f19187a --- /dev/null +++ b/script/function.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +#input:[10023,2323,3434] +#output:10023 2323 3434 +list_to_string(){ +ports_list=$* +sub_s1=`echo $ports_list | sed 's/ //g'` +sub_s2=${sub_s1//,/ } +sub_s3=${sub_s2#*[} +sub_s4=${sub_s3%]*} +ports_array=$sub_s4 +} +remove_space(){ + value=$* + result=`echo $value | sed 's/ //g'` +} \ No newline at end of file diff --git a/script/msg_gateway_start.sh b/script/msg_gateway_start.sh new file mode 100644 index 000000000..7c107f16a --- /dev/null +++ b/script/msg_gateway_start.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +#Include shell font styles and some basic information +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh +ulimit -n 200000 + +list1=$(cat $config_path | grep openImOnlineRelayPort | awk -F '[:]' '{print $NF}') +list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') +list_to_string $list1 +rpc_ports=($ports_array) +list_to_string $list2 +ws_ports=($ports_array) +if [ ${#rpc_ports[@]} -ne ${#ws_ports[@]} ]; then + + echo -e ${RED_PREFIX}"ws_ports does not match push_rpc_ports in quantity!!!"${COLOR_SUFFIX} + exit -1 + +fi +#Check if the service exists +#If it is exists,kill this process +check=$(ps aux | grep -w ./${msg_gateway_name} | grep -v grep | wc -l) +if [ $check -ge 1 ]; then + oldPid=$(ps aux | grep -w ./${msg_gateway_name} | grep -v grep | awk '{print $2}') + kill -9 ${oldPid} +fi +#Waiting port recycling +sleep 1 +cd ${msg_gateway_binary_root} +for ((i = 0; i < ${#ws_ports[@]}; i++)); do + nohup ./${msg_gateway_name} -rpc_port ${rpc_ports[$i]} -ws_port ${ws_ports[$i]} >>../logs/openIM.log 2>&1 & +done + +#Check launched service process +sleep 3 +check=$(ps aux | grep -w ./${msg_gateway_name} | grep -v grep | wc -l) +allPorts="" +if [ $check -ge 1 ]; then + allNewPid=$(ps aux | grep -w ./${msg_gateway_name} | grep -v grep | awk '{print $2}') + for i in $allNewPid; do + ports=$(netstat -netulp | grep -w ${i} | awk '{print $4}' | awk -F '[:]' '{print $NF}') + allPorts=${allPorts}"$ports " + done + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS"${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${msg_gateway_name}${COLOR_SUFFIX} + 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 openIM.log"${COLOR_SUFFIX} +fi diff --git a/script/msg_transfer_start.sh b/script/msg_transfer_start.sh new file mode 100644 index 000000000..4d7fb96cd --- /dev/null +++ b/script/msg_transfer_start.sh @@ -0,0 +1,36 @@ +#!/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 ./${msg_transfer_name} | grep -v grep| wc -l` +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} +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 -ge 1 ] +then +newPid=`ps aux | grep -w ./${msg_transfer_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}${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 openIM.log"${COLOR_SUFFIX} +fi diff --git a/script/mysql_database_init.sh b/script/mysql_database_init.sh new file mode 100644 index 000000000..2a5135e8e --- /dev/null +++ b/script/mysql_database_init.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh + +#define database attributes +address=$(cat $config_path | grep -w dbMysqlAddress) +list_to_string ${address} +hostAndPort=($ports_array) +DATABASE_HOST=$(echo $hostAndPort | awk -F '[:]' '{print $1}') +DATABASE_PORT=$(echo $hostAndPort | awk -F '[:]' '{print $NF}') +DATABASE_USERNAME=$(cat $config_path | grep -w dbMysqlUserName | awk -F '[:]' '{print $NF}') +DATABASE_PWD=`eval echo $(cat $config_path | grep -w dbMysqlPassword | awk -F '[:]' '{print $NF}')` +DATABASE_NAME=$(cat $config_path | grep -w dbMysqlDatabaseName | awk -F '[:]' '{print $NF}') +SQL_FILE="../config/mysql_sql_file/openIM.sql" + + +create_data_sql="create database IF NOT EXISTS $DATABASE_NAME" +set_character_code_sql="alter database $DATABASE_NAME character set utf8mb4 collate utf8mb4_general_ci" + +echo -e "${SKY_BLUE_PREFIX}start to create database.....$COLOR_SUFFIX" +mysql -h $DATABASE_HOST -P $DATABASE_PORT -u $DATABASE_USERNAME -p$DATABASE_PWD -e "$create_data_sql" + +if [ $? -eq 0 ]; then + echo -e "${SKY_BLUE_PREFIX}create database ${DATABASE_NAME} successfully$COLOR_SUFFIX" + mysql -h $DATABASE_HOST -P $DATABASE_PORT -u $DATABASE_USERNAME -p$DATABASE_PWD -e "$set_character_code_sql" +else + echo -e "${RED_PREFIX}create database failed or exists the database$COLOR_SUFFIX\n" +fi + +echo -e "${SKY_BLUE_PREFIX}start to source openIM.sql .....$COLOR_SUFFIX" +mysql -h $DATABASE_HOST -P $DATABASE_PORT -u $DATABASE_USERNAME -p$DATABASE_PWD -D $DATABASE_NAME <$SQL_FILE +if [ $? -eq 0 ]; then + echo -e "${SKY_BLUE_PREFIX}source openIM.sql successfully$COLOR_SUFFIX" +else + echo -e "${RED_PREFIX}source openIM.sql failed$COLOR_SUFFIX\n" +fi diff --git a/script/path_info.cfg b/script/path_info.cfg new file mode 100644 index 000000000..b50fc18fb --- /dev/null +++ b/script/path_info.cfg @@ -0,0 +1,84 @@ +#Don't put the space between "=" +msg_gateway_name="open_im_msg_gateway" +msg_gateway_binary_root="../bin/" +msg_gateway_source_root="../cmd/open_im_msg_gateway/" + +msg_name="open_im_msg" +msg_binary_root="../bin/" +msg_source_root="../cmd/rpc/open_im_msg/" + +push_name="open_im_push" +push_binary_root="../bin/" +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/" + +demo_server_name="open_im_demo" +demo_server_binary_root="../bin/" +demo_server_source_root="../cmd/open_im_demo/" + + +#Global configuration file default dir +config_path="../config/config.yaml" + +#servicefile dir path +service_source_root=( + #api service file + ../cmd/open_im_api/ + ../cmd/open_im_cms_api/ + #rpc service file + ../cmd/rpc/open_im_user/ + ../cmd/rpc/open_im_friend/ + ../cmd/rpc/open_im_group/ + ../cmd/rpc/open_im_auth/ + ../cmd/rpc/open_im_admin_cms/ + ../cmd/rpc/open_im_message_cms/ + ../cmd/rpc/open_im_statistics/ + ../cmd/rpc/open_im_office/ + ../cmd/rpc/open_im_organization/ + ${msg_gateway_source_root} + ${msg_transfer_source_root} + ${msg_source_root} + ${push_source_root} + ${sdk_server_source_root} + ${demo_server_source_root} +) +#service filename +service_names=( + #api service filename + open_im_api + open_im_cms_api + #rpc service filename + open_im_user + open_im_friend + open_im_group + open_im_auth + open_im_admin_cms + open_im_message_cms + open_im_statistics + open_im_office + open_im_organization + ${msg_gateway_name} + ${msg_transfer_name} + ${msg_name} + ${push_name} + ${sdk_server_name} + ${demo_server_name} +) + + + diff --git a/script/push_start.sh b/script/push_start.sh new file mode 100644 index 000000000..8b2a47896 --- /dev/null +++ b/script/push_start.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +#Include shell font styles and some basic information +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh + + + +list1=$(cat $config_path | grep openImPushPort | awk -F '[:]' '{print $NF}') +list_to_string $list1 +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 -ge 1 ]; then + oldPid=$(ps aux | grep -w ./${push_name} | grep -v grep | awk '{print $2}') + kill -9 $oldPid +fi +#Waiting port recycling +sleep 1 +cd ${push_binary_root} + +for ((i = 0; i < ${#rpc_ports[@]}; i++)); do + nohup ./${push_name} -port ${rpc_ports[$i]} >>../logs/openIM.log 2>&1 & +done + +sleep 3 +#Check launched service process +check=$(ps aux | grep -w ./${push_name} | grep -v grep | wc -l) +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="" + + 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}${push_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}${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 new file mode 100644 index 000000000..5f47228dc --- /dev/null +++ b/script/sdk_svr_start.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +#Include shell font styles and some basic information +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh +list1=$(cat $config_path | grep openImApiPort | awk -F '[:]' '{print $NF}') +list2=$(cat $config_path | grep openImWsPort | awk -F '[:]' '{print $NF}') +list3=$(cat $config_path | grep openImSdkWsPort | awk -F '[:]' '{print $NF}') +logLevel=$(cat $config_path | grep remainLogLevel | awk -F '[:]' '{print $NF}') +list_to_string $list1 +api_ports=($ports_array) +list_to_string $list2 +ws_ports=($ports_array) +list_to_string $list3 +sdk_ws_ports=($ports_array) +list_to_string $list4 + + + +#Check if the service exists +#If it is exists,kill this process +check=$(ps aux | grep -w ./${sdk_server_name} | grep -v grep | wc -l) +if [ $check -ge 1 ]; then + oldPid=$(ps aux | grep -w ./${sdk_server_name} | grep -v grep | awk '{print $2}') + kill -9 ${oldPid} +fi +#Waiting port recycling +sleep 1 +cd ${sdk_server_binary_root} + nohup ./${sdk_server_name} -openIM_api_port ${api_ports[0]} -openIM_ws_port ${ws_ports[0]} -sdk_ws_port ${sdk_ws_ports[0]} -openIM_log_level ${logLevel} >>../logs/openIM.log 2>&1 & + +#Check launched service process +sleep 3 +check=$(ps aux | grep -w ./${sdk_server_name} | grep -v grep | wc -l) +allPorts="" +if [ $check -ge 1 ]; then + allNewPid=$(ps aux | grep -w ./${sdk_server_name} | grep -v grep | awk '{print $2}') + for i in $allNewPid; do + ports=$(netstat -netulp | grep -w ${i} | awk '{print $4}' | awk -F '[:]' '{print $NF}') + allPorts=${allPorts}"$ports " + done + echo -e ${SKY_BLUE_PREFIX}"SERVICE START SUCCESS "${COLOR_SUFFIX} + echo -e ${SKY_BLUE_PREFIX}"SERVICE_NAME: "${COLOR_SUFFIX}${YELLOW_PREFIX}${sdk_server_name}${COLOR_SUFFIX} + 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 openIM.log"${COLOR_SUFFIX} +fi diff --git a/script/start_all.sh b/script/start_all.sh new file mode 100644 index 000000000..bf7170d68 --- /dev/null +++ b/script/start_all.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +#fixme This script is the total startup script +#fixme The full name of the shell script that needs to be started is placed in the need_to_start_server_shell array + +#fixme Put the shell script name here +need_to_start_server_shell=( + start_rpc_service.sh + msg_gateway_start.sh + push_start.sh + msg_transfer_start.sh + sdk_svr_start.sh + demo_svr_start.sh +) +time=`date +"%Y-%m-%d %H:%M:%S"` +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========server start time:${time}===========">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & +echo "==========================================================">>../logs/openIM.log 2>&1 & + +for i in ${need_to_start_server_shell[*]}; do + chmod +x $i + ./$i + if [ $? -ne 0 ]; then + exit -1 + fi +done diff --git a/script/start_rpc_service.sh b/script/start_rpc_service.sh new file mode 100644 index 000000000..20e7991b4 --- /dev/null +++ b/script/start_rpc_service.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +source ./style_info.cfg +source ./path_info.cfg +source ./function.sh + +#service filename +service_filename=( + #api + open_im_api + open_im_cms_api + #rpc + open_im_user + open_im_friend + open_im_group + open_im_auth + open_im_admin_cms + open_im_message_cms + open_im_statistics + ${msg_name} + open_im_office + open_im_organization +) + +#service config port name +service_port_name=( + #api port name + openImApiPort + openImCmsApiPort + #rpc port name + openImUserPort + openImFriendPort + openImGroupPort + openImAuthPort + openImAdminCmsPort + openImMessageCmsPort + openImStatisticsPort + openImOfflineMessagePort + openImOfficePort + openImOrganizationPort +) + +for ((i = 0; i < ${#service_filename[*]}; i++)); do + #Check whether the service exists + service_name="ps -aux |grep -w ${service_filename[$i]} |grep -v grep" + count="${service_name}| wc -l" + + if [ $(eval ${count}) -gt 0 ]; then + pid="${service_name}| awk '{print \$2}'" + echo "${service_filename[$i]} service has been started,pid:$(eval $pid)" + echo "killing the service ${service_filename[$i]} pid:$(eval $pid)" + #kill the service that existed + kill -9 $(eval $pid) + sleep 0.5 + fi + cd ../bin + #Get the rpc port in the configuration file + portList=$(cat $config_path | grep ${service_port_name[$i]} | awk -F '[:]' '{print $NF}') + list_to_string ${portList} + #Start related rpc services based on the number of ports + for j in ${ports_array}; do + #Start the service in the background + # ./${service_filename[$i]} -port $j & + nohup ./${service_filename[$i]} -port $j >>../logs/openIM.log 2>&1 & + sleep 1 + pid="netstat -ntlp|grep $j |awk '{printf \$7}'|cut -d/ -f1" + echo -e "${GREEN_PREFIX}${service_filename[$i]} start success,port number:$j pid:$(eval $pid)$COLOR_SUFFIX" + done +done diff --git a/script/stop_all.sh b/script/stop_all.sh new file mode 100644 index 000000000..2e1e119c1 --- /dev/null +++ b/script/stop_all.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +#fixme This script is to stop the service + +source ./style_info.cfg +source ./path_info.cfg + + +for i in ${service_names[*]}; do + #Check whether the service exists + name="ps -aux |grep -w $i |grep -v grep" + count="${name}| wc -l" + if [ $(eval ${count}) -gt 0 ]; then + pid="${name}| awk '{print \$2}'" + echo -e "${SKY_BLUE_PREFIX}Killing service:$i pid:$(eval $pid)${COLOR_SUFFIX}" + #kill the service that existed + kill -9 $(eval $pid) + echo -e "${SKY_BLUE_PREFIX}service:$i was killed ${COLOR_SUFFIX}" + fi +done diff --git a/script/style_info.cfg b/script/style_info.cfg new file mode 100644 index 000000000..ff28dcb88 --- /dev/null +++ b/script/style_info.cfg @@ -0,0 +1,9 @@ +#Shell font formatting information +COLOR_SUFFIX="\033[0m" +BLACK_PREFIX="\033[30m" +RED_PREFIX="\033[31m" +GREEN_PREFIX="\033[32m" +YELLOW_PREFIX="\033[33m" +BLUE_PREFIX="\033[34m" +PURPLE_PREFIX="\033[35m" +SKY_BLUE_PREFIX="\033[36m" 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