diff --git a/.github/workflows/cleanup-after-milestone-prs-merged.yml b/.github/workflows/cleanup-after-milestone-prs-merged.yml new file mode 100644 index 000000000..8a3e381d6 --- /dev/null +++ b/.github/workflows/cleanup-after-milestone-prs-merged.yml @@ -0,0 +1,65 @@ +name: Cleanup After Milestone PRs Merged + +on: + pull_request: + types: + - closed + +jobs: + handle_pr: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.0 + + - name: Get the PR title and extract PR numbers + id: extract_pr_numbers + run: | + # Get the PR title + PR_TITLE="${{ github.event.pull_request.title }}" + + echo "PR Title: $PR_TITLE" + + # Extract PR numbers from the title + PR_NUMBERS=$(echo "$PR_TITLE" | grep -oE "#[0-9]+" | tr -d '#' | tr '\n' ' ') + echo "Extracted PR Numbers: $PR_NUMBERS" + + # Save PR numbers to a file + echo "$PR_NUMBERS" > pr_numbers.txt + echo "Saved PR Numbers to pr_numbers.txt" + + # Check if the title matches a specific pattern + if echo "$PR_TITLE" | grep -qE "^deps: Merge( #[0-9]+)+ PRs into .+"; then + echo "proceed=true" >> $GITHUB_OUTPUT + else + echo "proceed=false" >> $GITHUB_OUTPUT + fi + + - name: Use extracted PR numbers and label PRs + if: (steps.extract_pr_numbers.outputs.proceed == 'true' || contains(github.event.pull_request.labels.*.name, 'milestone-merge')) && github.event.pull_request.merged == true + run: | + # Read the previously saved PR numbers + PR_NUMBERS=$(cat pr_numbers.txt) + echo "Using extracted PR Numbers: $PR_NUMBERS" + + # Loop through each PR number and add label + for PR_NUMBER in $PR_NUMBERS; do + echo "Adding 'cherry-picked' label to PR #$PR_NUMBER" + curl -X POST \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER/labels \ + -d '{"labels":["cherry-picked"]}' + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Delete branch after PR close + if: steps.extract_pr_numbers.outputs.proceed == 'true' || contains(github.event.pull_request.labels.*.name, 'milestone-merge') + run: | + BRANCH_NAME="${{ github.event.pull_request.head.ref }}" + echo "Branch to delete: $BRANCH_NAME" + git push origin --delete "$BRANCH_NAME" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/docker-buildx.bak b/.github/workflows/docker-buildx.bak index b40aa6fef..cbd6440e4 100644 --- a/.github/workflows/docker-buildx.bak +++ b/.github/workflows/docker-buildx.bak @@ -1,17 +1,3 @@ -# Copyright © 2023 OpenIM open source community. All rights reserved. -# -# 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. - name: Docker Buildx Images CI on: @@ -40,11 +26,12 @@ jobs: install: true - name: Cache Docker layers - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /tmp/.buildx-cache key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: ${{ runner.os }}-buildx- + restore-keys: | + ${{ runner.os }}-buildx- - name: Log in to GitHub Container Registry uses: docker/login-action@v3 diff --git a/.github/workflows/merge-from-milestone.yml b/.github/workflows/merge-from-milestone.yml new file mode 100644 index 000000000..939c08fcb --- /dev/null +++ b/.github/workflows/merge-from-milestone.yml @@ -0,0 +1,218 @@ +name: Create Pre-Release PR from Milestone + +permissions: + contents: write + pull-requests: write + issues: write + +on: + workflow_dispatch: + inputs: + milestone_name: + description: 'Milestone name to collect closed PRs from' + required: true + default: 'v1.8.3' + target_branch: + description: 'Target branch to merge the consolidated PR' + required: true + default: 'pre-release-v1.8.3' + +env: + MILESTONE_NAME: ${{ github.event.inputs.milestone_name || 'v1.8.3' }} + TARGET_BRANCH: ${{ github.event.inputs.target_branch || 'pre-release-v1.8.3' }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BOT_TOKEN: ${{ secrets.BOT_TOKEN }} + LABEL_NAME: cherry-picked + TEMP_DIR: /tmp # Using /tmp as the temporary directory + +jobs: + cherry_pick_milestone_prs: + runs-on: ubuntu-latest + steps: + - name: Setup temp directory + run: | + # Create the temporary directory and initialize necessary files + mkdir -p ${{ env.TEMP_DIR }} + touch ${{ env.TEMP_DIR }}/pr_numbers.txt + touch ${{ env.TEMP_DIR }}/commit_hashes.txt + touch ${{ env.TEMP_DIR }}/pr_title.txt + touch ${{ env.TEMP_DIR }}/pr_body.txt + touch ${{ env.TEMP_DIR }}/created_pr_number.txt + + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.BOT_TOKEN }} + + - name: Setup Git User for OpenIM-Robot + run: | + # Set up Git credentials for the bot + git config --global user.email "OpenIM-Robot@users.noreply.github.com" + git config --global user.name "OpenIM-Robot" + + - name: Fetch Milestone ID and Filter PR Numbers + env: + MILESTONE_NAME: ${{ env.MILESTONE_NAME }} + run: | + # Fetch milestone details and extract milestone ID + milestones=$(curl -s -H "Authorization: token $BOT_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${{ github.repository }}/milestones") + milestone_id=$(echo "$milestones" | grep -B3 "\"title\": \"$MILESTONE_NAME\"" | grep '"number":' | head -n1 | grep -o '[0-9]\+') + if [ -z "$milestone_id" ]; then + echo "Milestone '$MILESTONE_NAME' not found. Exiting." + exit 1 + fi + echo "Milestone ID: $milestone_id" + echo "MILESTONE_ID=$milestone_id" >> $GITHUB_ENV + + # Fetch issues for the milestone + issues=$(curl -s -H "Authorization: token $BOT_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${{ github.repository }}/issues?milestone=$milestone_id&state=closed&per_page=100") + + > ${{ env.TEMP_DIR }}/pr_numbers.txt + + # Filter PRs that do not have the 'cherry-picked' label + for pr_number in $(echo "$issues" | jq -r '.[] | select(.pull_request != null) | .number'); do + labels=$(curl -s -H "Authorization: token $BOT_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${{ github.repository }}/issues/$pr_number/labels" | jq -r '.[].name') + + if ! echo "$labels" | grep -q "${LABEL_NAME}"; then + echo "PR #$pr_number does not have the 'cherry-picked' label. Adding to the list." + echo "$pr_number" >> ${{ env.TEMP_DIR }}/pr_numbers.txt + else + echo "PR #$pr_number already has the 'cherry-picked' label. Skipping." + fi + done + + # Sort the filtered PR numbers + sort -n ${{ env.TEMP_DIR }}/pr_numbers.txt -o ${{ env.TEMP_DIR }}/pr_numbers.txt + + echo "Filtered and sorted PR numbers:" + cat ${{ env.TEMP_DIR }}/pr_numbers.txt || echo "No closed PR numbers found for milestone." + + - name: Fetch Merge Commits for PRs and Generate Title and Body + run: | + # Ensure the files are initialized + > ${{ env.TEMP_DIR }}/commit_hashes.txt + > ${{ env.TEMP_DIR }}/pr_title.txt + > ${{ env.TEMP_DIR }}/pr_body.txt + + # Write description to the PR body + echo "### Description:" >> ${{ env.TEMP_DIR }}/pr_body.txt + echo "Merging PRs from milestone \`$MILESTONE_NAME\` into target branch \`$TARGET_BRANCH\`." >> ${{ env.TEMP_DIR }}/pr_body.txt + echo "" >> ${{ env.TEMP_DIR }}/pr_body.txt + echo "### Need Merge PRs:" >> ${{ env.TEMP_DIR }}/pr_body.txt + + pr_numbers_in_title="" + + # Process sorted PR numbers and generate commit hashes + for pr_number in $(cat ${{ env.TEMP_DIR }}/pr_numbers.txt); do + echo "Processing PR #$pr_number" + pr_details=$(curl -s -H "Authorization: token $BOT_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/${{ github.repository }}/pulls/$pr_number") + pr_title=$(echo "$pr_details" | jq -r '.title') + merge_commit=$(echo "$pr_details" | jq -r '.merge_commit_sha') + short_commit_hash=$(echo "$merge_commit" | cut -c 1-7) + + # Append PR details to the body + echo "- $pr_title: (#$pr_number) ($short_commit_hash)" >> ${{ env.TEMP_DIR }}/pr_body.txt + + if [ "$merge_commit" != "null" ];then + echo "$merge_commit" >> ${{ env.TEMP_DIR }}/commit_hashes.txt + echo "#$pr_number" >> ${{ env.TEMP_DIR }}/pr_title.txt + pr_numbers_in_title="$pr_numbers_in_title #$pr_number" + fi + done + + commit_hashes=$(cat ${{ env.TEMP_DIR }}/commit_hashes.txt | tr '\n' ' ') + first_commit_hash=$(head -n 1 ${{ env.TEMP_DIR }}/commit_hashes.txt) + cherry_pick_branch="cherry-pick-${first_commit_hash:0:7}" + echo "COMMIT_HASHES=$commit_hashes" >> $GITHUB_ENV + echo "CHERRY_PICK_BRANCH=$cherry_pick_branch" >> $GITHUB_ENV + echo "pr_numbers_in_title=$pr_numbers_in_title" >> $GITHUB_ENV + + - name: Pull and Cherry-pick Commits, Then Push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BOT_TOKEN: ${{ secrets.BOT_TOKEN }} + run: | + # Fetch and pull the latest changes from the target branch + git fetch origin + git checkout $TARGET_BRANCH + git pull origin $TARGET_BRANCH + + # Create a new branch for cherry-picking + git checkout -b $CHERRY_PICK_BRANCH + + # Cherry-pick the commits and handle conflicts + for commit_hash in $COMMIT_HASHES; do + echo "Attempting to cherry-pick commit $commit_hash" + if ! git cherry-pick "$commit_hash" --strategy=recursive -X theirs; then + echo "Conflict detected for $commit_hash. Resolving with incoming changes." + conflict_files=$(git diff --name-only --diff-filter=U) + echo "Conflicting files:" + echo "$conflict_files" + + for file in $conflict_files; do + if [ -f "$file" ]; then + echo "Resolving conflict for $file" + git add "$file" + else + echo "File $file has been deleted. Skipping." + git rm "$file" + fi + done + + echo "Conflicts resolved. Continuing cherry-pick." + git cherry-pick --continue + else + echo "Cherry-pick successful for commit $commit_hash." + fi + done + + # Push the cherry-pick branch to the repository + git remote set-url origin "https://${BOT_TOKEN}@github.com/${{ github.repository }}.git" + git push origin $CHERRY_PICK_BRANCH --force + + - name: Create Pull Request + run: | + # Prepare and create the PR + pr_title="deps: Merge ${{ env.pr_numbers_in_title }} PRs into $TARGET_BRANCH" + pr_body=$(cat ${{ env.TEMP_DIR }}/pr_body.txt) + + echo "Prepared PR title:" + echo "$pr_title" + echo "Prepared PR body:" + echo "$pr_body" + + # Create the PR using the GitHub API + response=$(curl -s -X POST -H "Authorization: token $BOT_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/repos/${{ github.repository }}/pulls \ + -d "$(jq -n --arg title "$pr_title" \ + --arg head "$CHERRY_PICK_BRANCH" \ + --arg base "$TARGET_BRANCH" \ + --arg body "$pr_body" \ + '{title: $title, head: $head, base: $base, body: $body}')") + + pr_number=$(echo "$response" | jq -r '.number') + echo "$pr_number" > ${{ env.TEMP_DIR }}/created_pr_number.txt + echo "Created PR #$pr_number" + + - name: Add Label to Created Pull Request + run: | + # Add 'milestone-merge' label to the created PR + pr_number=$(cat ${{ env.TEMP_DIR }}/created_pr_number.txt) + echo "Adding label to PR #$pr_number" + + curl -s -X POST -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + -d '{"labels": ["milestone-merge"]}' \ + "https://api.github.com/repos/${{ github.repository }}/issues/$pr_number/labels" + + echo "Added 'milestone-merge' label to PR #$pr_number." diff --git a/.github/workflows/remove-unused-labels copy.yml b/.github/workflows/remove-unused-labels copy.yml new file mode 100644 index 000000000..ab80b1f96 --- /dev/null +++ b/.github/workflows/remove-unused-labels copy.yml @@ -0,0 +1,74 @@ +name: Remove Unused Labels +on: + workflow_dispatch: + +jobs: + cleanup: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + contents: read + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Fetch All Issues and PRs + id: fetch_issues_prs + uses: actions/github-script@v7.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issues = await github.paginate(github.rest.issues.listForRepo, { + owner: context.repo.owner, + repo: context.repo.repo, + state: 'all', + per_page: 100 + }); + + const labelsInUse = new Set(); + issues.forEach(issue => { + issue.labels.forEach(label => { + labelsInUse.add(label.name); + }); + }); + + return JSON.stringify(Array.from(labelsInUse)); + result-encoding: string + + - name: Fetch All Labels + id: fetch_labels + uses: actions/github-script@v7.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const labels = await github.paginate(github.rest.issues.listLabelsForRepo, { + owner: context.repo.owner, + repo: context.repo.repo, + per_page: 100 + }); + + return JSON.stringify(labels.map(label => label.name)); + result-encoding: string + + - name: Remove Unused Labels + uses: actions/github-script@v7.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const labelsInUse = new Set(JSON.parse(process.env.LABELS_IN_USE)); + const allLabels = JSON.parse(process.env.ALL_LABELS); + + const unusedLabels = allLabels.filter(label => !labelsInUse.has(label)); + + for (const label of unusedLabels) { + await github.rest.issues.deleteLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + name: label + }); + console.log(`Deleted label: ${label}`); + } + env: + LABELS_IN_USE: ${{ steps.fetch_issues_prs.outputs.result }} + ALL_LABELS: ${{ steps.fetch_labels.outputs.result }} diff --git a/.github/workflows/remove-unused-labels.yml b/.github/workflows/remove-unused-labels.yml new file mode 100644 index 000000000..a2259d718 --- /dev/null +++ b/.github/workflows/remove-unused-labels.yml @@ -0,0 +1,75 @@ +name: Remove Unused Labels +on: + workflow_dispatch: + +jobs: + cleanup: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + contents: read + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Fetch All Issues and PRs + id: fetch_issues_prs + uses: actions/github-script@v7.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issues = await github.paginate(github.rest.issues.listForRepo, { + owner: context.repo.owner, + repo: context.repo.repo, + state: 'all', + per_page: 100 + }); + + const labelsInUse = new Set(); + issues.forEach(issue => { + issue.labels.forEach(label => { + labelsInUse.add(label.name); + }); + }); + + return JSON.stringify(Array.from(labelsInUse)); + result-encoding: string + + - name: Fetch All Labels + id: fetch_labels + uses: actions/github-script@v7.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const labels = await github.paginate(github.rest.issues.listLabelsForRepo, { + owner: context.repo.owner, + repo: context.repo.repo, + per_page: 100 + }); + + return JSON.stringify(labels.map(label => label.name)); + result-encoding: string + + - name: Remove Unused Labels + uses: actions/github-script@v7.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const labelsInUse = new Set(JSON.parse(process.env.LABELS_IN_USE)); + const allLabels = JSON.parse(process.env.ALL_LABELS); + + const unusedLabels = allLabels.filter(label => !labelsInUse.has(label)); + + for (const label of unusedLabels) { + await github.rest.issues.deleteLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + name: label + }); + console.log(`Deleted label: ${label}`); + } + + env: + LABELS_IN_USE: ${{ steps.fetch_issues_prs.outputs.result }} + ALL_LABELS: ${{ steps.fetch_labels.outputs.result }} \ No newline at end of file diff --git a/.github/workflows/update-version-file-on-release.yml b/.github/workflows/update-version-file-on-release.yml index f582edf48..dc29d770b 100644 --- a/.github/workflows/update-version-file-on-release.yml +++ b/.github/workflows/update-version-file-on-release.yml @@ -8,7 +8,7 @@ jobs: update-version: runs-on: ubuntu-latest env: - TAG_VERSION: ${{ github.event.release.tag_name }} + TAG_VERSION: ${{ github.event.release.tag_name }} steps: # Step 1: Checkout the original repository's code - name: Checkout code @@ -26,33 +26,33 @@ jobs: - name: Check and delete existing tag run: | if git rev-parse ${{ env.TAG_VERSION }} >/dev/null 2>&1; then - git tag -d ${{ env.TAG_VERSION }} - git push --delete origin ${{ env.TAG_VERSION }} + git tag -d ${{ env.TAG_VERSION }} # Delete local tag + git push --delete origin ${{ env.TAG_VERSION }} # Delete remote tag fi # Step 4: Update version file - name: Update version file run: | - echo "${{ env.TAG_VERSION }}" > version/version + echo "${{ env.TAG_VERSION }}" > version/version # Write the version to the file - # Step 5: Commit and push changes + # Step 5: Commit and push changes to the correct branch - name: Commit and push changes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git add version/version git commit -m "Update version to ${{ env.TAG_VERSION }}" - git push origin HEAD:${{ github.ref }} + git push origin HEAD:${{ github.ref }} # Push to the current branch - # Step 6: Create and push tag + # Step 6: Create and push new tag - name: Create and push tag env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git tag ${{ env.TAG_VERSION }} - git push origin ${{ env.TAG_VERSION }} + git tag ${{ env.TAG_VERSION }} # Create new tag + git push origin ${{ env.TAG_VERSION }} # Push the tag - # Step 8: Find and Publish Draft Release + # Step 7: Find and Publish Draft Release - name: Find and Publish Draft Release uses: actions/github-script@v6 with: diff --git a/config/chat-rpc-chat.yml b/config/chat-rpc-chat.yml index d015ad63f..329cfd51f 100644 --- a/config/chat-rpc-chat.yml +++ b/config/chat-rpc-chat.yml @@ -33,3 +33,5 @@ liveKit: url: "ws://127.0.0.1:7880" # LIVEKIT_URL, LiveKit server address and port key: "APIGPW3gnFTzqHH" secret: "23ztfSqsfQ8hKkHzHTl3Z4bvaxro0snjk5jwbp5p6Q3" + +allowRegister: true diff --git a/go.mod b/go.mod index 2b84c4af7..415298ac2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/openimsdk/chat -go 1.21.2 +go 1.21 require ( github.com/gin-gonic/gin v1.9.1 @@ -26,7 +26,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/openimsdk/gomake v0.0.14-alpha.5 github.com/openimsdk/protocol v0.0.72 - github.com/openimsdk/tools v0.0.50-alpha.15 + github.com/openimsdk/tools v0.0.50-alpha.20 github.com/redis/go-redis/v9 v9.5.1 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 diff --git a/go.sum b/go.sum index a4f7c8ac8..b6f181fe2 100644 --- a/go.sum +++ b/go.sum @@ -189,8 +189,8 @@ github.com/openimsdk/gomake v0.0.14-alpha.5 h1:VY9c5x515lTfmdhhPjMvR3BBRrRquAUCF github.com/openimsdk/gomake v0.0.14-alpha.5/go.mod h1:PndCozNc2IsQIciyn9mvEblYWZwJmAI+06z94EY+csI= github.com/openimsdk/protocol v0.0.72 h1:K+vslwaR7lDXyBzb07UuEQITaqsgighz7NyXVIWsu6A= github.com/openimsdk/protocol v0.0.72/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8= -github.com/openimsdk/tools v0.0.50-alpha.15 h1:HV9aKZ4vvCZCGG4wFDsgUONkkdJeCcrFNn3BT52nUVQ= -github.com/openimsdk/tools v0.0.50-alpha.15/go.mod h1:h1cYmfyaVtgFbKmb1Cfsl8XwUOMTt8ubVUQrdGtsUh4= +github.com/openimsdk/tools v0.0.50-alpha.20 h1:TUCZOwaea983Qj1MCbiGZUBlwBkTMwTF9SLS0WQcsJs= +github.com/openimsdk/tools v0.0.50-alpha.20/go.mod h1:h1cYmfyaVtgFbKmb1Cfsl8XwUOMTt8ubVUQrdGtsUh4= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pion/datachannel v1.5.5 h1:10ef4kwdjije+M9d7Xm9im2Y3O6A6ccQb0zcqZcJew8= diff --git a/internal/api/admin/admin.go b/internal/api/admin/admin.go index 7e0a44893..b3b3ee395 100644 --- a/internal/api/admin/admin.go +++ b/internal/api/admin/admin.go @@ -1,17 +1,3 @@ -// Copyright © 2023 OpenIM open source community. All rights reserved. -// -// 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. - package admin import ( @@ -72,7 +58,7 @@ func (o *Api) AdminLogin(c *gin.Context) { return } imAdminUserID := o.GetDefaultIMAdminUserID() - imToken, err := o.imApiCaller.GetAdminToken(c, imAdminUserID) + imToken, err := o.imApiCaller.ImAdminTokenWithDefaultAdmin(c) if err != nil { apiresp.GinError(c, err) return @@ -127,7 +113,7 @@ func (o *Api) AdminUpdateInfo(c *gin.Context) { } imAdminUserID := o.GetDefaultIMAdminUserID() - imToken, err := o.imApiCaller.GetAdminToken(c, imAdminUserID) + imToken, err := o.imApiCaller.GetAdminTokenCache(c, imAdminUserID) if err != nil { log.ZError(c, "AdminUpdateInfo ImAdminTokenWithDefaultAdmin", err, "imAdminUserID", imAdminUserID) return @@ -156,25 +142,25 @@ func (o *Api) AddUserAccount(c *gin.Context) { apiresp.GinError(c, err) return } - if _, err := o.chatClient.AddUserAccount(c, req); err != nil { + ip, err := o.GetClientIP(c) + if err != nil { apiresp.GinError(c, err) return } - - userInfo := &sdkws.UserInfo{ - UserID: req.User.UserID, - Nickname: req.User.Nickname, - FaceURL: req.User.FaceURL, - CreateTime: time.Now().UnixMilli(), - } - err = o.imApiCaller.RegisterUser(c, []*sdkws.UserInfo{userInfo}) + imToken, err := o.imApiCaller.ImAdminTokenWithDefaultAdmin(c) if err != nil { apiresp.GinError(c, err) return } - apiresp.GinSuccess(c, nil) + ctx := o.WithAdminUser(mctx.WithApiToken(c, imToken)) + + err = o.registerChatUser(ctx, ip, []*chat.RegisterUserInfo{req.User}) + if err != nil { + return + } + apiresp.GinSuccess(c, nil) } func (o *Api) DelAdminAccount(c *gin.Context) { @@ -207,7 +193,7 @@ func (o *Api) AddDefaultGroup(c *gin.Context) { apiresp.GinError(c, err) return } - imToken, err := o.imApiCaller.GetAdminToken(c, o.GetDefaultIMAdminUserID()) + imToken, err := o.imApiCaller.ImAdminTokenWithDefaultAdmin(c) if err != nil { apiresp.GinError(c, err) return @@ -255,7 +241,7 @@ func (o *Api) SearchDefaultGroup(c *gin.Context) { Groups: make([]*sdkws.GroupInfo, 0, len(searchResp.GroupIDs)), } if len(searchResp.GroupIDs) > 0 { - imToken, err := o.imApiCaller.GetAdminToken(c, o.GetDefaultIMAdminUserID()) + imToken, err := o.imApiCaller.ImAdminTokenWithDefaultAdmin(c) if err != nil { apiresp.GinError(c, err) return @@ -337,7 +323,7 @@ func (o *Api) BlockUser(c *gin.Context) { apiresp.GinError(c, err) return } - imToken, err := o.imApiCaller.GetAdminToken(c, o.GetDefaultIMAdminUserID()) + imToken, err := o.imApiCaller.ImAdminTokenWithDefaultAdmin(c) if err != nil { apiresp.GinError(c, err) return @@ -396,7 +382,7 @@ func (o *Api) NewUserCount(c *gin.Context) { apiresp.GinError(c, err) return } - imToken, err := o.imApiCaller.GetAdminToken(c, o.GetDefaultIMAdminUserID()) + imToken, err := o.imApiCaller.ImAdminTokenWithDefaultAdmin(c) if err != nil { apiresp.GinError(c, err) return @@ -547,6 +533,7 @@ func (o *Api) registerChatUser(ctx context.Context, ip string, users []*chat.Reg if err = o.imApiCaller.RegisterUser(ctx, []*sdkws.UserInfo{userInfo}); err != nil { return err } + if resp, err := o.adminClient.FindDefaultFriend(ctx, &admin.FindDefaultFriendReq{}); err == nil { _ = o.imApiCaller.ImportFriend(ctx, respRegisterUser.UserID, resp.UserIDs) } @@ -571,3 +558,31 @@ func (o *Api) BatchImportTemplate(c *gin.Context) { c.Header("ETag", md5Val) c.Data(http.StatusOK, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", config.ImportTemplate) } + +func (o *Api) SetAllowRegister(c *gin.Context) { + a2r.Call(chat.ChatClient.SetAllowRegister, o.chatClient, c) +} + +func (o *Api) GetAllowRegister(c *gin.Context) { + a2r.Call(chat.ChatClient.GetAllowRegister, o.chatClient, c) +} + +func (o *Api) LatestApplicationVersion(c *gin.Context) { + a2r.Call(admin.AdminClient.LatestApplicationVersion, o.adminClient, c) +} + +func (o *Api) PageApplicationVersion(c *gin.Context) { + a2r.Call(admin.AdminClient.PageApplicationVersion, o.adminClient, c) +} + +func (o *Api) AddApplicationVersion(c *gin.Context) { + a2r.Call(admin.AdminClient.AddApplicationVersion, o.adminClient, c) +} + +func (o *Api) UpdateApplicationVersion(c *gin.Context) { + a2r.Call(admin.AdminClient.UpdateApplicationVersion, o.adminClient, c) +} + +func (o *Api) DeleteApplicationVersion(c *gin.Context) { + a2r.Call(admin.AdminClient.DeleteApplicationVersion, o.adminClient, c) +} diff --git a/internal/api/admin/start.go b/internal/api/admin/start.go index 05a1799b3..3aa1e717d 100644 --- a/internal/api/admin/start.go +++ b/internal/api/admin/start.go @@ -81,6 +81,10 @@ func SetAdminRoute(router gin.IRouter, admin *Api, mw *chatmw.MW) { importGroup.POST("/xlsx", mw.CheckAdmin, admin.ImportUserByXlsx) importGroup.GET("/xlsx", admin.BatchImportTemplate) + allowRegisterGroup := router.Group("/user/allow_register", mw.CheckAdmin) + allowRegisterGroup.POST("/get", admin.GetAllowRegister) + allowRegisterGroup.POST("/set", admin.SetAllowRegister) + defaultRouter := router.Group("/default", mw.CheckAdmin) defaultUserRouter := defaultRouter.Group("/user") defaultUserRouter.POST("/add", admin.AddDefaultFriend) // Add default friend at registration @@ -131,4 +135,11 @@ func SetAdminRoute(router gin.IRouter, admin *Api, mw *chatmw.MW) { statistic := router.Group("/statistic", mw.CheckAdmin) statistic.POST("/new_user_count", admin.NewUserCount) statistic.POST("/login_user_count", admin.LoginUserCount) + + applicationGroup := router.Group("application") + applicationGroup.POST("/add_version", mw.CheckAdmin, admin.AddApplicationVersion) + applicationGroup.POST("/update_version", mw.CheckAdmin, admin.UpdateApplicationVersion) + applicationGroup.POST("/delete_version", mw.CheckAdmin, admin.DeleteApplicationVersion) + applicationGroup.POST("/latest_version", admin.LatestApplicationVersion) + applicationGroup.POST("/page_versions", admin.PageApplicationVersion) } diff --git a/internal/api/chat/chat.go b/internal/api/chat/chat.go index eca5e3bbe..e61978ed3 100644 --- a/internal/api/chat/chat.go +++ b/internal/api/chat/chat.go @@ -22,7 +22,6 @@ import ( "github.com/gin-gonic/gin" "github.com/openimsdk/chat/pkg/common/apistruct" - "github.com/openimsdk/chat/pkg/common/constant" "github.com/openimsdk/chat/pkg/common/imapi" "github.com/openimsdk/chat/pkg/common/mctx" "github.com/openimsdk/chat/pkg/protocol/admin" @@ -235,20 +234,9 @@ func (o *Api) UpdateUserInfo(c *gin.Context) { apiresp.GinError(c, err) return } - opUserType, err := mctx.GetUserType(c) - if err != nil { - apiresp.GinError(c, err) - return - } + var imToken string - if opUserType == constant.NormalUser { - imToken, err = o.imApiCaller.ImAdminTokenWithDefaultAdmin(c) - } else if opUserType == constant.AdminUser { - imToken, err = o.imApiCaller.GetAdminToken(c, o.GetDefaultIMAdminUserID()) - } else { - apiresp.GinError(c, errs.ErrArgs.WrapMsg("opUserType unknown")) - return - } + imToken, err = o.imApiCaller.ImAdminTokenWithDefaultAdmin(c) if err != nil { apiresp.GinError(c, err) return @@ -360,3 +348,11 @@ func (o *Api) SearchFriend(c *gin.Context) { } apiresp.GinSuccess(c, resp) } + +func (o *Api) LatestApplicationVersion(c *gin.Context) { + a2r.Call(admin.AdminClient.LatestApplicationVersion, o.adminClient, c) +} + +func (o *Api) PageApplicationVersion(c *gin.Context) { + a2r.Call(admin.AdminClient.PageApplicationVersion, o.adminClient, c) +} diff --git a/internal/api/chat/start.go b/internal/api/chat/start.go index 22cb38bf1..81b250cd1 100644 --- a/internal/api/chat/start.go +++ b/internal/api/chat/start.go @@ -86,5 +86,9 @@ func SetChatRoute(router gin.IRouter, chat *Api, mw *chatmw.MW) { router.Group("/client_config").POST("/get", chat.GetClientConfig) // Get client initialization configuration + applicationGroup := router.Group("application") + applicationGroup.POST("/latest_version", chat.LatestApplicationVersion) + applicationGroup.POST("/page_versions", chat.PageApplicationVersion) + router.Group("/callback").POST("/open_im", chat.OpenIMCallback) // Callback } diff --git a/internal/rpc/admin/application.go b/internal/rpc/admin/application.go new file mode 100644 index 000000000..6aff546de --- /dev/null +++ b/internal/rpc/admin/application.go @@ -0,0 +1,128 @@ +package admin + +import ( + "context" + admindb "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/chat/pkg/common/mctx" + "github.com/openimsdk/chat/pkg/protocol/admin" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/utils/datautil" + "github.com/redis/go-redis/v9" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "time" +) + +func IsNotFound(err error) bool { + switch errs.Unwrap(err) { + case redis.Nil, mongo.ErrNoDocuments: + return true + default: + return false + } +} + +func (o *adminServer) db2pbApplication(val *admindb.Application) *admin.ApplicationVersion { + return &admin.ApplicationVersion{ + Id: val.ID.Hex(), + Platform: val.Platform, + Version: val.Version, + Url: val.Url, + Text: val.Text, + Force: val.Force, + Latest: val.Latest, + Hot: val.Hot, + CreateTime: val.CreateTime.UnixMilli(), + } +} + +func (o *adminServer) LatestApplicationVersion(ctx context.Context, req *admin.LatestApplicationVersionReq) (*admin.LatestApplicationVersionResp, error) { + res, err := o.Database.LatestVersion(ctx, req.Platform) + if err == nil { + return &admin.LatestApplicationVersionResp{Version: o.db2pbApplication(res)}, nil + } else if IsNotFound(err) { + return &admin.LatestApplicationVersionResp{}, nil + } else { + return nil, err + } +} + +func (o *adminServer) AddApplicationVersion(ctx context.Context, req *admin.AddApplicationVersionReq) (*admin.AddApplicationVersionResp, error) { + if _, err := mctx.CheckAdmin(ctx); err != nil { + return nil, err + } + val := &admindb.Application{ + ID: primitive.NewObjectID(), + Platform: req.Platform, + Version: req.Version, + Url: req.Url, + Text: req.Text, + Force: req.Force, + Latest: req.Latest, + Hot: req.Hot, + CreateTime: time.Now(), + } + if err := o.Database.AddVersion(ctx, val); err != nil { + return nil, err + } + return &admin.AddApplicationVersionResp{}, nil +} + +func (o *adminServer) UpdateApplicationVersion(ctx context.Context, req *admin.UpdateApplicationVersionReq) (*admin.UpdateApplicationVersionResp, error) { + if _, err := mctx.CheckAdmin(ctx); err != nil { + return nil, err + } + oid, err := primitive.ObjectIDFromHex(req.Id) + if err != nil { + return nil, errs.ErrArgs.WrapMsg("invalid id " + err.Error()) + } + update := make(map[string]any) + putUpdate(update, "platform", req.Platform) + putUpdate(update, "version", req.Version) + putUpdate(update, "url", req.Url) + putUpdate(update, "text", req.Text) + putUpdate(update, "force", req.Force) + putUpdate(update, "latest", req.Latest) + putUpdate(update, "hot", req.Hot) + if err := o.Database.UpdateVersion(ctx, oid, update); err != nil { + return nil, err + } + return &admin.UpdateApplicationVersionResp{}, nil +} + +func (o *adminServer) DeleteApplicationVersion(ctx context.Context, req *admin.DeleteApplicationVersionReq) (*admin.DeleteApplicationVersionResp, error) { + if _, err := mctx.CheckAdmin(ctx); err != nil { + return nil, err + } + ids := make([]primitive.ObjectID, 0, len(req.Id)) + for _, id := range req.Id { + oid, err := primitive.ObjectIDFromHex(id) + if err != nil { + return nil, errs.ErrArgs.WrapMsg("invalid id " + err.Error()) + } + ids = append(ids, oid) + } + if err := o.Database.DeleteVersion(ctx, ids); err != nil { + return nil, err + } + return &admin.DeleteApplicationVersionResp{}, nil +} + +func (o *adminServer) PageApplicationVersion(ctx context.Context, req *admin.PageApplicationVersionReq) (*admin.PageApplicationVersionResp, error) { + total, res, err := o.Database.PageVersion(ctx, req.Platform, req.Pagination) + if err != nil { + return nil, err + } + return &admin.PageApplicationVersionResp{ + Total: total, + Versions: datautil.Slice(res, o.db2pbApplication), + }, nil +} + +func putUpdate[T any](update map[string]any, name string, val interface{ GetValuePtr() *T }) { + ptrVal := val.GetValuePtr() + if ptrVal == nil { + return + } + update[name] = *ptrVal +} diff --git a/internal/rpc/chat/callback.go b/internal/rpc/chat/callback.go index b355d7660..d4bfe5558 100644 --- a/internal/rpc/chat/callback.go +++ b/internal/rpc/chat/callback.go @@ -47,7 +47,7 @@ func (o *chatSvr) OpenIMCallback(ctx context.Context, req *chat.OpenIMCallbackRe if err := json.Unmarshal([]byte(req.Body), &data); err != nil { return nil, errs.Wrap(err) } - user, err := o.Database.GetAttribute(ctx, data.ToUserID) + user, err := o.Database.TakeAttributeByUserID(ctx, data.ToUserID) if err != nil { return nil, err } diff --git a/internal/rpc/chat/login.go b/internal/rpc/chat/login.go index 59990302d..5c4007d4d 100644 --- a/internal/rpc/chat/login.go +++ b/internal/rpc/chat/login.go @@ -1,17 +1,3 @@ -// Copyright © 2023 OpenIM open source community. All rights reserved. -// -// 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. - package chat import ( @@ -50,7 +36,7 @@ func (o *chatSvr) SendVerifyCode(ctx context.Context, req *chat.SendVerifyCodeRe if req.AreaCode == "" || req.PhoneNumber == "" { return nil, errs.ErrArgs.WrapMsg("area code or phone number is empty") } - if req.AreaCode[0] != '+' { + if !strings.HasPrefix(req.AreaCode, "+") { req.AreaCode = "+" + req.AreaCode } if _, err := strconv.ParseUint(req.AreaCode[1:], 10, 64); err != nil { @@ -59,22 +45,10 @@ func (o *chatSvr) SendVerifyCode(ctx context.Context, req *chat.SendVerifyCodeRe if _, err := strconv.ParseUint(req.PhoneNumber, 10, 64); err != nil { return nil, errs.ErrArgs.WrapMsg("phone number must be number") } - _, err := o.Database.TakeAttributeByPhone(ctx, req.AreaCode, req.PhoneNumber) - if err == nil { - return nil, eerrs.ErrPhoneAlreadyRegister.WrapMsg("phone already register") - } else if !dbutil.IsDBNotFound(err) { - return nil, err - } } else { if err := chat.EmailCheck(req.Email); err != nil { return nil, errs.ErrArgs.WrapMsg("email must be right") } - _, err := o.Database.TakeAttributeByEmail(ctx, req.Email) - if err == nil { - return nil, eerrs.ErrEmailAlreadyRegister.WrapMsg("email already register") - } else if !dbutil.IsDBNotFound(err) { - return nil, err - } } conf, err := o.Admin.GetConfig(ctx) if err != nil { @@ -245,16 +219,14 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( if err != nil { return nil, err } - if req.User == nil { - return nil, errs.ErrArgs.WrapMsg("user is nil") - } - if req.User.Email == "" { - if (req.User.AreaCode == "" && req.User.PhoneNumber != "") || (req.User.AreaCode != "" && req.User.PhoneNumber == "") { - return nil, errs.ErrArgs.WrapMsg("area code or phone number error, no email provide") - } + if err = o.checkRegisterInfo(ctx, req.User, isAdmin); err != nil { + return nil, err } var usedInvitationCode bool if !isAdmin { + if !o.AllowRegister { + return nil, errs.ErrNoPermission.WrapMsg("register user is disabled") + } if req.User.UserID != "" { return nil, errs.ErrNoPermission.WrapMsg("only admin can set user id") } @@ -308,43 +280,39 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( return nil, err } } - var registerType int32 + var ( + credentials []*chatdb.Credential + registerType int32 + ) + if req.User.PhoneNumber != "" { - if req.User.AreaCode[0] != '+' { - req.User.AreaCode = "+" + req.User.AreaCode - } - if _, err := strconv.ParseUint(req.User.AreaCode[1:], 10, 64); err != nil { - return nil, errs.ErrArgs.WrapMsg("area code must be number") - } - if _, err := strconv.ParseUint(req.User.PhoneNumber, 10, 64); err != nil { - return nil, errs.ErrArgs.WrapMsg("phone number must be number") - } - _, err := o.Database.TakeAttributeByPhone(ctx, req.User.AreaCode, req.User.PhoneNumber) - if err == nil { - return nil, eerrs.ErrPhoneAlreadyRegister.Wrap() - } else if !dbutil.IsDBNotFound(err) { - return nil, err - } registerType = constant.PhoneRegister + credentials = append(credentials, &chatdb.Credential{ + UserID: req.User.UserID, + Account: BuildCredentialPhone(req.User.AreaCode, req.User.PhoneNumber), + Type: constant.CredentialPhone, + AllowChange: true, + }) } if req.User.Account != "" { - _, err := o.Database.TakeAttributeByAccount(ctx, req.User.Account) - if err == nil { - return nil, eerrs.ErrAccountAlreadyRegister.Wrap() - } else if !dbutil.IsDBNotFound(err) { - return nil, err - } + credentials = append(credentials, &chatdb.Credential{ + UserID: req.User.UserID, + Account: req.User.Account, + Type: constant.CredentialAccount, + AllowChange: true, + }) + registerType = constant.AccountRegister } if req.User.Email != "" { - _, err := o.Database.TakeAttributeByEmail(ctx, req.User.Email) registerType = constant.EmailRegister - if err == nil { - return nil, eerrs.ErrEmailAlreadyRegister.Wrap() - } else if !dbutil.IsDBNotFound(err) { - return nil, err - } + credentials = append(credentials, &chatdb.Credential{ + UserID: req.User.UserID, + Account: req.User.Email, + Type: constant.CredentialEmail, + AllowChange: true, + }) } register := &chatdb.Register{ UserID: req.User.UserID, @@ -362,6 +330,7 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( ChangeTime: register.CreateTime, CreateTime: register.CreateTime, } + attribute := &chatdb.Attribute{ UserID: req.User.UserID, Account: req.User.Account, @@ -379,7 +348,7 @@ func (o *chatSvr) RegisterUser(ctx context.Context, req *chat.RegisterUserReq) ( AllowAddFriend: constant.DefaultAllowAddFriend, RegisterType: registerType, } - if err := o.Database.RegisterUser(ctx, register, account, attribute); err != nil { + if err := o.Database.RegisterUser(ctx, register, account, attribute, credentials); err != nil { return nil, err } if usedInvitationCode { @@ -405,33 +374,39 @@ func (o *chatSvr) Login(ctx context.Context, req *chat.LoginReq) (*chat.LoginRes if req.Password == "" && req.VerifyCode == "" { return nil, errs.ErrArgs.WrapMsg("password or code must be set") } - var err error - var attribute *chatdb.Attribute - if req.Account != "" { - attribute, err = o.Database.GetAttributeByAccount(ctx, req.Account) - } else if req.PhoneNumber != "" { + var ( + err error + credential *chatdb.Credential + acc string + ) + + switch { + case req.Account != "": + acc = req.Account + case req.PhoneNumber != "": if req.AreaCode == "" { return nil, errs.ErrArgs.WrapMsg("area code must") } - if req.AreaCode[0] != '+' { + if !strings.HasPrefix(req.AreaCode, "+") { req.AreaCode = "+" + req.AreaCode } if _, err := strconv.ParseUint(req.AreaCode[1:], 10, 64); err != nil { return nil, errs.ErrArgs.WrapMsg("area code must be number") } - attribute, err = o.Database.GetAttributeByPhone(ctx, req.AreaCode, req.PhoneNumber) - } else if req.Email != "" { - attribute, err = o.Database.GetAttributeByEmail(ctx, req.Email) - } else { - err = errs.ErrArgs.WrapMsg("account or phone number or email must be set") + acc = BuildCredentialPhone(req.AreaCode, req.PhoneNumber) + case req.Email != "": + acc = req.Email + default: + return nil, errs.ErrArgs.WrapMsg("account or phone number or email must be set") } + credential, err = o.Database.TakeCredentialByAccount(ctx, acc) if err != nil { if dbutil.IsDBNotFound(err) { return nil, eerrs.ErrAccountNotFound.WrapMsg("user unregistered") } return nil, err } - if err := o.Admin.CheckLogin(ctx, attribute.UserID, req.Ip); err != nil { + if err := o.Admin.CheckLogin(ctx, credential.UserID, req.Ip); err != nil { return nil, err } var verifyCodeID *string @@ -450,7 +425,7 @@ func (o *chatSvr) Login(ctx context.Context, req *chat.LoginReq) (*chat.LoginRes verifyCodeID = &id } } else { - account, err := o.Database.GetAccount(ctx, attribute.UserID) + account, err := o.Database.TakeAccount(ctx, credential.UserID) if err != nil { return nil, err } @@ -458,12 +433,12 @@ func (o *chatSvr) Login(ctx context.Context, req *chat.LoginReq) (*chat.LoginRes return nil, eerrs.ErrPassword.Wrap() } } - chatToken, err := o.Admin.CreateToken(ctx, attribute.UserID, constant.NormalUser) + chatToken, err := o.Admin.CreateToken(ctx, credential.UserID, constant.NormalUser) if err != nil { return nil, err } record := &chatdb.UserLoginRecord{ - UserID: attribute.UserID, + UserID: credential.UserID, LoginTime: time.Now(), IP: req.Ip, DeviceID: req.DeviceID, @@ -477,7 +452,7 @@ func (o *chatSvr) Login(ctx context.Context, req *chat.LoginReq) (*chat.LoginRes return nil, err } } - resp.UserID = attribute.UserID + resp.UserID = credential.UserID resp.ChatToken = chatToken.Token return resp, nil } diff --git a/internal/rpc/chat/password.go b/internal/rpc/chat/password.go index 6235a2df7..73d34a36f 100644 --- a/internal/rpc/chat/password.go +++ b/internal/rpc/chat/password.go @@ -16,7 +16,6 @@ package chat import ( "context" - "github.com/openimsdk/tools/errs" "github.com/openimsdk/chat/pkg/common/constant" @@ -28,6 +27,11 @@ func (o *chatSvr) ResetPassword(ctx context.Context, req *chat.ResetPasswordReq) if req.Password == "" { return nil, errs.ErrArgs.WrapMsg("password must be set") } + if req.AreaCode == "" || req.PhoneNumber == "" { + if !(req.AreaCode == "" && req.PhoneNumber == "") { + return nil, errs.ErrArgs.WrapMsg("area code and phone number must set together") + } + } var verifyCodeID string var err error if req.Email == "" { @@ -39,22 +43,19 @@ func (o *chatSvr) ResetPassword(ctx context.Context, req *chat.ResetPasswordReq) if err != nil { return nil, err } - + var account string if req.Email == "" { - attribute, err := o.Database.GetAttributeByPhone(ctx, req.AreaCode, req.PhoneNumber) - if err != nil { - return nil, err - } - err = o.Database.UpdatePasswordAndDeleteVerifyCode(ctx, attribute.UserID, req.Password, verifyCodeID) + account = BuildCredentialPhone(req.AreaCode, req.PhoneNumber) } else { - attribute, err := o.Database.GetAttributeByEmail(ctx, req.Email) - if err != nil { - return nil, err - } - err = o.Database.UpdatePasswordAndDeleteVerifyCode(ctx, attribute.UserID, req.Password, verifyCodeID) - if err != nil { - return nil, err - } + account = req.Email + } + cred, err := o.Database.TakeCredentialByAccount(ctx, account) + if err != nil { + return nil, err + } + err = o.Database.UpdatePasswordAndDeleteVerifyCode(ctx, cred.UserID, req.Password, verifyCodeID) + if err != nil { + return nil, err } return &chat.ResetPasswordResp{}, nil } diff --git a/internal/rpc/chat/register.go b/internal/rpc/chat/register.go new file mode 100644 index 000000000..9eb610044 --- /dev/null +++ b/internal/rpc/chat/register.go @@ -0,0 +1,15 @@ +package chat + +import ( + "context" + "github.com/openimsdk/chat/pkg/protocol/chat" +) + +func (o *chatSvr) SetAllowRegister(ctx context.Context, req *chat.SetAllowRegisterReq) (*chat.SetAllowRegisterResp, error) { + o.AllowRegister = req.AllowRegister + return &chat.SetAllowRegisterResp{}, nil +} + +func (o *chatSvr) GetAllowRegister(ctx context.Context, req *chat.GetAllowRegisterReq) (*chat.GetAllowRegisterResp, error) { + return &chat.GetAllowRegisterResp{AllowRegister: o.AllowRegister}, nil +} diff --git a/internal/rpc/chat/start.go b/internal/rpc/chat/start.go index 71939dd54..901b2c5dd 100644 --- a/internal/rpc/chat/start.go +++ b/internal/rpc/chat/start.go @@ -68,6 +68,7 @@ func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryReg Len: config.RpcConfig.VerifyCode.Len, } srv.Livekit = rtc.NewLiveKit(config.RpcConfig.LiveKit.Key, config.RpcConfig.LiveKit.Secret, config.RpcConfig.LiveKit.URL) + srv.AllowRegister = config.RpcConfig.AllowRegister chat.RegisterChatServer(server, &srv) return nil } @@ -80,6 +81,7 @@ type chatSvr struct { Code verifyCode Livekit *rtc.LiveKit ChatAdminUserID string + AllowRegister bool } func (o *chatSvr) WithAdminUser(ctx context.Context) context.Context { diff --git a/internal/rpc/chat/update.go b/internal/rpc/chat/update.go index 4579f1c3e..13b9b57f1 100644 --- a/internal/rpc/chat/update.go +++ b/internal/rpc/chat/update.go @@ -15,6 +15,8 @@ package chat import ( + "github.com/openimsdk/chat/pkg/common/constant" + chatdb "github.com/openimsdk/chat/pkg/common/db/table/chat" "time" "github.com/openimsdk/tools/errs" @@ -68,3 +70,56 @@ func ToDBAttributeUpdate(req *chat.UpdateUserInfoReq) (map[string]any, error) { //} return update, nil } + +func ToDBCredentialUpdate(req *chat.UpdateUserInfoReq, allowChange bool) ([]*chatdb.Credential, []*chatdb.Credential, error) { + update := make([]*chatdb.Credential, 0) + del := make([]*chatdb.Credential, 0) + if req.Account != nil { + if req.Account.GetValue() == "" { + del = append(del, &chatdb.Credential{ + UserID: req.UserID, + Type: constant.CredentialAccount, + }) + } else { + update = append(update, &chatdb.Credential{ + UserID: req.UserID, + Account: req.Account.GetValue(), + Type: constant.CredentialAccount, + AllowChange: allowChange, + }) + } + } + + if req.Email != nil { + if req.Email.GetValue() == "" { + del = append(del, &chatdb.Credential{ + UserID: req.UserID, + Type: constant.CredentialEmail, + }) + } else { + update = append(update, &chatdb.Credential{ + UserID: req.UserID, + Account: req.Email.GetValue(), + Type: constant.CredentialEmail, + AllowChange: allowChange, + }) + } + } + if req.PhoneNumber != nil { + if req.PhoneNumber.GetValue() == "" { + del = append(del, &chatdb.Credential{ + UserID: req.UserID, + Type: constant.CredentialPhone, + }) + } else { + update = append(update, &chatdb.Credential{ + UserID: req.UserID, + Account: BuildCredentialPhone(req.AreaCode.GetValue(), req.PhoneNumber.GetValue()), + Type: constant.CredentialPhone, + AllowChange: allowChange, + }) + } + } + + return update, del, nil +} diff --git a/internal/rpc/chat/user.go b/internal/rpc/chat/user.go index ce789613a..c3fc234af 100644 --- a/internal/rpc/chat/user.go +++ b/internal/rpc/chat/user.go @@ -16,6 +16,12 @@ package chat import ( "context" + "errors" + "github.com/openimsdk/chat/pkg/eerrs" + "github.com/openimsdk/protocol/wrapperspb" + "github.com/openimsdk/tools/utils/stringutil" + "strconv" + "strings" "time" "github.com/openimsdk/chat/pkg/common/db/dbutil" @@ -27,83 +33,118 @@ import ( "github.com/openimsdk/chat/pkg/common/constant" "github.com/openimsdk/chat/pkg/common/mctx" - "github.com/openimsdk/chat/pkg/eerrs" "github.com/openimsdk/chat/pkg/protocol/chat" "github.com/openimsdk/tools/errs" ) func (o *chatSvr) checkUpdateInfo(ctx context.Context, req *chat.UpdateUserInfoReq) error { - attribute, err := o.Database.TakeAttributeByUserID(ctx, req.UserID) + if req.AreaCode != nil || req.PhoneNumber != nil { + if !(req.AreaCode != nil && req.PhoneNumber != nil) { + return errs.ErrArgs.WrapMsg("areaCode and phoneNumber must be set together") + } + if req.AreaCode.Value == "" || req.PhoneNumber.Value == "" { + if req.AreaCode.Value != req.PhoneNumber.Value { + return errs.ErrArgs.WrapMsg("areaCode and phoneNumber must be set together") + } + } + } + if req.UserID == "" { + return errs.ErrArgs.WrapMsg("user id is empty") + } + + credentials, err := o.Database.TakeCredentialsByUserID(ctx, req.UserID) if err != nil { return err + } else if len(credentials) == 0 { + return errs.ErrArgs.WrapMsg("user not found") } - checkEmail := func() error { - if req.Email == nil { - return nil - } - if req.Email.Value == attribute.Email { - req.Email = nil - return nil + var ( + credNum, delNum, addNum = len(credentials), 0, 0 + ) + + addFunc := func(s *wrapperspb.StringValue) { + if s != nil { + if s.Value != "" { + addNum++ + } } - if req.Email.Value == "" { - if !(attribute.Account != "" || (attribute.AreaCode != "" && attribute.PhoneNumber != "")) { - return errs.ErrArgs.WrapMsg("a login method must exist") + } + + for _, s := range []*wrapperspb.StringValue{req.Account, req.PhoneNumber, req.Email} { + addFunc(s) + } + + for _, credential := range credentials { + switch credential.Type { + case constant.CredentialAccount: + if req.Account != nil { + if req.Account.Value == credential.Account { + req.Account = nil + } else if req.Account.Value == "" { + delNum += 1 + } } - return nil - } else { - if _, err := o.Database.GetAttributeByEmail(ctx, req.Email.Value); err == nil { - return errs.ErrDuplicateKey.WrapMsg("email already exists") - } else if !dbutil.IsDBNotFound(err) { - return err + case constant.CredentialPhone: + if req.PhoneNumber != nil { + phoneAccount := BuildCredentialPhone(req.AreaCode.Value, req.PhoneNumber.Value) + if phoneAccount == credential.Account { + req.AreaCode = nil + req.PhoneNumber = nil + } else if req.PhoneNumber.Value == "" { + delNum += 1 + } + } + case constant.CredentialEmail: + if req.Email != nil { + if req.Email.Value == credential.Account { + req.Email = nil + } else if req.Email.Value == "" { + delNum += 1 + } } } - return nil } - checkPhone := func() error { - if req.AreaCode == nil { - return nil + + if addNum+credNum-delNum <= 0 { + return errs.ErrArgs.WrapMsg("a login method must exist") + } + + if req.PhoneNumber.GetValue() != "" { + if !strings.HasPrefix(req.AreaCode.GetValue(), "+") { + req.AreaCode.Value = "+" + req.AreaCode.Value } - if req.AreaCode.Value == attribute.AreaCode && req.PhoneNumber.Value == attribute.PhoneNumber { - req.AreaCode = nil - req.PhoneNumber = nil - return nil + if _, err := strconv.ParseUint(req.AreaCode.Value[1:], 10, 64); err != nil { + return errs.ErrArgs.WrapMsg("area code must be number") } - if req.AreaCode.Value == "" || req.PhoneNumber.Value == "" { - if attribute.Email == "" || attribute.Account == "" { - return errs.ErrArgs.WrapMsg("a login method must exist") - } - } else { - if _, err := o.Database.GetAttributeByPhone(ctx, req.AreaCode.Value, req.PhoneNumber.Value); err == nil { - return errs.ErrDuplicateKey.WrapMsg("phone number already exists") - } else if !dbutil.IsDBNotFound(err) { - return err - } + if _, err := strconv.ParseUint(req.PhoneNumber.GetValue(), 10, 64); err != nil { + return errs.ErrArgs.WrapMsg("phone number must be number") } - return nil - } - checkAccount := func() error { - if req.Account == nil { - return nil + _, err := o.Database.TakeCredentialByAccount(ctx, BuildCredentialPhone(req.AreaCode.GetValue(), req.PhoneNumber.GetValue())) + if err == nil { + return eerrs.ErrPhoneAlreadyRegister.Wrap() + } else if !dbutil.IsDBNotFound(err) { + return err } - if req.Account.Value == attribute.Account { - req.Account = nil - return nil + } + if req.Account.GetValue() != "" { + if !stringutil.IsAlphanumeric(req.Account.GetValue()) { + return errs.ErrArgs.WrapMsg("account must be alphanumeric") } - if req.Account.Value == "" { - if !(attribute.Email == "" && (attribute.AreaCode == "" || attribute.PhoneNumber == "")) { - return errs.ErrArgs.WrapMsg("a login method must exist") - } - } else { - if _, err := o.Database.GetAttributeByAccount(ctx, req.Account.Value); err == nil { - return errs.ErrDuplicateKey.WrapMsg("account already exists") - } else if !dbutil.IsDBNotFound(err) { - return err - } + _, err := o.Database.TakeCredentialByAccount(ctx, req.Account.GetValue()) + if err == nil { + return eerrs.ErrAccountAlreadyRegister.Wrap() + } else if !dbutil.IsDBNotFound(err) { + return err } - return nil } - for _, fn := range []func() error{checkEmail, checkPhone, checkAccount} { - if err := fn(); err != nil { + if req.Email.GetValue() != "" { + if !stringutil.IsValidEmail(req.Email.GetValue()) { + return errs.ErrArgs.WrapMsg("invalid email") + } + _, err := o.Database.TakeCredentialByAccount(ctx, req.Email.GetValue()) + if err == nil { + return eerrs.ErrEmailAlreadyRegister.Wrap() + } else if !dbutil.IsDBNotFound(err) { return err } } @@ -111,56 +152,39 @@ func (o *chatSvr) checkUpdateInfo(ctx context.Context, req *chat.UpdateUserInfoR } func (o *chatSvr) UpdateUserInfo(ctx context.Context, req *chat.UpdateUserInfoReq) (*chat.UpdateUserInfoResp, error) { - if req.AreaCode != nil || req.PhoneNumber != nil { - if !(req.AreaCode != nil && req.PhoneNumber != nil) { - return nil, errs.ErrArgs.WrapMsg("areaCode and phoneNumber must be set together") - } - if req.AreaCode.Value == "" || req.PhoneNumber.Value == "" { - if req.AreaCode.Value != req.PhoneNumber.Value { - return nil, errs.ErrArgs.WrapMsg("areaCode and phoneNumber must be set together") - } - } - } opUserID, userType, err := mctx.Check(ctx) if err != nil { return nil, err } - if req.UserID == "" { - return nil, errs.ErrArgs.WrapMsg("user id is empty") + + if err = o.checkUpdateInfo(ctx, req); err != nil { + return nil, err } + switch userType { case constant.NormalUser: - //if req.UserID == "" { - // req.UserID = opUserID - //} + if req.RegisterType != nil { + return nil, errs.ErrNoPermission.WrapMsg("registerType can not be updated") + } if req.UserID != opUserID { return nil, errs.ErrNoPermission.WrapMsg("only admin can update other user info") } - if req.AreaCode != nil { - return nil, errs.ErrNoPermission.WrapMsg("areaCode can not be updated") - } - if req.PhoneNumber != nil { - return nil, errs.ErrNoPermission.WrapMsg("phoneNumber can not be updated") - } - if req.Account != nil { - return nil, errs.ErrNoPermission.WrapMsg("account can not be updated") - } - if req.Level != nil { - return nil, errs.ErrNoPermission.WrapMsg("level can not be updated") - } + case constant.AdminUser: default: return nil, errs.ErrNoPermission.WrapMsg("user type error") } - if err := o.checkUpdateInfo(ctx, req); err != nil { + + update, err := ToDBAttributeUpdate(req) + if err != nil { return nil, err } - update, err := ToDBAttributeUpdate(req) + credUpdate, credDel, err := ToDBCredentialUpdate(req, true) if err != nil { return nil, err } if len(update) > 0 { - if err := o.Database.UpdateUseInfo(ctx, req.UserID, update); err != nil { + if err := o.Database.UpdateUseInfo(ctx, req.UserID, update, credUpdate, credDel); err != nil { return nil, err } } @@ -185,7 +209,7 @@ func (o *chatSvr) AddUserAccount(ctx context.Context, req *chat.AddUserAccountRe return nil, err } - if err := o.checkTheUniqueness(ctx, req); err != nil { + if err := o.checkRegisterInfo(ctx, req.User, true); err != nil { return nil, err } @@ -205,6 +229,44 @@ func (o *chatSvr) AddUserAccount(ctx context.Context, req *chat.AddUserAccountRe if req.User.UserID == "" { return nil, errs.ErrInternalServer.WrapMsg("gen user id failed") } + } else { + _, err := o.Database.GetUser(ctx, req.User.UserID) + if err == nil { + return nil, errs.ErrArgs.WrapMsg("appoint user id already register") + } else if !dbutil.IsDBNotFound(err) { + return nil, err + } + } + + var ( + credentials []*chatdb.Credential + ) + + if req.User.PhoneNumber != "" { + credentials = append(credentials, &chatdb.Credential{ + UserID: req.User.UserID, + Account: BuildCredentialPhone(req.User.AreaCode, req.User.PhoneNumber), + Type: constant.CredentialPhone, + AllowChange: true, + }) + } + + if req.User.Account != "" { + credentials = append(credentials, &chatdb.Credential{ + UserID: req.User.UserID, + Account: req.User.Account, + Type: constant.CredentialAccount, + AllowChange: true, + }) + } + + if req.User.Email != "" { + credentials = append(credentials, &chatdb.Credential{ + UserID: req.User.UserID, + Account: req.User.Email, + Type: constant.CredentialEmail, + AllowChange: true, + }) } register := &chatdb.Register{ @@ -240,10 +302,9 @@ func (o *chatSvr) AddUserAccount(ctx context.Context, req *chat.AddUserAccountRe AllowAddFriend: constant.DefaultAllowAddFriend, } - if err := o.Database.RegisterUser(ctx, register, account, attribute); err != nil { + if err := o.Database.RegisterUser(ctx, register, account, attribute, credentials); err != nil { return nil, err } - return &chat.AddUserAccountResp{}, nil } @@ -339,52 +400,42 @@ func (o *chatSvr) SearchUserInfo(ctx context.Context, req *chat.SearchUserInfoRe }, nil } -func (o *chatSvr) checkTheUniqueness(ctx context.Context, req *chat.AddUserAccountReq) error { +func (o *chatSvr) CheckUserExist(ctx context.Context, req *chat.CheckUserExistReq) (resp *chat.CheckUserExistResp, err error) { + if req.User == nil { + return nil, errs.ErrArgs.WrapMsg("user is nil") + } if req.User.PhoneNumber != "" { - _, err := o.Database.TakeAttributeByPhone(ctx, req.User.AreaCode, req.User.PhoneNumber) - if err == nil { - return eerrs.ErrPhoneAlreadyRegister.Wrap() - } else if !dbutil.IsDBNotFound(err) { - return err + account, err := o.Database.TakeCredentialByAccount(ctx, BuildCredentialPhone(req.User.AreaCode, req.User.PhoneNumber)) + // err != nil is not found User + if err != nil && !errors.Is(err, mongo.ErrNoDocuments) { + return nil, err } - } else { - _, err := o.Database.TakeAttributeByEmail(ctx, req.User.Email) - if err == nil { - return eerrs.ErrEmailAlreadyRegister.Wrap() - } else if !dbutil.IsDBNotFound(err) { - return err + if account != nil { + log.ZDebug(ctx, "Check Number is ", account.Account) + log.ZDebug(ctx, "Check userID is ", account.UserID) + return &chat.CheckUserExistResp{Userid: account.UserID, IsRegistered: true}, nil } } - return nil -} - -func (o *chatSvr) CheckUserExist(ctx context.Context, req *chat.CheckUserExistReq) (resp *chat.CheckUserExistResp, err error) { - if req.User.PhoneNumber != "" { - attributeByPhone, err := o.Database.TakeAttributeByPhone(ctx, req.User.AreaCode, req.User.PhoneNumber) - // err != nil is not found User - if err != nil && errs.Unwrap(err) != mongo.ErrNoDocuments { + if req.User.Email != "" { + account, err := o.Database.TakeCredentialByAccount(ctx, req.User.AreaCode) + if err != nil && !errors.Is(err, mongo.ErrNoDocuments) { return nil, err } - if attributeByPhone != nil { - log.ZDebug(ctx, "Check Number is ", attributeByPhone.PhoneNumber) - log.ZDebug(ctx, "Check userID is ", attributeByPhone.UserID) - if attributeByPhone.PhoneNumber == req.User.PhoneNumber { - return &chat.CheckUserExistResp{Userid: attributeByPhone.UserID, IsRegistered: true}, nil - } + if account != nil { + log.ZDebug(ctx, "Check email is ", account.Account) + log.ZDebug(ctx, "Check userID is ", account.UserID) + return &chat.CheckUserExistResp{Userid: account.UserID, IsRegistered: true}, nil } - } else { - if req.User.Email != "" { - attributeByEmail, err := o.Database.TakeAttributeByEmail(ctx, req.User.Email) - if err != nil && errs.Unwrap(err) != mongo.ErrNoDocuments { - return nil, err - } - if attributeByEmail != nil { - log.ZDebug(ctx, "Check email is ", attributeByEmail.Email) - log.ZDebug(ctx, "Check userID is ", attributeByEmail.UserID) - if attributeByEmail.Email == req.User.Email { - return &chat.CheckUserExistResp{Userid: attributeByEmail.UserID, IsRegistered: true}, nil - } - } + } + if req.User.Account != "" { + account, err := o.Database.TakeCredentialByAccount(ctx, req.User.Account) + if err != nil && !errors.Is(err, mongo.ErrNoDocuments) { + return nil, err + } + if account != nil { + log.ZDebug(ctx, "Check account is ", account.Account) + log.ZDebug(ctx, "Check userID is ", account.UserID) + return &chat.CheckUserExistResp{Userid: account.UserID, IsRegistered: true}, nil } } return nil, nil diff --git a/internal/rpc/chat/utils.go b/internal/rpc/chat/utils.go index 03a95d0df..41ebd1bc1 100644 --- a/internal/rpc/chat/utils.go +++ b/internal/rpc/chat/utils.go @@ -1,26 +1,20 @@ -// Copyright © 2023 OpenIM open source community. All rights reserved. -// -// 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. - package chat import ( - "github.com/openimsdk/chat/pkg/common/db/table/chat" + "context" + "github.com/openimsdk/chat/pkg/common/db/dbutil" + table "github.com/openimsdk/chat/pkg/common/db/table/chat" + "github.com/openimsdk/chat/pkg/eerrs" + "github.com/openimsdk/chat/pkg/protocol/chat" "github.com/openimsdk/chat/pkg/protocol/common" + "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/utils/datautil" + "github.com/openimsdk/tools/utils/stringutil" + "strconv" + "strings" ) -func DbToPbAttribute(attribute *chat.Attribute) *common.UserPublicInfo { +func DbToPbAttribute(attribute *table.Attribute) *common.UserPublicInfo { if attribute == nil { return nil } @@ -35,11 +29,11 @@ func DbToPbAttribute(attribute *chat.Attribute) *common.UserPublicInfo { } } -func DbToPbAttributes(attributes []*chat.Attribute) []*common.UserPublicInfo { +func DbToPbAttributes(attributes []*table.Attribute) []*common.UserPublicInfo { return datautil.Slice(attributes, DbToPbAttribute) } -func DbToPbUserFullInfo(attribute *chat.Attribute) *common.UserFullInfo { +func DbToPbUserFullInfo(attribute *table.Attribute) *common.UserFullInfo { return &common.UserFullInfo{ UserID: attribute.UserID, Password: "", @@ -60,6 +54,59 @@ func DbToPbUserFullInfo(attribute *chat.Attribute) *common.UserFullInfo { } } -func DbToPbUserFullInfos(attributes []*chat.Attribute) []*common.UserFullInfo { +func DbToPbUserFullInfos(attributes []*table.Attribute) []*common.UserFullInfo { return datautil.Slice(attributes, DbToPbUserFullInfo) } + +func BuildCredentialPhone(areaCode, phone string) string { + return areaCode + " " + phone +} + +func (o *chatSvr) checkRegisterInfo(ctx context.Context, user *chat.RegisterUserInfo, isAdmin bool) error { + if user == nil { + return errs.ErrArgs.WrapMsg("user is nil") + } + if user.Email == "" && !(user.PhoneNumber != "" && user.AreaCode != "") && (!isAdmin || user.Account == "") { + return errs.ErrArgs.WrapMsg("at least one valid account is required") + } + if user.PhoneNumber != "" { + if !strings.HasPrefix(user.AreaCode, "+") { + user.AreaCode = "+" + user.AreaCode + } + if _, err := strconv.ParseUint(user.AreaCode[1:], 10, 64); err != nil { + return errs.ErrArgs.WrapMsg("area code must be number") + } + if _, err := strconv.ParseUint(user.PhoneNumber, 10, 64); err != nil { + return errs.ErrArgs.WrapMsg("phone number must be number") + } + _, err := o.Database.TakeAttributeByPhone(ctx, user.AreaCode, user.PhoneNumber) + if err == nil { + return eerrs.ErrPhoneAlreadyRegister.Wrap() + } else if !dbutil.IsDBNotFound(err) { + return err + } + } + if user.Account != "" { + if !stringutil.IsAlphanumeric(user.Account) { + return errs.ErrArgs.WrapMsg("account must be alphanumeric") + } + _, err := o.Database.TakeAttributeByAccount(ctx, user.Account) + if err == nil { + return eerrs.ErrAccountAlreadyRegister.Wrap() + } else if !dbutil.IsDBNotFound(err) { + return err + } + } + if user.Email != "" { + if !stringutil.IsValidEmail(user.Email) { + return errs.ErrArgs.WrapMsg("invalid email") + } + _, err := o.Database.TakeAttributeByAccount(ctx, user.Email) + if err == nil { + return eerrs.ErrEmailAlreadyRegister.Wrap() + } else if !dbutil.IsDBNotFound(err) { + return err + } + } + return nil +} diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 76acd6c65..2348e9f0e 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -145,6 +145,7 @@ type Chat struct { Key string `mapstructure:"key"` Secret string `mapstructure:"secret"` } `mapstructure:"liveKit"` + AllowRegister bool `mapstructure:"allowRegister"` } type Admin struct { diff --git a/pkg/common/constant/constant.go b/pkg/common/constant/constant.go index ed2e77854..0c0acec5d 100644 --- a/pkg/common/constant/constant.go +++ b/pkg/common/constant/constant.go @@ -1,17 +1,3 @@ -// Copyright © 2023 OpenIM open source community. All rights reserved. -// -// 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. - package constant import "github.com/openimsdk/protocol/constant" @@ -108,6 +94,20 @@ const ( const CtxApiToken = "api-token" const ( - EmailRegister = 1 - PhoneRegister = 2 + AccountRegister = iota + EmailRegister + PhoneRegister +) + +const ( + GenderFemale = 0 // female + GenderMale = 1 // male + GenderUnknown = 2 // unknown +) + +// Credential Type +const ( + CredentialAccount = iota + CredentialPhone + CredentialEmail ) diff --git a/pkg/common/db/database/admin.go b/pkg/common/db/database/admin.go index bf4859772..527a32d65 100644 --- a/pkg/common/db/database/admin.go +++ b/pkg/common/db/database/admin.go @@ -16,7 +16,7 @@ package database import ( "context" - "github.com/openimsdk/chat/pkg/common/tokenverify" + "go.mongodb.org/mongo-driver/bson/primitive" "time" "github.com/openimsdk/chat/pkg/common/db/cache" @@ -78,6 +78,11 @@ type AdminDatabaseInterface interface { CacheToken(ctx context.Context, userID string, token string, expire time.Duration) error GetTokens(ctx context.Context, userID string) (map[string]int32, error) DeleteToken(ctx context.Context, userID string) error + LatestVersion(ctx context.Context, platform string) (*admindb.Application, error) + AddVersion(ctx context.Context, val *admindb.Application) error + UpdateVersion(ctx context.Context, id primitive.ObjectID, update map[string]any) error + DeleteVersion(ctx context.Context, id []primitive.ObjectID) error + PageVersion(ctx context.Context, platforms []string, page pagination.Pagination) (int64, []*admindb.Application, error) } func NewAdminDatabase(cli *mongoutil.Client, rdb redis.UniversalClient, token *tokenverify.Token) (AdminDatabaseInterface, error) { @@ -117,6 +122,10 @@ func NewAdminDatabase(cli *mongoutil.Client, rdb redis.UniversalClient, token *t if err != nil { return nil, err } + application, err := admin.NewApplication(cli.GetDB()) + if err != nil { + return nil, err + } return &AdminDatabase{ tx: cli.GetTx(), admin: a, @@ -128,7 +137,8 @@ func NewAdminDatabase(cli *mongoutil.Client, rdb redis.UniversalClient, token *t registerAddGroup: registerAddGroup, applet: applet, clientConfig: clientConfig, - cache: cache.NewTokenInterface(rdb, token), + application: application, + cache: cache.NewTokenInterface(rdb), }, nil } @@ -143,6 +153,7 @@ type AdminDatabase struct { registerAddGroup admindb.RegisterAddGroupInterface applet admindb.AppletInterface clientConfig admindb.ClientConfigInterface + application admindb.ApplicationInterface cache cache.TokenInterface } @@ -337,3 +348,23 @@ func (o *AdminDatabase) GetTokens(ctx context.Context, userID string) (map[strin func (o *AdminDatabase) DeleteToken(ctx context.Context, userID string) error { return o.cache.DeleteTokenByUid(ctx, userID) } + +func (o *AdminDatabase) LatestVersion(ctx context.Context, platform string) (*admindb.Application, error) { + return o.application.LatestVersion(ctx, platform) +} + +func (o *AdminDatabase) AddVersion(ctx context.Context, val *admindb.Application) error { + return o.application.AddVersion(ctx, val) +} + +func (o *AdminDatabase) UpdateVersion(ctx context.Context, id primitive.ObjectID, update map[string]any) error { + return o.application.UpdateVersion(ctx, id, update) +} + +func (o *AdminDatabase) DeleteVersion(ctx context.Context, id []primitive.ObjectID) error { + return o.application.DeleteVersion(ctx, id) +} + +func (o *AdminDatabase) PageVersion(ctx context.Context, platforms []string, page pagination.Pagination) (int64, []*admindb.Application, error) { + return o.application.PageVersion(ctx, platforms, page) +} diff --git a/pkg/common/db/database/chat.go b/pkg/common/db/database/chat.go index e618845a4..5898fd73e 100644 --- a/pkg/common/db/database/chat.go +++ b/pkg/common/db/database/chat.go @@ -31,26 +31,24 @@ import ( type ChatDatabaseInterface interface { GetUser(ctx context.Context, userID string) (account *chatdb.Account, err error) - UpdateUseInfo(ctx context.Context, userID string, attribute map[string]any) (err error) + UpdateUseInfo(ctx context.Context, userID string, attribute map[string]any, updateCred, delCred []*chatdb.Credential) (err error) FindAttribute(ctx context.Context, userIDs []string) ([]*chatdb.Attribute, error) FindAttributeByAccount(ctx context.Context, accounts []string) ([]*chatdb.Attribute, error) TakeAttributeByPhone(ctx context.Context, areaCode string, phoneNumber string) (*chatdb.Attribute, error) TakeAttributeByEmail(ctx context.Context, Email string) (*chatdb.Attribute, error) TakeAttributeByAccount(ctx context.Context, account string) (*chatdb.Attribute, error) TakeAttributeByUserID(ctx context.Context, userID string) (*chatdb.Attribute, error) + TakeAccount(ctx context.Context, userID string) (*chatdb.Account, error) + TakeCredentialByAccount(ctx context.Context, account string) (*chatdb.Credential, error) + TakeCredentialsByUserID(ctx context.Context, userID string) ([]*chatdb.Credential, error) + TakeLastVerifyCode(ctx context.Context, account string) (*chatdb.VerifyCode, error) Search(ctx context.Context, normalUser int32, keyword string, gender int32, pagination pagination.Pagination) (int64, []*chatdb.Attribute, error) SearchUser(ctx context.Context, keyword string, userIDs []string, genders []int32, pagination pagination.Pagination) (int64, []*chatdb.Attribute, error) CountVerifyCodeRange(ctx context.Context, account string, start time.Time, end time.Time) (int64, error) AddVerifyCode(ctx context.Context, verifyCode *chatdb.VerifyCode, fn func() error) error UpdateVerifyCodeIncrCount(ctx context.Context, id string) error - TakeLastVerifyCode(ctx context.Context, account string) (*chatdb.VerifyCode, error) DelVerifyCode(ctx context.Context, id string) error - RegisterUser(ctx context.Context, register *chatdb.Register, account *chatdb.Account, attribute *chatdb.Attribute) error - GetAccount(ctx context.Context, userID string) (*chatdb.Account, error) - GetAttribute(ctx context.Context, userID string) (*chatdb.Attribute, error) - GetAttributeByAccount(ctx context.Context, account string) (*chatdb.Attribute, error) - GetAttributeByPhone(ctx context.Context, areaCode string, phoneNumber string) (*chatdb.Attribute, error) - GetAttributeByEmail(ctx context.Context, email string) (*chatdb.Attribute, error) + RegisterUser(ctx context.Context, register *chatdb.Register, account *chatdb.Account, attribute *chatdb.Attribute, credentials []*chatdb.Credential) error LoginRecord(ctx context.Context, record *chatdb.UserLoginRecord, verifyCodeID *string) error UpdatePassword(ctx context.Context, userID string, password string) error UpdatePasswordAndDeleteVerifyCode(ctx context.Context, userID string, password string, codeID string) error @@ -73,6 +71,10 @@ func NewChatDatabase(cli *mongoutil.Client) (ChatDatabaseInterface, error) { if err != nil { return nil, err } + credential, err := chat.NewCredential(cli.GetDB()) + if err != nil { + return nil, err + } userLoginRecord, err := chat.NewUserLoginRecord(cli.GetDB()) if err != nil { return nil, err @@ -90,6 +92,7 @@ func NewChatDatabase(cli *mongoutil.Client) (ChatDatabaseInterface, error) { register: register, account: account, attribute: attribute, + credential: credential, userLoginRecord: userLoginRecord, verifyCode: verifyCode, forbiddenAccount: forbiddenAccount, @@ -101,6 +104,7 @@ type ChatDatabase struct { register chatdb.RegisterInterface account chatdb.AccountInterface attribute chatdb.AttributeInterface + credential chatdb.CredentialInterface userLoginRecord chatdb.UserLoginRecordInterface verifyCode chatdb.VerifyCodeInterface forbiddenAccount admin.ForbiddenAccountInterface @@ -110,8 +114,21 @@ func (o *ChatDatabase) GetUser(ctx context.Context, userID string) (account *cha return o.account.Take(ctx, userID) } -func (o *ChatDatabase) UpdateUseInfo(ctx context.Context, userID string, attribute map[string]any) (err error) { - return o.attribute.Update(ctx, userID, attribute) +func (o *ChatDatabase) UpdateUseInfo(ctx context.Context, userID string, attribute map[string]any, updateCred, delCred []*chatdb.Credential) (err error) { + return o.tx.Transaction(ctx, func(ctx context.Context) error { + if err = o.attribute.Update(ctx, userID, attribute); err != nil { + return err + } + for _, credential := range updateCred { + if err = o.credential.CreateOrUpdateAccount(ctx, credential); err != nil { + return err + } + } + if err = o.credential.DeleteByUserIDType(ctx, delCred...); err != nil { + return err + } + return nil + }) } func (o *ChatDatabase) FindAttribute(ctx context.Context, userIDs []string) ([]*chatdb.Attribute, error) { @@ -138,6 +155,22 @@ func (o *ChatDatabase) TakeAttributeByUserID(ctx context.Context, userID string) return o.attribute.Take(ctx, userID) } +func (o *ChatDatabase) TakeLastVerifyCode(ctx context.Context, account string) (*chatdb.VerifyCode, error) { + return o.verifyCode.TakeLast(ctx, account) +} + +func (o *ChatDatabase) TakeAccount(ctx context.Context, userID string) (*chatdb.Account, error) { + return o.account.Take(ctx, userID) +} + +func (o *ChatDatabase) TakeCredentialByAccount(ctx context.Context, account string) (*chatdb.Credential, error) { + return o.credential.TakeAccount(ctx, account) +} + +func (o *ChatDatabase) TakeCredentialsByUserID(ctx context.Context, userID string) ([]*chatdb.Credential, error) { + return o.credential.Find(ctx, userID) +} + func (o *ChatDatabase) Search(ctx context.Context, normalUser int32, keyword string, genders int32, pagination pagination.Pagination) (total int64, attributes []*chatdb.Attribute, err error) { var forbiddenIDs []string if int(normalUser) == constant.NormalUser { @@ -177,15 +210,11 @@ func (o *ChatDatabase) UpdateVerifyCodeIncrCount(ctx context.Context, id string) return o.verifyCode.Incr(ctx, id) } -func (o *ChatDatabase) TakeLastVerifyCode(ctx context.Context, account string) (*chatdb.VerifyCode, error) { - return o.verifyCode.TakeLast(ctx, account) -} - func (o *ChatDatabase) DelVerifyCode(ctx context.Context, id string) error { return o.verifyCode.Delete(ctx, id) } -func (o *ChatDatabase) RegisterUser(ctx context.Context, register *chatdb.Register, account *chatdb.Account, attribute *chatdb.Attribute) error { +func (o *ChatDatabase) RegisterUser(ctx context.Context, register *chatdb.Register, account *chatdb.Account, attribute *chatdb.Attribute, credentials []*chatdb.Credential) error { return o.tx.Transaction(ctx, func(ctx context.Context) error { if err := o.register.Create(ctx, register); err != nil { return err @@ -196,30 +225,13 @@ func (o *ChatDatabase) RegisterUser(ctx context.Context, register *chatdb.Regist if err := o.attribute.Create(ctx, attribute); err != nil { return err } + if err := o.credential.Create(ctx, credentials...); err != nil { + return err + } return nil }) } -func (o *ChatDatabase) GetAccount(ctx context.Context, userID string) (*chatdb.Account, error) { - return o.account.Take(ctx, userID) -} - -func (o *ChatDatabase) GetAttribute(ctx context.Context, userID string) (*chatdb.Attribute, error) { - return o.attribute.Take(ctx, userID) -} - -func (o *ChatDatabase) GetAttributeByAccount(ctx context.Context, account string) (*chatdb.Attribute, error) { - return o.attribute.TakeAccount(ctx, account) -} - -func (o *ChatDatabase) GetAttributeByPhone(ctx context.Context, areaCode string, phoneNumber string) (*chatdb.Attribute, error) { - return o.attribute.TakePhone(ctx, areaCode, phoneNumber) -} - -func (o *ChatDatabase) GetAttributeByEmail(ctx context.Context, email string) (*chatdb.Attribute, error) { - return o.attribute.TakeEmail(ctx, email) -} - func (o *ChatDatabase) LoginRecord(ctx context.Context, record *chatdb.UserLoginRecord, verifyCodeID *string) error { return o.tx.Transaction(ctx, func(ctx context.Context) error { if err := o.userLoginRecord.Create(ctx, record); err != nil { @@ -243,6 +255,9 @@ func (o *ChatDatabase) UpdatePasswordAndDeleteVerifyCode(ctx context.Context, us if err := o.account.UpdatePassword(ctx, userID, password); err != nil { return err } + if codeID == "" { + return nil + } if err := o.verifyCode.Delete(ctx, codeID); err != nil { return err } diff --git a/pkg/common/db/model/admin/application.go b/pkg/common/db/model/admin/application.go new file mode 100644 index 000000000..e69268d21 --- /dev/null +++ b/pkg/common/db/model/admin/application.go @@ -0,0 +1,83 @@ +package admin + +import ( + "context" + "github.com/openimsdk/chat/pkg/common/db/table/admin" + admindb "github.com/openimsdk/chat/pkg/common/db/table/admin" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" +) + +func NewApplication(db *mongo.Database) (admindb.ApplicationInterface, error) { + coll := db.Collection("application") + _, err := coll.Indexes().CreateMany(context.Background(), []mongo.IndexModel{ + { + Keys: bson.D{ + {Key: "platform", Value: 1}, + {Key: "version", Value: 1}, + }, + Options: options.Index().SetUnique(true), + }, + { + Keys: bson.D{ + {Key: "latest", Value: -1}, + }, + }, + }) + if err != nil { + return nil, err + } + return &ApplicationMgo{coll: coll}, nil +} + +type ApplicationMgo struct { + coll *mongo.Collection +} + +func (a *ApplicationMgo) sort() any { + return bson.D{{"latest", -1}, {"_id", -1}} +} + +func (a *ApplicationMgo) LatestVersion(ctx context.Context, platform string) (*admin.Application, error) { + return mongoutil.FindOne[*admin.Application](ctx, a.coll, bson.M{"platform": platform}, options.FindOne().SetSort(a.sort())) +} + +func (a *ApplicationMgo) AddVersion(ctx context.Context, val *admin.Application) error { + if val.ID.IsZero() { + val.ID = primitive.NewObjectID() + } + return mongoutil.InsertMany(ctx, a.coll, []*admin.Application{val}) +} + +func (a *ApplicationMgo) UpdateVersion(ctx context.Context, id primitive.ObjectID, update map[string]any) error { + if len(update) == 0 { + return nil + } + return mongoutil.UpdateOne(ctx, a.coll, bson.M{"_id": id}, bson.M{"$set": update}, true) +} + +func (a *ApplicationMgo) DeleteVersion(ctx context.Context, id []primitive.ObjectID) error { + if len(id) == 0 { + return nil + } + return mongoutil.DeleteMany(ctx, a.coll, bson.M{"_id": bson.M{"$in": id}}) +} + +func (a *ApplicationMgo) PageVersion(ctx context.Context, platforms []string, page pagination.Pagination) (int64, []*admin.Application, error) { + filter := bson.M{} + if len(platforms) > 0 { + filter["platform"] = bson.M{"$in": platforms} + } + return mongoutil.FindPage[*admin.Application](ctx, a.coll, filter, page, options.Find().SetSort(a.sort())) +} + +func (a *ApplicationMgo) FindPlatform(ctx context.Context, id []primitive.ObjectID) ([]string, error) { + if len(id) == 0 { + return nil, nil + } + return mongoutil.Find[string](ctx, a.coll, bson.M{"_id": bson.M{"$in": id}}, options.Find().SetProjection(bson.M{"_id": 0, "platform": 1})) +} diff --git a/pkg/common/db/model/chat/attribute.go b/pkg/common/db/model/chat/attribute.go index 9b83b2df3..15112d3d3 100644 --- a/pkg/common/db/model/chat/attribute.go +++ b/pkg/common/db/model/chat/attribute.go @@ -140,6 +140,7 @@ func (o *Attribute) SearchNormalUser(ctx context.Context, keyword string, forbid {"account": bson.M{"$regex": keyword, "$options": "i"}}, {"nickname": bson.M{"$regex": keyword, "$options": "i"}}, {"phone_number": bson.M{"$regex": keyword, "$options": "i"}}, + {"email": bson.M{"$regex": keyword, "$options": "i"}}, } } return mongoutil.FindPage[*chat.Attribute](ctx, o.coll, filter, pagination) @@ -163,6 +164,7 @@ func (o *Attribute) SearchUser(ctx context.Context, keyword string, userIDs []st {"account": bson.M{"$regex": keyword, "$options": "i"}}, {"nickname": bson.M{"$regex": keyword, "$options": "i"}}, {"phone_number": bson.M{"$regex": keyword, "$options": "i"}}, + {"email": bson.M{"$regex": keyword, "$options": "i"}}, } } return mongoutil.FindPage[*chat.Attribute](ctx, o.coll, filter, pagination) diff --git a/pkg/common/db/model/chat/credential.go b/pkg/common/db/model/chat/credential.go new file mode 100644 index 000000000..5a389b3e5 --- /dev/null +++ b/pkg/common/db/model/chat/credential.go @@ -0,0 +1,144 @@ +package chat + +import ( + "context" + "github.com/openimsdk/chat/pkg/common/db/table/chat" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/pagination" + "github.com/openimsdk/tools/errs" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" +) + +func NewCredential(db *mongo.Database) (chat.CredentialInterface, error) { + coll := db.Collection("credential") + _, err := coll.Indexes().CreateMany(context.Background(), []mongo.IndexModel{ + { + Keys: bson.D{ + {Key: "user_id", Value: 1}, + {Key: "type", Value: 1}, + }, + Options: options.Index().SetUnique(true), + }, + { + Keys: bson.D{ + {Key: "account", Value: 1}, + }, + Options: options.Index().SetUnique(true), + }, + }) + if err != nil { + return nil, errs.Wrap(err) + } + return &Credential{coll: coll}, nil +} + +type Credential struct { + coll *mongo.Collection +} + +func (o *Credential) Create(ctx context.Context, credential ...*chat.Credential) error { + return mongoutil.InsertMany(ctx, o.coll, credential) +} + +func (o *Credential) CreateOrUpdateAccount(ctx context.Context, credential *chat.Credential) error { + return mongoutil.UpdateOne(ctx, o.coll, bson.M{ + "user_id": credential.UserID, + "type": credential.Type, + }, bson.M{ + "$set": bson.M{ + "account": credential.Account, + }, + "$setOnInsert": bson.M{ + "user_id": credential.UserID, + "type": credential.Type, + "allow_change": credential.AllowChange, + }, + }, false, options.Update().SetUpsert(true)) +} + +func (o *Credential) Update(ctx context.Context, userID string, data map[string]any) error { + if len(data) == 0 { + return nil + } + return mongoutil.UpdateOne(ctx, o.coll, bson.M{"user_id": userID}, bson.M{"$set": data}, false) +} + +func (o *Credential) Find(ctx context.Context, userID string) ([]*chat.Credential, error) { + return mongoutil.Find[*chat.Credential](ctx, o.coll, bson.M{"user_id": userID}) +} + +func (o *Credential) FindAccount(ctx context.Context, accounts []string) ([]*chat.Credential, error) { + return mongoutil.Find[*chat.Credential](ctx, o.coll, bson.M{"account": bson.M{"$in": accounts}}) +} + +func (o *Credential) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*chat.Credential, error) { + return o.SearchUser(ctx, keyword, nil, pagination) +} + +func (o *Credential) TakeAccount(ctx context.Context, account string) (*chat.Credential, error) { + return mongoutil.FindOne[*chat.Credential](ctx, o.coll, bson.M{"account": account}) +} + +func (o *Credential) Take(ctx context.Context, userID string) (*chat.Credential, error) { + return mongoutil.FindOne[*chat.Credential](ctx, o.coll, bson.M{"user_id": userID}) +} + +func (o *Credential) SearchNormalUser(ctx context.Context, keyword string, forbiddenIDs []string, pagination pagination.Pagination) (int64, []*chat.Credential, error) { + filter := bson.M{} + + if len(forbiddenIDs) > 0 { + filter["user_id"] = bson.M{ + "$nin": forbiddenIDs, + } + } + if keyword != "" { + filter["$or"] = []bson.M{ + {"user_id": bson.M{"$regex": keyword, "$options": "i"}}, + {"account": bson.M{"$regex": keyword, "$options": "i"}}, + } + } + return mongoutil.FindPage[*chat.Credential](ctx, o.coll, filter, pagination) +} + +func (o *Credential) SearchUser(ctx context.Context, keyword string, userIDs []string, pagination pagination.Pagination) (int64, []*chat.Credential, error) { + filter := bson.M{} + + if len(userIDs) > 0 { + filter["user_id"] = bson.M{ + "$in": userIDs, + } + } + if keyword != "" { + filter["$or"] = []bson.M{ + {"user_id": bson.M{"$regex": keyword, "$options": "i"}}, + {"account": bson.M{"$regex": keyword, "$options": "i"}}, + } + } + return mongoutil.FindPage[*chat.Credential](ctx, o.coll, filter, pagination) +} + +func (o *Credential) Delete(ctx context.Context, userIDs []string) error { + if len(userIDs) == 0 { + return nil + } + return mongoutil.DeleteMany(ctx, o.coll, bson.M{"user_id": bson.M{"$in": userIDs}}) +} + +func (o *Credential) DeleteByUserIDType(ctx context.Context, credentials ...*chat.Credential) error { + if len(credentials) == 0 { + return nil + } + var filters []bson.M + for _, credential := range credentials { + filters = append(filters, bson.M{ + "user_id": credential.UserID, + "type": credential.Type, + }) + } + + query := bson.M{"$or": filters} + + return mongoutil.DeleteMany(ctx, o.coll, query) +} diff --git a/pkg/common/db/table/admin/application.go b/pkg/common/db/table/admin/application.go new file mode 100644 index 000000000..44333fa3a --- /dev/null +++ b/pkg/common/db/table/admin/application.go @@ -0,0 +1,29 @@ +package admin + +import ( + "context" + "github.com/openimsdk/tools/db/pagination" + "go.mongodb.org/mongo-driver/bson/primitive" + "time" +) + +type Application struct { + ID primitive.ObjectID `bson:"_id"` + Platform string `bson:"platform"` + Hot bool `bson:"hot"` + Version string `bson:"version"` + Url string `bson:"url"` + Text string `bson:"text"` + Force bool `bson:"force"` + Latest bool `bson:"latest"` + CreateTime time.Time `bson:"create_time"` +} + +type ApplicationInterface interface { + LatestVersion(ctx context.Context, platform string) (*Application, error) + AddVersion(ctx context.Context, val *Application) error + UpdateVersion(ctx context.Context, id primitive.ObjectID, update map[string]any) error + DeleteVersion(ctx context.Context, id []primitive.ObjectID) error + PageVersion(ctx context.Context, platforms []string, page pagination.Pagination) (int64, []*Application, error) + FindPlatform(ctx context.Context, id []primitive.ObjectID) ([]string, error) +} diff --git a/pkg/common/db/table/chat/attribute.go b/pkg/common/db/table/chat/attribute.go index d77f06176..4e033ba16 100644 --- a/pkg/common/db/table/chat/attribute.go +++ b/pkg/common/db/table/chat/attribute.go @@ -1,17 +1,3 @@ -// Copyright © 2023 OpenIM open source community. All rights reserved. -// -// 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. - package chat import ( diff --git a/pkg/common/db/table/chat/credential.go b/pkg/common/db/table/chat/credential.go new file mode 100644 index 000000000..e4d23d6c8 --- /dev/null +++ b/pkg/common/db/table/chat/credential.go @@ -0,0 +1,32 @@ +package chat + +import ( + "context" + "github.com/openimsdk/tools/db/pagination" +) + +type Credential struct { + UserID string `bson:"user_id"` + Account string `bson:"account"` + Type int `bson:"type"` // 1:phone;2:email + AllowChange bool `bson:"allow_change"` +} + +func (Credential) TableName() string { + return "credentials" +} + +type CredentialInterface interface { + Create(ctx context.Context, credential ...*Credential) error + CreateOrUpdateAccount(ctx context.Context, credential *Credential) error + Update(ctx context.Context, userID string, data map[string]any) error + Find(ctx context.Context, userID string) ([]*Credential, error) + FindAccount(ctx context.Context, accounts []string) ([]*Credential, error) + Search(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*Credential, error) + TakeAccount(ctx context.Context, account string) (*Credential, error) + Take(ctx context.Context, userID string) (*Credential, error) + SearchNormalUser(ctx context.Context, keyword string, forbiddenID []string, pagination pagination.Pagination) (int64, []*Credential, error) + SearchUser(ctx context.Context, keyword string, userIDs []string, pagination pagination.Pagination) (int64, []*Credential, error) + Delete(ctx context.Context, userIDs []string) error + DeleteByUserIDType(ctx context.Context, credentials ...*Credential) error +} diff --git a/pkg/common/imapi/caller.go b/pkg/common/imapi/caller.go index 0a3923cb2..3ebee9213 100644 --- a/pkg/common/imapi/caller.go +++ b/pkg/common/imapi/caller.go @@ -1,27 +1,12 @@ -// Copyright © 2023 OpenIM open source community. All rights reserved. -// -// 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. - package imapi import ( "context" + "github.com/openimsdk/tools/log" "sync" "time" "github.com/openimsdk/chat/pkg/eerrs" - "github.com/openimsdk/tools/log" - "github.com/openimsdk/protocol/auth" "github.com/openimsdk/protocol/constant" constantpb "github.com/openimsdk/protocol/constant" @@ -35,7 +20,7 @@ type CallerInterface interface { ImAdminTokenWithDefaultAdmin(ctx context.Context) (string, error) ImportFriend(ctx context.Context, ownerUserID string, friendUserID []string) error GetUserToken(ctx context.Context, userID string, platform int32) (string, error) - GetAdminToken(ctx context.Context, userID string) (string, error) + GetAdminTokenCache(ctx context.Context, userID string) (string, error) InviteToGroup(ctx context.Context, userID string, groupIDs []string) error UpdateUserInfo(ctx context.Context, userID string, nickName string, faceURL string) error ForceOffLine(ctx context.Context, userID string) error @@ -46,13 +31,17 @@ type CallerInterface interface { AccountCheckSingle(ctx context.Context, userID string) (bool, error) } +type authToken struct { + token string + timeout time.Time +} + type Caller struct { imApi string imSecret string defaultIMUserID string - token string - timeout time.Time - lock sync.Mutex + tokenCache map[string]*authToken + lock sync.RWMutex } func New(imApi string, imSecret string, defaultIMUserID string) CallerInterface { @@ -60,6 +49,8 @@ func New(imApi string, imSecret string, defaultIMUserID string) CallerInterface imApi: imApi, imSecret: imSecret, defaultIMUserID: defaultIMUserID, + tokenCache: make(map[string]*authToken), + lock: sync.RWMutex{}, } } @@ -75,23 +66,32 @@ func (c *Caller) ImportFriend(ctx context.Context, ownerUserID string, friendUse } func (c *Caller) ImAdminTokenWithDefaultAdmin(ctx context.Context) (string, error) { - c.lock.Lock() - defer c.lock.Unlock() - if c.token == "" || c.timeout.Before(time.Now()) { - userID := c.defaultIMUserID - token, err := c.GetAdminToken(ctx, userID) - if err != nil { - log.ZError(ctx, "get im admin token", err, "userID", userID) - return "", err + return c.GetAdminTokenCache(ctx, c.defaultIMUserID) +} + +func (c *Caller) GetAdminTokenCache(ctx context.Context, userID string) (string, error) { + c.lock.RLock() + t, ok := c.tokenCache[userID] + c.lock.RUnlock() + if !ok || t.timeout.Before(time.Now()) { + c.lock.Lock() + t, ok = c.tokenCache[userID] + if !ok || t.timeout.Before(time.Now()) { + token, err := c.getAdminTokenServer(ctx, userID) + if err != nil { + log.ZError(ctx, "get im admin token", err, "userID", userID) + return "", err + } + log.ZDebug(ctx, "get im admin token", "userID", userID) + t = &authToken{token: token, timeout: time.Now().Add(time.Minute * 5)} + c.tokenCache[userID] = t } - log.ZDebug(ctx, "get im admin token", "userID", userID) - c.token = token - c.timeout = time.Now().Add(time.Minute * 5) + c.lock.Unlock() } - return c.token, nil + return t.token, nil } -func (c *Caller) GetAdminToken(ctx context.Context, userID string) (string, error) { +func (c *Caller) getAdminTokenServer(ctx context.Context, userID string) (string, error) { resp, err := getAdminToken.Call(ctx, c.imApi, &auth.GetAdminTokenReq{ Secret: c.imSecret, UserID: userID, diff --git a/pkg/common/tokenverify/token_verify.go b/pkg/common/tokenverify/token_verify.go index 59521873f..f53cd5aee 100644 --- a/pkg/common/tokenverify/token_verify.go +++ b/pkg/common/tokenverify/token_verify.go @@ -109,22 +109,7 @@ func (t *Token) GetToken(token string) (string, int32, error) { return userID, userType, nil } -func (t *Token) GetExpire(token string) time.Time { - val, err := jwt.ParseWithClaims(token, &claims{}, t.secret()) - if err != nil { - return time.Time{} - } - c, ok := val.Claims.(*claims) - if !ok { - return time.Time{} - } - if c.ExpiresAt == nil { - return time.Time{} - } - return c.ExpiresAt.Time -} - -//func (t *Token) GetAdminToken(token string) (string, error) { +//func (t *Token) GetAdminTokenCache(token string) (string, error) { // userID, userType, err := getToken(token) // if err != nil { // return "", err diff --git a/pkg/email/mail_test.go b/pkg/email/mail_test.go index c6824510a..0f9ebe348 100644 --- a/pkg/email/mail_test.go +++ b/pkg/email/mail_test.go @@ -1,77 +1,51 @@ -// Copyright © 2023 OpenIM open source community. All rights reserved. -// -// 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. - package email -import ( - "context" - "errors" - "fmt" - "io/ioutil" - "os" - "testing" - - "github.com/openimsdk/chat/pkg/common/config" - "gopkg.in/yaml.v3" -) - -func TestEmail(T *testing.T) { - if err := InitConfig(); err != nil { - fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err) - os.Exit(-1) - } - tests := []struct { - name string - ctx context.Context - mail string - code string - want error - }{ - { - name: "success send email", - ctx: context.Background(), - mail: "test@gmail.com", - code: "5555", - want: errors.New("nil"), - }, - { - name: "fail send email", - ctx: context.Background(), - mail: "", - code: "5555", - want: errors.New("dial tcp :0: connectex: The requested address is not valid in its context."), - }, - } - mail := NewMail() - - for _, tt := range tests { - T.Run(tt.name, func(t *testing.T) { - if got := mail.SendMail(tt.ctx, tt.mail, tt.code); errors.Is(got, tt.want) { - t.Errorf("%v have a err,%v", tt.name, tt.want) - } - }) - } -} - -func InitConfig() error { - yam, err := ioutil.ReadFile("../../config/config.yaml") - if err != nil { - return err - } - err = yaml.Unmarshal(yam, &config.Config) - if err != nil { - return err - } - return nil -} +//func TestEmail(T *testing.T) { +// if err := InitConfig(); err != nil { +// fmt.Fprintf(os.Stderr, "\n\nexit -1: \n%+v\n\n", err) +// os.Exit(-1) +// } +// tests := []struct { +// name string +// ctx context.Context +// mail string +// code string +// want error +// }{ +// { +// name: "success send email", +// ctx: context.Background(), +// mail: "test@gmail.com", +// code: "5555", +// want: errors.New("nil"), +// }, +// { +// name: "fail send email", +// ctx: context.Background(), +// mail: "", +// code: "5555", +// want: errors.New("dial tcp :0: connectex: The requested address is not valid in its context."), +// }, +// } +// mail := NewMail() +// +// for _, tt := range tests { +// T.Run(tt.name, func(t *testing.T) { +// if got := mail.SendMail(tt.ctx, tt.mail, tt.code); errors.Is(got, tt.want) { +// t.Errorf("%v have a err,%v", tt.name, tt.want) +// } +// }) +// } +//} +// +//func InitConfig() error { +// yam, err := ioutil.ReadFile("../../config/config.yaml") +// if err != nil { +// return err +// } +// err = yaml.Unmarshal(yam, &config.Config) +// if err != nil { +// return err +// } +// return nil +//} diff --git a/pkg/protocol/admin/admin.pb.go b/pkg/protocol/admin/admin.pb.go index 9b8161e14..309326fbe 100644 --- a/pkg/protocol/admin/admin.pb.go +++ b/pkg/protocol/admin/admin.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v5.27.1 +// protoc v5.26.0 // source: admin/admin.proto package admin @@ -5398,6 +5398,688 @@ func (x *GetUserTokenResp) GetTokensMap() map[string]int32 { return nil } +type ApplicationVersion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` + Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version"` + Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url"` + Text string `protobuf:"bytes,5,opt,name=text,proto3" json:"text"` + Force bool `protobuf:"varint,6,opt,name=force,proto3" json:"force"` + Latest bool `protobuf:"varint,7,opt,name=latest,proto3" json:"latest"` + Hot bool `protobuf:"varint,8,opt,name=hot,proto3" json:"hot"` + CreateTime int64 `protobuf:"varint,9,opt,name=createTime,proto3" json:"createTime"` +} + +func (x *ApplicationVersion) Reset() { + *x = ApplicationVersion{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[103] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplicationVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplicationVersion) ProtoMessage() {} + +func (x *ApplicationVersion) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[103] + 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 ApplicationVersion.ProtoReflect.Descriptor instead. +func (*ApplicationVersion) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{103} +} + +func (x *ApplicationVersion) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ApplicationVersion) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *ApplicationVersion) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ApplicationVersion) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *ApplicationVersion) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *ApplicationVersion) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +func (x *ApplicationVersion) GetLatest() bool { + if x != nil { + return x.Latest + } + return false +} + +func (x *ApplicationVersion) GetHot() bool { + if x != nil { + return x.Hot + } + return false +} + +func (x *ApplicationVersion) GetCreateTime() int64 { + if x != nil { + return x.CreateTime + } + return 0 +} + +type LatestApplicationVersionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version"` +} + +func (x *LatestApplicationVersionReq) Reset() { + *x = LatestApplicationVersionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[104] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LatestApplicationVersionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LatestApplicationVersionReq) ProtoMessage() {} + +func (x *LatestApplicationVersionReq) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[104] + 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 LatestApplicationVersionReq.ProtoReflect.Descriptor instead. +func (*LatestApplicationVersionReq) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{104} +} + +func (x *LatestApplicationVersionReq) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *LatestApplicationVersionReq) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type LatestApplicationVersionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version *ApplicationVersion `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` +} + +func (x *LatestApplicationVersionResp) Reset() { + *x = LatestApplicationVersionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[105] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LatestApplicationVersionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LatestApplicationVersionResp) ProtoMessage() {} + +func (x *LatestApplicationVersionResp) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[105] + 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 LatestApplicationVersionResp.ProtoReflect.Descriptor instead. +func (*LatestApplicationVersionResp) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{105} +} + +func (x *LatestApplicationVersionResp) GetVersion() *ApplicationVersion { + if x != nil { + return x.Version + } + return nil +} + +type AddApplicationVersionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version"` + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url"` + Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text"` + Force bool `protobuf:"varint,5,opt,name=force,proto3" json:"force"` + Latest bool `protobuf:"varint,6,opt,name=latest,proto3" json:"latest"` + Hot bool `protobuf:"varint,7,opt,name=hot,proto3" json:"hot"` +} + +func (x *AddApplicationVersionReq) Reset() { + *x = AddApplicationVersionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[106] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddApplicationVersionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddApplicationVersionReq) ProtoMessage() {} + +func (x *AddApplicationVersionReq) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[106] + 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 AddApplicationVersionReq.ProtoReflect.Descriptor instead. +func (*AddApplicationVersionReq) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{106} +} + +func (x *AddApplicationVersionReq) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *AddApplicationVersionReq) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *AddApplicationVersionReq) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +func (x *AddApplicationVersionReq) GetText() string { + if x != nil { + return x.Text + } + return "" +} + +func (x *AddApplicationVersionReq) GetForce() bool { + if x != nil { + return x.Force + } + return false +} + +func (x *AddApplicationVersionReq) GetLatest() bool { + if x != nil { + return x.Latest + } + return false +} + +func (x *AddApplicationVersionReq) GetHot() bool { + if x != nil { + return x.Hot + } + return false +} + +type AddApplicationVersionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AddApplicationVersionResp) Reset() { + *x = AddApplicationVersionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[107] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddApplicationVersionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddApplicationVersionResp) ProtoMessage() {} + +func (x *AddApplicationVersionResp) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[107] + 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 AddApplicationVersionResp.ProtoReflect.Descriptor instead. +func (*AddApplicationVersionResp) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{107} +} + +type UpdateApplicationVersionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` + Platform *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform"` + Version *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=version,proto3" json:"version"` + Url *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=url,proto3" json:"url"` + Text *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=text,proto3" json:"text"` + Force *wrapperspb.BoolValue `protobuf:"bytes,6,opt,name=force,proto3" json:"force"` + Latest *wrapperspb.BoolValue `protobuf:"bytes,7,opt,name=latest,proto3" json:"latest"` + Hot *wrapperspb.BoolValue `protobuf:"bytes,8,opt,name=hot,proto3" json:"hot"` +} + +func (x *UpdateApplicationVersionReq) Reset() { + *x = UpdateApplicationVersionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[108] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateApplicationVersionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateApplicationVersionReq) ProtoMessage() {} + +func (x *UpdateApplicationVersionReq) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[108] + 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 UpdateApplicationVersionReq.ProtoReflect.Descriptor instead. +func (*UpdateApplicationVersionReq) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{108} +} + +func (x *UpdateApplicationVersionReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *UpdateApplicationVersionReq) GetPlatform() *wrapperspb.StringValue { + if x != nil { + return x.Platform + } + return nil +} + +func (x *UpdateApplicationVersionReq) GetVersion() *wrapperspb.StringValue { + if x != nil { + return x.Version + } + return nil +} + +func (x *UpdateApplicationVersionReq) GetUrl() *wrapperspb.StringValue { + if x != nil { + return x.Url + } + return nil +} + +func (x *UpdateApplicationVersionReq) GetText() *wrapperspb.StringValue { + if x != nil { + return x.Text + } + return nil +} + +func (x *UpdateApplicationVersionReq) GetForce() *wrapperspb.BoolValue { + if x != nil { + return x.Force + } + return nil +} + +func (x *UpdateApplicationVersionReq) GetLatest() *wrapperspb.BoolValue { + if x != nil { + return x.Latest + } + return nil +} + +func (x *UpdateApplicationVersionReq) GetHot() *wrapperspb.BoolValue { + if x != nil { + return x.Hot + } + return nil +} + +type UpdateApplicationVersionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateApplicationVersionResp) Reset() { + *x = UpdateApplicationVersionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[109] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateApplicationVersionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateApplicationVersionResp) ProtoMessage() {} + +func (x *UpdateApplicationVersionResp) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[109] + 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 UpdateApplicationVersionResp.ProtoReflect.Descriptor instead. +func (*UpdateApplicationVersionResp) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{109} +} + +type DeleteApplicationVersionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id []string `protobuf:"bytes,1,rep,name=id,proto3" json:"id"` +} + +func (x *DeleteApplicationVersionReq) Reset() { + *x = DeleteApplicationVersionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[110] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteApplicationVersionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteApplicationVersionReq) ProtoMessage() {} + +func (x *DeleteApplicationVersionReq) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[110] + 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 DeleteApplicationVersionReq.ProtoReflect.Descriptor instead. +func (*DeleteApplicationVersionReq) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{110} +} + +func (x *DeleteApplicationVersionReq) GetId() []string { + if x != nil { + return x.Id + } + return nil +} + +type DeleteApplicationVersionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteApplicationVersionResp) Reset() { + *x = DeleteApplicationVersionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[111] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteApplicationVersionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteApplicationVersionResp) ProtoMessage() {} + +func (x *DeleteApplicationVersionResp) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[111] + 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 DeleteApplicationVersionResp.ProtoReflect.Descriptor instead. +func (*DeleteApplicationVersionResp) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{111} +} + +type PageApplicationVersionReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Platform []string `protobuf:"bytes,1,rep,name=platform,proto3" json:"platform"` + Pagination *sdkws.RequestPagination `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination"` +} + +func (x *PageApplicationVersionReq) Reset() { + *x = PageApplicationVersionReq{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[112] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PageApplicationVersionReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PageApplicationVersionReq) ProtoMessage() {} + +func (x *PageApplicationVersionReq) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[112] + 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 PageApplicationVersionReq.ProtoReflect.Descriptor instead. +func (*PageApplicationVersionReq) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{112} +} + +func (x *PageApplicationVersionReq) GetPlatform() []string { + if x != nil { + return x.Platform + } + return nil +} + +func (x *PageApplicationVersionReq) GetPagination() *sdkws.RequestPagination { + if x != nil { + return x.Pagination + } + return nil +} + +type PageApplicationVersionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` + Versions []*ApplicationVersion `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions"` +} + +func (x *PageApplicationVersionResp) Reset() { + *x = PageApplicationVersionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_admin_admin_proto_msgTypes[113] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PageApplicationVersionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PageApplicationVersionResp) ProtoMessage() {} + +func (x *PageApplicationVersionResp) ProtoReflect() protoreflect.Message { + mi := &file_admin_admin_proto_msgTypes[113] + 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 PageApplicationVersionResp.ProtoReflect.Descriptor instead. +func (*PageApplicationVersionResp) Descriptor() ([]byte, []int) { + return file_admin_admin_proto_rawDescGZIP(), []int{113} +} + +func (x *PageApplicationVersionResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *PageApplicationVersionResp) GetVersions() []*ApplicationVersion { + if x != nil { + return x.Versions + } + return nil +} + var File_admin_admin_proto protoreflect.FileDescriptor var file_admin_admin_proto_rawDesc = []byte{ @@ -5925,270 +6607,391 @@ var file_admin_admin_proto_rawDesc = []byte{ 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, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x32, 0xbe, 0x20, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x38, 0x0a, 0x05, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x53, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, - 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x41, 0x64, - 0x6d, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, - 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, - 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x43, 0x68, 0x61, + 0x01, 0x22, 0xe0, 0x01, 0x0a, 0x12, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x03, 0x68, 0x6f, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x1b, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x1c, 0x4c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xb6, 0x01, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, + 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, + 0x6f, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, + 0x68, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x68, 0x6f, 0x74, 0x22, 0x1b, + 0x0a, 0x19, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x95, 0x03, 0x0a, 0x1b, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x08, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x70, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x36, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, + 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x30, 0x0a, + 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, + 0x30, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, + 0x65, 0x12, 0x32, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x6c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x03, 0x68, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, + 0x68, 0x6f, 0x74, 0x22, 0x1e, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x2d, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x78, 0x0a, 0x19, 0x50, 0x61, 0x67, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x3f, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x70, 0x0a, 0x1a, + 0x50, 0x61, 0x67, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x12, 0x3c, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xee, + 0x24, 0x0a, 0x05, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x38, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x12, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x53, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x41, 0x64, 0x6d, 0x69, 0x6e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x4d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, + 0x65, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1e, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, + 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, + 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x24, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x12, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, - 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, - 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, - 0x0f, 0x44, 0x65, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x44, 0x65, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, - 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, - 0x1a, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x6f, 0x70, 0x65, + 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x44, 0x65, + 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, + 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, + 0x65, 0x6c, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x64, + 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, - 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x59, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, + 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x12, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, - 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, - 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x53, 0x65, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x46, 0x69, 0x6e, + 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x22, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x24, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x12, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, - 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, - 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x12, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x12, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, - 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, + 0x64, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x41, 0x64, - 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, - 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x49, - 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, - 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x47, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, - 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, - 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x41, + 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x20, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, + 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, + 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x41, 0x64, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x44, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, 0x46, + 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, + 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, + 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x49, 0x6e, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x49, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, + 0x41, 0x64, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, - 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x65, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x76, - 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, - 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x24, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x44, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, + 0x6e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x24, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x73, 0x65, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x73, 0x65, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x65, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, + 0x26, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x12, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x24, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, + 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x12, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, - 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x5c, 0x0a, 0x11, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x6e, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, - 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, - 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, - 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x53, 0x0a, - 0x0e, 0x41, 0x64, 0x64, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, - 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, - 0x64, 0x64, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, - 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x41, 0x64, 0x64, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x53, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x6e, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, - 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, - 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x22, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x44, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, 0x0b, 0x55, 0x6e, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, - 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, - 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, - 0x64, 0x64, 0x65, 0x6e, 0x12, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, - 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x24, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, - 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, 0x6f, - 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, 0x0b, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, - 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x73, 0x65, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, - 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x44, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1a, 0x2e, + 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x50, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x6e, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x50, 0x46, 0x6f, 0x72, + 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x53, 0x0a, 0x0e, 0x41, 0x64, + 0x64, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x1f, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x49, + 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, - 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, - 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, - 0x6c, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, - 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, - 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0c, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x47, 0x0a, 0x0a, 0x46, - 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, - 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x53, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x6e, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, + 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x49, 0x50, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x59, 0x0a, 0x10, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x22, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x44, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, 0x0b, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x55, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5c, 0x0a, 0x11, 0x46, 0x69, 0x6e, + 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, + 0x6e, 0x12, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, + 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x62, 0x0a, 0x13, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x24, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, + 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x46, 0x6f, 0x72, 0x62, 0x69, + 0x64, 0x64, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x47, 0x0a, 0x0a, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, + 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x50, + 0x61, 0x72, 0x73, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, + 0x09, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, + 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x09, 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, + 0x12, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x44, 0x65, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x41, + 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0c, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, + 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, + 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x47, 0x0a, 0x0a, 0x46, 0x69, 0x6e, 0x64, + 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, - 0x70, 0x6c, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, - 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x53, - 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, - 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, - 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, - 0x53, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, - 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, - 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0c, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x49, 0x6e, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x6e, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, - 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, - 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x61, 0x64, 0x6d, - 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x4d, 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, + 0x74, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x56, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x53, 0x65, 0x74, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x56, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x49, 0x6e, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x71, 0x0a, 0x18, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x2a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x68, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x71, 0x0a, 0x18, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, + 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x1a, 0x2a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, + 0x69, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x71, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x2a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x6b, 0x0a, 0x16, 0x50, 0x61, 0x67, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x65, + 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x61, + 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, + 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6203,266 +7006,298 @@ func file_admin_admin_proto_rawDescGZIP() []byte { return file_admin_admin_proto_rawDescData } -var file_admin_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 106) +var file_admin_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 117) var file_admin_admin_proto_goTypes = []interface{}{ - (*LoginReq)(nil), // 0: openim.admin.LoginReq - (*LoginResp)(nil), // 1: openim.admin.LoginResp - (*AddAdminAccountReq)(nil), // 2: openim.admin.AddAdminAccountReq - (*AddAdminAccountResp)(nil), // 3: openim.admin.AddAdminAccountResp - (*AdminUpdateInfoReq)(nil), // 4: openim.admin.AdminUpdateInfoReq - (*AdminUpdateInfoResp)(nil), // 5: openim.admin.AdminUpdateInfoResp - (*ChangePasswordReq)(nil), // 6: openim.admin.ChangePasswordReq - (*ChangePasswordResp)(nil), // 7: openim.admin.ChangePasswordResp - (*GetAdminInfoReq)(nil), // 8: openim.admin.GetAdminInfoReq - (*ChangeAdminPasswordReq)(nil), // 9: openim.admin.ChangeAdminPasswordReq - (*ChangeAdminPasswordResp)(nil), // 10: openim.admin.ChangeAdminPasswordResp - (*DelAdminAccountReq)(nil), // 11: openim.admin.DelAdminAccountReq - (*DelAdminAccountResp)(nil), // 12: openim.admin.DelAdminAccountResp - (*SearchAdminAccountReq)(nil), // 13: openim.admin.SearchAdminAccountReq - (*SearchAdminAccountResp)(nil), // 14: openim.admin.SearchAdminAccountResp - (*GetAdminInfoResp)(nil), // 15: openim.admin.GetAdminInfoResp - (*AddDefaultFriendReq)(nil), // 16: openim.admin.AddDefaultFriendReq - (*AddDefaultFriendResp)(nil), // 17: openim.admin.AddDefaultFriendResp - (*DelDefaultFriendReq)(nil), // 18: openim.admin.DelDefaultFriendReq - (*DelDefaultFriendResp)(nil), // 19: openim.admin.DelDefaultFriendResp - (*FindDefaultFriendReq)(nil), // 20: openim.admin.FindDefaultFriendReq - (*FindDefaultFriendResp)(nil), // 21: openim.admin.FindDefaultFriendResp - (*SearchDefaultFriendReq)(nil), // 22: openim.admin.SearchDefaultFriendReq - (*DefaultFriendAttribute)(nil), // 23: openim.admin.DefaultFriendAttribute - (*SearchDefaultFriendResp)(nil), // 24: openim.admin.SearchDefaultFriendResp - (*AddDefaultGroupReq)(nil), // 25: openim.admin.AddDefaultGroupReq - (*AddDefaultGroupResp)(nil), // 26: openim.admin.AddDefaultGroupResp - (*DelDefaultGroupReq)(nil), // 27: openim.admin.DelDefaultGroupReq - (*DelDefaultGroupResp)(nil), // 28: openim.admin.DelDefaultGroupResp - (*FindDefaultGroupReq)(nil), // 29: openim.admin.FindDefaultGroupReq - (*FindDefaultGroupResp)(nil), // 30: openim.admin.FindDefaultGroupResp - (*SearchDefaultGroupReq)(nil), // 31: openim.admin.SearchDefaultGroupReq - (*GroupAttribute)(nil), // 32: openim.admin.GroupAttribute - (*SearchDefaultGroupResp)(nil), // 33: openim.admin.SearchDefaultGroupResp - (*AddInvitationCodeReq)(nil), // 34: openim.admin.AddInvitationCodeReq - (*AddInvitationCodeResp)(nil), // 35: openim.admin.AddInvitationCodeResp - (*GenInvitationCodeReq)(nil), // 36: openim.admin.GenInvitationCodeReq - (*GenInvitationCodeResp)(nil), // 37: openim.admin.GenInvitationCodeResp - (*FindInvitationCodeReq)(nil), // 38: openim.admin.FindInvitationCodeReq - (*FindInvitationCodeResp)(nil), // 39: openim.admin.FindInvitationCodeResp - (*UseInvitationCodeReq)(nil), // 40: openim.admin.UseInvitationCodeReq - (*UseInvitationCodeResp)(nil), // 41: openim.admin.UseInvitationCodeResp - (*DelInvitationCodeReq)(nil), // 42: openim.admin.DelInvitationCodeReq - (*DelInvitationCodeResp)(nil), // 43: openim.admin.DelInvitationCodeResp - (*InvitationRegister)(nil), // 44: openim.admin.InvitationRegister - (*SearchInvitationCodeReq)(nil), // 45: openim.admin.SearchInvitationCodeReq - (*SearchInvitationCodeResp)(nil), // 46: openim.admin.SearchInvitationCodeResp - (*SearchUserIPLimitLoginReq)(nil), // 47: openim.admin.SearchUserIPLimitLoginReq - (*LimitUserLoginIP)(nil), // 48: openim.admin.LimitUserLoginIP - (*SearchUserIPLimitLoginResp)(nil), // 49: openim.admin.SearchUserIPLimitLoginResp - (*UserIPLimitLogin)(nil), // 50: openim.admin.UserIPLimitLogin - (*AddUserIPLimitLoginReq)(nil), // 51: openim.admin.AddUserIPLimitLoginReq - (*AddUserIPLimitLoginResp)(nil), // 52: openim.admin.AddUserIPLimitLoginResp - (*DelUserIPLimitLoginReq)(nil), // 53: openim.admin.DelUserIPLimitLoginReq - (*DelUserIPLimitLoginResp)(nil), // 54: openim.admin.DelUserIPLimitLoginResp - (*IPForbidden)(nil), // 55: openim.admin.IPForbidden - (*IPForbiddenAdd)(nil), // 56: openim.admin.IPForbiddenAdd - (*SearchIPForbiddenReq)(nil), // 57: openim.admin.SearchIPForbiddenReq - (*SearchIPForbiddenResp)(nil), // 58: openim.admin.SearchIPForbiddenResp - (*AddIPForbiddenReq)(nil), // 59: openim.admin.AddIPForbiddenReq - (*AddIPForbiddenResp)(nil), // 60: openim.admin.AddIPForbiddenResp - (*DelIPForbiddenReq)(nil), // 61: openim.admin.DelIPForbiddenReq - (*DelIPForbiddenResp)(nil), // 62: openim.admin.DelIPForbiddenResp - (*CheckRegisterForbiddenReq)(nil), // 63: openim.admin.CheckRegisterForbiddenReq - (*CheckRegisterForbiddenResp)(nil), // 64: openim.admin.CheckRegisterForbiddenResp - (*CheckLoginForbiddenReq)(nil), // 65: openim.admin.CheckLoginForbiddenReq - (*CheckLoginForbiddenResp)(nil), // 66: openim.admin.CheckLoginForbiddenResp - (*CancellationUserReq)(nil), // 67: openim.admin.CancellationUserReq - (*CancellationUserResp)(nil), // 68: openim.admin.CancellationUserResp - (*BlockUserReq)(nil), // 69: openim.admin.BlockUserReq - (*BlockUserResp)(nil), // 70: openim.admin.BlockUserResp - (*UnblockUserReq)(nil), // 71: openim.admin.UnblockUserReq - (*UnblockUserResp)(nil), // 72: openim.admin.UnblockUserResp - (*SearchBlockUserReq)(nil), // 73: openim.admin.SearchBlockUserReq - (*BlockUserInfo)(nil), // 74: openim.admin.BlockUserInfo - (*SearchBlockUserResp)(nil), // 75: openim.admin.SearchBlockUserResp - (*FindUserBlockInfoReq)(nil), // 76: openim.admin.FindUserBlockInfoReq - (*BlockInfo)(nil), // 77: openim.admin.BlockInfo - (*FindUserBlockInfoResp)(nil), // 78: openim.admin.FindUserBlockInfoResp - (*CreateTokenReq)(nil), // 79: openim.admin.CreateTokenReq - (*CreateTokenResp)(nil), // 80: openim.admin.CreateTokenResp - (*ParseTokenReq)(nil), // 81: openim.admin.ParseTokenReq - (*ParseTokenResp)(nil), // 82: openim.admin.ParseTokenResp - (*InvalidateTokenReq)(nil), // 83: openim.admin.InvalidateTokenReq - (*InvalidateTokenResp)(nil), // 84: openim.admin.InvalidateTokenResp - (*AddAppletReq)(nil), // 85: openim.admin.AddAppletReq - (*AddAppletResp)(nil), // 86: openim.admin.AddAppletResp - (*DelAppletReq)(nil), // 87: openim.admin.DelAppletReq - (*DelAppletResp)(nil), // 88: openim.admin.DelAppletResp - (*UpdateAppletReq)(nil), // 89: openim.admin.UpdateAppletReq - (*UpdateAppletResp)(nil), // 90: openim.admin.UpdateAppletResp - (*FindAppletReq)(nil), // 91: openim.admin.FindAppletReq - (*FindAppletResp)(nil), // 92: openim.admin.FindAppletResp - (*SearchAppletReq)(nil), // 93: openim.admin.SearchAppletReq - (*SearchAppletResp)(nil), // 94: openim.admin.SearchAppletResp - (*SetClientConfigReq)(nil), // 95: openim.admin.SetClientConfigReq - (*SetClientConfigResp)(nil), // 96: openim.admin.SetClientConfigResp - (*DelClientConfigReq)(nil), // 97: openim.admin.DelClientConfigReq - (*DelClientConfigResp)(nil), // 98: openim.admin.DelClientConfigResp - (*GetClientConfigReq)(nil), // 99: openim.admin.GetClientConfigReq - (*GetClientConfigResp)(nil), // 100: openim.admin.GetClientConfigResp - (*GetUserTokenReq)(nil), // 101: openim.admin.GetUserTokenReq - (*GetUserTokenResp)(nil), // 102: openim.admin.GetUserTokenResp - nil, // 103: openim.admin.SetClientConfigReq.ConfigEntry - nil, // 104: openim.admin.GetClientConfigResp.ConfigEntry - nil, // 105: openim.admin.GetUserTokenResp.TokensMapEntry - (*wrapperspb.StringValue)(nil), // 106: openim.protobuf.StringValue - (*wrapperspb.Int32Value)(nil), // 107: openim.protobuf.Int32Value - (*sdkws.RequestPagination)(nil), // 108: openim.sdkws.RequestPagination - (*common.UserPublicInfo)(nil), // 109: openim.chat.common.UserPublicInfo - (*sdkws.GroupInfo)(nil), // 110: openim.sdkws.GroupInfo - (*wrapperspb.Int64Value)(nil), // 111: openim.protobuf.Int64Value - (*wrapperspb.UInt32Value)(nil), // 112: openim.protobuf.UInt32Value - (*common.AppletInfo)(nil), // 113: openim.chat.common.AppletInfo + (*LoginReq)(nil), // 0: openim.admin.LoginReq + (*LoginResp)(nil), // 1: openim.admin.LoginResp + (*AddAdminAccountReq)(nil), // 2: openim.admin.AddAdminAccountReq + (*AddAdminAccountResp)(nil), // 3: openim.admin.AddAdminAccountResp + (*AdminUpdateInfoReq)(nil), // 4: openim.admin.AdminUpdateInfoReq + (*AdminUpdateInfoResp)(nil), // 5: openim.admin.AdminUpdateInfoResp + (*ChangePasswordReq)(nil), // 6: openim.admin.ChangePasswordReq + (*ChangePasswordResp)(nil), // 7: openim.admin.ChangePasswordResp + (*GetAdminInfoReq)(nil), // 8: openim.admin.GetAdminInfoReq + (*ChangeAdminPasswordReq)(nil), // 9: openim.admin.ChangeAdminPasswordReq + (*ChangeAdminPasswordResp)(nil), // 10: openim.admin.ChangeAdminPasswordResp + (*DelAdminAccountReq)(nil), // 11: openim.admin.DelAdminAccountReq + (*DelAdminAccountResp)(nil), // 12: openim.admin.DelAdminAccountResp + (*SearchAdminAccountReq)(nil), // 13: openim.admin.SearchAdminAccountReq + (*SearchAdminAccountResp)(nil), // 14: openim.admin.SearchAdminAccountResp + (*GetAdminInfoResp)(nil), // 15: openim.admin.GetAdminInfoResp + (*AddDefaultFriendReq)(nil), // 16: openim.admin.AddDefaultFriendReq + (*AddDefaultFriendResp)(nil), // 17: openim.admin.AddDefaultFriendResp + (*DelDefaultFriendReq)(nil), // 18: openim.admin.DelDefaultFriendReq + (*DelDefaultFriendResp)(nil), // 19: openim.admin.DelDefaultFriendResp + (*FindDefaultFriendReq)(nil), // 20: openim.admin.FindDefaultFriendReq + (*FindDefaultFriendResp)(nil), // 21: openim.admin.FindDefaultFriendResp + (*SearchDefaultFriendReq)(nil), // 22: openim.admin.SearchDefaultFriendReq + (*DefaultFriendAttribute)(nil), // 23: openim.admin.DefaultFriendAttribute + (*SearchDefaultFriendResp)(nil), // 24: openim.admin.SearchDefaultFriendResp + (*AddDefaultGroupReq)(nil), // 25: openim.admin.AddDefaultGroupReq + (*AddDefaultGroupResp)(nil), // 26: openim.admin.AddDefaultGroupResp + (*DelDefaultGroupReq)(nil), // 27: openim.admin.DelDefaultGroupReq + (*DelDefaultGroupResp)(nil), // 28: openim.admin.DelDefaultGroupResp + (*FindDefaultGroupReq)(nil), // 29: openim.admin.FindDefaultGroupReq + (*FindDefaultGroupResp)(nil), // 30: openim.admin.FindDefaultGroupResp + (*SearchDefaultGroupReq)(nil), // 31: openim.admin.SearchDefaultGroupReq + (*GroupAttribute)(nil), // 32: openim.admin.GroupAttribute + (*SearchDefaultGroupResp)(nil), // 33: openim.admin.SearchDefaultGroupResp + (*AddInvitationCodeReq)(nil), // 34: openim.admin.AddInvitationCodeReq + (*AddInvitationCodeResp)(nil), // 35: openim.admin.AddInvitationCodeResp + (*GenInvitationCodeReq)(nil), // 36: openim.admin.GenInvitationCodeReq + (*GenInvitationCodeResp)(nil), // 37: openim.admin.GenInvitationCodeResp + (*FindInvitationCodeReq)(nil), // 38: openim.admin.FindInvitationCodeReq + (*FindInvitationCodeResp)(nil), // 39: openim.admin.FindInvitationCodeResp + (*UseInvitationCodeReq)(nil), // 40: openim.admin.UseInvitationCodeReq + (*UseInvitationCodeResp)(nil), // 41: openim.admin.UseInvitationCodeResp + (*DelInvitationCodeReq)(nil), // 42: openim.admin.DelInvitationCodeReq + (*DelInvitationCodeResp)(nil), // 43: openim.admin.DelInvitationCodeResp + (*InvitationRegister)(nil), // 44: openim.admin.InvitationRegister + (*SearchInvitationCodeReq)(nil), // 45: openim.admin.SearchInvitationCodeReq + (*SearchInvitationCodeResp)(nil), // 46: openim.admin.SearchInvitationCodeResp + (*SearchUserIPLimitLoginReq)(nil), // 47: openim.admin.SearchUserIPLimitLoginReq + (*LimitUserLoginIP)(nil), // 48: openim.admin.LimitUserLoginIP + (*SearchUserIPLimitLoginResp)(nil), // 49: openim.admin.SearchUserIPLimitLoginResp + (*UserIPLimitLogin)(nil), // 50: openim.admin.UserIPLimitLogin + (*AddUserIPLimitLoginReq)(nil), // 51: openim.admin.AddUserIPLimitLoginReq + (*AddUserIPLimitLoginResp)(nil), // 52: openim.admin.AddUserIPLimitLoginResp + (*DelUserIPLimitLoginReq)(nil), // 53: openim.admin.DelUserIPLimitLoginReq + (*DelUserIPLimitLoginResp)(nil), // 54: openim.admin.DelUserIPLimitLoginResp + (*IPForbidden)(nil), // 55: openim.admin.IPForbidden + (*IPForbiddenAdd)(nil), // 56: openim.admin.IPForbiddenAdd + (*SearchIPForbiddenReq)(nil), // 57: openim.admin.SearchIPForbiddenReq + (*SearchIPForbiddenResp)(nil), // 58: openim.admin.SearchIPForbiddenResp + (*AddIPForbiddenReq)(nil), // 59: openim.admin.AddIPForbiddenReq + (*AddIPForbiddenResp)(nil), // 60: openim.admin.AddIPForbiddenResp + (*DelIPForbiddenReq)(nil), // 61: openim.admin.DelIPForbiddenReq + (*DelIPForbiddenResp)(nil), // 62: openim.admin.DelIPForbiddenResp + (*CheckRegisterForbiddenReq)(nil), // 63: openim.admin.CheckRegisterForbiddenReq + (*CheckRegisterForbiddenResp)(nil), // 64: openim.admin.CheckRegisterForbiddenResp + (*CheckLoginForbiddenReq)(nil), // 65: openim.admin.CheckLoginForbiddenReq + (*CheckLoginForbiddenResp)(nil), // 66: openim.admin.CheckLoginForbiddenResp + (*CancellationUserReq)(nil), // 67: openim.admin.CancellationUserReq + (*CancellationUserResp)(nil), // 68: openim.admin.CancellationUserResp + (*BlockUserReq)(nil), // 69: openim.admin.BlockUserReq + (*BlockUserResp)(nil), // 70: openim.admin.BlockUserResp + (*UnblockUserReq)(nil), // 71: openim.admin.UnblockUserReq + (*UnblockUserResp)(nil), // 72: openim.admin.UnblockUserResp + (*SearchBlockUserReq)(nil), // 73: openim.admin.SearchBlockUserReq + (*BlockUserInfo)(nil), // 74: openim.admin.BlockUserInfo + (*SearchBlockUserResp)(nil), // 75: openim.admin.SearchBlockUserResp + (*FindUserBlockInfoReq)(nil), // 76: openim.admin.FindUserBlockInfoReq + (*BlockInfo)(nil), // 77: openim.admin.BlockInfo + (*FindUserBlockInfoResp)(nil), // 78: openim.admin.FindUserBlockInfoResp + (*CreateTokenReq)(nil), // 79: openim.admin.CreateTokenReq + (*CreateTokenResp)(nil), // 80: openim.admin.CreateTokenResp + (*ParseTokenReq)(nil), // 81: openim.admin.ParseTokenReq + (*ParseTokenResp)(nil), // 82: openim.admin.ParseTokenResp + (*InvalidateTokenReq)(nil), // 83: openim.admin.InvalidateTokenReq + (*InvalidateTokenResp)(nil), // 84: openim.admin.InvalidateTokenResp + (*AddAppletReq)(nil), // 85: openim.admin.AddAppletReq + (*AddAppletResp)(nil), // 86: openim.admin.AddAppletResp + (*DelAppletReq)(nil), // 87: openim.admin.DelAppletReq + (*DelAppletResp)(nil), // 88: openim.admin.DelAppletResp + (*UpdateAppletReq)(nil), // 89: openim.admin.UpdateAppletReq + (*UpdateAppletResp)(nil), // 90: openim.admin.UpdateAppletResp + (*FindAppletReq)(nil), // 91: openim.admin.FindAppletReq + (*FindAppletResp)(nil), // 92: openim.admin.FindAppletResp + (*SearchAppletReq)(nil), // 93: openim.admin.SearchAppletReq + (*SearchAppletResp)(nil), // 94: openim.admin.SearchAppletResp + (*SetClientConfigReq)(nil), // 95: openim.admin.SetClientConfigReq + (*SetClientConfigResp)(nil), // 96: openim.admin.SetClientConfigResp + (*DelClientConfigReq)(nil), // 97: openim.admin.DelClientConfigReq + (*DelClientConfigResp)(nil), // 98: openim.admin.DelClientConfigResp + (*GetClientConfigReq)(nil), // 99: openim.admin.GetClientConfigReq + (*GetClientConfigResp)(nil), // 100: openim.admin.GetClientConfigResp + (*GetUserTokenReq)(nil), // 101: openim.admin.GetUserTokenReq + (*GetUserTokenResp)(nil), // 102: openim.admin.GetUserTokenResp + (*ApplicationVersion)(nil), // 103: openim.admin.ApplicationVersion + (*LatestApplicationVersionReq)(nil), // 104: openim.admin.LatestApplicationVersionReq + (*LatestApplicationVersionResp)(nil), // 105: openim.admin.LatestApplicationVersionResp + (*AddApplicationVersionReq)(nil), // 106: openim.admin.AddApplicationVersionReq + (*AddApplicationVersionResp)(nil), // 107: openim.admin.AddApplicationVersionResp + (*UpdateApplicationVersionReq)(nil), // 108: openim.admin.UpdateApplicationVersionReq + (*UpdateApplicationVersionResp)(nil), // 109: openim.admin.UpdateApplicationVersionResp + (*DeleteApplicationVersionReq)(nil), // 110: openim.admin.DeleteApplicationVersionReq + (*DeleteApplicationVersionResp)(nil), // 111: openim.admin.DeleteApplicationVersionResp + (*PageApplicationVersionReq)(nil), // 112: openim.admin.PageApplicationVersionReq + (*PageApplicationVersionResp)(nil), // 113: openim.admin.PageApplicationVersionResp + nil, // 114: openim.admin.SetClientConfigReq.ConfigEntry + nil, // 115: openim.admin.GetClientConfigResp.ConfigEntry + nil, // 116: openim.admin.GetUserTokenResp.TokensMapEntry + (*wrapperspb.StringValue)(nil), // 117: openim.protobuf.StringValue + (*wrapperspb.Int32Value)(nil), // 118: openim.protobuf.Int32Value + (*sdkws.RequestPagination)(nil), // 119: openim.sdkws.RequestPagination + (*common.UserPublicInfo)(nil), // 120: openim.chat.common.UserPublicInfo + (*sdkws.GroupInfo)(nil), // 121: openim.sdkws.GroupInfo + (*wrapperspb.Int64Value)(nil), // 122: openim.protobuf.Int64Value + (*wrapperspb.UInt32Value)(nil), // 123: openim.protobuf.UInt32Value + (*common.AppletInfo)(nil), // 124: openim.chat.common.AppletInfo + (*wrapperspb.BoolValue)(nil), // 125: openim.protobuf.BoolValue } var file_admin_admin_proto_depIdxs = []int32{ - 106, // 0: openim.admin.AdminUpdateInfoReq.account:type_name -> openim.protobuf.StringValue - 106, // 1: openim.admin.AdminUpdateInfoReq.password:type_name -> openim.protobuf.StringValue - 106, // 2: openim.admin.AdminUpdateInfoReq.faceURL:type_name -> openim.protobuf.StringValue - 106, // 3: openim.admin.AdminUpdateInfoReq.nickname:type_name -> openim.protobuf.StringValue - 107, // 4: openim.admin.AdminUpdateInfoReq.level:type_name -> openim.protobuf.Int32Value - 108, // 5: openim.admin.SearchAdminAccountReq.pagination:type_name -> openim.sdkws.RequestPagination + 117, // 0: openim.admin.AdminUpdateInfoReq.account:type_name -> openim.protobuf.StringValue + 117, // 1: openim.admin.AdminUpdateInfoReq.password:type_name -> openim.protobuf.StringValue + 117, // 2: openim.admin.AdminUpdateInfoReq.faceURL:type_name -> openim.protobuf.StringValue + 117, // 3: openim.admin.AdminUpdateInfoReq.nickname:type_name -> openim.protobuf.StringValue + 118, // 4: openim.admin.AdminUpdateInfoReq.level:type_name -> openim.protobuf.Int32Value + 119, // 5: openim.admin.SearchAdminAccountReq.pagination:type_name -> openim.sdkws.RequestPagination 15, // 6: openim.admin.SearchAdminAccountResp.adminAccounts:type_name -> openim.admin.GetAdminInfoResp - 108, // 7: openim.admin.SearchDefaultFriendReq.pagination:type_name -> openim.sdkws.RequestPagination - 109, // 8: openim.admin.DefaultFriendAttribute.user:type_name -> openim.chat.common.UserPublicInfo + 119, // 7: openim.admin.SearchDefaultFriendReq.pagination:type_name -> openim.sdkws.RequestPagination + 120, // 8: openim.admin.DefaultFriendAttribute.user:type_name -> openim.chat.common.UserPublicInfo 23, // 9: openim.admin.SearchDefaultFriendResp.users:type_name -> openim.admin.DefaultFriendAttribute - 108, // 10: openim.admin.SearchDefaultGroupReq.pagination:type_name -> openim.sdkws.RequestPagination - 110, // 11: openim.admin.GroupAttribute.group:type_name -> openim.sdkws.GroupInfo + 119, // 10: openim.admin.SearchDefaultGroupReq.pagination:type_name -> openim.sdkws.RequestPagination + 121, // 11: openim.admin.GroupAttribute.group:type_name -> openim.sdkws.GroupInfo 44, // 12: openim.admin.FindInvitationCodeResp.codes:type_name -> openim.admin.InvitationRegister - 109, // 13: openim.admin.InvitationRegister.usedUser:type_name -> openim.chat.common.UserPublicInfo - 108, // 14: openim.admin.SearchInvitationCodeReq.pagination:type_name -> openim.sdkws.RequestPagination + 120, // 13: openim.admin.InvitationRegister.usedUser:type_name -> openim.chat.common.UserPublicInfo + 119, // 14: openim.admin.SearchInvitationCodeReq.pagination:type_name -> openim.sdkws.RequestPagination 44, // 15: openim.admin.SearchInvitationCodeResp.list:type_name -> openim.admin.InvitationRegister - 108, // 16: openim.admin.SearchUserIPLimitLoginReq.pagination:type_name -> openim.sdkws.RequestPagination - 109, // 17: openim.admin.LimitUserLoginIP.user:type_name -> openim.chat.common.UserPublicInfo + 119, // 16: openim.admin.SearchUserIPLimitLoginReq.pagination:type_name -> openim.sdkws.RequestPagination + 120, // 17: openim.admin.LimitUserLoginIP.user:type_name -> openim.chat.common.UserPublicInfo 48, // 18: openim.admin.SearchUserIPLimitLoginResp.limits:type_name -> openim.admin.LimitUserLoginIP 50, // 19: openim.admin.AddUserIPLimitLoginReq.limits:type_name -> openim.admin.UserIPLimitLogin 50, // 20: openim.admin.DelUserIPLimitLoginReq.limits:type_name -> openim.admin.UserIPLimitLogin - 108, // 21: openim.admin.SearchIPForbiddenReq.pagination:type_name -> openim.sdkws.RequestPagination + 119, // 21: openim.admin.SearchIPForbiddenReq.pagination:type_name -> openim.sdkws.RequestPagination 55, // 22: openim.admin.SearchIPForbiddenResp.forbiddens:type_name -> openim.admin.IPForbidden 56, // 23: openim.admin.AddIPForbiddenReq.forbiddens:type_name -> openim.admin.IPForbiddenAdd - 108, // 24: openim.admin.SearchBlockUserReq.pagination:type_name -> openim.sdkws.RequestPagination + 119, // 24: openim.admin.SearchBlockUserReq.pagination:type_name -> openim.sdkws.RequestPagination 74, // 25: openim.admin.SearchBlockUserResp.users:type_name -> openim.admin.BlockUserInfo 77, // 26: openim.admin.FindUserBlockInfoResp.blocks:type_name -> openim.admin.BlockInfo - 106, // 27: openim.admin.UpdateAppletReq.name:type_name -> openim.protobuf.StringValue - 106, // 28: openim.admin.UpdateAppletReq.appID:type_name -> openim.protobuf.StringValue - 106, // 29: openim.admin.UpdateAppletReq.icon:type_name -> openim.protobuf.StringValue - 106, // 30: openim.admin.UpdateAppletReq.url:type_name -> openim.protobuf.StringValue - 106, // 31: openim.admin.UpdateAppletReq.md5:type_name -> openim.protobuf.StringValue - 111, // 32: openim.admin.UpdateAppletReq.size:type_name -> openim.protobuf.Int64Value - 106, // 33: openim.admin.UpdateAppletReq.version:type_name -> openim.protobuf.StringValue - 112, // 34: openim.admin.UpdateAppletReq.priority:type_name -> openim.protobuf.UInt32Value - 112, // 35: openim.admin.UpdateAppletReq.status:type_name -> openim.protobuf.UInt32Value - 111, // 36: openim.admin.UpdateAppletReq.createTime:type_name -> openim.protobuf.Int64Value - 113, // 37: openim.admin.FindAppletResp.applets:type_name -> openim.chat.common.AppletInfo - 108, // 38: openim.admin.SearchAppletReq.pagination:type_name -> openim.sdkws.RequestPagination - 113, // 39: openim.admin.SearchAppletResp.applets:type_name -> openim.chat.common.AppletInfo - 103, // 40: openim.admin.SetClientConfigReq.config:type_name -> openim.admin.SetClientConfigReq.ConfigEntry - 104, // 41: openim.admin.GetClientConfigResp.config:type_name -> openim.admin.GetClientConfigResp.ConfigEntry - 105, // 42: openim.admin.GetUserTokenResp.tokensMap:type_name -> openim.admin.GetUserTokenResp.TokensMapEntry - 0, // 43: openim.admin.admin.Login:input_type -> openim.admin.LoginReq - 6, // 44: openim.admin.admin.ChangePassword:input_type -> openim.admin.ChangePasswordReq - 4, // 45: openim.admin.admin.AdminUpdateInfo:input_type -> openim.admin.AdminUpdateInfoReq - 8, // 46: openim.admin.admin.GetAdminInfo:input_type -> openim.admin.GetAdminInfoReq - 2, // 47: openim.admin.admin.AddAdminAccount:input_type -> openim.admin.AddAdminAccountReq - 9, // 48: openim.admin.admin.ChangeAdminPassword:input_type -> openim.admin.ChangeAdminPasswordReq - 11, // 49: openim.admin.admin.DelAdminAccount:input_type -> openim.admin.DelAdminAccountReq - 13, // 50: openim.admin.admin.SearchAdminAccount:input_type -> openim.admin.SearchAdminAccountReq - 16, // 51: openim.admin.admin.AddDefaultFriend:input_type -> openim.admin.AddDefaultFriendReq - 18, // 52: openim.admin.admin.DelDefaultFriend:input_type -> openim.admin.DelDefaultFriendReq - 20, // 53: openim.admin.admin.FindDefaultFriend:input_type -> openim.admin.FindDefaultFriendReq - 22, // 54: openim.admin.admin.SearchDefaultFriend:input_type -> openim.admin.SearchDefaultFriendReq - 25, // 55: openim.admin.admin.AddDefaultGroup:input_type -> openim.admin.AddDefaultGroupReq - 27, // 56: openim.admin.admin.DelDefaultGroup:input_type -> openim.admin.DelDefaultGroupReq - 29, // 57: openim.admin.admin.FindDefaultGroup:input_type -> openim.admin.FindDefaultGroupReq - 31, // 58: openim.admin.admin.SearchDefaultGroup:input_type -> openim.admin.SearchDefaultGroupReq - 34, // 59: openim.admin.admin.AddInvitationCode:input_type -> openim.admin.AddInvitationCodeReq - 36, // 60: openim.admin.admin.GenInvitationCode:input_type -> openim.admin.GenInvitationCodeReq - 38, // 61: openim.admin.admin.FindInvitationCode:input_type -> openim.admin.FindInvitationCodeReq - 40, // 62: openim.admin.admin.UseInvitationCode:input_type -> openim.admin.UseInvitationCodeReq - 42, // 63: openim.admin.admin.DelInvitationCode:input_type -> openim.admin.DelInvitationCodeReq - 45, // 64: openim.admin.admin.SearchInvitationCode:input_type -> openim.admin.SearchInvitationCodeReq - 47, // 65: openim.admin.admin.SearchUserIPLimitLogin:input_type -> openim.admin.SearchUserIPLimitLoginReq - 51, // 66: openim.admin.admin.AddUserIPLimitLogin:input_type -> openim.admin.AddUserIPLimitLoginReq - 53, // 67: openim.admin.admin.DelUserIPLimitLogin:input_type -> openim.admin.DelUserIPLimitLoginReq - 57, // 68: openim.admin.admin.SearchIPForbidden:input_type -> openim.admin.SearchIPForbiddenReq - 59, // 69: openim.admin.admin.AddIPForbidden:input_type -> openim.admin.AddIPForbiddenReq - 61, // 70: openim.admin.admin.DelIPForbidden:input_type -> openim.admin.DelIPForbiddenReq - 67, // 71: openim.admin.admin.CancellationUser:input_type -> openim.admin.CancellationUserReq - 69, // 72: openim.admin.admin.BlockUser:input_type -> openim.admin.BlockUserReq - 71, // 73: openim.admin.admin.UnblockUser:input_type -> openim.admin.UnblockUserReq - 73, // 74: openim.admin.admin.SearchBlockUser:input_type -> openim.admin.SearchBlockUserReq - 76, // 75: openim.admin.admin.FindUserBlockInfo:input_type -> openim.admin.FindUserBlockInfoReq - 63, // 76: openim.admin.admin.CheckRegisterForbidden:input_type -> openim.admin.CheckRegisterForbiddenReq - 65, // 77: openim.admin.admin.CheckLoginForbidden:input_type -> openim.admin.CheckLoginForbiddenReq - 79, // 78: openim.admin.admin.CreateToken:input_type -> openim.admin.CreateTokenReq - 81, // 79: openim.admin.admin.ParseToken:input_type -> openim.admin.ParseTokenReq - 85, // 80: openim.admin.admin.AddApplet:input_type -> openim.admin.AddAppletReq - 87, // 81: openim.admin.admin.DelApplet:input_type -> openim.admin.DelAppletReq - 89, // 82: openim.admin.admin.UpdateApplet:input_type -> openim.admin.UpdateAppletReq - 91, // 83: openim.admin.admin.FindApplet:input_type -> openim.admin.FindAppletReq - 93, // 84: openim.admin.admin.SearchApplet:input_type -> openim.admin.SearchAppletReq - 99, // 85: openim.admin.admin.GetClientConfig:input_type -> openim.admin.GetClientConfigReq - 95, // 86: openim.admin.admin.SetClientConfig:input_type -> openim.admin.SetClientConfigReq - 97, // 87: openim.admin.admin.DelClientConfig:input_type -> openim.admin.DelClientConfigReq - 101, // 88: openim.admin.admin.GetUserToken:input_type -> openim.admin.GetUserTokenReq - 83, // 89: openim.admin.admin.InvalidateToken:input_type -> openim.admin.InvalidateTokenReq - 1, // 90: openim.admin.admin.Login:output_type -> openim.admin.LoginResp - 7, // 91: openim.admin.admin.ChangePassword:output_type -> openim.admin.ChangePasswordResp - 5, // 92: openim.admin.admin.AdminUpdateInfo:output_type -> openim.admin.AdminUpdateInfoResp - 15, // 93: openim.admin.admin.GetAdminInfo:output_type -> openim.admin.GetAdminInfoResp - 3, // 94: openim.admin.admin.AddAdminAccount:output_type -> openim.admin.AddAdminAccountResp - 10, // 95: openim.admin.admin.ChangeAdminPassword:output_type -> openim.admin.ChangeAdminPasswordResp - 12, // 96: openim.admin.admin.DelAdminAccount:output_type -> openim.admin.DelAdminAccountResp - 14, // 97: openim.admin.admin.SearchAdminAccount:output_type -> openim.admin.SearchAdminAccountResp - 17, // 98: openim.admin.admin.AddDefaultFriend:output_type -> openim.admin.AddDefaultFriendResp - 19, // 99: openim.admin.admin.DelDefaultFriend:output_type -> openim.admin.DelDefaultFriendResp - 21, // 100: openim.admin.admin.FindDefaultFriend:output_type -> openim.admin.FindDefaultFriendResp - 24, // 101: openim.admin.admin.SearchDefaultFriend:output_type -> openim.admin.SearchDefaultFriendResp - 26, // 102: openim.admin.admin.AddDefaultGroup:output_type -> openim.admin.AddDefaultGroupResp - 28, // 103: openim.admin.admin.DelDefaultGroup:output_type -> openim.admin.DelDefaultGroupResp - 30, // 104: openim.admin.admin.FindDefaultGroup:output_type -> openim.admin.FindDefaultGroupResp - 33, // 105: openim.admin.admin.SearchDefaultGroup:output_type -> openim.admin.SearchDefaultGroupResp - 35, // 106: openim.admin.admin.AddInvitationCode:output_type -> openim.admin.AddInvitationCodeResp - 37, // 107: openim.admin.admin.GenInvitationCode:output_type -> openim.admin.GenInvitationCodeResp - 39, // 108: openim.admin.admin.FindInvitationCode:output_type -> openim.admin.FindInvitationCodeResp - 41, // 109: openim.admin.admin.UseInvitationCode:output_type -> openim.admin.UseInvitationCodeResp - 43, // 110: openim.admin.admin.DelInvitationCode:output_type -> openim.admin.DelInvitationCodeResp - 46, // 111: openim.admin.admin.SearchInvitationCode:output_type -> openim.admin.SearchInvitationCodeResp - 49, // 112: openim.admin.admin.SearchUserIPLimitLogin:output_type -> openim.admin.SearchUserIPLimitLoginResp - 52, // 113: openim.admin.admin.AddUserIPLimitLogin:output_type -> openim.admin.AddUserIPLimitLoginResp - 54, // 114: openim.admin.admin.DelUserIPLimitLogin:output_type -> openim.admin.DelUserIPLimitLoginResp - 58, // 115: openim.admin.admin.SearchIPForbidden:output_type -> openim.admin.SearchIPForbiddenResp - 60, // 116: openim.admin.admin.AddIPForbidden:output_type -> openim.admin.AddIPForbiddenResp - 62, // 117: openim.admin.admin.DelIPForbidden:output_type -> openim.admin.DelIPForbiddenResp - 68, // 118: openim.admin.admin.CancellationUser:output_type -> openim.admin.CancellationUserResp - 70, // 119: openim.admin.admin.BlockUser:output_type -> openim.admin.BlockUserResp - 72, // 120: openim.admin.admin.UnblockUser:output_type -> openim.admin.UnblockUserResp - 75, // 121: openim.admin.admin.SearchBlockUser:output_type -> openim.admin.SearchBlockUserResp - 78, // 122: openim.admin.admin.FindUserBlockInfo:output_type -> openim.admin.FindUserBlockInfoResp - 64, // 123: openim.admin.admin.CheckRegisterForbidden:output_type -> openim.admin.CheckRegisterForbiddenResp - 66, // 124: openim.admin.admin.CheckLoginForbidden:output_type -> openim.admin.CheckLoginForbiddenResp - 80, // 125: openim.admin.admin.CreateToken:output_type -> openim.admin.CreateTokenResp - 82, // 126: openim.admin.admin.ParseToken:output_type -> openim.admin.ParseTokenResp - 86, // 127: openim.admin.admin.AddApplet:output_type -> openim.admin.AddAppletResp - 88, // 128: openim.admin.admin.DelApplet:output_type -> openim.admin.DelAppletResp - 90, // 129: openim.admin.admin.UpdateApplet:output_type -> openim.admin.UpdateAppletResp - 92, // 130: openim.admin.admin.FindApplet:output_type -> openim.admin.FindAppletResp - 94, // 131: openim.admin.admin.SearchApplet:output_type -> openim.admin.SearchAppletResp - 100, // 132: openim.admin.admin.GetClientConfig:output_type -> openim.admin.GetClientConfigResp - 96, // 133: openim.admin.admin.SetClientConfig:output_type -> openim.admin.SetClientConfigResp - 98, // 134: openim.admin.admin.DelClientConfig:output_type -> openim.admin.DelClientConfigResp - 102, // 135: openim.admin.admin.GetUserToken:output_type -> openim.admin.GetUserTokenResp - 84, // 136: openim.admin.admin.InvalidateToken:output_type -> openim.admin.InvalidateTokenResp - 90, // [90:137] is the sub-list for method output_type - 43, // [43:90] is the sub-list for method input_type - 43, // [43:43] is the sub-list for extension type_name - 43, // [43:43] is the sub-list for extension extendee - 0, // [0:43] is the sub-list for field type_name + 117, // 27: openim.admin.UpdateAppletReq.name:type_name -> openim.protobuf.StringValue + 117, // 28: openim.admin.UpdateAppletReq.appID:type_name -> openim.protobuf.StringValue + 117, // 29: openim.admin.UpdateAppletReq.icon:type_name -> openim.protobuf.StringValue + 117, // 30: openim.admin.UpdateAppletReq.url:type_name -> openim.protobuf.StringValue + 117, // 31: openim.admin.UpdateAppletReq.md5:type_name -> openim.protobuf.StringValue + 122, // 32: openim.admin.UpdateAppletReq.size:type_name -> openim.protobuf.Int64Value + 117, // 33: openim.admin.UpdateAppletReq.version:type_name -> openim.protobuf.StringValue + 123, // 34: openim.admin.UpdateAppletReq.priority:type_name -> openim.protobuf.UInt32Value + 123, // 35: openim.admin.UpdateAppletReq.status:type_name -> openim.protobuf.UInt32Value + 122, // 36: openim.admin.UpdateAppletReq.createTime:type_name -> openim.protobuf.Int64Value + 124, // 37: openim.admin.FindAppletResp.applets:type_name -> openim.chat.common.AppletInfo + 119, // 38: openim.admin.SearchAppletReq.pagination:type_name -> openim.sdkws.RequestPagination + 124, // 39: openim.admin.SearchAppletResp.applets:type_name -> openim.chat.common.AppletInfo + 114, // 40: openim.admin.SetClientConfigReq.config:type_name -> openim.admin.SetClientConfigReq.ConfigEntry + 115, // 41: openim.admin.GetClientConfigResp.config:type_name -> openim.admin.GetClientConfigResp.ConfigEntry + 116, // 42: openim.admin.GetUserTokenResp.tokensMap:type_name -> openim.admin.GetUserTokenResp.TokensMapEntry + 103, // 43: openim.admin.LatestApplicationVersionResp.version:type_name -> openim.admin.ApplicationVersion + 117, // 44: openim.admin.UpdateApplicationVersionReq.platform:type_name -> openim.protobuf.StringValue + 117, // 45: openim.admin.UpdateApplicationVersionReq.version:type_name -> openim.protobuf.StringValue + 117, // 46: openim.admin.UpdateApplicationVersionReq.url:type_name -> openim.protobuf.StringValue + 117, // 47: openim.admin.UpdateApplicationVersionReq.text:type_name -> openim.protobuf.StringValue + 125, // 48: openim.admin.UpdateApplicationVersionReq.force:type_name -> openim.protobuf.BoolValue + 125, // 49: openim.admin.UpdateApplicationVersionReq.latest:type_name -> openim.protobuf.BoolValue + 125, // 50: openim.admin.UpdateApplicationVersionReq.hot:type_name -> openim.protobuf.BoolValue + 119, // 51: openim.admin.PageApplicationVersionReq.pagination:type_name -> openim.sdkws.RequestPagination + 103, // 52: openim.admin.PageApplicationVersionResp.versions:type_name -> openim.admin.ApplicationVersion + 0, // 53: openim.admin.admin.Login:input_type -> openim.admin.LoginReq + 6, // 54: openim.admin.admin.ChangePassword:input_type -> openim.admin.ChangePasswordReq + 4, // 55: openim.admin.admin.AdminUpdateInfo:input_type -> openim.admin.AdminUpdateInfoReq + 8, // 56: openim.admin.admin.GetAdminInfo:input_type -> openim.admin.GetAdminInfoReq + 2, // 57: openim.admin.admin.AddAdminAccount:input_type -> openim.admin.AddAdminAccountReq + 9, // 58: openim.admin.admin.ChangeAdminPassword:input_type -> openim.admin.ChangeAdminPasswordReq + 11, // 59: openim.admin.admin.DelAdminAccount:input_type -> openim.admin.DelAdminAccountReq + 13, // 60: openim.admin.admin.SearchAdminAccount:input_type -> openim.admin.SearchAdminAccountReq + 16, // 61: openim.admin.admin.AddDefaultFriend:input_type -> openim.admin.AddDefaultFriendReq + 18, // 62: openim.admin.admin.DelDefaultFriend:input_type -> openim.admin.DelDefaultFriendReq + 20, // 63: openim.admin.admin.FindDefaultFriend:input_type -> openim.admin.FindDefaultFriendReq + 22, // 64: openim.admin.admin.SearchDefaultFriend:input_type -> openim.admin.SearchDefaultFriendReq + 25, // 65: openim.admin.admin.AddDefaultGroup:input_type -> openim.admin.AddDefaultGroupReq + 27, // 66: openim.admin.admin.DelDefaultGroup:input_type -> openim.admin.DelDefaultGroupReq + 29, // 67: openim.admin.admin.FindDefaultGroup:input_type -> openim.admin.FindDefaultGroupReq + 31, // 68: openim.admin.admin.SearchDefaultGroup:input_type -> openim.admin.SearchDefaultGroupReq + 34, // 69: openim.admin.admin.AddInvitationCode:input_type -> openim.admin.AddInvitationCodeReq + 36, // 70: openim.admin.admin.GenInvitationCode:input_type -> openim.admin.GenInvitationCodeReq + 38, // 71: openim.admin.admin.FindInvitationCode:input_type -> openim.admin.FindInvitationCodeReq + 40, // 72: openim.admin.admin.UseInvitationCode:input_type -> openim.admin.UseInvitationCodeReq + 42, // 73: openim.admin.admin.DelInvitationCode:input_type -> openim.admin.DelInvitationCodeReq + 45, // 74: openim.admin.admin.SearchInvitationCode:input_type -> openim.admin.SearchInvitationCodeReq + 47, // 75: openim.admin.admin.SearchUserIPLimitLogin:input_type -> openim.admin.SearchUserIPLimitLoginReq + 51, // 76: openim.admin.admin.AddUserIPLimitLogin:input_type -> openim.admin.AddUserIPLimitLoginReq + 53, // 77: openim.admin.admin.DelUserIPLimitLogin:input_type -> openim.admin.DelUserIPLimitLoginReq + 57, // 78: openim.admin.admin.SearchIPForbidden:input_type -> openim.admin.SearchIPForbiddenReq + 59, // 79: openim.admin.admin.AddIPForbidden:input_type -> openim.admin.AddIPForbiddenReq + 61, // 80: openim.admin.admin.DelIPForbidden:input_type -> openim.admin.DelIPForbiddenReq + 67, // 81: openim.admin.admin.CancellationUser:input_type -> openim.admin.CancellationUserReq + 69, // 82: openim.admin.admin.BlockUser:input_type -> openim.admin.BlockUserReq + 71, // 83: openim.admin.admin.UnblockUser:input_type -> openim.admin.UnblockUserReq + 73, // 84: openim.admin.admin.SearchBlockUser:input_type -> openim.admin.SearchBlockUserReq + 76, // 85: openim.admin.admin.FindUserBlockInfo:input_type -> openim.admin.FindUserBlockInfoReq + 63, // 86: openim.admin.admin.CheckRegisterForbidden:input_type -> openim.admin.CheckRegisterForbiddenReq + 65, // 87: openim.admin.admin.CheckLoginForbidden:input_type -> openim.admin.CheckLoginForbiddenReq + 79, // 88: openim.admin.admin.CreateToken:input_type -> openim.admin.CreateTokenReq + 81, // 89: openim.admin.admin.ParseToken:input_type -> openim.admin.ParseTokenReq + 85, // 90: openim.admin.admin.AddApplet:input_type -> openim.admin.AddAppletReq + 87, // 91: openim.admin.admin.DelApplet:input_type -> openim.admin.DelAppletReq + 89, // 92: openim.admin.admin.UpdateApplet:input_type -> openim.admin.UpdateAppletReq + 91, // 93: openim.admin.admin.FindApplet:input_type -> openim.admin.FindAppletReq + 93, // 94: openim.admin.admin.SearchApplet:input_type -> openim.admin.SearchAppletReq + 99, // 95: openim.admin.admin.GetClientConfig:input_type -> openim.admin.GetClientConfigReq + 95, // 96: openim.admin.admin.SetClientConfig:input_type -> openim.admin.SetClientConfigReq + 97, // 97: openim.admin.admin.DelClientConfig:input_type -> openim.admin.DelClientConfigReq + 101, // 98: openim.admin.admin.GetUserToken:input_type -> openim.admin.GetUserTokenReq + 83, // 99: openim.admin.admin.InvalidateToken:input_type -> openim.admin.InvalidateTokenReq + 104, // 100: openim.admin.admin.LatestApplicationVersion:input_type -> openim.admin.LatestApplicationVersionReq + 106, // 101: openim.admin.admin.AddApplicationVersion:input_type -> openim.admin.AddApplicationVersionReq + 108, // 102: openim.admin.admin.UpdateApplicationVersion:input_type -> openim.admin.UpdateApplicationVersionReq + 110, // 103: openim.admin.admin.DeleteApplicationVersion:input_type -> openim.admin.DeleteApplicationVersionReq + 112, // 104: openim.admin.admin.PageApplicationVersion:input_type -> openim.admin.PageApplicationVersionReq + 1, // 105: openim.admin.admin.Login:output_type -> openim.admin.LoginResp + 7, // 106: openim.admin.admin.ChangePassword:output_type -> openim.admin.ChangePasswordResp + 5, // 107: openim.admin.admin.AdminUpdateInfo:output_type -> openim.admin.AdminUpdateInfoResp + 15, // 108: openim.admin.admin.GetAdminInfo:output_type -> openim.admin.GetAdminInfoResp + 3, // 109: openim.admin.admin.AddAdminAccount:output_type -> openim.admin.AddAdminAccountResp + 10, // 110: openim.admin.admin.ChangeAdminPassword:output_type -> openim.admin.ChangeAdminPasswordResp + 12, // 111: openim.admin.admin.DelAdminAccount:output_type -> openim.admin.DelAdminAccountResp + 14, // 112: openim.admin.admin.SearchAdminAccount:output_type -> openim.admin.SearchAdminAccountResp + 17, // 113: openim.admin.admin.AddDefaultFriend:output_type -> openim.admin.AddDefaultFriendResp + 19, // 114: openim.admin.admin.DelDefaultFriend:output_type -> openim.admin.DelDefaultFriendResp + 21, // 115: openim.admin.admin.FindDefaultFriend:output_type -> openim.admin.FindDefaultFriendResp + 24, // 116: openim.admin.admin.SearchDefaultFriend:output_type -> openim.admin.SearchDefaultFriendResp + 26, // 117: openim.admin.admin.AddDefaultGroup:output_type -> openim.admin.AddDefaultGroupResp + 28, // 118: openim.admin.admin.DelDefaultGroup:output_type -> openim.admin.DelDefaultGroupResp + 30, // 119: openim.admin.admin.FindDefaultGroup:output_type -> openim.admin.FindDefaultGroupResp + 33, // 120: openim.admin.admin.SearchDefaultGroup:output_type -> openim.admin.SearchDefaultGroupResp + 35, // 121: openim.admin.admin.AddInvitationCode:output_type -> openim.admin.AddInvitationCodeResp + 37, // 122: openim.admin.admin.GenInvitationCode:output_type -> openim.admin.GenInvitationCodeResp + 39, // 123: openim.admin.admin.FindInvitationCode:output_type -> openim.admin.FindInvitationCodeResp + 41, // 124: openim.admin.admin.UseInvitationCode:output_type -> openim.admin.UseInvitationCodeResp + 43, // 125: openim.admin.admin.DelInvitationCode:output_type -> openim.admin.DelInvitationCodeResp + 46, // 126: openim.admin.admin.SearchInvitationCode:output_type -> openim.admin.SearchInvitationCodeResp + 49, // 127: openim.admin.admin.SearchUserIPLimitLogin:output_type -> openim.admin.SearchUserIPLimitLoginResp + 52, // 128: openim.admin.admin.AddUserIPLimitLogin:output_type -> openim.admin.AddUserIPLimitLoginResp + 54, // 129: openim.admin.admin.DelUserIPLimitLogin:output_type -> openim.admin.DelUserIPLimitLoginResp + 58, // 130: openim.admin.admin.SearchIPForbidden:output_type -> openim.admin.SearchIPForbiddenResp + 60, // 131: openim.admin.admin.AddIPForbidden:output_type -> openim.admin.AddIPForbiddenResp + 62, // 132: openim.admin.admin.DelIPForbidden:output_type -> openim.admin.DelIPForbiddenResp + 68, // 133: openim.admin.admin.CancellationUser:output_type -> openim.admin.CancellationUserResp + 70, // 134: openim.admin.admin.BlockUser:output_type -> openim.admin.BlockUserResp + 72, // 135: openim.admin.admin.UnblockUser:output_type -> openim.admin.UnblockUserResp + 75, // 136: openim.admin.admin.SearchBlockUser:output_type -> openim.admin.SearchBlockUserResp + 78, // 137: openim.admin.admin.FindUserBlockInfo:output_type -> openim.admin.FindUserBlockInfoResp + 64, // 138: openim.admin.admin.CheckRegisterForbidden:output_type -> openim.admin.CheckRegisterForbiddenResp + 66, // 139: openim.admin.admin.CheckLoginForbidden:output_type -> openim.admin.CheckLoginForbiddenResp + 80, // 140: openim.admin.admin.CreateToken:output_type -> openim.admin.CreateTokenResp + 82, // 141: openim.admin.admin.ParseToken:output_type -> openim.admin.ParseTokenResp + 86, // 142: openim.admin.admin.AddApplet:output_type -> openim.admin.AddAppletResp + 88, // 143: openim.admin.admin.DelApplet:output_type -> openim.admin.DelAppletResp + 90, // 144: openim.admin.admin.UpdateApplet:output_type -> openim.admin.UpdateAppletResp + 92, // 145: openim.admin.admin.FindApplet:output_type -> openim.admin.FindAppletResp + 94, // 146: openim.admin.admin.SearchApplet:output_type -> openim.admin.SearchAppletResp + 100, // 147: openim.admin.admin.GetClientConfig:output_type -> openim.admin.GetClientConfigResp + 96, // 148: openim.admin.admin.SetClientConfig:output_type -> openim.admin.SetClientConfigResp + 98, // 149: openim.admin.admin.DelClientConfig:output_type -> openim.admin.DelClientConfigResp + 102, // 150: openim.admin.admin.GetUserToken:output_type -> openim.admin.GetUserTokenResp + 84, // 151: openim.admin.admin.InvalidateToken:output_type -> openim.admin.InvalidateTokenResp + 105, // 152: openim.admin.admin.LatestApplicationVersion:output_type -> openim.admin.LatestApplicationVersionResp + 107, // 153: openim.admin.admin.AddApplicationVersion:output_type -> openim.admin.AddApplicationVersionResp + 109, // 154: openim.admin.admin.UpdateApplicationVersion:output_type -> openim.admin.UpdateApplicationVersionResp + 111, // 155: openim.admin.admin.DeleteApplicationVersion:output_type -> openim.admin.DeleteApplicationVersionResp + 113, // 156: openim.admin.admin.PageApplicationVersion:output_type -> openim.admin.PageApplicationVersionResp + 105, // [105:157] is the sub-list for method output_type + 53, // [53:105] is the sub-list for method input_type + 53, // [53:53] is the sub-list for extension type_name + 53, // [53:53] is the sub-list for extension extendee + 0, // [0:53] is the sub-list for field type_name } func init() { file_admin_admin_proto_init() } @@ -7707,6 +8542,138 @@ func file_admin_admin_proto_init() { return nil } } + file_admin_admin_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplicationVersion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LatestApplicationVersionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[105].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LatestApplicationVersionResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[106].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddApplicationVersionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddApplicationVersionResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[108].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateApplicationVersionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[109].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateApplicationVersionResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[110].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteApplicationVersionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[111].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteApplicationVersionResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[112].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PageApplicationVersionReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_admin_admin_proto_msgTypes[113].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PageApplicationVersionResp); 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{ @@ -7714,7 +8681,7 @@ func file_admin_admin_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_admin_admin_proto_rawDesc, NumEnums: 0, - NumMessages: 106, + NumMessages: 117, NumExtensions: 0, NumServices: 1, }, @@ -7799,6 +8766,11 @@ type AdminClient interface { GetUserToken(ctx context.Context, in *GetUserTokenReq, opts ...grpc.CallOption) (*GetUserTokenResp, error) // invalidate token InvalidateToken(ctx context.Context, in *InvalidateTokenReq, opts ...grpc.CallOption) (*InvalidateTokenResp, error) + LatestApplicationVersion(ctx context.Context, in *LatestApplicationVersionReq, opts ...grpc.CallOption) (*LatestApplicationVersionResp, error) + AddApplicationVersion(ctx context.Context, in *AddApplicationVersionReq, opts ...grpc.CallOption) (*AddApplicationVersionResp, error) + UpdateApplicationVersion(ctx context.Context, in *UpdateApplicationVersionReq, opts ...grpc.CallOption) (*UpdateApplicationVersionResp, error) + DeleteApplicationVersion(ctx context.Context, in *DeleteApplicationVersionReq, opts ...grpc.CallOption) (*DeleteApplicationVersionResp, error) + PageApplicationVersion(ctx context.Context, in *PageApplicationVersionReq, opts ...grpc.CallOption) (*PageApplicationVersionResp, error) } type adminClient struct { @@ -8232,6 +9204,51 @@ func (c *adminClient) InvalidateToken(ctx context.Context, in *InvalidateTokenRe return out, nil } +func (c *adminClient) LatestApplicationVersion(ctx context.Context, in *LatestApplicationVersionReq, opts ...grpc.CallOption) (*LatestApplicationVersionResp, error) { + out := new(LatestApplicationVersionResp) + err := c.cc.Invoke(ctx, "/openim.admin.admin/LatestApplicationVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminClient) AddApplicationVersion(ctx context.Context, in *AddApplicationVersionReq, opts ...grpc.CallOption) (*AddApplicationVersionResp, error) { + out := new(AddApplicationVersionResp) + err := c.cc.Invoke(ctx, "/openim.admin.admin/AddApplicationVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminClient) UpdateApplicationVersion(ctx context.Context, in *UpdateApplicationVersionReq, opts ...grpc.CallOption) (*UpdateApplicationVersionResp, error) { + out := new(UpdateApplicationVersionResp) + err := c.cc.Invoke(ctx, "/openim.admin.admin/UpdateApplicationVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminClient) DeleteApplicationVersion(ctx context.Context, in *DeleteApplicationVersionReq, opts ...grpc.CallOption) (*DeleteApplicationVersionResp, error) { + out := new(DeleteApplicationVersionResp) + err := c.cc.Invoke(ctx, "/openim.admin.admin/DeleteApplicationVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *adminClient) PageApplicationVersion(ctx context.Context, in *PageApplicationVersionReq, opts ...grpc.CallOption) (*PageApplicationVersionResp, error) { + out := new(PageApplicationVersionResp) + err := c.cc.Invoke(ctx, "/openim.admin.admin/PageApplicationVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // AdminServer is the server API for Admin service. type AdminServer interface { // Login @@ -8293,6 +9310,11 @@ type AdminServer interface { GetUserToken(context.Context, *GetUserTokenReq) (*GetUserTokenResp, error) // invalidate token InvalidateToken(context.Context, *InvalidateTokenReq) (*InvalidateTokenResp, error) + LatestApplicationVersion(context.Context, *LatestApplicationVersionReq) (*LatestApplicationVersionResp, error) + AddApplicationVersion(context.Context, *AddApplicationVersionReq) (*AddApplicationVersionResp, error) + UpdateApplicationVersion(context.Context, *UpdateApplicationVersionReq) (*UpdateApplicationVersionResp, error) + DeleteApplicationVersion(context.Context, *DeleteApplicationVersionReq) (*DeleteApplicationVersionResp, error) + PageApplicationVersion(context.Context, *PageApplicationVersionReq) (*PageApplicationVersionResp, error) } // UnimplementedAdminServer can be embedded to have forward compatible implementations. @@ -8440,6 +9462,21 @@ func (*UnimplementedAdminServer) GetUserToken(context.Context, *GetUserTokenReq) func (*UnimplementedAdminServer) InvalidateToken(context.Context, *InvalidateTokenReq) (*InvalidateTokenResp, error) { return nil, status.Errorf(codes.Unimplemented, "method InvalidateToken not implemented") } +func (*UnimplementedAdminServer) LatestApplicationVersion(context.Context, *LatestApplicationVersionReq) (*LatestApplicationVersionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method LatestApplicationVersion not implemented") +} +func (*UnimplementedAdminServer) AddApplicationVersion(context.Context, *AddApplicationVersionReq) (*AddApplicationVersionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddApplicationVersion not implemented") +} +func (*UnimplementedAdminServer) UpdateApplicationVersion(context.Context, *UpdateApplicationVersionReq) (*UpdateApplicationVersionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateApplicationVersion not implemented") +} +func (*UnimplementedAdminServer) DeleteApplicationVersion(context.Context, *DeleteApplicationVersionReq) (*DeleteApplicationVersionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteApplicationVersion not implemented") +} +func (*UnimplementedAdminServer) PageApplicationVersion(context.Context, *PageApplicationVersionReq) (*PageApplicationVersionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method PageApplicationVersion not implemented") +} func RegisterAdminServer(s *grpc.Server, srv AdminServer) { s.RegisterService(&_Admin_serviceDesc, srv) @@ -9291,6 +10328,96 @@ func _Admin_InvalidateToken_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Admin_LatestApplicationVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LatestApplicationVersionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).LatestApplicationVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/openim.admin.admin/LatestApplicationVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).LatestApplicationVersion(ctx, req.(*LatestApplicationVersionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Admin_AddApplicationVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddApplicationVersionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).AddApplicationVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/openim.admin.admin/AddApplicationVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).AddApplicationVersion(ctx, req.(*AddApplicationVersionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Admin_UpdateApplicationVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateApplicationVersionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).UpdateApplicationVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/openim.admin.admin/UpdateApplicationVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).UpdateApplicationVersion(ctx, req.(*UpdateApplicationVersionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Admin_DeleteApplicationVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteApplicationVersionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).DeleteApplicationVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/openim.admin.admin/DeleteApplicationVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).DeleteApplicationVersion(ctx, req.(*DeleteApplicationVersionReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Admin_PageApplicationVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PageApplicationVersionReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AdminServer).PageApplicationVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/openim.admin.admin/PageApplicationVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AdminServer).PageApplicationVersion(ctx, req.(*PageApplicationVersionReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Admin_serviceDesc = grpc.ServiceDesc{ ServiceName: "openim.admin.admin", HandlerType: (*AdminServer)(nil), @@ -9483,6 +10610,26 @@ var _Admin_serviceDesc = grpc.ServiceDesc{ MethodName: "InvalidateToken", Handler: _Admin_InvalidateToken_Handler, }, + { + MethodName: "LatestApplicationVersion", + Handler: _Admin_LatestApplicationVersion_Handler, + }, + { + MethodName: "AddApplicationVersion", + Handler: _Admin_AddApplicationVersion_Handler, + }, + { + MethodName: "UpdateApplicationVersion", + Handler: _Admin_UpdateApplicationVersion_Handler, + }, + { + MethodName: "DeleteApplicationVersion", + Handler: _Admin_DeleteApplicationVersion_Handler, + }, + { + MethodName: "PageApplicationVersion", + Handler: _Admin_PageApplicationVersion_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "admin/admin.proto", diff --git a/pkg/protocol/admin/admin.proto b/pkg/protocol/admin/admin.proto index 2c4ee995a..86063aa03 100644 --- a/pkg/protocol/admin/admin.proto +++ b/pkg/protocol/admin/admin.proto @@ -485,6 +485,76 @@ message GetUserTokenResp { map tokensMap = 1; } + +message ApplicationVersion { + string id = 1; + string platform = 2; + string version = 3; + string url = 4; + string text = 5; + bool force = 6; + bool latest = 7; + bool hot = 8; + int64 createTime = 9; +} + +message LatestApplicationVersionReq { + string platform = 2; + string version = 3; +} + +message LatestApplicationVersionResp { + ApplicationVersion version = 1; +} + +message AddApplicationVersionReq { + string platform = 1; + string version = 2; + string url = 3; + string text = 4; + bool force = 5; + bool latest = 6; + bool hot = 7; +} + +message AddApplicationVersionResp { + +} + +message UpdateApplicationVersionReq { + string id = 1; + openim.protobuf.StringValue platform = 2; + openim.protobuf.StringValue version = 3; + openim.protobuf.StringValue url = 4; + openim.protobuf.StringValue text = 5; + openim.protobuf.BoolValue force = 6; + openim.protobuf.BoolValue latest = 7; + openim.protobuf.BoolValue hot = 8; +} + +message UpdateApplicationVersionResp { + +} + +message DeleteApplicationVersionReq { + repeated string id = 1; +} + +message DeleteApplicationVersionResp { + +} + +message PageApplicationVersionReq { + repeated string platform = 1; + openim.sdkws.RequestPagination pagination = 2; +} + +message PageApplicationVersionResp { + int64 total = 1; + repeated ApplicationVersion versions = 2; +} + + service admin { // Login rpc Login(LoginReq) returns (LoginResp); @@ -557,4 +627,10 @@ service admin { // invalidate token rpc InvalidateToken(InvalidateTokenReq) returns (InvalidateTokenResp); + + rpc LatestApplicationVersion(LatestApplicationVersionReq) returns (LatestApplicationVersionResp); + rpc AddApplicationVersion(AddApplicationVersionReq) returns (AddApplicationVersionResp); + rpc UpdateApplicationVersion(UpdateApplicationVersionReq) returns (UpdateApplicationVersionResp); + rpc DeleteApplicationVersion(DeleteApplicationVersionReq) returns (DeleteApplicationVersionResp); + rpc PageApplicationVersion(PageApplicationVersionReq) returns (PageApplicationVersionResp); } diff --git a/pkg/protocol/chat/chat.pb.go b/pkg/protocol/chat/chat.pb.go index 992e9b2e5..b5a68d7ca 100644 --- a/pkg/protocol/chat/chat.pb.go +++ b/pkg/protocol/chat/chat.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v5.27.1 +// protoc v5.26.0 // source: chat/chat.proto package chat @@ -2767,6 +2767,176 @@ func (*DelUserAccountResp) Descriptor() ([]byte, []int) { return file_chat_chat_proto_rawDescGZIP(), []int{42} } +type SetAllowRegisterReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AllowRegister bool `protobuf:"varint,1,opt,name=allowRegister,proto3" json:"allowRegister"` +} + +func (x *SetAllowRegisterReq) Reset() { + *x = SetAllowRegisterReq{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_chat_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetAllowRegisterReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetAllowRegisterReq) ProtoMessage() {} + +func (x *SetAllowRegisterReq) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[43] + 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 SetAllowRegisterReq.ProtoReflect.Descriptor instead. +func (*SetAllowRegisterReq) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{43} +} + +func (x *SetAllowRegisterReq) GetAllowRegister() bool { + if x != nil { + return x.AllowRegister + } + return false +} + +type SetAllowRegisterResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetAllowRegisterResp) Reset() { + *x = SetAllowRegisterResp{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_chat_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetAllowRegisterResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetAllowRegisterResp) ProtoMessage() {} + +func (x *SetAllowRegisterResp) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[44] + 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 SetAllowRegisterResp.ProtoReflect.Descriptor instead. +func (*SetAllowRegisterResp) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{44} +} + +type GetAllowRegisterReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetAllowRegisterReq) Reset() { + *x = GetAllowRegisterReq{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_chat_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAllowRegisterReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllowRegisterReq) ProtoMessage() {} + +func (x *GetAllowRegisterReq) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[45] + 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 GetAllowRegisterReq.ProtoReflect.Descriptor instead. +func (*GetAllowRegisterReq) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{45} +} + +type GetAllowRegisterResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AllowRegister bool `protobuf:"varint,1,opt,name=allowRegister,proto3" json:"allowRegister"` +} + +func (x *GetAllowRegisterResp) Reset() { + *x = GetAllowRegisterResp{} + if protoimpl.UnsafeEnabled { + mi := &file_chat_chat_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAllowRegisterResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAllowRegisterResp) ProtoMessage() {} + +func (x *GetAllowRegisterResp) ProtoReflect() protoreflect.Message { + mi := &file_chat_chat_proto_msgTypes[46] + 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 GetAllowRegisterResp.ProtoReflect.Descriptor instead. +func (*GetAllowRegisterResp) Descriptor() ([]byte, []int) { + return file_chat_chat_proto_rawDescGZIP(), []int{46} +} + +func (x *GetAllowRegisterResp) GetAllowRegister() bool { + if x != nil { + return x.AllowRegister + } + return false +} + var File_chat_chat_proto protoreflect.FileDescriptor var file_chat_chat_proto_rawDesc = []byte{ @@ -3136,117 +3306,138 @@ var file_chat_chat_proto_rawDesc = []byte{ 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x32, 0xa3, 0x0d, 0x0a, 0x04, 0x63, 0x68, 0x61, 0x74, 0x12, 0x51, - 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x63, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, - 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x6f, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x3b, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, + 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x22, 0x16, 0x0a, 0x14, 0x53, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x22, 0x15, 0x0a, 0x13, 0x47, 0x65, + 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x22, 0x3c, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x32, + 0xd5, 0x0e, 0x0a, 0x04, 0x63, 0x68, 0x61, 0x74, 0x12, 0x51, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x41, + 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x63, + 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x71, 0x1a, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5d, 0x0a, 0x12, 0x46, 0x69, 0x6e, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, - 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, - 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5d, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, + 0x65, 0x73, 0x70, 0x12, 0x5d, 0x0a, 0x12, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x51, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, - 0x64, 0x65, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x0a, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4b, 0x0a, 0x0c, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, - 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x12, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, - 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x4e, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, - 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, - 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, - 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x51, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x5d, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, + 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, + 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, + 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x23, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x57, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, + 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, + 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x46, 0x75, + 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x53, 0x65, + 0x6e, 0x64, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, + 0x0a, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, + 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x4b, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, + 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x36, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x15, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x71, 0x1a, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a, 0x0d, 0x52, 0x65, 0x73, + 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, + 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x12, 0x1e, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x51, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, + 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, - 0x78, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, - 0x61, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, - 0x61, 0x74, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, - 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, - 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, + 0x44, 0x65, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x54, 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, + 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, 0x73, - 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x55, - 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x54, - 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, - 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, - 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, - 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, - 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, - 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6c, 0x0a, - 0x17, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, - 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, - 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, - 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, - 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, - 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x42, 0x2d, 0x5a, 0x2b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, - 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x6f, + 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, + 0x0a, 0x0e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4f, + 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, + 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x4f, + 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, + 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x51, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, + 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6c, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, + 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, + 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, + 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x46, 0x6f, 0x72, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x65, 0x65, 0x74, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, + 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, + 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x53, 0x65, 0x74, 0x41, 0x6c, 0x6c, + 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x57, + 0x0a, 0x10, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, 0x61, 0x74, + 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68, + 0x61, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x73, 0x64, 0x6b, 0x2f, + 0x63, 0x68, 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3261,7 +3452,7 @@ func file_chat_chat_proto_rawDescGZIP() []byte { return file_chat_chat_proto_rawDescData } -var file_chat_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 46) +var file_chat_chat_proto_msgTypes = make([]protoimpl.MessageInfo, 50) var file_chat_chat_proto_goTypes = []interface{}{ (*UserIdentity)(nil), // 0: openim.chat.UserIdentity (*UpdateUserInfoReq)(nil), // 1: openim.chat.UpdateUserInfoReq @@ -3306,45 +3497,49 @@ var file_chat_chat_proto_goTypes = []interface{}{ (*CheckUserExistResp)(nil), // 40: openim.chat.CheckUserExistResp (*DelUserAccountReq)(nil), // 41: openim.chat.DelUserAccountReq (*DelUserAccountResp)(nil), // 42: openim.chat.DelUserAccountResp - nil, // 43: openim.chat.FindUserAccountResp.UserAccountMapEntry - nil, // 44: openim.chat.FindAccountUserResp.AccountUserMapEntry - nil, // 45: openim.chat.UserLoginCountResp.CountEntry - (*wrapperspb.StringValue)(nil), // 46: openim.protobuf.StringValue - (*wrapperspb.Int32Value)(nil), // 47: openim.protobuf.Int32Value - (*wrapperspb.Int64Value)(nil), // 48: openim.protobuf.Int64Value - (*common.UserPublicInfo)(nil), // 49: openim.chat.common.UserPublicInfo - (*sdkws.RequestPagination)(nil), // 50: openim.sdkws.RequestPagination - (*common.UserFullInfo)(nil), // 51: openim.chat.common.UserFullInfo + (*SetAllowRegisterReq)(nil), // 43: openim.chat.SetAllowRegisterReq + (*SetAllowRegisterResp)(nil), // 44: openim.chat.SetAllowRegisterResp + (*GetAllowRegisterReq)(nil), // 45: openim.chat.GetAllowRegisterReq + (*GetAllowRegisterResp)(nil), // 46: openim.chat.GetAllowRegisterResp + nil, // 47: openim.chat.FindUserAccountResp.UserAccountMapEntry + nil, // 48: openim.chat.FindAccountUserResp.AccountUserMapEntry + nil, // 49: openim.chat.UserLoginCountResp.CountEntry + (*wrapperspb.StringValue)(nil), // 50: openim.protobuf.StringValue + (*wrapperspb.Int32Value)(nil), // 51: openim.protobuf.Int32Value + (*wrapperspb.Int64Value)(nil), // 52: openim.protobuf.Int64Value + (*common.UserPublicInfo)(nil), // 53: openim.chat.common.UserPublicInfo + (*sdkws.RequestPagination)(nil), // 54: openim.sdkws.RequestPagination + (*common.UserFullInfo)(nil), // 55: openim.chat.common.UserFullInfo } var file_chat_chat_proto_depIdxs = []int32{ - 46, // 0: openim.chat.UpdateUserInfoReq.account:type_name -> openim.protobuf.StringValue - 46, // 1: openim.chat.UpdateUserInfoReq.phoneNumber:type_name -> openim.protobuf.StringValue - 46, // 2: openim.chat.UpdateUserInfoReq.areaCode:type_name -> openim.protobuf.StringValue - 46, // 3: openim.chat.UpdateUserInfoReq.email:type_name -> openim.protobuf.StringValue - 46, // 4: openim.chat.UpdateUserInfoReq.nickname:type_name -> openim.protobuf.StringValue - 46, // 5: openim.chat.UpdateUserInfoReq.faceURL:type_name -> openim.protobuf.StringValue - 47, // 6: openim.chat.UpdateUserInfoReq.gender:type_name -> openim.protobuf.Int32Value - 47, // 7: openim.chat.UpdateUserInfoReq.level:type_name -> openim.protobuf.Int32Value - 48, // 8: openim.chat.UpdateUserInfoReq.birth:type_name -> openim.protobuf.Int64Value - 47, // 9: openim.chat.UpdateUserInfoReq.allowAddFriend:type_name -> openim.protobuf.Int32Value - 47, // 10: openim.chat.UpdateUserInfoReq.allowBeep:type_name -> openim.protobuf.Int32Value - 47, // 11: openim.chat.UpdateUserInfoReq.allowVibration:type_name -> openim.protobuf.Int32Value - 47, // 12: openim.chat.UpdateUserInfoReq.globalRecvMsgOpt:type_name -> openim.protobuf.Int32Value - 47, // 13: openim.chat.UpdateUserInfoReq.RegisterType:type_name -> openim.protobuf.Int32Value - 49, // 14: openim.chat.FindUserPublicInfoResp.users:type_name -> openim.chat.common.UserPublicInfo - 50, // 15: openim.chat.SearchUserPublicInfoReq.pagination:type_name -> openim.sdkws.RequestPagination - 49, // 16: openim.chat.SearchUserPublicInfoResp.users:type_name -> openim.chat.common.UserPublicInfo - 51, // 17: openim.chat.FindUserFullInfoResp.users:type_name -> openim.chat.common.UserFullInfo + 50, // 0: openim.chat.UpdateUserInfoReq.account:type_name -> openim.protobuf.StringValue + 50, // 1: openim.chat.UpdateUserInfoReq.phoneNumber:type_name -> openim.protobuf.StringValue + 50, // 2: openim.chat.UpdateUserInfoReq.areaCode:type_name -> openim.protobuf.StringValue + 50, // 3: openim.chat.UpdateUserInfoReq.email:type_name -> openim.protobuf.StringValue + 50, // 4: openim.chat.UpdateUserInfoReq.nickname:type_name -> openim.protobuf.StringValue + 50, // 5: openim.chat.UpdateUserInfoReq.faceURL:type_name -> openim.protobuf.StringValue + 51, // 6: openim.chat.UpdateUserInfoReq.gender:type_name -> openim.protobuf.Int32Value + 51, // 7: openim.chat.UpdateUserInfoReq.level:type_name -> openim.protobuf.Int32Value + 52, // 8: openim.chat.UpdateUserInfoReq.birth:type_name -> openim.protobuf.Int64Value + 51, // 9: openim.chat.UpdateUserInfoReq.allowAddFriend:type_name -> openim.protobuf.Int32Value + 51, // 10: openim.chat.UpdateUserInfoReq.allowBeep:type_name -> openim.protobuf.Int32Value + 51, // 11: openim.chat.UpdateUserInfoReq.allowVibration:type_name -> openim.protobuf.Int32Value + 51, // 12: openim.chat.UpdateUserInfoReq.globalRecvMsgOpt:type_name -> openim.protobuf.Int32Value + 51, // 13: openim.chat.UpdateUserInfoReq.RegisterType:type_name -> openim.protobuf.Int32Value + 53, // 14: openim.chat.FindUserPublicInfoResp.users:type_name -> openim.chat.common.UserPublicInfo + 54, // 15: openim.chat.SearchUserPublicInfoReq.pagination:type_name -> openim.sdkws.RequestPagination + 53, // 16: openim.chat.SearchUserPublicInfoResp.users:type_name -> openim.chat.common.UserPublicInfo + 55, // 17: openim.chat.FindUserFullInfoResp.users:type_name -> openim.chat.common.UserFullInfo 13, // 18: openim.chat.RegisterUserReq.user:type_name -> openim.chat.RegisterUserInfo 13, // 19: openim.chat.AddUserAccountReq.user:type_name -> openim.chat.RegisterUserInfo - 43, // 20: openim.chat.FindUserAccountResp.userAccountMap:type_name -> openim.chat.FindUserAccountResp.UserAccountMapEntry - 44, // 21: openim.chat.FindAccountUserResp.accountUserMap:type_name -> openim.chat.FindAccountUserResp.AccountUserMapEntry - 49, // 22: openim.chat.SignalRecord.inviterUserList:type_name -> openim.chat.common.UserPublicInfo - 50, // 23: openim.chat.SearchUserFullInfoReq.pagination:type_name -> openim.sdkws.RequestPagination - 51, // 24: openim.chat.SearchUserFullInfoResp.users:type_name -> openim.chat.common.UserFullInfo - 45, // 25: openim.chat.UserLoginCountResp.count:type_name -> openim.chat.UserLoginCountResp.CountEntry - 50, // 26: openim.chat.SearchUserInfoReq.pagination:type_name -> openim.sdkws.RequestPagination - 51, // 27: openim.chat.SearchUserInfoResp.users:type_name -> openim.chat.common.UserFullInfo + 47, // 20: openim.chat.FindUserAccountResp.userAccountMap:type_name -> openim.chat.FindUserAccountResp.UserAccountMapEntry + 48, // 21: openim.chat.FindAccountUserResp.accountUserMap:type_name -> openim.chat.FindAccountUserResp.AccountUserMapEntry + 53, // 22: openim.chat.SignalRecord.inviterUserList:type_name -> openim.chat.common.UserPublicInfo + 54, // 23: openim.chat.SearchUserFullInfoReq.pagination:type_name -> openim.sdkws.RequestPagination + 55, // 24: openim.chat.SearchUserFullInfoResp.users:type_name -> openim.chat.common.UserFullInfo + 49, // 25: openim.chat.UserLoginCountResp.count:type_name -> openim.chat.UserLoginCountResp.CountEntry + 54, // 26: openim.chat.SearchUserInfoReq.pagination:type_name -> openim.sdkws.RequestPagination + 55, // 27: openim.chat.SearchUserInfoResp.users:type_name -> openim.chat.common.UserFullInfo 13, // 28: openim.chat.CheckUserExistReq.user:type_name -> openim.chat.RegisterUserInfo 1, // 29: openim.chat.chat.UpdateUserInfo:input_type -> openim.chat.UpdateUserInfoReq 16, // 30: openim.chat.chat.AddUserAccount:input_type -> openim.chat.AddUserAccountReq @@ -3366,28 +3561,32 @@ var file_chat_chat_proto_depIdxs = []int32{ 32, // 46: openim.chat.chat.UserLoginCount:input_type -> openim.chat.UserLoginCountReq 35, // 47: openim.chat.chat.SearchUserInfo:input_type -> openim.chat.SearchUserInfoReq 37, // 48: openim.chat.chat.GetTokenForVideoMeeting:input_type -> openim.chat.GetTokenForVideoMeetingReq - 2, // 49: openim.chat.chat.UpdateUserInfo:output_type -> openim.chat.UpdateUserInfoResp - 17, // 50: openim.chat.chat.AddUserAccount:output_type -> openim.chat.AddUserAccountResp - 6, // 51: openim.chat.chat.SearchUserPublicInfo:output_type -> openim.chat.SearchUserPublicInfoResp - 4, // 52: openim.chat.chat.FindUserPublicInfo:output_type -> openim.chat.FindUserPublicInfoResp - 31, // 53: openim.chat.chat.SearchUserFullInfo:output_type -> openim.chat.SearchUserFullInfoResp - 8, // 54: openim.chat.chat.FindUserFullInfo:output_type -> openim.chat.FindUserFullInfoResp - 10, // 55: openim.chat.chat.SendVerifyCode:output_type -> openim.chat.SendVerifyCodeResp - 12, // 56: openim.chat.chat.VerifyCode:output_type -> openim.chat.VerifyCodeResp - 15, // 57: openim.chat.chat.RegisterUser:output_type -> openim.chat.RegisterUserResp - 34, // 58: openim.chat.chat.Login:output_type -> openim.chat.LoginResp - 20, // 59: openim.chat.chat.ResetPassword:output_type -> openim.chat.ResetPasswordResp - 22, // 60: openim.chat.chat.ChangePassword:output_type -> openim.chat.ChangePasswordResp - 40, // 61: openim.chat.chat.CheckUserExist:output_type -> openim.chat.CheckUserExistResp - 42, // 62: openim.chat.chat.DelUserAccount:output_type -> openim.chat.DelUserAccountResp - 24, // 63: openim.chat.chat.FindUserAccount:output_type -> openim.chat.FindUserAccountResp - 26, // 64: openim.chat.chat.FindAccountUser:output_type -> openim.chat.FindAccountUserResp - 29, // 65: openim.chat.chat.OpenIMCallback:output_type -> openim.chat.OpenIMCallbackResp - 33, // 66: openim.chat.chat.UserLoginCount:output_type -> openim.chat.UserLoginCountResp - 36, // 67: openim.chat.chat.SearchUserInfo:output_type -> openim.chat.SearchUserInfoResp - 38, // 68: openim.chat.chat.GetTokenForVideoMeeting:output_type -> openim.chat.GetTokenForVideoMeetingResp - 49, // [49:69] is the sub-list for method output_type - 29, // [29:49] is the sub-list for method input_type + 43, // 49: openim.chat.chat.SetAllowRegister:input_type -> openim.chat.SetAllowRegisterReq + 45, // 50: openim.chat.chat.GetAllowRegister:input_type -> openim.chat.GetAllowRegisterReq + 2, // 51: openim.chat.chat.UpdateUserInfo:output_type -> openim.chat.UpdateUserInfoResp + 17, // 52: openim.chat.chat.AddUserAccount:output_type -> openim.chat.AddUserAccountResp + 6, // 53: openim.chat.chat.SearchUserPublicInfo:output_type -> openim.chat.SearchUserPublicInfoResp + 4, // 54: openim.chat.chat.FindUserPublicInfo:output_type -> openim.chat.FindUserPublicInfoResp + 31, // 55: openim.chat.chat.SearchUserFullInfo:output_type -> openim.chat.SearchUserFullInfoResp + 8, // 56: openim.chat.chat.FindUserFullInfo:output_type -> openim.chat.FindUserFullInfoResp + 10, // 57: openim.chat.chat.SendVerifyCode:output_type -> openim.chat.SendVerifyCodeResp + 12, // 58: openim.chat.chat.VerifyCode:output_type -> openim.chat.VerifyCodeResp + 15, // 59: openim.chat.chat.RegisterUser:output_type -> openim.chat.RegisterUserResp + 34, // 60: openim.chat.chat.Login:output_type -> openim.chat.LoginResp + 20, // 61: openim.chat.chat.ResetPassword:output_type -> openim.chat.ResetPasswordResp + 22, // 62: openim.chat.chat.ChangePassword:output_type -> openim.chat.ChangePasswordResp + 40, // 63: openim.chat.chat.CheckUserExist:output_type -> openim.chat.CheckUserExistResp + 42, // 64: openim.chat.chat.DelUserAccount:output_type -> openim.chat.DelUserAccountResp + 24, // 65: openim.chat.chat.FindUserAccount:output_type -> openim.chat.FindUserAccountResp + 26, // 66: openim.chat.chat.FindAccountUser:output_type -> openim.chat.FindAccountUserResp + 29, // 67: openim.chat.chat.OpenIMCallback:output_type -> openim.chat.OpenIMCallbackResp + 33, // 68: openim.chat.chat.UserLoginCount:output_type -> openim.chat.UserLoginCountResp + 36, // 69: openim.chat.chat.SearchUserInfo:output_type -> openim.chat.SearchUserInfoResp + 38, // 70: openim.chat.chat.GetTokenForVideoMeeting:output_type -> openim.chat.GetTokenForVideoMeetingResp + 44, // 71: openim.chat.chat.SetAllowRegister:output_type -> openim.chat.SetAllowRegisterResp + 46, // 72: openim.chat.chat.GetAllowRegister:output_type -> openim.chat.GetAllowRegisterResp + 51, // [51:73] is the sub-list for method output_type + 29, // [29:51] is the sub-list for method input_type 29, // [29:29] is the sub-list for extension type_name 29, // [29:29] is the sub-list for extension extendee 0, // [0:29] is the sub-list for field type_name @@ -3915,6 +4114,54 @@ func file_chat_chat_proto_init() { return nil } } + file_chat_chat_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetAllowRegisterReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_chat_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetAllowRegisterResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_chat_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllowRegisterReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_chat_chat_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAllowRegisterResp); 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{ @@ -3922,7 +4169,7 @@ func file_chat_chat_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_chat_chat_proto_rawDesc, NumEnums: 0, - NumMessages: 46, + NumMessages: 50, NumExtensions: 0, NumServices: 1, }, @@ -3973,6 +4220,8 @@ type ChatClient interface { SearchUserInfo(ctx context.Context, in *SearchUserInfoReq, opts ...grpc.CallOption) (*SearchUserInfoResp, error) // Audio/video call and video meeting GetTokenForVideoMeeting(ctx context.Context, in *GetTokenForVideoMeetingReq, opts ...grpc.CallOption) (*GetTokenForVideoMeetingResp, error) + SetAllowRegister(ctx context.Context, in *SetAllowRegisterReq, opts ...grpc.CallOption) (*SetAllowRegisterResp, error) + GetAllowRegister(ctx context.Context, in *GetAllowRegisterReq, opts ...grpc.CallOption) (*GetAllowRegisterResp, error) } type chatClient struct { @@ -4163,6 +4412,24 @@ func (c *chatClient) GetTokenForVideoMeeting(ctx context.Context, in *GetTokenFo return out, nil } +func (c *chatClient) SetAllowRegister(ctx context.Context, in *SetAllowRegisterReq, opts ...grpc.CallOption) (*SetAllowRegisterResp, error) { + out := new(SetAllowRegisterResp) + err := c.cc.Invoke(ctx, "/openim.chat.chat/SetAllowRegister", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *chatClient) GetAllowRegister(ctx context.Context, in *GetAllowRegisterReq, opts ...grpc.CallOption) (*GetAllowRegisterResp, error) { + out := new(GetAllowRegisterResp) + err := c.cc.Invoke(ctx, "/openim.chat.chat/GetAllowRegister", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ChatServer is the server API for Chat service. type ChatServer interface { // Edit personal information - called by the user or an administrator @@ -4190,6 +4457,8 @@ type ChatServer interface { SearchUserInfo(context.Context, *SearchUserInfoReq) (*SearchUserInfoResp, error) // Audio/video call and video meeting GetTokenForVideoMeeting(context.Context, *GetTokenForVideoMeetingReq) (*GetTokenForVideoMeetingResp, error) + SetAllowRegister(context.Context, *SetAllowRegisterReq) (*SetAllowRegisterResp, error) + GetAllowRegister(context.Context, *GetAllowRegisterReq) (*GetAllowRegisterResp, error) } // UnimplementedChatServer can be embedded to have forward compatible implementations. @@ -4256,6 +4525,12 @@ func (*UnimplementedChatServer) SearchUserInfo(context.Context, *SearchUserInfoR func (*UnimplementedChatServer) GetTokenForVideoMeeting(context.Context, *GetTokenForVideoMeetingReq) (*GetTokenForVideoMeetingResp, error) { return nil, status.Errorf(codes.Unimplemented, "method GetTokenForVideoMeeting not implemented") } +func (*UnimplementedChatServer) SetAllowRegister(context.Context, *SetAllowRegisterReq) (*SetAllowRegisterResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetAllowRegister not implemented") +} +func (*UnimplementedChatServer) GetAllowRegister(context.Context, *GetAllowRegisterReq) (*GetAllowRegisterResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAllowRegister not implemented") +} func RegisterChatServer(s *grpc.Server, srv ChatServer) { s.RegisterService(&_Chat_serviceDesc, srv) @@ -4621,6 +4896,42 @@ func _Chat_GetTokenForVideoMeeting_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Chat_SetAllowRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetAllowRegisterReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServer).SetAllowRegister(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/openim.chat.chat/SetAllowRegister", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServer).SetAllowRegister(ctx, req.(*SetAllowRegisterReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Chat_GetAllowRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAllowRegisterReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChatServer).GetAllowRegister(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/openim.chat.chat/GetAllowRegister", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChatServer).GetAllowRegister(ctx, req.(*GetAllowRegisterReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Chat_serviceDesc = grpc.ServiceDesc{ ServiceName: "openim.chat.chat", HandlerType: (*ChatServer)(nil), @@ -4705,6 +5016,14 @@ var _Chat_serviceDesc = grpc.ServiceDesc{ MethodName: "GetTokenForVideoMeeting", Handler: _Chat_GetTokenForVideoMeeting_Handler, }, + { + MethodName: "SetAllowRegister", + Handler: _Chat_SetAllowRegister_Handler, + }, + { + MethodName: "GetAllowRegister", + Handler: _Chat_GetAllowRegister_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "chat/chat.proto", diff --git a/pkg/protocol/chat/chat.proto b/pkg/protocol/chat/chat.proto index c66bbd62c..45781533f 100644 --- a/pkg/protocol/chat/chat.proto +++ b/pkg/protocol/chat/chat.proto @@ -274,6 +274,21 @@ message DelUserAccountReq { } message DelUserAccountResp {} +message SetAllowRegisterReq { + bool allowRegister = 1; +} + +message SetAllowRegisterResp { +} + +message GetAllowRegisterReq { +} + +message GetAllowRegisterResp { + bool allowRegister = 1; +} + + service chat { // Edit personal information - called by the user or an administrator rpc UpdateUserInfo(UpdateUserInfoReq) returns (UpdateUserInfoResp); @@ -305,4 +320,7 @@ service chat { // Audio/video call and video meeting rpc GetTokenForVideoMeeting(GetTokenForVideoMeetingReq) returns (GetTokenForVideoMeetingResp); + + rpc SetAllowRegister(SetAllowRegisterReq) returns(SetAllowRegisterResp); + rpc GetAllowRegister(GetAllowRegisterReq) returns(GetAllowRegisterResp); } diff --git a/pkg/protocol/gen.cmd b/pkg/protocol/gen.cmd index ac7ae372e..b837c1d57 100644 --- a/pkg/protocol/gen.cmd +++ b/pkg/protocol/gen.cmd @@ -9,4 +9,9 @@ for %%i in (%PROTO_NAMES%) do ( protoc --go_out=plugins=grpc:./%%i --go_opt=module=github.com/openimsdk/chat/pkg/protocol/%%i %%i/%%i.proto ) +rem Replace "omitempty" in *.pb.go files with UTF-8 encoding +for /r %%f in (*.pb.go) do ( + powershell -Command "(Get-Content -Path '%%f' -Encoding UTF8) -replace ',omitempty\"`"', '\"`"' | Set-Content -Path '%%f' -Encoding UTF8" +) + endlocal diff --git a/pkg/protocol/sdkws/sdkws.proto b/pkg/protocol/sdkws/sdkws.proto index 57301c5be..6a55e7f7f 100644 --- a/pkg/protocol/sdkws/sdkws.proto +++ b/pkg/protocol/sdkws/sdkws.proto @@ -389,7 +389,6 @@ message FriendApplicationRejectedTips { FromToUserID fromToUserID = 1; //from: rejecter; to: requester string handleMsg = 2; } -} // FromUserID Added a friend ToUserID message FriendAddedTips { diff --git a/start-config.yml b/start-config.yml index b5b8ddc55..0d6707834 100644 --- a/start-config.yml +++ b/start-config.yml @@ -5,4 +5,5 @@ serviceBinaries: admin-rpc: 1 toolBinaries: - check-component + - attribute-to-credential maxFileDescriptors: 10000 diff --git a/tools/attribute-to-credential/main.go b/tools/attribute-to-credential/main.go new file mode 100644 index 000000000..315a3c229 --- /dev/null +++ b/tools/attribute-to-credential/main.go @@ -0,0 +1,153 @@ +package main + +import ( + "context" + "flag" + "fmt" + "github.com/openimsdk/chat/internal/rpc/chat" + "github.com/openimsdk/chat/pkg/common/cmd" + "github.com/openimsdk/chat/pkg/common/config" + "github.com/openimsdk/chat/pkg/common/constant" + table "github.com/openimsdk/chat/pkg/common/db/table/chat" + "github.com/openimsdk/chat/tools/dataversion" + "github.com/openimsdk/protocol/sdkws" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/system/program" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "path/filepath" +) + +const ( + credentialKey = "credential" + credentialVersion = 1 + + attributeCollection = "attribute" + credentialCollection = "credential" + pageNum = 1000 +) + +func initConfig(configDir string) (*config.Mongo, error) { + var ( + mongoConfig = &config.Mongo{} + ) + err := config.LoadConfig(filepath.Join(configDir, cmd.MongodbConfigFileName), cmd.ConfigEnvPrefixMap[cmd.MongodbConfigFileName], mongoConfig) + if err != nil { + return nil, err + } + + return mongoConfig, nil +} + +func pageGetAttribute(ctx context.Context, coll *mongo.Collection, pagination *sdkws.RequestPagination) (int64, []*table.Attribute, error) { + return mongoutil.FindPage[*table.Attribute](ctx, coll, bson.M{}, pagination) +} + +func doAttributeToCredential() error { + var index int + var configDir string + flag.IntVar(&index, "i", 0, "Index number") + defaultConfigDir := filepath.Join("..", "..", "..", "..", "..", "config") + flag.StringVar(&configDir, "c", defaultConfigDir, "Configuration dir") + flag.Parse() + + fmt.Printf("Index: %d, Config Path: %s\n", index, configDir) + + mongoConfig, err := initConfig(configDir) + if err != nil { + return err + } + + ctx := context.Background() + + mgocli, err := mongoutil.NewMongoDB(ctx, mongoConfig.Build()) + if err != nil { + return err + } + + versionColl := mgocli.GetDB().Collection(dataversion.Collection) + converted, err := dataversion.CheckVersion(versionColl, credentialKey, credentialVersion) + if err != nil { + return err + } + if converted { + fmt.Println("[credential] credential data has been converted") + return nil + } + + attrColl := mgocli.GetDB().Collection(attributeCollection) + credColl := mgocli.GetDB().Collection(credentialCollection) + + pagination := &sdkws.RequestPagination{ + PageNumber: 1, + ShowNumber: pageNum, + } + tx := mgocli.GetTx() + if err = tx.Transaction(ctx, func(ctx context.Context) error { + for { + total, attrs, err := pageGetAttribute(ctx, attrColl, pagination) + if err != nil { + return err + } + credentials := make([]*table.Credential, 0, pageNum*3) + for _, attr := range attrs { + if attr.Email != "" { + credentials = append(credentials, &table.Credential{ + UserID: attr.UserID, + Account: attr.Email, + Type: constant.CredentialEmail, + AllowChange: true, + }) + } + if attr.Account != "" { + credentials = append(credentials, &table.Credential{ + UserID: attr.UserID, + Account: attr.Account, + Type: constant.CredentialAccount, + AllowChange: true, + }) + } + if attr.PhoneNumber != "" && attr.AreaCode != "" { + credentials = append(credentials, &table.Credential{ + UserID: attr.UserID, + Account: chat.BuildCredentialPhone(attr.AreaCode, attr.PhoneNumber), + Type: constant.CredentialPhone, + AllowChange: true, + }) + } + + } + for _, credential := range credentials { + err = mongoutil.UpdateOne(ctx, credColl, bson.M{ + "user_id": credential.UserID, + "type": credential.Type, + }, bson.M{ + "$set": credential, + }, false, options.Update().SetUpsert(true)) + if err != nil { + return err + } + } + + pagination.PageNumber++ + if total < pageNum { + break + } + } + return nil + }); err != nil { + return err + } + if err := dataversion.SetVersion(versionColl, credentialKey, credentialVersion); err != nil { + return fmt.Errorf("set mongodb credential version %w", err) + } + fmt.Println("[credential] update old data to credential success") + return nil +} + +func main() { + if err := doAttributeToCredential(); err != nil { + program.ExitWithError(err) + } +} diff --git a/tools/check-component/main.go b/tools/check-component/main.go index ab7676a16..f3f2dd25f 100644 --- a/tools/check-component/main.go +++ b/tools/check-component/main.go @@ -57,7 +57,7 @@ func CheckRedis(ctx context.Context, config *config.Redis) error { func CheckOpenIM(ctx context.Context, apiURL, secret, adminUserID string) error { imAPI := imapi.New(apiURL, secret, adminUserID) - _, err := imAPI.GetAdminToken(mcontext.SetOperationID(ctx, "CheckOpenIM"+idutil.OperationIDGenerator()), adminUserID) + _, err := imAPI.GetAdminTokenCache(mcontext.SetOperationID(ctx, "CheckOpenIM"+idutil.OperationIDGenerator()), adminUserID) return err } diff --git a/tools/dataversion/data_version.go b/tools/dataversion/data_version.go new file mode 100644 index 000000000..8a1bb8396 --- /dev/null +++ b/tools/dataversion/data_version.go @@ -0,0 +1,50 @@ +package dataversion + +import ( + "context" + "errors" + "fmt" + "github.com/openimsdk/tools/db/mongoutil" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "strconv" + "time" +) + +const ( + Collection = "data_version" +) + +func CheckVersion(coll *mongo.Collection, key string, currentVersion int) (converted bool, err error) { + type VersionTable struct { + Key string `bson:"key"` + Value string `bson:"value"` + } + ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + defer cancel() + res, err := mongoutil.FindOne[VersionTable](ctx, coll, bson.M{"key": key}) + if err == nil { + ver, err := strconv.Atoi(res.Value) + if err != nil { + return false, fmt.Errorf("version %s parse error %w", res.Value, err) + } + if ver >= currentVersion { + return true, nil + } + return false, nil + } else if errors.Is(err, mongo.ErrNoDocuments) { + return false, nil + } else { + return false, err + } +} + +func SetVersion(coll *mongo.Collection, key string, version int) error { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + defer cancel() + option := options.Update().SetUpsert(true) + filter := bson.M{"key": key, "value": strconv.Itoa(version)} + update := bson.M{"$set": bson.M{"key": key, "value": strconv.Itoa(version)}} + return mongoutil.UpdateOne(ctx, coll, filter, update, false, option) +}