diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..751dcae --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,182 @@ +version: 2.1 + +commands: # a reusable command with parameters + task-docker: + parameters: + to: + default: "build" + type: string + steps: + - checkout + - setup_remote_docker + - run: + name: Install Docker + command: | + apt-get update + apt-get install curl -y + apt-get install apt-utils -y + curl -fsSL https://get.docker.com -o get-docker.sh + sh ./get-docker.sh + - run: + name: Install Docker Buildx + command: | + docker run --privileged --rm tonistiigi/binfmt --install all + mkdir -p ~/.docker/cli-plugins + docker buildx create --name mybuilder --use + docker buildx inspect --bootstrap + - run: + name: Switch to containerd image store + command: | + docker context create mycontext + docker context use mycontext + - run: + name: Login to Docker Hub + command: | + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + task-tag: + parameters: + to: + default: "build" + type: string + steps: + - run: + name: Check tag creator + command: | + authorized_users=("zizdlp") + if [[ ! " ${authorized_users[@]} " =~ " $CIRCLE_USERNAME " ]]; then + echo "Unauthorized user: $CIRCLE_USERNAME" + exit 1 + fi + - run: + name: Ensure tag is greater than latest tag + command: | + current_tag=${CIRCLE_TAG} + git fetch --tags + latest_tag=$(git tag --sort=-v:refname --list 'v[0-9]*.[0-9]*.[0-9]*' | head -n1) + + if [ -z "$latest_tag" ]; then + echo "No previous tags found. Assuming ${current_tag} is the first tag." + exit 0 + fi + + echo "Current tag: ${current_tag}" + echo "Latest tag: ${latest_tag}" + + # Remove 'v' prefix and compare versions + current_version=$(echo "$current_tag" | sed 's/^v//') + latest_version=$(echo "$latest_tag" | sed 's/^v//') + + # Compare versions + if [ "$(printf '%s\n%s\n' "$current_version" "$latest_version" | sort -V | head -n1)" != "$latest_version" ]; then + echo "Error: Tag ${current_tag} is not greater than or equal to the latest tag ${latest_tag}." + exit 1 + fi + + echo "Tag ${current_tag} is greater than or equal to the latest tag ${latest_tag}. Proceeding." + +jobs: + build_frontend: + docker: + - image: ubuntu:22.04 + steps: + - task-docker: + to: "build_frontend" + - task-tag: + to: "build_frontend" + - run: + name: Build multi-architecture zbook frontend image + command: | + docker buildx build --platform linux/amd64,linux/arm64 -t zizdlp/zbook_frontend:${CIRCLE_TAG} -t zizdlp/zbook_frontend:latest -f ./zbook_frontend/zbook_frontend.Dockerfile ./zbook_frontend --push + + build_backend: + docker: + - image: ubuntu:22.04 + steps: + - task-docker: + to: "build_frontend" + - task-tag: + to: "build_frontend" + - run: + name: Build multi-architecture zbook backend image + command: | + docker buildx build --platform linux/amd64,linux/arm64 -t zizdlp/zbook_backend:${CIRCLE_TAG} -t zizdlp/zbook_backend:latest -f ./zbook_backend/zbook_backend.Dockerfile ./zbook_backend --push + + build_database: + docker: + - image: ubuntu:22.04 + steps: + - task-docker: + to: "build_frontend" + - task-tag: + to: "build_frontend" + - run: + name: Build multi-architecture zbook database image + command: | + docker buildx build --platform linux/amd64,linux/arm64 -t zizdlp/zbook_database:${CIRCLE_TAG} -t zizdlp/zbook_database:latest -f ./zbook_database/zbook_database.Dockerfile ./zbook_database --push + + build_release_frontend: + docker: + - image: ubuntu:22.04 + steps: + - task-docker: + to: "build_another_frontend" + - run: + name: Build another multi-architecture frontend image + command: | + docker buildx build --platform linux/amd64,linux/arm64 -t zizdlp/zbook_frontend -f ./zbook_frontend/zbook_frontend.Dockerfile ./zbook_frontend + + build_release_backend: + docker: + - image: ubuntu:22.04 + steps: + - task-docker: + to: "build_another_backend" + - run: + name: Build another multi-architecture backend image + command: | + docker buildx build --platform linux/amd64,linux/arm64 -t zizdlp/zbook_backend -f ./zbook_backend/zbook_backend.Dockerfile ./zbook_backend + + build_release_database: + docker: + - image: ubuntu:22.04 + steps: + - task-docker: + to: "build_another_database" + - run: + name: Build another multi-architecture database image + command: | + docker buildx build --platform linux/amd64,linux/arm64 -t zizdlp/zbook_database -f ./zbook_database/zbook_database.Dockerfile ./zbook_database + +workflows: + build-and-test: + jobs: + - build_frontend: + filters: + tags: + only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ + branches: + ignore: /.*/ + - build_backend: + filters: + tags: + only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ + branches: + ignore: /.*/ + - build_database: + filters: + tags: + only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ + branches: + ignore: /.*/ + - build_release_frontend: + filters: + branches: + only: release + - build_release_backend: + filters: + branches: + only: release + - build_release_database: + filters: + branches: + only: release diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..b37c7d2 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# .github/CODEOWNERS + +* @zizdlp diff --git a/.github/workflows/build_main.yaml b/.github/workflows/build_main.yaml new file mode 100644 index 0000000..21ee6e4 --- /dev/null +++ b/.github/workflows/build_main.yaml @@ -0,0 +1,31 @@ +name: BUILD_MAIN + +on: + push: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + service: [zbook_backend, zbook_database, zbook_frontend] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.PRIVATE_REGISTRY_USERNAME }} + password: ${{ secrets.PRIVATE_REGISTRY_TOKEN }} + registry: ${{ secrets.PRIVATE_REGISTRY_URL }} + - name: Build and push ${{ matrix.service }} + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:${{ matrix.service }}" + file: ${{ matrix.service }}.Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ secrets.PRIVATE_REGISTRY_URL }}/zbook/${{ matrix.service }} diff --git a/.github/workflows/test_backend.yaml b/.github/workflows/test_backend.yaml new file mode 100644 index 0000000..82859cc --- /dev/null +++ b/.github/workflows/test_backend.yaml @@ -0,0 +1,42 @@ +name: TEST_BACKEND + +on: + push: +jobs: + test: + runs-on: ubuntu-latest + + services: + postgres: + image: zizdlp/zbook_database + env: + POSTGRES_USER: root + POSTGRES_PASSWORD: secret + POSTGRES_DB: zbook + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.19 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Install golang-migrate + run: | + curl -L https://github.com/golang-migrate/migrate/releases/download/v4.14.1/migrate.linux-amd64.tar.gz | tar xvz + sudo mv migrate.linux-amd64 /usr/bin/migrate + which migrate + - name: Run migrations + run: make migrateup + + - name: Test + run: make test diff --git a/.github/workflows/test_frontend.yaml b/.github/workflows/test_frontend.yaml new file mode 100644 index 0000000..98c4469 --- /dev/null +++ b/.github/workflows/test_frontend.yaml @@ -0,0 +1,37 @@ +name: TEST_FRONTEND + +on: + push: +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Change directory to frontend + run: cd zbook_frontend + + - name: Install dependencies + run: npm install + working-directory: zbook_frontend + - name: Run lint + run: npm run lint + working-directory: zbook_frontend + - name: Run build + run: npm run build + working-directory: zbook_frontend + + - name: Run tests + run: npm test -- --updateSnapshot + working-directory: zbook_frontend diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b88f5dd --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +zbook_data +__snapshots__ +.swc \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9786469 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,43 @@ +{ + "markdown-preview-enhanced.enablePreviewZenMode": false, + "protoc": { + "options": ["--proto_path=proto"] + }, + + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + + "[markdown]": { + "editor.defaultFormatter": "DavidAnson.vscode-markdownlint" + }, + "files.associations": { + ".env*": "dotenv", + "vector": "cpp", + "iosfwd": "cpp" + }, + "go.toolsManagement.autoUpdate": true, + "[proto3]": { + "editor.defaultFormatter": "zxh404.vscode-proto3" + }, + "clang-format.style": "{ IndentWidth: 2, BasedOnStyle: google, AlignConsecutiveAssignments: AcrossEmptyLines, AlignAfterOpenBracket: AlwaysBreak}", + "editor.formatOnSave": true, + "[go]": { + "editor.defaultFormatter": "golang.go" + }, + "i18n-ally.localesPaths": ["./zbook_frontend/messages"], // E.g. "./messages" + "i18n-ally.keystyle": "nested" +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..15b2d99 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + + Preamble + +The GNU General Public License is a free, copyleft license for +software and other kinds of works. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + +0. Definitions. + +"This License" refers to version 3 of the GNU General Public License. + +"Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + +To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based +on the Program. + +To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + +An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +1. Source Code. + +The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + +A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + +The Corresponding Source for a work in source code form is that +same work. + +2. Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + +4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + +"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + +8. Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +11. Patents. + +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + +13. Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + +14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + +17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + +The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..554df6f --- /dev/null +++ b/Makefile @@ -0,0 +1,93 @@ +include zbook_backend/app.env +export + +CURRENT_DIR := $(shell pwd) + + +######################################################## +################## local backend ###################### +tidy: + cd zbook_backend && \ + go mod tidy +md2html: + cd zbook_backend && \ + go run cmd/md2html/main.go ${CURRENT_DIR}/zbook_data/convert_src ${CURRENT_DIR}/zbook_data/convert_dest +compress_img: + cd zbook_backend && \ + go run cmd/compress_image/main.go ${CURRENT_DIR}/zbook_data/linchat.jpg ${CURRENT_DIR}/zbook_data/linchat_compress.png +########################################## +database: + docker run --name zbook-local-database -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d zizdlp/zbook_database +createdb: + docker exec -it zbook-local-database createdb --username=root --owner=root zbook +dropdb: + docker exec -it zbook-local-database dropdb zbook +migrateup: + cd zbook_backend && \ + migrate -path db/migration -database "$(DB_SOURCE)" -verbose up + # docker exec -it zbook-local-database gunzip geoip_data.sql.gz + docker exec -it zbook-local-database psql -U root -d zbook -f geoip_data.sql +migratedown: + cd zbook_backend && \ + migrate -path db/migration -database "$(DB_SOURCE)" -verbose down +sqlc: + cd zbook_backend && \ + sqlc generate +mock: + cd zbook_backend && \ + mockgen -package mockdb -destination db/mock/store.go github.com/zizdlp/zbook/db/sqlc Store && \ + mockgen -package mockwk -destination worker/mock/distributor.go github.com/zizdlp/zbook/worker TaskDistributor +test: + cd zbook_backend && \ + go test -v -cover -short ./... +jtest: + cd zbook_frontend && \ + npm run test +redis: + docker run --name zbook-local-redis -p 6379:6379 -d redis:7-alpine +minio: + docker run --name zbook-local-minio -itd -p 9000:9000 -p 9001:9001 -e "MINIO_ROOT_USER=${MINIO_ROOT_USER}" -e "MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}" minio/minio server /data --console-address ":9001" +create_bucket: + mc alias set avatar http://localhost:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD} + mc mb avatar/avatar +server: + cd zbook_backend && \ + REQUIRE_EMAIL_VERIFY=false go run cmd/server/main.go +gp: + cd zbook_backend && \ + mkdir -p pb && \ + rm -f -r statik/* && \ + rm -f -r pb/* && \ + rm -f -r doc/swagger/* && \ + protoc --proto_path=proto --proto_path=proto/models --proto_path=proto/rpcs --go_out=pb --go_opt=paths=source_relative \ + --go-grpc_out=pb --go-grpc_opt=paths=source_relative \ + --grpc-gateway_out=pb \ + --openapiv2_out=doc/swagger \ + --grpc-gateway_opt paths=source_relative \ + proto/**/*.proto proto/*.proto && \ + statik -src=./doc -dest=./ +evans: + evans --host localhost --port 9090 -r repl +batch_test: + cd zbook_backend && \ + go run cmd/batch_test/main.go +build_frontend_localhost: + docker build -t zbook_frontend_localhost --build-arg ENV_FILE=.env.production.localhost -f ./zbook_frontend/zbook_frontend.Dockerfile ./zbook_frontend +build_frontend_zizdlp: + docker build -t zbook_frontend_zizdlp --build-arg ENV_FILE=.env.production.zizdlp -f ./zbook_frontend/zbook_frontend.Dockerfile ./zbook_frontend +build_backend: + docker build -t zbook_backend --build-arg BUILDPLATFORM=amd64 -f ./zbook_backend/zbook_backend.Dockerfile ./zbook_backend +build_database: + docker build -t zbook_database -f ./zbook_database/zbook_database.Dockerfile ./zbook_database +run_frontend: + docker run -it zizdlp/zbook_frontend + +#frontend +next: + cd zbook_frontend && \ + npm run dev +compose: + sudo docker-compose -f docker-compose.yaml down --volumes + sudo docker-compose -f docker-compose.yaml build + sudo docker-compose -f docker-compose.yaml up --remove-orphans +.PHONY: database createdb dropdb migrateup migratedown sqlc mock test server next compose diff --git a/README.md b/README.md new file mode 100644 index 0000000..508b0d0 --- /dev/null +++ b/README.md @@ -0,0 +1,110 @@ +

ZBook

+ +

+ ZBook Docs - Discord - Youtube +

+ +[![Actions Status](https://github.com/zizdlp/zbook/workflows/BUILD_MAIN/badge.svg)](https://github.com/zizdlp/zbook/actions) +[![Actions Status](https://github.com/zizdlp/zbook/workflows/TEST_BACKEND/badge.svg)](https://github.com/zizdlp/zbook/actions) +[![Actions Status](https://github.com/zizdlp/zbook/workflows/TEST_FRONTEND/badge.svg)](https://github.com/zizdlp/zbook/actions) +[![CircleCI](https://dl.circleci.com/status-badge/img/gh/zizdlp/zbook/tree/release.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/zizdlp/zbook/tree/release) + +[中文版](README_zh.md) + +------ +

Welcome to ZBook, a fully open-source full-stack knowledge base management software for teams.

+

This repository contains the open-source code used to render and serve ZBook

+ +

+ ZBook Logo +

+ +## Table of Contents + +- [Getting Started](#getting-started) +- [Features](#features) +- [Deployment](#deployment) +- [Licensing](#license) +- [Acknowledgements](#acknowledgements) + +## Getting Started + +To run a local version of this project, please follow these simple steps. + +### Prerequisites + +- docker & docker-compose + +### Set up + +1. Clone the repo into a **public** GitHub repository. If you plan to distribute the code, keep the source code public to comply with GNU GPLv3. + + ```shell + git clone https://github.com/zizdlp/zbook.git + ``` + +2. Build & run your local development server + + ```shell + make compose + ``` + +3. Then open the space in your web browser, using + +4. 🍻 To use email services and third-party account login, please apply first. For details, please refer to [ZBook User Guide](https://github.com/zizdlp/zbook-user-guide). + +### CI and testing + +All pull-requests will be tested against both visual and performances testing to prevent regressions. +ZBook is fully open-source and built on top of [Next.js](https://nextjs.org/). + +### Types of contributions + +We encourage you to contribute to ZBook to help us build the best tool for documenting technical knowledge. If you're looking for some quick ways to contribute, continue reading to learn more about popular contributions. + +#### Translations + +The ZBook UI is rendered using a set of translation files found in [`zbook_frontend/messages`](/zbook_frontend/messages/). We welcome all additional translations for the UI. + +#### Bugs + +Encounter a bug or find an issue you'd like to fix? Helping us fix issues related to ZBook greatly improves the experience for everyone. Head to the issues section of this repository to learn more about the types of bugs you can already help out with. + +## Features + +Support: + +- **full-stack**: a full-stack software utilizing Next.js and Tailwind CSS for the frontend, Golang gRPC for backend services, PostgreSQL for database management, and MinIO for storage, and WebSocket for real-time messaging notifications. +- **multi-level permission management**: Support for various repository visibility options including public, login-only, selected users, and creator-only access. +- **Comments** +- **Notifications** +- **open source** + +Not Support: + +ZBook does **not support online editing**. We believe that tools like Git in local environments such as VS Code and Typora are sufficient for editing and collaborating on content. **Online editing is not essential** in our view. Additionally, enabling online editing would require granting write permissions to Git repositories, which could pose **security risks**. + +## Deployment + +For privacy and other reasons (for private repositories, you may need to input an access token; although GitHub supports fine-grained access tokens that can grant specific permissions to specific repositories, such as read-only), we encourage you to deploy ZBook yourself. You can use docker-compose or a k8s cluster for deployment. For details, please refer to the [ZBook User Guide](https://github.com/zizdlp/zbook-user-guide). + +## License + +Distributed under the [GNU GPLv3 License](https://github.com/zizdlp/zbook/LICENSE). + +If you plan to distribute the code, you must the source code public to comply with GNU GPLv3. +See `LICENSE` for more information. + +## Acknowledgements + +ZBook wouldn't be possible without these projects: + +- [Next.js](https://nextjs.org/) +- [Tailwind CSS](https://tailwindcss.com/) +- [GoldMark](https://github.com/yuin/goldmark) + +## Contributors + + + + diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 0000000..16f980f --- /dev/null +++ b/README_zh.md @@ -0,0 +1,110 @@ +

ZBook

+ +

+ 用户指南 - 开发者指南 - Discord - Youtube +

+ +[![Actions Status](https://github.com/zizdlp/zbook/workflows/BUILD_MAIN/badge.svg)](https://github.com/zizdlp/zbook/actions) +[![Actions Status](https://github.com/zizdlp/zbook/workflows/TEST_BACKEND/badge.svg)](https://github.com/zizdlp/zbook/actions) +[![Actions Status](https://github.com/zizdlp/zbook/workflows/TEST_FRONTEND/badge.svg)](https://github.com/zizdlp/zbook/actions) +[![CircleCI](https://dl.circleci.com/status-badge/img/gh/zizdlp/zbook/tree/release.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/zizdlp/zbook/tree/release) + +[English Version](README.md) + +------ +

欢迎来到 ZBook,一个为团队设计的完全开源的全栈知识库管理软件。

+

这个仓库包含用于渲染和服务 ZBook 的开源代码。

+ +

+ ZBook Logo +

+ +## 目录 + +- [入门指南](#getting-started) +- [功能](#features) +- [部署](#deployment) +- [许可](#license) +- [致谢](#acknowledgements) + +## 入门指南 + +要运行这个项目的本地版本,请按照以下简单步骤操作。 + +### 先决条件 + +- Docker 和 Docker Compose + +### 设置 + +1. 将仓库克隆到一个 公开 的 GitHub 仓库。如果你计划分发代码,请保持源码公开以符合 GNU GPLv3。 + + ```shell + git clone https://github.com/zizdlp/zbook.git + ``` + +2. 构建并运行本地开发服务器 + + ```shell + make compose + ``` + +3. 然后在你的网页浏览器中打开 + +4. 🍻 要使用电子邮件服务和第三方账户登录,请先申请。详情请参阅 [ZBook 用户指南](https://github.com/zizdlp/zbook-user-guide). + +### CI 和测试 + +所有的拉取请求都会进行视觉和性能测试,以防止回归问题。 +ZBook 完全开源,并建立在 [Next.js](https://nextjs.org/),[Golang](https://go.dev/) 之上. + +### 贡献类型 + +我们鼓励你为 ZBook 做贡献,帮助我们构建最好的技术知识文档工具。如果你想快速做出贡献,请继续阅读以了解更多关于热门贡献的方法。 + +#### 翻译 + +ZBook 的用户界面使用一组翻译文件进行渲染,这些文件可以在 [`zbook_frontend/messages`](/zbook_frontend/messages/) 中找到。我们欢迎所有 UI 的额外翻译。 + +#### 错误 + +遇到错误或找到你想修复的问题?帮助我们修复与 ZBook 相关的问题可以极大地改善所有人的体验。前往本仓库的问题部分,了解你可以帮助解决的错误类型。 + +## 功能 + +支持: + +- **全栈**:利用 Next.js 和 Tailwind CSS 的前端,Golang gRPC 的后端服务,PostgreSQL 的数据库管理,MinIO 的存储,以及用于实时消息通知的 WebSocket。 +- **多级权限管理**:支持多种存储库可见性选项,包括公开、仅登录、选定用户和仅创建者访问。 +- **评论** +- **通知** +- **开源** + +不支持: + +ZBook 不支持**在线编辑**。我们认为 Git 在本地环境如 VS Code 和 Typora 中的工具足以用于编辑和协作内容。在线编辑不是必需的。此外,启用在线编辑需要授予 Git 仓库写权限,这可能带来**安全风险**。 + +## 部署 + +由于隐私和其他原因(对于私人仓库,你可能需要输入访问令牌;虽然 GitHub 支持细粒度访问令牌,可以授予特定仓库的特定权限,例如只读),我们鼓励你自行部署 ZBook。你可以使用 Docker Compose 或 k8s 集群进行部署。详情请参阅 [ZBook 用户指南](https://github.com/zizdlp/zbook-user-guide)。 + +## 许可 + +根据[GNU GPLv3 License](https://github.com/zizdlp/zbook/LICENSE) 许可证 分发。 + +如果你计划分发代码,必须保持源码公开以符合 GNU GPLv3。 +请参阅 LICENSE 了解更多信息。 + +## 致谢 + +没有以下项目,ZBook 将无法实现: + +- [Next.js](https://nextjs.org/) +- [Tailwind CSS](https://tailwindcss.com/) +- [GoldMark](https://github.com/yuin/goldmark) + +## 贡献者 + + + + diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..ad9694f --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,103 @@ +version: "3" + +services: + zbook-compose-postgres: + container_name: zbook-compose-postgres + image: zizdlp/zbook_database + # build: + # context: ./zbook_database + # dockerfile: zbook_database.Dockerfile + environment: + - POSTGRES_USER=root + - POSTGRES_PASSWORD=postgres-secret + - POSTGRES_DB=zbook + expose: + - "5342" + volumes: + - ./zbook_data/database:/var/lib/postgresql/data + zbook-compose-redis: + container_name: zbook-compose-redis + image: redis:7-alpine + expose: + - "6379" + volumes: + - ./zbook_data/redis:/data + zbook-compose-minio: + container_name: zbook-compose-minio + image: minio/minio + expose: + - "9000" + ports: + - 10001:9001 + environment: + - MINIO_ROOT_USER=root + - MINIO_ROOT_PASSWORD=minio-secret + command: ["server", "/data", "--console-address", ":9001"] + volumes: + - ./zbook_data/avatar:/data + zbook-compose-backend: + container_name: zbook-compose-backend + build: + context: ./zbook_backend + dockerfile: zbook_backend.Dockerfile + expose: + - "8080" + - "9090" + ports: + - 10099:9099 + environment: + - DB_SOURCE=postgresql://root:postgres-secret@zbook-compose-postgres:5432/zbook?sslmode=disable + - MINIO_ROOT_USER=root + - MINIO_ROOT_PASSWORD=minio-secret + - REQUIRE_EMAIL_VERIFY=false + - TOKEN_SYMMETRIC_KEY=12345058901234567890123456789083 + - EMAIL_SENDER_NAME=zbook + - EMAIL_SENDER_ADDRESS=example@example.com + - EMAIL_SENDER_PASSWORD=email-secret + - SMTP_AUTH_ADDR=smtp.qq.com + - SMTP_SERVER_ADDR=smtp.qq.com:25 + + - REDIS_ADDRESS=zbook-compose-redis:6379 + - HOME_ADDRESS=http://localhost:3000 + - MINIO_ADDR=zbook-compose-minio:9000 + + depends_on: + - zbook-compose-postgres + - zbook-compose-redis + - zbook-compose-minio + entrypoint: + [ + "/app/wait-for.sh", + "zbook-compose-minio:9000", + "--", + "/app/wait-for.sh", + "zbook-compose-postgres:5432", + "--", + "/app/start.sh", + ] + command: ["/app/main"] + zbook-compose-frontend: + container_name: zbook-compose-frontend + build: + context: ./zbook_frontend + dockerfile: zbook_frontend.Dockerfile + restart: always + ports: + - 3000:3000 + environment: + - WEBSOCKET_URL=ws://localhost:10099 + - BACKEND_URL=http://zbook-compose-backend:8080/ + - AUTH_URL=http://localhost:3000 + - AUTH_SECRET=abcadsfasfsdafawefwaefa2 + - AUTH_TRUST_HOST=true + - DOC_REPONAME=docs + - DOC_USERNAME=admin + - GITHUB_ID=fake-github-id + - GITHUB_SECRET=fake-github-secret + - GOOGLE_CLIENT_ID=fake-google-client-id + - GOOGLE_CLIENT_SECRET=fake-google-client-secret + depends_on: + - zbook-compose-backend +networks: + zbook-compose-network: + driver: bridge diff --git a/zbook_backend/.protolint.yaml b/zbook_backend/.protolint.yaml new file mode 100644 index 0000000..3c7dbb0 --- /dev/null +++ b/zbook_backend/.protolint.yaml @@ -0,0 +1,7 @@ +lint: + rules: + no_default: true + + add: + - MESSAGE_NAMES_UPPER_CAMEL_CASE + - SERVICE_NAMES_UPPER_CAMEL_CASE \ No newline at end of file diff --git a/zbook_backend/app.env b/zbook_backend/app.env new file mode 100644 index 0000000..8743f12 --- /dev/null +++ b/zbook_backend/app.env @@ -0,0 +1,21 @@ +ENVIRONMENT=development +MIGRATION_URL=file://db/migration +HTTP_SERVER_ADDRESS=0.0.0.0:8080 +GRPC_SERVER_ADDRESS=0.0.0.0:9090 +WEBSOCKET_SERVER_ADDRESS=0.0.0.0:9099 +ACCESS_TOKEN_DURATION=15m +REFRESH_TOKEN_DURATION=24h +DB_SOURCE=postgresql://root:secret@localhost:5432/zbook?sslmode=disable +HOME_ADDRESS=http://localhost:3000 +REDIS_ADDRESS=0.0.0.0:6379 +TOKEN_SYMMETRIC_KEY=12345058901234567890123456789063 +REQUIRE_EMAIL_VERIFY=true +MINIO_ADDR=localhost:9000 +MINIO_ROOT_USER=zizdlp +MINIO_ROOT_PASSWORD=minio-secret +SMTP_AUTH_ADDR=smtp.qq.com +SMTP_SERVER_ADDR=smtp.qq.com:25 +EMAIL_SENDER_NAME=zbook +EMAIL_SENDER_ADDRESS=example@example.com +EMAIL_SENDER_PASSWORD=email-secret +TIME_ZONE=Asia/Shanghai \ No newline at end of file diff --git a/zbook_backend/cert.pem b/zbook_backend/cert.pem new file mode 100644 index 0000000..57d4a37 --- /dev/null +++ b/zbook_backend/cert.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw +TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh +cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 +WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu +ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc +h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ +0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U +A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW +T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH +B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC +B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv +KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn +OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn +jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw +qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI +rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq +hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL +ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ +3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK +NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 +ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur +TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC +jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc +oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq +4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA +mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d +emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/zbook_backend/cmd/batch_test/main.go b/zbook_backend/cmd/batch_test/main.go new file mode 100644 index 0000000..6d77d47 --- /dev/null +++ b/zbook_backend/cmd/batch_test/main.go @@ -0,0 +1,192 @@ +package main + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + + "github.com/rs/zerolog/log" + + "github.com/zizdlp/zbook/util" +) + +func create_user(config util.Config, jsonStr string) { + payload := bytes.NewBuffer([]byte(jsonStr)) + // 创建POST请求 + req, err := http.NewRequest("POST", "http://"+config.HTTPServerAddress+"/v1/create_user", payload) + if err != nil { + fmt.Println("创建用户请求失败:", err) + return + } + + // 设置请求头 + req.Header.Set("Content-Type", "application/json") + client := &http.Client{} + + // 发送请求并获取响应 + resp, err := client.Do(req) + if err != nil { + fmt.Println("发送请求失败:", err) + return + } + defer resp.Body.Close() + + // 读取响应的内容 + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println("读取响应失败:", err) + return + } + + // 输出响应内容 + fmt.Println("响应内容:", string(body)) +} + +type LoginResponseData struct { + AccessToken string `json:"access_token"` +} + +func login_user(config util.Config, jsonStr string) (string, error) { + payload := bytes.NewBuffer([]byte(jsonStr)) + // 创建POST请求 + req, err := http.NewRequest("POST", "http://"+config.HTTPServerAddress+"/v1/login_user", payload) + if err != nil { + fmt.Println("创建用户请求失败:", err) + return "", err + } + + // 设置请求头 + req.Header.Set("Content-Type", "application/json") + client := &http.Client{} + + // 发送请求并获取响应 + resp, err := client.Do(req) + if err != nil { + fmt.Println("发送请求失败:", err) + return "", err + } + defer resp.Body.Close() + + // 读取响应的内容 + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println("读取响应失败:", err) + return "", err + } + + // 输出响应内容 + // fmt.Println("响应内容:", string(body)) + + var data LoginResponseData + err = json.Unmarshal(body, &data) + if err != nil { + fmt.Println("解码JSON失败:", err) + return "", err + } + return data.AccessToken, nil +} + +func update_user(config util.Config, jsonStr string, access_token string) (string, error) { + payload := bytes.NewBuffer([]byte(jsonStr)) + // 创建POST请求 + req, err := http.NewRequest("POST", "http://"+config.HTTPServerAddress+"/v1/update_user", payload) + if err != nil { + fmt.Println("创建用户请求失败:", err) + return "", err + } + + // 设置请求头 + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", access_token)) + + client := &http.Client{} + + // 发送请求并获取响应 + resp, err := client.Do(req) + if err != nil { + fmt.Println("发送请求失败:", err) + return "", err + } + defer resp.Body.Close() + + // 读取响应的内容 + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println("读取响应失败:", err) + return "", err + } + + // 输出响应内容 + fmt.Println("响应内容:", string(body)) + return "", err +} + +func create_follow(config util.Config, jsonStr string, access_token string) (string, error) { + payload := bytes.NewBuffer([]byte(jsonStr)) + // 创建POST请求 + req, err := http.NewRequest("POST", "http://"+config.HTTPServerAddress+"/v1/create_follow", payload) + if err != nil { + fmt.Println("创建用户请求失败:", err) + return "", err + } + + // 设置请求头 + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", access_token)) + + client := &http.Client{} + + // 发送请求并获取响应 + resp, err := client.Do(req) + if err != nil { + fmt.Println("发送请求失败:", err) + return "", err + } + defer resp.Body.Close() + + // 读取响应的内容 + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println("读取响应失败:", err) + return "", err + } + + // 输出响应内容 + fmt.Println("响应内容:", string(body)) + return "", err +} + +func main() { + config, err := util.LoadConfig(".") + if err != nil { + log.Fatal().Msgf("cannot load config: %s", err) + } + numUser := 10 + for i := 0; i < numUser; i++ { + username := "test_" + fmt.Sprint(i) + email := username + "@zizdlp.com" + password := "zzzz1234" + content := fmt.Sprintf(`{"email":"%s","username":"%s","password":"%s" }`, + email, username, password) + loginContent := fmt.Sprintf(`{"email":"%s","password":"%s" }`, + email, password) + create_user(config, content) + access_token, err := login_user(config, loginContent) + if err == nil { + fmt.Println("access_toekn is:", access_token) + + updateContent := fmt.Sprintf(`{"motto":"%s","visibiliy_level":"%s"}`, + username+"_motto", "public") + update_user(config, updateContent, access_token) + + followContent := fmt.Sprintf(`{"following_id":"%s" }`, + "1") + + create_follow(config, followContent, access_token) + } + } + // 定义JSON参数 + +} diff --git a/zbook_backend/cmd/compress_image/main.go b/zbook_backend/cmd/compress_image/main.go new file mode 100644 index 0000000..eb4e26e --- /dev/null +++ b/zbook_backend/cmd/compress_image/main.go @@ -0,0 +1,39 @@ +package main + +import ( + "fmt" + "os" + + "github.com/zizdlp/zbook/util" +) + +func main() { + // 从命令行获取源目录和目标目录 + if len(os.Args) != 3 { + fmt.Println("请提供源目录和目标目录参数") + return + } + srcImg := os.Args[1] + desImg := os.Args[2] + + base64, err := util.ReadImageBytes(srcImg) + if err != nil { + fmt.Printf("failed to read image to base64: %v\n", err) + return + } + // 调用压缩函数 + compressedImage, err := util.CompressImage(base64) + if err != nil { + fmt.Printf("failed to compress image: %v\n", err) + return + } + + // 保存压缩后的文件 + err = os.WriteFile(desImg, compressedImage, 0644) + if err != nil { + fmt.Printf("failed to write compressed image to file: %v\n", err) + return + } + + fmt.Printf("Image compressed and saved to %s\n", desImg) +} diff --git a/zbook_backend/cmd/md2html/main.go b/zbook_backend/cmd/md2html/main.go new file mode 100644 index 0000000..02dc64f --- /dev/null +++ b/zbook_backend/cmd/md2html/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "os" + + "github.com/zizdlp/zbook/markdown/convert" +) + +func main() { + // 从命令行获取源目录和目标目录 + if len(os.Args) != 3 { + fmt.Println("请提供源目录和目标目录参数") + return + } + srcDir := os.Args[1] + destDir := os.Args[2] + // convert.ConvertMd2Html(srcDir, destDir) //convert content + convert.ConvertFolder(srcDir, destDir) + // convert.ConvertMdTable2Html(srcDir, destDir) // convert table +} diff --git a/zbook_backend/cmd/server/main.go b/zbook_backend/cmd/server/main.go new file mode 100644 index 0000000..b4d094c --- /dev/null +++ b/zbook_backend/cmd/server/main.go @@ -0,0 +1,348 @@ +package main + +import ( + "C" + + "github.com/golang-migrate/migrate/v4" + _ "github.com/golang-migrate/migrate/v4/database/postgres" + _ "github.com/golang-migrate/migrate/v4/source/file" + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + _ "github.com/zizdlp/zbook/statik" + storage "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/util" +) +import ( + "context" + "errors" + "fmt" + "net" + "net/http" + "os" + "os/signal" + "strings" + "syscall" + "time" + + "github.com/go-redis/redis" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/hibiken/asynq" + "github.com/jackc/pgx/v5/pgxpool" + "github.com/minio/minio-go/v7" + "github.com/rs/zerolog" + "github.com/zizdlp/zbook/gapi" + "github.com/zizdlp/zbook/mail" + "github.com/zizdlp/zbook/pb" + "github.com/zizdlp/zbook/worker" + "github.com/zizdlp/zbook/wsserver" + "golang.org/x/sync/errgroup" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + "google.golang.org/protobuf/encoding/protojson" +) + +var interruptSignals = []os.Signal{ + os.Interrupt, + syscall.SIGTERM, + syscall.SIGINT, +} + +func main() { + + config, err := util.LoadConfig(".") + if err != nil { + log.Fatal().Msgf("cannot load config: %s", err) + } + // Parse the timezone from config + loc, err := time.LoadLocation(config.TIMEZONE) + if err != nil { + log.Fatal().Msgf("cannot load timezone: %s", err) + } + // Set the logger to use the custom timezone + zerolog.TimestampFunc = func() time.Time { + return time.Now().In(loc) + } + if config.Environment == "development" { + log.Logger = log.Output(zerolog.ConsoleWriter{ + Out: os.Stderr, + TimeFormat: "2006-01-02 03:04:05 PM", // 自定义时间格式为包含日期的12小时制 + FormatTimestamp: func(i interface{}) string { + switch v := i.(type) { + case time.Time: + // 使用指定时区格式化时间戳,并应用暗色 + return v.In(loc).Format("2006-01-02 03:04:05 PM") + case string: + // 如果时间戳是字符串,可以尝试转换为 time.Time + if ts, err := time.Parse(time.RFC3339, v); err == nil { + return ts.In(loc).Format("2006-01-02 03:04:05 PM") + } + } + return fmt.Sprint(i) + }, + }) + } + + ctx, stop := signal.NotifyContext(context.Background(), interruptSignals...) + defer stop() + + connPool, err := pgxpool.New(ctx, config.DBSource) + if err != nil { + log.Fatal().Msgf("cannot connect to db: %s", err) + } + go wsserver.ListenWebSocket(connPool) + + runDBMigration(config.MigrationURL, config.DBSource) + store := db.NewStore(connPool) + + redisOpt := asynq.RedisClientOpt{ + Addr: config.RedisAddress, + } + taskDistributor := worker.NewRedisTaskDistributor(redisOpt) + redisClient := redis.NewClient(&redis.Options{ + Addr: config.RedisAddress, // Redis 服务器地址和端口 + }) + minioClient, err := storage.GetMinioClient() + if err != nil { + log.Fatal().Msgf("cannot connect to minio: %s", err) + } + waitGroup, ctx := errgroup.WithContext(ctx) + + runTaskProcessor(ctx, waitGroup, config, redisOpt, store) + runGatewayServer(ctx, waitGroup, config, store, taskDistributor, redisClient, minioClient) + runGrpcServer(ctx, waitGroup, config, store, taskDistributor, redisClient, minioClient) + wsserver.WebSocketServer(ctx, waitGroup, config) + err = waitGroup.Wait() + if err != nil { + log.Fatal().Err(err).Msg("error from wait group") + } +} + +func runTaskProcessor( + ctx context.Context, + waitGroup *errgroup.Group, + config util.Config, redisOpt asynq.RedisClientOpt, store db.Store) { + mailer := mail.NewGmailSender(config.EmailSenderName, config.EmailSenderAddress, config.EmailSenderPassword) + taskProcessor := worker.NewRedisTaskProcessor(redisOpt, store, mailer) + log.Info().Msg("start task processor") + err := taskProcessor.Start() + if err != nil { + log.Fatal().Err(err).Msg("failed to start task processor") + } + + waitGroup.Go(func() error { + <-ctx.Done() + log.Info().Msg("graceful shutdown task processor") + + taskProcessor.Shutdown() + log.Info().Msg("task processor is stopped") + + return nil + }) +} + +func runDBMigration(migrationURL string, dbSource string) { + migration, err := migrate.New(migrationURL, dbSource) + if err != nil { + log.Fatal().Msgf("cannot create new migrate instance: %s", err) + } + if err = migration.Up(); err != nil && err != migrate.ErrNoChange { + log.Fatal().Msgf("failed to run migrate up: %s", err) + } + log.Info().Msg("db migrate succ") +} + +func runGrpcServer(ctx context.Context, + waitGroup *errgroup.Group, config util.Config, store db.Store, taskDistributor worker.TaskDistributor, redisClient *redis.Client, minioClient *minio.Client) { + + server, err := gapi.NewServer(config, store, taskDistributor, redisClient, minioClient) + if err != nil { + log.Fatal().Msgf("cannot create server: %s", err) + } + grpcLogger := grpc.UnaryInterceptor(gapi.GrpcLogger) + grpcServer := grpc.NewServer(grpcLogger) + pb.RegisterZBookVerificationServer(grpcServer, server) + pb.RegisterZBookRepoRelationServer(grpcServer, server) + pb.RegisterZBookCommentRelationServer(grpcServer, server) + pb.RegisterZBookNotificationServer(grpcServer, server) + pb.RegisterZBookAdminServer(grpcServer, server) + pb.RegisterZBookCommentServer(grpcServer, server) + pb.RegisterZBookRepoServer(grpcServer, server) + pb.RegisterZBookMarkdownServer(grpcServer, server) + pb.RegisterZBookUserServer(grpcServer, server) + pb.RegisterZBookOAuthServer(grpcServer, server) + pb.RegisterZBookFollowServer(grpcServer, server) + reflection.Register(grpcServer) + + listener, err := net.Listen("tcp", config.GRPCServerAddress) + if err != nil { + log.Fatal().Msgf("cannot create listener: %s", err) + } + + waitGroup.Go(func() error { + log.Info().Msgf("start gRPC server at %s", listener.Addr().String()) + + err = grpcServer.Serve(listener) + if err != nil { + if errors.Is(err, grpc.ErrServerStopped) { + return nil + } + log.Error().Err(err).Msg("gRPC server failed to serve") + return err + } + + return nil + }) + + waitGroup.Go(func() error { + <-ctx.Done() + log.Info().Msg("graceful shutdown gRPC server") + + grpcServer.GracefulStop() + log.Info().Msg("gRPC server is stopped") + + return nil + }) +} + +func CustomMatcher(key string) (string, bool) { + switch key { + case "X-Envoy-External-Address": + return key, true + default: + return runtime.DefaultHeaderMatcher(key) + } +} +func runGatewayServer(ctx context.Context, + waitGroup *errgroup.Group, config util.Config, store db.Store, taskDistributor worker.TaskDistributor, redisClient *redis.Client, minioClient *minio.Client) { + + server, err := gapi.NewServer(config, store, taskDistributor, redisClient, minioClient) + if err != nil { + log.Fatal().Msgf("cannot create server: %s", err) + } + + options := runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{ + MarshalOptions: protojson.MarshalOptions{ + UseProtoNames: true, + }, + UnmarshalOptions: protojson.UnmarshalOptions{ + DiscardUnknown: true, + }, + }) + + grpcMux := runtime.NewServeMux(options, runtime.WithIncomingHeaderMatcher(CustomMatcher)) + + err = pb.RegisterZBookVerificationHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler server") + } + err = pb.RegisterZBookRepoHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler ZBook_post server") + } + err = pb.RegisterZBookRepoRelationHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler ZBook_post_relation server") + } + err = pb.RegisterZBookCommentHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler ZBook_comment server") + } + err = pb.RegisterZBookCommentRelationHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler ZBook_comment_relation server") + } + + err = pb.RegisterZBookNotificationHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler post_notification server") + } + err = pb.RegisterZBookAdminHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler ZBook_admin server") + } + + err = pb.RegisterZBookMarkdownHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler ZBook_markdown server") + } + + err = pb.RegisterZBookUserHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler ZBook_user server") + } + err = pb.RegisterZBookOAuthHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler ZBook_oauth server") + } + err = pb.RegisterZBookFollowHandlerServer(ctx, grpcMux, server) + if err != nil { + log.Fatal().Msg("cannot register handler ZBook_follow server") + } + + mux := http.NewServeMux() + mux.Handle("/", allowCORS(grpcMux)) + + // WARNING: static file not exposed for security reason + // statikFS, err := fs.New() + // if err != nil { + // log.Fatal().Msg("cannot create statik fs") + // } + // swaggerHandler := http.StripPrefix("/statik/", http.FileServer(statikFS)) + // mux.Handle("/statik/", allowCORS(swaggerHandler)) + + httpServer := &http.Server{ + Handler: gapi.HttpLogger(mux), + Addr: config.HTTPServerAddress, + } + + waitGroup.Go(func() error { + log.Info().Msgf("start HTTP gateway server at %s", httpServer.Addr) + err = httpServer.ListenAndServe() + if err != nil { + if errors.Is(err, http.ErrServerClosed) { + return nil + } + log.Error().Err(err).Msg("HTTP gateway server failed to serve") + return err + } + return nil + }) + waitGroup.Go(func() error { + <-ctx.Done() + log.Info().Msg("graceful shutdown HTTP gateway server") + + err := httpServer.Shutdown(context.Background()) + if err != nil { + log.Error().Err(err).Msg("failed to shutdown HTTP gateway server") + return err + } + + log.Info().Msg("HTTP gateway server is stopped") + return nil + }) + +} + +func allowCORS(h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if origin := r.Header.Get("Origin"); origin != "" { + w.Header().Set("Access-Control-Allow-Origin", origin) + if r.Method == "OPTIONS" && r.Header.Get("Access-Control-Request-Method") != "" { + preflightHandler(w, r) + return + } + } + h.ServeHTTP(w, r) + }) +} + +// preflightHandler adds the necessary headers in order to serve +// CORS from any origin using the methods "GET", "HEAD", "POST", "PUT", "DELETE" +// We insist, don't do this without consideration in production systems. +func preflightHandler(w http.ResponseWriter, r *http.Request) { + headers := []string{"Content-Type", "Accept", "Authorization"} + w.Header().Set("Access-Control-Allow-Headers", strings.Join(headers, ",")) + methods := []string{"GET", "HEAD", "POST", "PUT", "DELETE", "PATCH"} + w.Header().Set("Access-Control-Allow-Methods", strings.Join(methods, ",")) + log.Info().Msgf("preflightHandler at %s", r.URL.Path) +} diff --git a/zbook_backend/db/migration/0000010_add_configuration.down.sql b/zbook_backend/db/migration/0000010_add_configuration.down.sql new file mode 100644 index 0000000..5338049 --- /dev/null +++ b/zbook_backend/db/migration/0000010_add_configuration.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS "configurations"; diff --git a/zbook_backend/db/migration/0000010_add_configuration.up.sql b/zbook_backend/db/migration/0000010_add_configuration.up.sql new file mode 100644 index 0000000..a1a7ecc --- /dev/null +++ b/zbook_backend/db/migration/0000010_add_configuration.up.sql @@ -0,0 +1,19 @@ +CREATE TABLE configurations ( + "config_name" VARCHAR(255) PRIMARY KEY, + "config_value" BOOLEAN NOT NULL, + "created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- 允许注册&登录 +INSERT INTO "configurations" ("config_name", "config_value") +VALUES ('allow_registration', true) +ON CONFLICT ("config_name") DO NOTHING; + +INSERT INTO "configurations" ("config_name", "config_value") +VALUES ('allow_login', true) +ON CONFLICT ("config_name") DO NOTHING; + +INSERT INTO "configurations" ("config_name", "config_value") +VALUES ('allow_invitation', true) +ON CONFLICT ("config_name") DO NOTHING; \ No newline at end of file diff --git a/zbook_backend/db/migration/0000011_add_invitation.down.sql b/zbook_backend/db/migration/0000011_add_invitation.down.sql new file mode 100644 index 0000000..b67c63f --- /dev/null +++ b/zbook_backend/db/migration/0000011_add_invitation.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS "invitations"; diff --git a/zbook_backend/db/migration/0000011_add_invitation.up.sql b/zbook_backend/db/migration/0000011_add_invitation.up.sql new file mode 100644 index 0000000..825ea09 --- /dev/null +++ b/zbook_backend/db/migration/0000011_add_invitation.up.sql @@ -0,0 +1,10 @@ +CREATE TABLE invitations ( + "invitation_id" BIGSERIAL PRIMARY KEY, + "email" VARCHAR(255) NOT NULL, -- 邀请邮箱 + "invitation_url" VARCHAR(255) NOT NULL UNIQUE, -- 随机字符串 URL + "is_used" boolean NOT NULL DEFAULT FALSE, + "created_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP, + "expired_at" timestamptz NOT NULL DEFAULT (CURRENT_TIMESTAMP + INTERVAL '10 minutes') +); + +CREATE INDEX ON "invitations" ("invitation_url"); diff --git a/zbook_backend/db/migration/0000012_add_notifications.down.sql b/zbook_backend/db/migration/0000012_add_notifications.down.sql new file mode 100644 index 0000000..149e1e9 --- /dev/null +++ b/zbook_backend/db/migration/0000012_add_notifications.down.sql @@ -0,0 +1,4 @@ +DROP TABLE IF EXISTS system_notifications; +DROP TABLE IF EXISTS follower_notifications; +DROP TABLE IF EXISTS comment_notifications; +DROP TABLE IF EXISTS repo_notifications; \ No newline at end of file diff --git a/zbook_backend/db/migration/0000012_add_notifications.up.sql b/zbook_backend/db/migration/0000012_add_notifications.up.sql new file mode 100644 index 0000000..6881ae2 --- /dev/null +++ b/zbook_backend/db/migration/0000012_add_notifications.up.sql @@ -0,0 +1,67 @@ +---- 系统通知,通知指定用户 +CREATE TABLE "system_notifications" ( + "noti_id" bigserial PRIMARY KEY, + "user_id" bigint NOT NULL, + "title" varchar NOT NULL, + "contents" varchar NOT NULL, + "redirect_url" varchar DEFAULT '', + "readed" boolean NOT NULL DEFAULT 'false', + "created_at" timestamptz NOT NULL DEFAULT (now()) +); + +-- 添加外键约束和索引 +ALTER TABLE "system_notifications" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE; + +CREATE INDEX ON "system_notifications" ("noti_id", "user_id"); --- 添加索引,加快检索 + +---- new follower 通知 +CREATE TABLE "follower_notifications" ( + "noti_id" bigserial PRIMARY KEY, + "user_id" bigint NOT NULL, + "follower_id" bigint NOT NULL, + "readed" boolean NOT NULL DEFAULT 'false', + "created_at" timestamptz NOT NULL DEFAULT (now()) +); + +-- 添加外键约束和索引 +ALTER TABLE "follower_notifications" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("follower_id") REFERENCES "users" ("user_id") ON DELETE CASCADE; + +CREATE UNIQUE INDEX ON "follower_notifications" ("user_id","follower_id"); --- 添加唯一索引,防止重复 +CREATE INDEX ON "follower_notifications" ("noti_id","user_id"); --- 添加索引,加快检索 + +---- following's repo create +CREATE TABLE "repo_notifications" ( + "noti_id" bigserial PRIMARY KEY, + "user_id" bigint NOT NULL, + "repo_id" bigint NOT NULL, + "readed" boolean NOT NULL DEFAULT 'false', + "created_at" timestamptz NOT NULL DEFAULT (now()) +); + +-- 添加外键约束和索引 +ALTER TABLE "repo_notifications" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("repo_id") REFERENCES "repos" ("repo_id") ON DELETE CASCADE; + +CREATE UNIQUE INDEX ON "repo_notifications" ("user_id","repo_id"); --- 添加唯一索引,防止重复 +CREATE INDEX ON "repo_notifications" ("noti_id","user_id"); --- 添加索引,加快检索 + +---- new comment 通知 +CREATE TABLE "comment_notifications" ( + "noti_id" bigserial PRIMARY KEY, + "user_id" bigint NOT NULL, + "comment_id" bigint Not NULL, + "readed" boolean NOT NULL DEFAULT 'false', + "created_at" timestamptz NOT NULL DEFAULT (now()) +); + +-- 添加外键约束和索引 +ALTER TABLE "comment_notifications" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("comment_id") REFERENCES "comments" ("comment_id") ON DELETE CASCADE; + +CREATE UNIQUE INDEX ON "comment_notifications" ("user_id","comment_id"); --- 添加唯一索引,防止重复 +CREATE INDEX ON "comment_notifications" ("noti_id","user_id"); --- 添加索引,加快检索 \ No newline at end of file diff --git a/zbook_backend/db/migration/0000013_add_oauths.down.sql b/zbook_backend/db/migration/0000013_add_oauths.down.sql new file mode 100644 index 0000000..becfba8 --- /dev/null +++ b/zbook_backend/db/migration/0000013_add_oauths.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS oauths; diff --git a/zbook_backend/db/migration/0000013_add_oauths.up.sql b/zbook_backend/db/migration/0000013_add_oauths.up.sql new file mode 100644 index 0000000..52df38b --- /dev/null +++ b/zbook_backend/db/migration/0000013_add_oauths.up.sql @@ -0,0 +1,14 @@ + +CREATE TABLE "oauths" ( + "oauth_id" bigserial PRIMARY KEY, + "user_id" bigint NOT NULL, + "oauth_type" varchar(255) NOT NULL, + "app_id" varchar NOT NULL, + "created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE "oauths" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE; + +CREATE UNIQUE INDEX ON "oauths" ("oauth_type", "app_id"); --- 添加索引,加快检索 +CREATE UNIQUE INDEX ON "oauths" ("oauth_type", "user_id"); --- 添加索引,加快检索 diff --git a/zbook_backend/db/migration/0000014_add_geoip.down.sql b/zbook_backend/db/migration/0000014_add_geoip.down.sql new file mode 100644 index 0000000..9813cdd --- /dev/null +++ b/zbook_backend/db/migration/0000014_add_geoip.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS geoip; diff --git a/zbook_backend/db/migration/0000014_add_geoip.up.sql b/zbook_backend/db/migration/0000014_add_geoip.up.sql new file mode 100644 index 0000000..28d2cc0 --- /dev/null +++ b/zbook_backend/db/migration/0000014_add_geoip.up.sql @@ -0,0 +1,7 @@ +CREATE TABLE IF NOT EXISTS "geoip" ( + ip_range_cidr cidr PRIMARY KEY, -- IP 地址范围(CIDR 格式) + city_name_en TEXT, -- 城市名称(英语) + city_name_zh_cn TEXT, -- 城市名称(中文-简体) + latitude DOUBLE PRECISION, -- 纬度 + longitude DOUBLE PRECISION -- 经度 +); \ No newline at end of file diff --git a/zbook_backend/db/migration/000001_add_user.down.sql b/zbook_backend/db/migration/000001_add_user.down.sql new file mode 100644 index 0000000..a023e6f --- /dev/null +++ b/zbook_backend/db/migration/000001_add_user.down.sql @@ -0,0 +1,16 @@ +-- 删除表 +DROP TABLE IF EXISTS "users"; + +-- 删除索引 +DROP INDEX IF EXISTS "idx_users_name_email"; +DROP INDEX IF EXISTS "users_fts_username_gin_index"; + +-- 删除扩展 +DROP EXTENSION IF EXISTS pg_trgm; +DROP EXTENSION IF EXISTS btree_gin; +DROP EXTENSION IF EXISTS pg_jieba; + +-- 删除触发器 +DROP TRIGGER IF EXISTS "trig_users_update_fts_username" ON "users"; +DROP TRIGGER IF EXISTS "trig_users_unread_count_change" ON "users"; + diff --git a/zbook_backend/db/migration/000001_add_user.up.sql b/zbook_backend/db/migration/000001_add_user.up.sql new file mode 100644 index 0000000..358080d --- /dev/null +++ b/zbook_backend/db/migration/000001_add_user.up.sql @@ -0,0 +1,54 @@ +-- 创建 users 表 +CREATE TABLE "users" ( + "user_id" BIGSERIAL PRIMARY KEY, + "username" VARCHAR(255) UNIQUE NOT NULL CHECK (char_length(username) >= 3), + "email" VARCHAR(255) UNIQUE NOT NULL CHECK (email ~* '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z]{2,}$'), + "hashed_password" VARCHAR(255) NOT NULL, + "blocked" BOOLEAN NOT NULL DEFAULT FALSE, + "verified" BOOLEAN NOT NULL DEFAULT FALSE, + "motto" TEXT NOT NULL DEFAULT 'Strive for progress, not perfection.', + "user_role" VARCHAR(50) NOT NULL DEFAULT 'user', + "onboarding" BOOLEAN NOT NULL DEFAULT TRUE, + "created_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, + "unread_count" INT NOT NULL DEFAULT 0, + "unread_count_updated_at" TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, + "fts_username" TSVECTOR +); + +-- 创建索引 +CREATE INDEX "idx_users_name_email" ON "users" ("username", "email"); + +-- 创建扩展 +CREATE EXTENSION IF NOT EXISTS pg_trgm; +CREATE EXTENSION IF NOT EXISTS btree_gin; +CREATE EXTENSION IF NOT EXISTS pg_jieba; + +-- 初始化 fts_username +UPDATE "users" +SET "fts_username" = setweight(to_tsvector('english', "username"), 'A'); + +-- 创建全文搜索索引 +CREATE INDEX "users_fts_username_gin_index" ON "users" USING gin ("fts_username"); + +-- 在 username 更新时触发更新 fts_username +CREATE TRIGGER "trig_users_update_fts_username" + BEFORE INSERT OR UPDATE OF "username" + ON "users" + FOR EACH ROW + EXECUTE FUNCTION tsvector_update_trigger("fts_username", 'pg_catalog.english', "username"); + +-- 创建触发器,通知未读消息数量的变化 +CREATE OR REPLACE FUNCTION "notify_unread_count_change"() RETURNS TRIGGER AS $$ +BEGIN + PERFORM pg_notify('unread_count_change', json_build_object('username', NEW."username", 'unread_count', NEW."unread_count")::text); + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +-- 在 unread_count 更新时触发通知 +CREATE TRIGGER "trig_users_unread_count_change" + AFTER UPDATE OF "unread_count" ON "users" + FOR EACH ROW + EXECUTE FUNCTION "notify_unread_count_change"(); + diff --git a/zbook_backend/db/migration/000002_add_sessions.down.sql b/zbook_backend/db/migration/000002_add_sessions.down.sql new file mode 100644 index 0000000..9797667 --- /dev/null +++ b/zbook_backend/db/migration/000002_add_sessions.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS "sessions"; diff --git a/zbook_backend/db/migration/000002_add_sessions.up.sql b/zbook_backend/db/migration/000002_add_sessions.up.sql new file mode 100644 index 0000000..29a8c74 --- /dev/null +++ b/zbook_backend/db/migration/000002_add_sessions.up.sql @@ -0,0 +1,14 @@ +CREATE TABLE "sessions" ( + "session_id" uuid PRIMARY KEY, + "user_id" bigint NOT NULL, + "refresh_token" varchar NOT NULL, + "user_agent" varchar NOT NULL, + "client_ip" varchar NOT NULL, + "expires_at" timestamptz NOT NULL, + "created_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +ALTER TABLE "sessions" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE; + +CREATE INDEX ON "sessions" ("user_id"); diff --git a/zbook_backend/db/migration/000003_add_verification.down.sql b/zbook_backend/db/migration/000003_add_verification.down.sql new file mode 100644 index 0000000..05f5137 --- /dev/null +++ b/zbook_backend/db/migration/000003_add_verification.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS "verifications"; \ No newline at end of file diff --git a/zbook_backend/db/migration/000003_add_verification.up.sql b/zbook_backend/db/migration/000003_add_verification.up.sql new file mode 100644 index 0000000..cda5601 --- /dev/null +++ b/zbook_backend/db/migration/000003_add_verification.up.sql @@ -0,0 +1,16 @@ + +CREATE TABLE "verifications" ( + "verification_id" BIGSERIAL PRIMARY KEY, + "verification_url" VARCHAR(255) NOT NULL UNIQUE, -- 随机字符串 URL + "verification_type" varchar(255) NOT NULL, + "user_id" bigint NOT NULL, + "is_used" boolean NOT NULL DEFAULT FALSE, + "created_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP, + "expired_at" timestamptz NOT NULL DEFAULT (CURRENT_TIMESTAMP + INTERVAL '10 minutes') +); + +ALTER TABLE "verifications" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE; + +CREATE INDEX ON "verifications" ("user_id"); +CREATE INDEX ON "verifications" ("verification_url"); diff --git a/zbook_backend/db/migration/000004_add_follow.down.sql b/zbook_backend/db/migration/000004_add_follow.down.sql new file mode 100644 index 0000000..463a96b --- /dev/null +++ b/zbook_backend/db/migration/000004_add_follow.down.sql @@ -0,0 +1,2 @@ +-- 删除表 +DROP TABLE IF EXISTS "follows"; \ No newline at end of file diff --git a/zbook_backend/db/migration/000004_add_follow.up.sql b/zbook_backend/db/migration/000004_add_follow.up.sql new file mode 100644 index 0000000..e5b2f8a --- /dev/null +++ b/zbook_backend/db/migration/000004_add_follow.up.sql @@ -0,0 +1,15 @@ +CREATE TABLE "follows" ( + "follow_id" bigserial PRIMARY KEY, + "follower_id" bigint NOT NULL, + "following_id" bigint NOT NULL, + "created_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP +); + + +ALTER TABLE "follows" + ADD FOREIGN KEY ("follower_id") REFERENCES "users" ("user_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("following_id") REFERENCES "users" ("user_id") ON DELETE CASCADE; + +CREATE INDEX ON "follows" ("follower_id"); +CREATE INDEX ON "follows" ("following_id"); +CREATE UNIQUE INDEX ON "follows" ("follower_id","following_id"); \ No newline at end of file diff --git a/zbook_backend/db/migration/000005_add_repos.down.sql b/zbook_backend/db/migration/000005_add_repos.down.sql new file mode 100644 index 0000000..c7c343a --- /dev/null +++ b/zbook_backend/db/migration/000005_add_repos.down.sql @@ -0,0 +1,7 @@ +DROP TABLE IF EXISTS "repos"; + +DROP INDEX IF EXISTS "repos_fts_reop_name_gin_index"; + +-- 删除触发器 +DROP TRIGGER IF EXISTS "trig_repos_update_fts_repo_zh" ON "repos"; +DROP TRIGGER IF EXISTS "trig_repos_update_fts_repo_en" ON "repos"; \ No newline at end of file diff --git a/zbook_backend/db/migration/000005_add_repos.up.sql b/zbook_backend/db/migration/000005_add_repos.up.sql new file mode 100644 index 0000000..5f3271d --- /dev/null +++ b/zbook_backend/db/migration/000005_add_repos.up.sql @@ -0,0 +1,55 @@ +CREATE TABLE "repos" ( + "repo_id" BIGSERIAL PRIMARY KEY, + "user_id" bigint NOT NULL, + "git_protocol" varchar(255) NOT NULL, + "git_host" varchar(255) NOT NULL, + "git_username" varchar(255) NOT NULL, + "git_repo" varchar(255) NOT NULL, + "git_access_token" varchar(255) DEFAULT '', + "repo_name" varchar(255) NOT NULL, + "repo_description" text NOT NULL, + "home_page" text NOT NULL, + "sync_token" varchar(255) DEFAULT '', + "visibility_level" varchar(255) NOT NULL, + "commit_id" varchar(255) NOT NULL, + "config" text NOT NULL DEFAULT '', + "theme_sidebar" text NOT NULL CHECK (length(trim(theme_sidebar)) > 0), + "theme_color" text NOT NULL CHECK (length(trim(theme_color)) > 0), + "created_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updated_at" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP, + "fts_repo_en" TSVECTOR, + "fts_repo_zh" TSVECTOR +); + +ALTER TABLE "repos" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE; + +CREATE UNIQUE INDEX ON "repos" ("user_id","repo_name"); + +-- 初始化 fts_repo_name_en +UPDATE "repos" +SET "fts_repo_en" = setweight(to_tsvector('english', "repo_name"), 'A') || + setweight(to_tsvector('english', "repo_description"), 'B'); + +-- 初始化 fts_repo_name_zh +UPDATE "repos" +SET "fts_repo_zh" = setweight(to_tsvector('jiebacfg', "repo_name"), 'A') || + setweight(to_tsvector('jiebacfg', "repo_description"), 'B'); + +-- 创建全文搜索索引 +CREATE INDEX "repos_fts_repo_en_gin_index" ON "repos" USING gin ("fts_repo_en"); +CREATE INDEX "repos_fts_repo_zh_gin_index" ON "repos" USING gin ("fts_repo_zh"); + +-- 在 repo_name,repo_description 更新时触发更新 fts_repo_en +CREATE TRIGGER "trig_repos_update_fts_repo_en" + BEFORE INSERT OR UPDATE OF "repo_name","repo_description" + ON "repos" + FOR EACH ROW + EXECUTE FUNCTION tsvector_update_trigger("fts_repo_en", 'pg_catalog.english', "repo_name","repo_description"); + +-- 在 repo_name,repo_description 更新时触发更新 fts_repo_zh +CREATE TRIGGER "trig_repos_update_fts_repo_zh" + BEFORE INSERT OR UPDATE OF "repo_name","repo_description" + ON "repos" + FOR EACH ROW + EXECUTE FUNCTION tsvector_update_trigger("fts_repo_zh", 'public.jiebacfg', "repo_name","repo_description"); \ No newline at end of file diff --git a/zbook_backend/db/migration/000006_add_repo_releation.down.sql b/zbook_backend/db/migration/000006_add_repo_releation.down.sql new file mode 100644 index 0000000..88e534b --- /dev/null +++ b/zbook_backend/db/migration/000006_add_repo_releation.down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS "repo_relations"; \ No newline at end of file diff --git a/zbook_backend/db/migration/000006_add_repo_releation.up.sql b/zbook_backend/db/migration/000006_add_repo_releation.up.sql new file mode 100644 index 0000000..0101ce7 --- /dev/null +++ b/zbook_backend/db/migration/000006_add_repo_releation.up.sql @@ -0,0 +1,12 @@ +CREATE TABLE "repo_relations" ( + "relation_id" bigserial PRIMARY KEY, + "relation_type" varchar(255) NOT NULL, + "user_id" bigint NOT NULL, + "repo_id" bigint NOT NULL, + "created_at" timestamptz NOT NULL DEFAULT (now()) +); + +ALTER TABLE "repo_relations" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("repo_id") REFERENCES "repos" ("repo_id") ON DELETE CASCADE; +CREATE UNIQUE INDEX ON "repo_relations" ("user_id","repo_id","relation_type"); \ No newline at end of file diff --git a/zbook_backend/db/migration/000007_add_markdowns.down.sql b/zbook_backend/db/migration/000007_add_markdowns.down.sql new file mode 100644 index 0000000..7f025c0 --- /dev/null +++ b/zbook_backend/db/migration/000007_add_markdowns.down.sql @@ -0,0 +1,6 @@ +DROP TABLE IF EXISTS "markdowns"; + +DROP TRIGGER IF EXISTS "trig_markdowns_insert_update_zh" ON "markdowns"; +DROP TRIGGER IF EXISTS "trig_markdowns_insert_update_en" ON "markdowns"; +DROP INDEX IF EXISTS "markdowns_fts_zh_gin_index"; +DROP INDEX IF EXISTS "markdowns_fts_en_gin_index"; diff --git a/zbook_backend/db/migration/000007_add_markdowns.up.sql b/zbook_backend/db/migration/000007_add_markdowns.up.sql new file mode 100644 index 0000000..d3b6927 --- /dev/null +++ b/zbook_backend/db/migration/000007_add_markdowns.up.sql @@ -0,0 +1,44 @@ +CREATE TABLE "markdowns" ( + "markdown_id" bigserial PRIMARY KEY, + "relative_path" text NOT NULL, + "user_id" bigint NOT NULL, + "repo_id" bigint NOT NULL, + "main_content" text NOT NULL, + "table_content" text NOT NULL, + "updated_at" timestamptz NOT NULL DEFAULT (now()), + "created_at" timestamptz NOT NULL DEFAULT (now()), + fts_zh tsvector, + fts_en tsvector +); + +ALTER TABLE "markdowns" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("repo_id") REFERENCES "repos" ("repo_id") ON DELETE CASCADE; + +CREATE UNIQUE INDEX ON "markdowns" ("repo_id","relative_path"); + +UPDATE "markdowns" +SET fts_zh = setweight(to_tsvector('jiebacfg', "relative_path"), 'A') || + setweight(to_tsvector('jiebacfg', "main_content"), 'B'); + + +UPDATE "markdowns" +SET fts_en = setweight(to_tsvector('english', "relative_path"), 'A') || + setweight(to_tsvector('english', "main_content"), 'B'); + + +CREATE INDEX markdowns_fts_zh_gin_index ON "markdowns" USING gin (fts_zh); +CREATE INDEX markdowns_fts_en_gin_index ON "markdowns" USING gin (fts_en); + +CREATE TRIGGER trig_markdowns_insert_update_zh + BEFORE INSERT OR UPDATE OF "relative_path","main_content" + ON "markdowns" + FOR EACH ROW +EXECUTE PROCEDURE tsvector_update_trigger(fts_zh, 'public.jiebacfg', "relative_path", "main_content"); + + +CREATE TRIGGER trig_markdowns_insert_update_en + BEFORE INSERT OR UPDATE OF "relative_path","main_content" + ON "markdowns" + FOR EACH ROW +EXECUTE PROCEDURE tsvector_update_trigger(fts_en, 'pg_catalog.english', "relative_path", "main_content"); diff --git a/zbook_backend/db/migration/000008_add_comments.down.sql b/zbook_backend/db/migration/000008_add_comments.down.sql new file mode 100644 index 0000000..0afbbcb --- /dev/null +++ b/zbook_backend/db/migration/000008_add_comments.down.sql @@ -0,0 +1,8 @@ +DROP TABLE IF EXISTS "comments"; + +DROP INDEX IF EXISTS "markdowns_fts_comment_zh_gin_index"; +DROP INDEX IF EXISTS "markdowns_fts_comment_en_gin_index"; + +-- 删除触发器 +DROP TRIGGER IF EXISTS "trig_markdowns_insert_update_comment_zh" ON "comments"; +DROP TRIGGER IF EXISTS "trig_markdowns_insert_update_comment_en" ON "comments"; \ No newline at end of file diff --git a/zbook_backend/db/migration/000008_add_comments.up.sql b/zbook_backend/db/migration/000008_add_comments.up.sql new file mode 100644 index 0000000..f2087fd --- /dev/null +++ b/zbook_backend/db/migration/000008_add_comments.up.sql @@ -0,0 +1,44 @@ +CREATE TABLE "comments" ( + "comment_id" bigserial PRIMARY KEY, + "repo_id" bigint NOT NULL, + "markdown_id" bigint NOT NULL, + "parent_id" bigint DEFAULT NULL, + "root_id" bigint DEFAULT NULL, + "user_id" bigint NOT NULL, + "blocked" boolean NOT NULL DEFAULT 'false', + "comment_content" text NOT NULL, + "created_at" timestamptz NOT NULL DEFAULT (now()), + fts_comment_zh tsvector, + fts_comment_en tsvector +); + + +-- Adding foreign key constraints +ALTER TABLE "comments" + ADD FOREIGN KEY ("markdown_id") REFERENCES "markdowns" ("markdown_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("parent_id") REFERENCES "comments" ("comment_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("repo_id") REFERENCES "repos" ("repo_id") ON DELETE CASCADE; + +UPDATE "comments" +SET fts_comment_zh = setweight(to_tsvector('jiebacfg', "comment_content"), 'A'); + +UPDATE "comments" +SET fts_comment_en = setweight(to_tsvector('english', "comment_content"), 'A'); + +CREATE INDEX markdowns_fts_comment_zh_gin_index ON "comments" USING gin (fts_comment_zh); +CREATE INDEX markdowns_fts_comment_en_gin_index ON "comments" USING gin (fts_comment_en); + + +CREATE TRIGGER trig_markdowns_insert_update_comment_zh + BEFORE INSERT OR UPDATE OF "comment_content" + ON "comments" + FOR EACH ROW +EXECUTE PROCEDURE tsvector_update_trigger(fts_comment_zh, 'public.jiebacfg', "comment_content"); + + +CREATE TRIGGER trig_markdowns_insert_update_comment_en + BEFORE INSERT OR UPDATE OF "comment_content" + ON "comments" + FOR EACH ROW +EXECUTE PROCEDURE tsvector_update_trigger(fts_comment_en, 'pg_catalog.english', "comment_content"); diff --git a/zbook_backend/db/migration/000009_add_comment_releation.down.sql b/zbook_backend/db/migration/000009_add_comment_releation.down.sql new file mode 100644 index 0000000..b1ded43 --- /dev/null +++ b/zbook_backend/db/migration/000009_add_comment_releation.down.sql @@ -0,0 +1,9 @@ +DROP TABLE IF EXISTS "comment_relations"; +DROP TABLE IF EXISTS "comment_reports"; + +DROP INDEX IF EXISTS "markdowns_fts_report_zh_gin_index"; +DROP INDEX IF EXISTS "markdowns_fts_report_en_gin_index"; + +-- 删除触发器 +DROP TRIGGER IF EXISTS "trig_markdowns_insert_update_report_zh" ON "comment_reports"; +DROP TRIGGER IF EXISTS "trig_markdowns_insert_update_report_en" ON "comment_reports"; \ No newline at end of file diff --git a/zbook_backend/db/migration/000009_add_comment_releation.up.sql b/zbook_backend/db/migration/000009_add_comment_releation.up.sql new file mode 100644 index 0000000..5baf8bf --- /dev/null +++ b/zbook_backend/db/migration/000009_add_comment_releation.up.sql @@ -0,0 +1,57 @@ +-- 1. comment_likes +CREATE TABLE "comment_relations" ( + "relation_id" bigserial PRIMARY KEY, + "relation_type" varchar(255) NOT NULL, + "user_id" bigint NOT NULL, + "comment_id" bigint NOT NULL, + "created_at" timestamptz NOT NULL DEFAULT (now()) +); + +-- Adding foreign key constraints +ALTER TABLE "comment_relations" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("comment_id") REFERENCES "comments" ("comment_id") ON DELETE CASCADE; + + +CREATE UNIQUE INDEX ON "comment_relations" ("user_id","comment_id","relation_type"); + +-- 4. reports +CREATE TABLE "comment_reports" ( + "report_id" bigserial PRIMARY KEY, + "user_id" bigint NOT NULL, + "comment_id" bigint NOT NULL, + "report_content" varchar NOT NULL DEFAULT '', + "processed" boolean NOT NULL DEFAULT 'false', + "created_at" timestamptz NOT NULL DEFAULT (now()), + fts_report_zh tsvector, + fts_report_en tsvector +); + +-- Adding foreign key constraints with ON DELETE CASCADE +ALTER TABLE "comment_reports" + ADD FOREIGN KEY ("user_id") REFERENCES "users" ("user_id") ON DELETE CASCADE, + ADD FOREIGN KEY ("comment_id") REFERENCES "comments" ("comment_id") ON DELETE CASCADE; + +CREATE UNIQUE INDEX ON "comment_reports" ("user_id","comment_id"); + +UPDATE "comment_reports" +SET fts_report_zh = setweight(to_tsvector('jiebacfg', "report_content"), 'A'); + +UPDATE "comment_reports" +SET fts_report_en = setweight(to_tsvector('english', "report_content"), 'A'); + + +CREATE INDEX markdowns_fts_report_zh_gin_index ON "comment_reports" USING gin (fts_report_zh); +CREATE INDEX markdowns_fts_report_en_gin_index ON "comment_reports" USING gin (fts_report_en); + +CREATE TRIGGER trig_markdowns_insert_update_report_zh + BEFORE INSERT OR UPDATE OF "report_content" + ON "comment_reports" + FOR EACH ROW +EXECUTE PROCEDURE tsvector_update_trigger(fts_report_zh, 'public.jiebacfg', "report_content"); + +CREATE TRIGGER trig_markdowns_insert_update_report_en + BEFORE INSERT OR UPDATE OF "report_content" + ON "comment_reports" + FOR EACH ROW +EXECUTE PROCEDURE tsvector_update_trigger(fts_report_en, 'pg_catalog.english', "report_content"); \ No newline at end of file diff --git a/zbook_backend/db/mock/store.go b/zbook_backend/db/mock/store.go new file mode 100644 index 0000000..fcf7bae --- /dev/null +++ b/zbook_backend/db/mock/store.go @@ -0,0 +1,1998 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/zizdlp/zbook/db/sqlc (interfaces: Store) + +// Package mockdb is a generated GoMock package. +package mockdb + +import ( + context "context" + netip "net/netip" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + uuid "github.com/google/uuid" + pgtype "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" +) + +// MockStore is a mock of Store interface. +type MockStore struct { + ctrl *gomock.Controller + recorder *MockStoreMockRecorder +} + +// MockStoreMockRecorder is the mock recorder for MockStore. +type MockStoreMockRecorder struct { + mock *MockStore +} + +// NewMockStore creates a new mock instance. +func NewMockStore(ctrl *gomock.Controller) *MockStore { + mock := &MockStore{ctrl: ctrl} + mock.recorder = &MockStoreMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockStore) EXPECT() *MockStoreMockRecorder { + return m.recorder +} + +// CheckOAuthStatus mocks base method. +func (m *MockStore) CheckOAuthStatus(arg0 context.Context, arg1 int64) (db.CheckOAuthStatusRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CheckOAuthStatus", arg0, arg1) + ret0, _ := ret[0].(db.CheckOAuthStatusRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CheckOAuthStatus indicates an expected call of CheckOAuthStatus. +func (mr *MockStoreMockRecorder) CheckOAuthStatus(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckOAuthStatus", reflect.TypeOf((*MockStore)(nil).CheckOAuthStatus), arg0, arg1) +} + +// CreateComment mocks base method. +func (m *MockStore) CreateComment(arg0 context.Context, arg1 db.CreateCommentParams) (db.Comment, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateComment", arg0, arg1) + ret0, _ := ret[0].(db.Comment) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateComment indicates an expected call of CreateComment. +func (mr *MockStoreMockRecorder) CreateComment(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateComment", reflect.TypeOf((*MockStore)(nil).CreateComment), arg0, arg1) +} + +// CreateCommentNotification mocks base method. +func (m *MockStore) CreateCommentNotification(arg0 context.Context, arg1 db.CreateCommentNotificationParams) (db.CommentNotification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateCommentNotification", arg0, arg1) + ret0, _ := ret[0].(db.CommentNotification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateCommentNotification indicates an expected call of CreateCommentNotification. +func (mr *MockStoreMockRecorder) CreateCommentNotification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCommentNotification", reflect.TypeOf((*MockStore)(nil).CreateCommentNotification), arg0, arg1) +} + +// CreateCommentRelation mocks base method. +func (m *MockStore) CreateCommentRelation(arg0 context.Context, arg1 db.CreateCommentRelationParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateCommentRelation", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateCommentRelation indicates an expected call of CreateCommentRelation. +func (mr *MockStoreMockRecorder) CreateCommentRelation(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCommentRelation", reflect.TypeOf((*MockStore)(nil).CreateCommentRelation), arg0, arg1) +} + +// CreateCommentReport mocks base method. +func (m *MockStore) CreateCommentReport(arg0 context.Context, arg1 db.CreateCommentReportParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateCommentReport", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateCommentReport indicates an expected call of CreateCommentReport. +func (mr *MockStoreMockRecorder) CreateCommentReport(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCommentReport", reflect.TypeOf((*MockStore)(nil).CreateCommentReport), arg0, arg1) +} + +// CreateCommentTx mocks base method. +func (m *MockStore) CreateCommentTx(arg0 context.Context, arg1 db.CreateCommentTxParams) (db.CreateCommentTxResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateCommentTx", arg0, arg1) + ret0, _ := ret[0].(db.CreateCommentTxResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateCommentTx indicates an expected call of CreateCommentTx. +func (mr *MockStoreMockRecorder) CreateCommentTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCommentTx", reflect.TypeOf((*MockStore)(nil).CreateCommentTx), arg0, arg1) +} + +// CreateFollow mocks base method. +func (m *MockStore) CreateFollow(arg0 context.Context, arg1 db.CreateFollowParams) (db.Follow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateFollow", arg0, arg1) + ret0, _ := ret[0].(db.Follow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateFollow indicates an expected call of CreateFollow. +func (mr *MockStoreMockRecorder) CreateFollow(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateFollow", reflect.TypeOf((*MockStore)(nil).CreateFollow), arg0, arg1) +} + +// CreateFollowTx mocks base method. +func (m *MockStore) CreateFollowTx(arg0 context.Context, arg1 db.CreateFollowTxParams) (db.CreateFollowTxResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateFollowTx", arg0, arg1) + ret0, _ := ret[0].(db.CreateFollowTxResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateFollowTx indicates an expected call of CreateFollowTx. +func (mr *MockStoreMockRecorder) CreateFollowTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateFollowTx", reflect.TypeOf((*MockStore)(nil).CreateFollowTx), arg0, arg1) +} + +// CreateFollowerNotification mocks base method. +func (m *MockStore) CreateFollowerNotification(arg0 context.Context, arg1 db.CreateFollowerNotificationParams) (db.FollowerNotification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateFollowerNotification", arg0, arg1) + ret0, _ := ret[0].(db.FollowerNotification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateFollowerNotification indicates an expected call of CreateFollowerNotification. +func (mr *MockStoreMockRecorder) CreateFollowerNotification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateFollowerNotification", reflect.TypeOf((*MockStore)(nil).CreateFollowerNotification), arg0, arg1) +} + +// CreateInvitation mocks base method. +func (m *MockStore) CreateInvitation(arg0 context.Context, arg1 db.CreateInvitationParams) (db.Invitation, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateInvitation", arg0, arg1) + ret0, _ := ret[0].(db.Invitation) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateInvitation indicates an expected call of CreateInvitation. +func (mr *MockStoreMockRecorder) CreateInvitation(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateInvitation", reflect.TypeOf((*MockStore)(nil).CreateInvitation), arg0, arg1) +} + +// CreateMarkdown mocks base method. +func (m *MockStore) CreateMarkdown(arg0 context.Context, arg1 db.CreateMarkdownParams) (db.Markdown, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateMarkdown", arg0, arg1) + ret0, _ := ret[0].(db.Markdown) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateMarkdown indicates an expected call of CreateMarkdown. +func (mr *MockStoreMockRecorder) CreateMarkdown(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateMarkdown", reflect.TypeOf((*MockStore)(nil).CreateMarkdown), arg0, arg1) +} + +// CreateMarkdownMulti mocks base method. +func (m *MockStore) CreateMarkdownMulti(arg0 context.Context, arg1 db.CreateMarkdownMultiParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateMarkdownMulti", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateMarkdownMulti indicates an expected call of CreateMarkdownMulti. +func (mr *MockStoreMockRecorder) CreateMarkdownMulti(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateMarkdownMulti", reflect.TypeOf((*MockStore)(nil).CreateMarkdownMulti), arg0, arg1) +} + +// CreateOAuth mocks base method. +func (m *MockStore) CreateOAuth(arg0 context.Context, arg1 db.CreateOAuthParams) (db.Oauth, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOAuth", arg0, arg1) + ret0, _ := ret[0].(db.Oauth) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOAuth indicates an expected call of CreateOAuth. +func (mr *MockStoreMockRecorder) CreateOAuth(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOAuth", reflect.TypeOf((*MockStore)(nil).CreateOAuth), arg0, arg1) +} + +// CreateRepo mocks base method. +func (m *MockStore) CreateRepo(arg0 context.Context, arg1 db.CreateRepoParams) (db.Repo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRepo", arg0, arg1) + ret0, _ := ret[0].(db.Repo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateRepo indicates an expected call of CreateRepo. +func (mr *MockStoreMockRecorder) CreateRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRepo", reflect.TypeOf((*MockStore)(nil).CreateRepo), arg0, arg1) +} + +// CreateRepoNotification mocks base method. +func (m *MockStore) CreateRepoNotification(arg0 context.Context, arg1 db.CreateRepoNotificationParams) (db.RepoNotification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRepoNotification", arg0, arg1) + ret0, _ := ret[0].(db.RepoNotification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateRepoNotification indicates an expected call of CreateRepoNotification. +func (mr *MockStoreMockRecorder) CreateRepoNotification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRepoNotification", reflect.TypeOf((*MockStore)(nil).CreateRepoNotification), arg0, arg1) +} + +// CreateRepoRelation mocks base method. +func (m *MockStore) CreateRepoRelation(arg0 context.Context, arg1 db.CreateRepoRelationParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRepoRelation", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateRepoRelation indicates an expected call of CreateRepoRelation. +func (mr *MockStoreMockRecorder) CreateRepoRelation(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRepoRelation", reflect.TypeOf((*MockStore)(nil).CreateRepoRelation), arg0, arg1) +} + +// CreateRepoTx mocks base method. +func (m *MockStore) CreateRepoTx(arg0 context.Context, arg1 db.CreateRepoTxParams) (db.CreateRepoTxResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRepoTx", arg0, arg1) + ret0, _ := ret[0].(db.CreateRepoTxResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateRepoTx indicates an expected call of CreateRepoTx. +func (mr *MockStoreMockRecorder) CreateRepoTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRepoTx", reflect.TypeOf((*MockStore)(nil).CreateRepoTx), arg0, arg1) +} + +// CreateSession mocks base method. +func (m *MockStore) CreateSession(arg0 context.Context, arg1 db.CreateSessionParams) (db.Session, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateSession", arg0, arg1) + ret0, _ := ret[0].(db.Session) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateSession indicates an expected call of CreateSession. +func (mr *MockStoreMockRecorder) CreateSession(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSession", reflect.TypeOf((*MockStore)(nil).CreateSession), arg0, arg1) +} + +// CreateSystemNotification mocks base method. +func (m *MockStore) CreateSystemNotification(arg0 context.Context, arg1 db.CreateSystemNotificationParams) (db.SystemNotification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateSystemNotification", arg0, arg1) + ret0, _ := ret[0].(db.SystemNotification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateSystemNotification indicates an expected call of CreateSystemNotification. +func (mr *MockStoreMockRecorder) CreateSystemNotification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSystemNotification", reflect.TypeOf((*MockStore)(nil).CreateSystemNotification), arg0, arg1) +} + +// CreateSystemNotificationTx mocks base method. +func (m *MockStore) CreateSystemNotificationTx(arg0 context.Context, arg1 db.CreateSystemNotificationTxParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateSystemNotificationTx", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateSystemNotificationTx indicates an expected call of CreateSystemNotificationTx. +func (mr *MockStoreMockRecorder) CreateSystemNotificationTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSystemNotificationTx", reflect.TypeOf((*MockStore)(nil).CreateSystemNotificationTx), arg0, arg1) +} + +// CreateUser mocks base method. +func (m *MockStore) CreateUser(arg0 context.Context, arg1 db.CreateUserParams) (db.User, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateUser", arg0, arg1) + ret0, _ := ret[0].(db.User) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateUser indicates an expected call of CreateUser. +func (mr *MockStoreMockRecorder) CreateUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*MockStore)(nil).CreateUser), arg0, arg1) +} + +// CreateUserTx mocks base method. +func (m *MockStore) CreateUserTx(arg0 context.Context, arg1 db.CreateUserTxParams) (db.CreateUserTxResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateUserTx", arg0, arg1) + ret0, _ := ret[0].(db.CreateUserTxResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateUserTx indicates an expected call of CreateUserTx. +func (mr *MockStoreMockRecorder) CreateUserTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUserTx", reflect.TypeOf((*MockStore)(nil).CreateUserTx), arg0, arg1) +} + +// CreateVerification mocks base method. +func (m *MockStore) CreateVerification(arg0 context.Context, arg1 db.CreateVerificationParams) (db.Verification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateVerification", arg0, arg1) + ret0, _ := ret[0].(db.Verification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateVerification indicates an expected call of CreateVerification. +func (mr *MockStoreMockRecorder) CreateVerification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateVerification", reflect.TypeOf((*MockStore)(nil).CreateVerification), arg0, arg1) +} + +// DeleteComment mocks base method. +func (m *MockStore) DeleteComment(arg0 context.Context, arg1 int64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteComment", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteComment indicates an expected call of DeleteComment. +func (mr *MockStoreMockRecorder) DeleteComment(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteComment", reflect.TypeOf((*MockStore)(nil).DeleteComment), arg0, arg1) +} + +// DeleteCommentRelation mocks base method. +func (m *MockStore) DeleteCommentRelation(arg0 context.Context, arg1 db.DeleteCommentRelationParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteCommentRelation", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteCommentRelation indicates an expected call of DeleteCommentRelation. +func (mr *MockStoreMockRecorder) DeleteCommentRelation(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCommentRelation", reflect.TypeOf((*MockStore)(nil).DeleteCommentRelation), arg0, arg1) +} + +// DeleteFollow mocks base method. +func (m *MockStore) DeleteFollow(arg0 context.Context, arg1 db.DeleteFollowParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteFollow", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteFollow indicates an expected call of DeleteFollow. +func (mr *MockStoreMockRecorder) DeleteFollow(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteFollow", reflect.TypeOf((*MockStore)(nil).DeleteFollow), arg0, arg1) +} + +// DeleteFollowTx mocks base method. +func (m *MockStore) DeleteFollowTx(arg0 context.Context, arg1 db.DeleteFollowTxParams) (db.DeleteFollowTxResult, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteFollowTx", arg0, arg1) + ret0, _ := ret[0].(db.DeleteFollowTxResult) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteFollowTx indicates an expected call of DeleteFollowTx. +func (mr *MockStoreMockRecorder) DeleteFollowTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteFollowTx", reflect.TypeOf((*MockStore)(nil).DeleteFollowTx), arg0, arg1) +} + +// DeleteFollowerNotification mocks base method. +func (m *MockStore) DeleteFollowerNotification(arg0 context.Context, arg1 db.DeleteFollowerNotificationParams) (db.FollowerNotification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteFollowerNotification", arg0, arg1) + ret0, _ := ret[0].(db.FollowerNotification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteFollowerNotification indicates an expected call of DeleteFollowerNotification. +func (mr *MockStoreMockRecorder) DeleteFollowerNotification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteFollowerNotification", reflect.TypeOf((*MockStore)(nil).DeleteFollowerNotification), arg0, arg1) +} + +// DeleteMarkdownMulti mocks base method. +func (m *MockStore) DeleteMarkdownMulti(arg0 context.Context, arg1 db.DeleteMarkdownMultiParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteMarkdownMulti", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteMarkdownMulti indicates an expected call of DeleteMarkdownMulti. +func (mr *MockStoreMockRecorder) DeleteMarkdownMulti(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteMarkdownMulti", reflect.TypeOf((*MockStore)(nil).DeleteMarkdownMulti), arg0, arg1) +} + +// DeleteOAuth mocks base method. +func (m *MockStore) DeleteOAuth(arg0 context.Context, arg1 db.DeleteOAuthParams) (db.Oauth, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteOAuth", arg0, arg1) + ret0, _ := ret[0].(db.Oauth) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteOAuth indicates an expected call of DeleteOAuth. +func (mr *MockStoreMockRecorder) DeleteOAuth(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOAuth", reflect.TypeOf((*MockStore)(nil).DeleteOAuth), arg0, arg1) +} + +// DeleteRepo mocks base method. +func (m *MockStore) DeleteRepo(arg0 context.Context, arg1 int64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRepo", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteRepo indicates an expected call of DeleteRepo. +func (mr *MockStoreMockRecorder) DeleteRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRepo", reflect.TypeOf((*MockStore)(nil).DeleteRepo), arg0, arg1) +} + +// DeleteRepoRelation mocks base method. +func (m *MockStore) DeleteRepoRelation(arg0 context.Context, arg1 db.DeleteRepoRelationParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRepoRelation", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteRepoRelation indicates an expected call of DeleteRepoRelation. +func (mr *MockStoreMockRecorder) DeleteRepoRelation(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRepoRelation", reflect.TypeOf((*MockStore)(nil).DeleteRepoRelation), arg0, arg1) +} + +// DeleteRepoTx mocks base method. +func (m *MockStore) DeleteRepoTx(arg0 context.Context, arg1 db.DeleteRepoTxParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRepoTx", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteRepoTx indicates an expected call of DeleteRepoTx. +func (mr *MockStoreMockRecorder) DeleteRepoTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRepoTx", reflect.TypeOf((*MockStore)(nil).DeleteRepoTx), arg0, arg1) +} + +// DeleteUser mocks base method. +func (m *MockStore) DeleteUser(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteUser", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteUser indicates an expected call of DeleteUser. +func (mr *MockStoreMockRecorder) DeleteUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUser", reflect.TypeOf((*MockStore)(nil).DeleteUser), arg0, arg1) +} + +// DeleteUserTx mocks base method. +func (m *MockStore) DeleteUserTx(arg0 context.Context, arg1 db.DeleteUserTxParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteUserTx", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteUserTx indicates an expected call of DeleteUserTx. +func (mr *MockStoreMockRecorder) DeleteUserTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUserTx", reflect.TypeOf((*MockStore)(nil).DeleteUserTx), arg0, arg1) +} + +// GetCommentBasicInfo mocks base method. +func (m *MockStore) GetCommentBasicInfo(arg0 context.Context, arg1 int64) (db.GetCommentBasicInfoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCommentBasicInfo", arg0, arg1) + ret0, _ := ret[0].(db.GetCommentBasicInfoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCommentBasicInfo indicates an expected call of GetCommentBasicInfo. +func (mr *MockStoreMockRecorder) GetCommentBasicInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommentBasicInfo", reflect.TypeOf((*MockStore)(nil).GetCommentBasicInfo), arg0, arg1) +} + +// GetCommentDetail mocks base method. +func (m *MockStore) GetCommentDetail(arg0 context.Context, arg1 db.GetCommentDetailParams) (db.GetCommentDetailRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCommentDetail", arg0, arg1) + ret0, _ := ret[0].(db.GetCommentDetailRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCommentDetail indicates an expected call of GetCommentDetail. +func (mr *MockStoreMockRecorder) GetCommentDetail(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommentDetail", reflect.TypeOf((*MockStore)(nil).GetCommentDetail), arg0, arg1) +} + +// GetCommentRepoInfo mocks base method. +func (m *MockStore) GetCommentRepoInfo(arg0 context.Context, arg1 int64) (db.Repo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCommentRepoInfo", arg0, arg1) + ret0, _ := ret[0].(db.Repo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCommentRepoInfo indicates an expected call of GetCommentRepoInfo. +func (mr *MockStoreMockRecorder) GetCommentRepoInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommentRepoInfo", reflect.TypeOf((*MockStore)(nil).GetCommentRepoInfo), arg0, arg1) +} + +// GetConfiguration mocks base method. +func (m *MockStore) GetConfiguration(arg0 context.Context, arg1 string) (db.Configuration, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetConfiguration", arg0, arg1) + ret0, _ := ret[0].(db.Configuration) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetConfiguration indicates an expected call of GetConfiguration. +func (mr *MockStoreMockRecorder) GetConfiguration(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetConfiguration", reflect.TypeOf((*MockStore)(nil).GetConfiguration), arg0, arg1) +} + +// GetDailyActiveUserCount mocks base method. +func (m *MockStore) GetDailyActiveUserCount(arg0 context.Context, arg1 db.GetDailyActiveUserCountParams) ([]db.GetDailyActiveUserCountRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDailyActiveUserCount", arg0, arg1) + ret0, _ := ret[0].([]db.GetDailyActiveUserCountRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDailyActiveUserCount indicates an expected call of GetDailyActiveUserCount. +func (mr *MockStoreMockRecorder) GetDailyActiveUserCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDailyActiveUserCount", reflect.TypeOf((*MockStore)(nil).GetDailyActiveUserCount), arg0, arg1) +} + +// GetDailyCreateUserCount mocks base method. +func (m *MockStore) GetDailyCreateUserCount(arg0 context.Context, arg1 db.GetDailyCreateUserCountParams) ([]db.GetDailyCreateUserCountRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDailyCreateUserCount", arg0, arg1) + ret0, _ := ret[0].([]db.GetDailyCreateUserCountRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDailyCreateUserCount indicates an expected call of GetDailyCreateUserCount. +func (mr *MockStoreMockRecorder) GetDailyCreateUserCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDailyCreateUserCount", reflect.TypeOf((*MockStore)(nil).GetDailyCreateUserCount), arg0, arg1) +} + +// GetGeoInfo mocks base method. +func (m *MockStore) GetGeoInfo(arg0 context.Context, arg1 netip.Addr) (db.Geoip, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetGeoInfo", arg0, arg1) + ret0, _ := ret[0].(db.Geoip) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetGeoInfo indicates an expected call of GetGeoInfo. +func (mr *MockStoreMockRecorder) GetGeoInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGeoInfo", reflect.TypeOf((*MockStore)(nil).GetGeoInfo), arg0, arg1) +} + +// GetInvitation mocks base method. +func (m *MockStore) GetInvitation(arg0 context.Context, arg1 db.GetInvitationParams) (db.Invitation, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetInvitation", arg0, arg1) + ret0, _ := ret[0].(db.Invitation) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetInvitation indicates an expected call of GetInvitation. +func (mr *MockStoreMockRecorder) GetInvitation(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInvitation", reflect.TypeOf((*MockStore)(nil).GetInvitation), arg0, arg1) +} + +// GetListCommentCount mocks base method. +func (m *MockStore) GetListCommentCount(arg0 context.Context) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListCommentCount", arg0) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListCommentCount indicates an expected call of GetListCommentCount. +func (mr *MockStoreMockRecorder) GetListCommentCount(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListCommentCount", reflect.TypeOf((*MockStore)(nil).GetListCommentCount), arg0) +} + +// GetListCommentLevelOneCount mocks base method. +func (m *MockStore) GetListCommentLevelOneCount(arg0 context.Context, arg1 int64) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListCommentLevelOneCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListCommentLevelOneCount indicates an expected call of GetListCommentLevelOneCount. +func (mr *MockStoreMockRecorder) GetListCommentLevelOneCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListCommentLevelOneCount", reflect.TypeOf((*MockStore)(nil).GetListCommentLevelOneCount), arg0, arg1) +} + +// GetListCommentLevelTwoCount mocks base method. +func (m *MockStore) GetListCommentLevelTwoCount(arg0 context.Context, arg1 pgtype.Int8) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListCommentLevelTwoCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListCommentLevelTwoCount indicates an expected call of GetListCommentLevelTwoCount. +func (mr *MockStoreMockRecorder) GetListCommentLevelTwoCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListCommentLevelTwoCount", reflect.TypeOf((*MockStore)(nil).GetListCommentLevelTwoCount), arg0, arg1) +} + +// GetListCommentNotificationUnreadedCount mocks base method. +func (m *MockStore) GetListCommentNotificationUnreadedCount(arg0 context.Context, arg1 int64) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListCommentNotificationUnreadedCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListCommentNotificationUnreadedCount indicates an expected call of GetListCommentNotificationUnreadedCount. +func (mr *MockStoreMockRecorder) GetListCommentNotificationUnreadedCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListCommentNotificationUnreadedCount", reflect.TypeOf((*MockStore)(nil).GetListCommentNotificationUnreadedCount), arg0, arg1) +} + +// GetListCommentReportCount mocks base method. +func (m *MockStore) GetListCommentReportCount(arg0 context.Context) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListCommentReportCount", arg0) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListCommentReportCount indicates an expected call of GetListCommentReportCount. +func (mr *MockStoreMockRecorder) GetListCommentReportCount(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListCommentReportCount", reflect.TypeOf((*MockStore)(nil).GetListCommentReportCount), arg0) +} + +// GetListFollowerCount mocks base method. +func (m *MockStore) GetListFollowerCount(arg0 context.Context, arg1 db.GetListFollowerCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListFollowerCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListFollowerCount indicates an expected call of GetListFollowerCount. +func (mr *MockStoreMockRecorder) GetListFollowerCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListFollowerCount", reflect.TypeOf((*MockStore)(nil).GetListFollowerCount), arg0, arg1) +} + +// GetListFollowerNotificationUnreadedCount mocks base method. +func (m *MockStore) GetListFollowerNotificationUnreadedCount(arg0 context.Context, arg1 int64) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListFollowerNotificationUnreadedCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListFollowerNotificationUnreadedCount indicates an expected call of GetListFollowerNotificationUnreadedCount. +func (mr *MockStoreMockRecorder) GetListFollowerNotificationUnreadedCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListFollowerNotificationUnreadedCount", reflect.TypeOf((*MockStore)(nil).GetListFollowerNotificationUnreadedCount), arg0, arg1) +} + +// GetListFollowingCount mocks base method. +func (m *MockStore) GetListFollowingCount(arg0 context.Context, arg1 db.GetListFollowingCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListFollowingCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListFollowingCount indicates an expected call of GetListFollowingCount. +func (mr *MockStoreMockRecorder) GetListFollowingCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListFollowingCount", reflect.TypeOf((*MockStore)(nil).GetListFollowingCount), arg0, arg1) +} + +// GetListRepoCount mocks base method. +func (m *MockStore) GetListRepoCount(arg0 context.Context, arg1 db.GetListRepoCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListRepoCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListRepoCount indicates an expected call of GetListRepoCount. +func (mr *MockStoreMockRecorder) GetListRepoCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListRepoCount", reflect.TypeOf((*MockStore)(nil).GetListRepoCount), arg0, arg1) +} + +// GetListRepoNotificationUnreadedCount mocks base method. +func (m *MockStore) GetListRepoNotificationUnreadedCount(arg0 context.Context, arg1 int64) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListRepoNotificationUnreadedCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListRepoNotificationUnreadedCount indicates an expected call of GetListRepoNotificationUnreadedCount. +func (mr *MockStoreMockRecorder) GetListRepoNotificationUnreadedCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListRepoNotificationUnreadedCount", reflect.TypeOf((*MockStore)(nil).GetListRepoNotificationUnreadedCount), arg0, arg1) +} + +// GetListSessionCount mocks base method. +func (m *MockStore) GetListSessionCount(arg0 context.Context) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListSessionCount", arg0) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListSessionCount indicates an expected call of GetListSessionCount. +func (mr *MockStoreMockRecorder) GetListSessionCount(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListSessionCount", reflect.TypeOf((*MockStore)(nil).GetListSessionCount), arg0) +} + +// GetListSystemNotificationUnReadedCount mocks base method. +func (m *MockStore) GetListSystemNotificationUnReadedCount(arg0 context.Context, arg1 int64) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListSystemNotificationUnReadedCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListSystemNotificationUnReadedCount indicates an expected call of GetListSystemNotificationUnReadedCount. +func (mr *MockStoreMockRecorder) GetListSystemNotificationUnReadedCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListSystemNotificationUnReadedCount", reflect.TypeOf((*MockStore)(nil).GetListSystemNotificationUnReadedCount), arg0, arg1) +} + +// GetListUserCount mocks base method. +func (m *MockStore) GetListUserCount(arg0 context.Context, arg1 string) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListUserCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListUserCount indicates an expected call of GetListUserCount. +func (mr *MockStoreMockRecorder) GetListUserCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListUserCount", reflect.TypeOf((*MockStore)(nil).GetListUserCount), arg0, arg1) +} + +// GetListUserLikeRepoCount mocks base method. +func (m *MockStore) GetListUserLikeRepoCount(arg0 context.Context, arg1 db.GetListUserLikeRepoCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListUserLikeRepoCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListUserLikeRepoCount indicates an expected call of GetListUserLikeRepoCount. +func (mr *MockStoreMockRecorder) GetListUserLikeRepoCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListUserLikeRepoCount", reflect.TypeOf((*MockStore)(nil).GetListUserLikeRepoCount), arg0, arg1) +} + +// GetListUserOwnRepoCount mocks base method. +func (m *MockStore) GetListUserOwnRepoCount(arg0 context.Context, arg1 db.GetListUserOwnRepoCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetListUserOwnRepoCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetListUserOwnRepoCount indicates an expected call of GetListUserOwnRepoCount. +func (mr *MockStoreMockRecorder) GetListUserOwnRepoCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetListUserOwnRepoCount", reflect.TypeOf((*MockStore)(nil).GetListUserOwnRepoCount), arg0, arg1) +} + +// GetMarkdownByID mocks base method. +func (m *MockStore) GetMarkdownByID(arg0 context.Context, arg1 int64) (db.Markdown, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMarkdownByID", arg0, arg1) + ret0, _ := ret[0].(db.Markdown) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetMarkdownByID indicates an expected call of GetMarkdownByID. +func (mr *MockStoreMockRecorder) GetMarkdownByID(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMarkdownByID", reflect.TypeOf((*MockStore)(nil).GetMarkdownByID), arg0, arg1) +} + +// GetMarkdownContent mocks base method. +func (m *MockStore) GetMarkdownContent(arg0 context.Context, arg1 db.GetMarkdownContentParams) (db.Markdown, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMarkdownContent", arg0, arg1) + ret0, _ := ret[0].(db.Markdown) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetMarkdownContent indicates an expected call of GetMarkdownContent. +func (mr *MockStoreMockRecorder) GetMarkdownContent(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMarkdownContent", reflect.TypeOf((*MockStore)(nil).GetMarkdownContent), arg0, arg1) +} + +// GetMarkdownRepoID mocks base method. +func (m *MockStore) GetMarkdownRepoID(arg0 context.Context, arg1 int64) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetMarkdownRepoID", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetMarkdownRepoID indicates an expected call of GetMarkdownRepoID. +func (mr *MockStoreMockRecorder) GetMarkdownRepoID(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMarkdownRepoID", reflect.TypeOf((*MockStore)(nil).GetMarkdownRepoID), arg0, arg1) +} + +// GetOAuthUser mocks base method. +func (m *MockStore) GetOAuthUser(arg0 context.Context, arg1 db.GetOAuthUserParams) (db.GetOAuthUserRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetOAuthUser", arg0, arg1) + ret0, _ := ret[0].(db.GetOAuthUserRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetOAuthUser indicates an expected call of GetOAuthUser. +func (mr *MockStoreMockRecorder) GetOAuthUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOAuthUser", reflect.TypeOf((*MockStore)(nil).GetOAuthUser), arg0, arg1) +} + +// GetQueryCommentCount mocks base method. +func (m *MockStore) GetQueryCommentCount(arg0 context.Context, arg1 string) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryCommentCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryCommentCount indicates an expected call of GetQueryCommentCount. +func (mr *MockStoreMockRecorder) GetQueryCommentCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCommentCount", reflect.TypeOf((*MockStore)(nil).GetQueryCommentCount), arg0, arg1) +} + +// GetQueryCommentReportCount mocks base method. +func (m *MockStore) GetQueryCommentReportCount(arg0 context.Context, arg1 string) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryCommentReportCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryCommentReportCount indicates an expected call of GetQueryCommentReportCount. +func (mr *MockStoreMockRecorder) GetQueryCommentReportCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCommentReportCount", reflect.TypeOf((*MockStore)(nil).GetQueryCommentReportCount), arg0, arg1) +} + +// GetQueryFollowerCount mocks base method. +func (m *MockStore) GetQueryFollowerCount(arg0 context.Context, arg1 db.GetQueryFollowerCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryFollowerCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryFollowerCount indicates an expected call of GetQueryFollowerCount. +func (mr *MockStoreMockRecorder) GetQueryFollowerCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryFollowerCount", reflect.TypeOf((*MockStore)(nil).GetQueryFollowerCount), arg0, arg1) +} + +// GetQueryFollowingCount mocks base method. +func (m *MockStore) GetQueryFollowingCount(arg0 context.Context, arg1 db.GetQueryFollowingCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryFollowingCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryFollowingCount indicates an expected call of GetQueryFollowingCount. +func (mr *MockStoreMockRecorder) GetQueryFollowingCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryFollowingCount", reflect.TypeOf((*MockStore)(nil).GetQueryFollowingCount), arg0, arg1) +} + +// GetQueryRepoCount mocks base method. +func (m *MockStore) GetQueryRepoCount(arg0 context.Context, arg1 db.GetQueryRepoCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryRepoCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryRepoCount indicates an expected call of GetQueryRepoCount. +func (mr *MockStoreMockRecorder) GetQueryRepoCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryRepoCount", reflect.TypeOf((*MockStore)(nil).GetQueryRepoCount), arg0, arg1) +} + +// GetQuerySessionCount mocks base method. +func (m *MockStore) GetQuerySessionCount(arg0 context.Context, arg1 string) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQuerySessionCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQuerySessionCount indicates an expected call of GetQuerySessionCount. +func (mr *MockStoreMockRecorder) GetQuerySessionCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQuerySessionCount", reflect.TypeOf((*MockStore)(nil).GetQuerySessionCount), arg0, arg1) +} + +// GetQueryUserCount mocks base method. +func (m *MockStore) GetQueryUserCount(arg0 context.Context, arg1 db.GetQueryUserCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryUserCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryUserCount indicates an expected call of GetQueryUserCount. +func (mr *MockStoreMockRecorder) GetQueryUserCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryUserCount", reflect.TypeOf((*MockStore)(nil).GetQueryUserCount), arg0, arg1) +} + +// GetQueryUserLikeRepoCount mocks base method. +func (m *MockStore) GetQueryUserLikeRepoCount(arg0 context.Context, arg1 db.GetQueryUserLikeRepoCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryUserLikeRepoCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryUserLikeRepoCount indicates an expected call of GetQueryUserLikeRepoCount. +func (mr *MockStoreMockRecorder) GetQueryUserLikeRepoCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryUserLikeRepoCount", reflect.TypeOf((*MockStore)(nil).GetQueryUserLikeRepoCount), arg0, arg1) +} + +// GetQueryUserOwnRepoCount mocks base method. +func (m *MockStore) GetQueryUserOwnRepoCount(arg0 context.Context, arg1 db.GetQueryUserOwnRepoCountParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetQueryUserOwnRepoCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetQueryUserOwnRepoCount indicates an expected call of GetQueryUserOwnRepoCount. +func (mr *MockStoreMockRecorder) GetQueryUserOwnRepoCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryUserOwnRepoCount", reflect.TypeOf((*MockStore)(nil).GetQueryUserOwnRepoCount), arg0, arg1) +} + +// GetRepo mocks base method. +func (m *MockStore) GetRepo(arg0 context.Context, arg1 int64) (db.Repo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRepo", arg0, arg1) + ret0, _ := ret[0].(db.Repo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRepo indicates an expected call of GetRepo. +func (mr *MockStoreMockRecorder) GetRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepo", reflect.TypeOf((*MockStore)(nil).GetRepo), arg0, arg1) +} + +// GetRepoBasicInfo mocks base method. +func (m *MockStore) GetRepoBasicInfo(arg0 context.Context, arg1 db.GetRepoBasicInfoParams) (db.GetRepoBasicInfoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRepoBasicInfo", arg0, arg1) + ret0, _ := ret[0].(db.GetRepoBasicInfoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRepoBasicInfo indicates an expected call of GetRepoBasicInfo. +func (mr *MockStoreMockRecorder) GetRepoBasicInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepoBasicInfo", reflect.TypeOf((*MockStore)(nil).GetRepoBasicInfo), arg0, arg1) +} + +// GetRepoByRepoName mocks base method. +func (m *MockStore) GetRepoByRepoName(arg0 context.Context, arg1 db.GetRepoByRepoNameParams) (db.GetRepoByRepoNameRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRepoByRepoName", arg0, arg1) + ret0, _ := ret[0].(db.GetRepoByRepoNameRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRepoByRepoName indicates an expected call of GetRepoByRepoName. +func (mr *MockStoreMockRecorder) GetRepoByRepoName(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepoByRepoName", reflect.TypeOf((*MockStore)(nil).GetRepoByRepoName), arg0, arg1) +} + +// GetRepoConfig mocks base method. +func (m *MockStore) GetRepoConfig(arg0 context.Context, arg1 db.GetRepoConfigParams) (db.GetRepoConfigRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRepoConfig", arg0, arg1) + ret0, _ := ret[0].(db.GetRepoConfigRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRepoConfig indicates an expected call of GetRepoConfig. +func (mr *MockStoreMockRecorder) GetRepoConfig(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepoConfig", reflect.TypeOf((*MockStore)(nil).GetRepoConfig), arg0, arg1) +} + +// GetRepoID mocks base method. +func (m *MockStore) GetRepoID(arg0 context.Context, arg1 db.GetRepoIDParams) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRepoID", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRepoID indicates an expected call of GetRepoID. +func (mr *MockStoreMockRecorder) GetRepoID(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepoID", reflect.TypeOf((*MockStore)(nil).GetRepoID), arg0, arg1) +} + +// GetRepoPermission mocks base method. +func (m *MockStore) GetRepoPermission(arg0 context.Context, arg1 int64) (db.GetRepoPermissionRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRepoPermission", arg0, arg1) + ret0, _ := ret[0].(db.GetRepoPermissionRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRepoPermission indicates an expected call of GetRepoPermission. +func (mr *MockStoreMockRecorder) GetRepoPermission(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepoPermission", reflect.TypeOf((*MockStore)(nil).GetRepoPermission), arg0, arg1) +} + +// GetRepoRelation mocks base method. +func (m *MockStore) GetRepoRelation(arg0 context.Context, arg1 db.GetRepoRelationParams) (db.RepoRelation, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRepoRelation", arg0, arg1) + ret0, _ := ret[0].(db.RepoRelation) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRepoRelation indicates an expected call of GetRepoRelation. +func (mr *MockStoreMockRecorder) GetRepoRelation(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepoRelation", reflect.TypeOf((*MockStore)(nil).GetRepoRelation), arg0, arg1) +} + +// GetRepoVisibilityByRepoCount mocks base method. +func (m *MockStore) GetRepoVisibilityByRepoCount(arg0 context.Context, arg1 int64) (int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRepoVisibilityByRepoCount", arg0, arg1) + ret0, _ := ret[0].(int64) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRepoVisibilityByRepoCount indicates an expected call of GetRepoVisibilityByRepoCount. +func (mr *MockStoreMockRecorder) GetRepoVisibilityByRepoCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepoVisibilityByRepoCount", reflect.TypeOf((*MockStore)(nil).GetRepoVisibilityByRepoCount), arg0, arg1) +} + +// GetSession mocks base method. +func (m *MockStore) GetSession(arg0 context.Context, arg1 uuid.UUID) (db.Session, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSession", arg0, arg1) + ret0, _ := ret[0].(db.Session) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSession indicates an expected call of GetSession. +func (mr *MockStoreMockRecorder) GetSession(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSession", reflect.TypeOf((*MockStore)(nil).GetSession), arg0, arg1) +} + +// GetUnReadCount mocks base method. +func (m *MockStore) GetUnReadCount(arg0 context.Context, arg1 string) (int32, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUnReadCount", arg0, arg1) + ret0, _ := ret[0].(int32) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetUnReadCount indicates an expected call of GetUnReadCount. +func (mr *MockStoreMockRecorder) GetUnReadCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUnReadCount", reflect.TypeOf((*MockStore)(nil).GetUnReadCount), arg0, arg1) +} + +// GetUserByEmail mocks base method. +func (m *MockStore) GetUserByEmail(arg0 context.Context, arg1 string) (db.User, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUserByEmail", arg0, arg1) + ret0, _ := ret[0].(db.User) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetUserByEmail indicates an expected call of GetUserByEmail. +func (mr *MockStoreMockRecorder) GetUserByEmail(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserByEmail", reflect.TypeOf((*MockStore)(nil).GetUserByEmail), arg0, arg1) +} + +// GetUserByUsername mocks base method. +func (m *MockStore) GetUserByUsername(arg0 context.Context, arg1 string) (db.User, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUserByUsername", arg0, arg1) + ret0, _ := ret[0].(db.User) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetUserByUsername indicates an expected call of GetUserByUsername. +func (mr *MockStoreMockRecorder) GetUserByUsername(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserByUsername", reflect.TypeOf((*MockStore)(nil).GetUserByUsername), arg0, arg1) +} + +// GetUserInfo mocks base method. +func (m *MockStore) GetUserInfo(arg0 context.Context, arg1 db.GetUserInfoParams) (db.GetUserInfoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUserInfo", arg0, arg1) + ret0, _ := ret[0].(db.GetUserInfoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetUserInfo indicates an expected call of GetUserInfo. +func (mr *MockStoreMockRecorder) GetUserInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserInfo", reflect.TypeOf((*MockStore)(nil).GetUserInfo), arg0, arg1) +} + +// GetVerification mocks base method. +func (m *MockStore) GetVerification(arg0 context.Context, arg1 string) (db.GetVerificationRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVerification", arg0, arg1) + ret0, _ := ret[0].(db.GetVerificationRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVerification indicates an expected call of GetVerification. +func (mr *MockStoreMockRecorder) GetVerification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVerification", reflect.TypeOf((*MockStore)(nil).GetVerification), arg0, arg1) +} + +// IsFollowing mocks base method. +func (m *MockStore) IsFollowing(arg0 context.Context, arg1 db.IsFollowingParams) (bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsFollowing", arg0, arg1) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// IsFollowing indicates an expected call of IsFollowing. +func (mr *MockStoreMockRecorder) IsFollowing(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsFollowing", reflect.TypeOf((*MockStore)(nil).IsFollowing), arg0, arg1) +} + +// ListComment mocks base method. +func (m *MockStore) ListComment(arg0 context.Context, arg1 db.ListCommentParams) ([]db.ListCommentRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListComment", arg0, arg1) + ret0, _ := ret[0].([]db.ListCommentRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListComment indicates an expected call of ListComment. +func (mr *MockStoreMockRecorder) ListComment(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListComment", reflect.TypeOf((*MockStore)(nil).ListComment), arg0, arg1) +} + +// ListCommentLevelOne mocks base method. +func (m *MockStore) ListCommentLevelOne(arg0 context.Context, arg1 db.ListCommentLevelOneParams) ([]db.ListCommentLevelOneRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListCommentLevelOne", arg0, arg1) + ret0, _ := ret[0].([]db.ListCommentLevelOneRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListCommentLevelOne indicates an expected call of ListCommentLevelOne. +func (mr *MockStoreMockRecorder) ListCommentLevelOne(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCommentLevelOne", reflect.TypeOf((*MockStore)(nil).ListCommentLevelOne), arg0, arg1) +} + +// ListCommentLevelTwo mocks base method. +func (m *MockStore) ListCommentLevelTwo(arg0 context.Context, arg1 db.ListCommentLevelTwoParams) ([]db.ListCommentLevelTwoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListCommentLevelTwo", arg0, arg1) + ret0, _ := ret[0].([]db.ListCommentLevelTwoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListCommentLevelTwo indicates an expected call of ListCommentLevelTwo. +func (mr *MockStoreMockRecorder) ListCommentLevelTwo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCommentLevelTwo", reflect.TypeOf((*MockStore)(nil).ListCommentLevelTwo), arg0, arg1) +} + +// ListCommentNotification mocks base method. +func (m *MockStore) ListCommentNotification(arg0 context.Context, arg1 db.ListCommentNotificationParams) ([]db.ListCommentNotificationRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListCommentNotification", arg0, arg1) + ret0, _ := ret[0].([]db.ListCommentNotificationRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListCommentNotification indicates an expected call of ListCommentNotification. +func (mr *MockStoreMockRecorder) ListCommentNotification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCommentNotification", reflect.TypeOf((*MockStore)(nil).ListCommentNotification), arg0, arg1) +} + +// ListCommentReport mocks base method. +func (m *MockStore) ListCommentReport(arg0 context.Context, arg1 db.ListCommentReportParams) ([]db.ListCommentReportRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListCommentReport", arg0, arg1) + ret0, _ := ret[0].([]db.ListCommentReportRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListCommentReport indicates an expected call of ListCommentReport. +func (mr *MockStoreMockRecorder) ListCommentReport(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCommentReport", reflect.TypeOf((*MockStore)(nil).ListCommentReport), arg0, arg1) +} + +// ListFollower mocks base method. +func (m *MockStore) ListFollower(arg0 context.Context, arg1 db.ListFollowerParams) ([]db.ListFollowerRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListFollower", arg0, arg1) + ret0, _ := ret[0].([]db.ListFollowerRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListFollower indicates an expected call of ListFollower. +func (mr *MockStoreMockRecorder) ListFollower(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListFollower", reflect.TypeOf((*MockStore)(nil).ListFollower), arg0, arg1) +} + +// ListFollowerNotification mocks base method. +func (m *MockStore) ListFollowerNotification(arg0 context.Context, arg1 db.ListFollowerNotificationParams) ([]db.ListFollowerNotificationRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListFollowerNotification", arg0, arg1) + ret0, _ := ret[0].([]db.ListFollowerNotificationRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListFollowerNotification indicates an expected call of ListFollowerNotification. +func (mr *MockStoreMockRecorder) ListFollowerNotification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListFollowerNotification", reflect.TypeOf((*MockStore)(nil).ListFollowerNotification), arg0, arg1) +} + +// ListFollowing mocks base method. +func (m *MockStore) ListFollowing(arg0 context.Context, arg1 db.ListFollowingParams) ([]db.ListFollowingRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListFollowing", arg0, arg1) + ret0, _ := ret[0].([]db.ListFollowingRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListFollowing indicates an expected call of ListFollowing. +func (mr *MockStoreMockRecorder) ListFollowing(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListFollowing", reflect.TypeOf((*MockStore)(nil).ListFollowing), arg0, arg1) +} + +// ListRepo mocks base method. +func (m *MockStore) ListRepo(arg0 context.Context, arg1 db.ListRepoParams) ([]db.ListRepoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListRepo", arg0, arg1) + ret0, _ := ret[0].([]db.ListRepoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListRepo indicates an expected call of ListRepo. +func (mr *MockStoreMockRecorder) ListRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRepo", reflect.TypeOf((*MockStore)(nil).ListRepo), arg0, arg1) +} + +// ListRepoNotification mocks base method. +func (m *MockStore) ListRepoNotification(arg0 context.Context, arg1 db.ListRepoNotificationParams) ([]db.ListRepoNotificationRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListRepoNotification", arg0, arg1) + ret0, _ := ret[0].([]db.ListRepoNotificationRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListRepoNotification indicates an expected call of ListRepoNotification. +func (mr *MockStoreMockRecorder) ListRepoNotification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRepoNotification", reflect.TypeOf((*MockStore)(nil).ListRepoNotification), arg0, arg1) +} + +// ListRepoVisibilityByRepo mocks base method. +func (m *MockStore) ListRepoVisibilityByRepo(arg0 context.Context, arg1 db.ListRepoVisibilityByRepoParams) ([]db.User, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListRepoVisibilityByRepo", arg0, arg1) + ret0, _ := ret[0].([]db.User) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListRepoVisibilityByRepo indicates an expected call of ListRepoVisibilityByRepo. +func (mr *MockStoreMockRecorder) ListRepoVisibilityByRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRepoVisibilityByRepo", reflect.TypeOf((*MockStore)(nil).ListRepoVisibilityByRepo), arg0, arg1) +} + +// ListSession mocks base method. +func (m *MockStore) ListSession(arg0 context.Context, arg1 db.ListSessionParams) ([]db.ListSessionRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListSession", arg0, arg1) + ret0, _ := ret[0].([]db.ListSessionRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListSession indicates an expected call of ListSession. +func (mr *MockStoreMockRecorder) ListSession(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSession", reflect.TypeOf((*MockStore)(nil).ListSession), arg0, arg1) +} + +// ListSystemNotification mocks base method. +func (m *MockStore) ListSystemNotification(arg0 context.Context, arg1 db.ListSystemNotificationParams) ([]db.ListSystemNotificationRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListSystemNotification", arg0, arg1) + ret0, _ := ret[0].([]db.ListSystemNotificationRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListSystemNotification indicates an expected call of ListSystemNotification. +func (mr *MockStoreMockRecorder) ListSystemNotification(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSystemNotification", reflect.TypeOf((*MockStore)(nil).ListSystemNotification), arg0, arg1) +} + +// ListUser mocks base method. +func (m *MockStore) ListUser(arg0 context.Context, arg1 db.ListUserParams) ([]db.User, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListUser", arg0, arg1) + ret0, _ := ret[0].([]db.User) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListUser indicates an expected call of ListUser. +func (mr *MockStoreMockRecorder) ListUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUser", reflect.TypeOf((*MockStore)(nil).ListUser), arg0, arg1) +} + +// ListUserLikeRepo mocks base method. +func (m *MockStore) ListUserLikeRepo(arg0 context.Context, arg1 db.ListUserLikeRepoParams) ([]db.ListUserLikeRepoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListUserLikeRepo", arg0, arg1) + ret0, _ := ret[0].([]db.ListUserLikeRepoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListUserLikeRepo indicates an expected call of ListUserLikeRepo. +func (mr *MockStoreMockRecorder) ListUserLikeRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUserLikeRepo", reflect.TypeOf((*MockStore)(nil).ListUserLikeRepo), arg0, arg1) +} + +// ListUserOwnRepo mocks base method. +func (m *MockStore) ListUserOwnRepo(arg0 context.Context, arg1 db.ListUserOwnRepoParams) ([]db.ListUserOwnRepoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListUserOwnRepo", arg0, arg1) + ret0, _ := ret[0].([]db.ListUserOwnRepoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListUserOwnRepo indicates an expected call of ListUserOwnRepo. +func (mr *MockStoreMockRecorder) ListUserOwnRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUserOwnRepo", reflect.TypeOf((*MockStore)(nil).ListUserOwnRepo), arg0, arg1) +} + +// ManualSyncRepoTx mocks base method. +func (m *MockStore) ManualSyncRepoTx(arg0 context.Context, arg1 db.ManualSyncRepoTxParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ManualSyncRepoTx", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ManualSyncRepoTx indicates an expected call of ManualSyncRepoTx. +func (mr *MockStoreMockRecorder) ManualSyncRepoTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ManualSyncRepoTx", reflect.TypeOf((*MockStore)(nil).ManualSyncRepoTx), arg0, arg1) +} + +// MarkCommentNotificationReaded mocks base method. +func (m *MockStore) MarkCommentNotificationReaded(arg0 context.Context, arg1 db.MarkCommentNotificationReadedParams) (db.CommentNotification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarkCommentNotificationReaded", arg0, arg1) + ret0, _ := ret[0].(db.CommentNotification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarkCommentNotificationReaded indicates an expected call of MarkCommentNotificationReaded. +func (mr *MockStoreMockRecorder) MarkCommentNotificationReaded(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkCommentNotificationReaded", reflect.TypeOf((*MockStore)(nil).MarkCommentNotificationReaded), arg0, arg1) +} + +// MarkFollowerNotificationReaded mocks base method. +func (m *MockStore) MarkFollowerNotificationReaded(arg0 context.Context, arg1 db.MarkFollowerNotificationReadedParams) (db.FollowerNotification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarkFollowerNotificationReaded", arg0, arg1) + ret0, _ := ret[0].(db.FollowerNotification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarkFollowerNotificationReaded indicates an expected call of MarkFollowerNotificationReaded. +func (mr *MockStoreMockRecorder) MarkFollowerNotificationReaded(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkFollowerNotificationReaded", reflect.TypeOf((*MockStore)(nil).MarkFollowerNotificationReaded), arg0, arg1) +} + +// MarkInvitationAsUsed mocks base method. +func (m *MockStore) MarkInvitationAsUsed(arg0 context.Context, arg1 db.MarkInvitationAsUsedParams) (db.Invitation, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarkInvitationAsUsed", arg0, arg1) + ret0, _ := ret[0].(db.Invitation) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarkInvitationAsUsed indicates an expected call of MarkInvitationAsUsed. +func (mr *MockStoreMockRecorder) MarkInvitationAsUsed(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkInvitationAsUsed", reflect.TypeOf((*MockStore)(nil).MarkInvitationAsUsed), arg0, arg1) +} + +// MarkRepoNotificationReaded mocks base method. +func (m *MockStore) MarkRepoNotificationReaded(arg0 context.Context, arg1 db.MarkRepoNotificationReadedParams) (db.RepoNotification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarkRepoNotificationReaded", arg0, arg1) + ret0, _ := ret[0].(db.RepoNotification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarkRepoNotificationReaded indicates an expected call of MarkRepoNotificationReaded. +func (mr *MockStoreMockRecorder) MarkRepoNotificationReaded(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkRepoNotificationReaded", reflect.TypeOf((*MockStore)(nil).MarkRepoNotificationReaded), arg0, arg1) +} + +// MarkSystemNotificationReaded mocks base method. +func (m *MockStore) MarkSystemNotificationReaded(arg0 context.Context, arg1 db.MarkSystemNotificationReadedParams) (db.SystemNotification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarkSystemNotificationReaded", arg0, arg1) + ret0, _ := ret[0].(db.SystemNotification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarkSystemNotificationReaded indicates an expected call of MarkSystemNotificationReaded. +func (mr *MockStoreMockRecorder) MarkSystemNotificationReaded(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkSystemNotificationReaded", reflect.TypeOf((*MockStore)(nil).MarkSystemNotificationReaded), arg0, arg1) +} + +// MarkVerificationAsUsed mocks base method. +func (m *MockStore) MarkVerificationAsUsed(arg0 context.Context, arg1 string) (db.Verification, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarkVerificationAsUsed", arg0, arg1) + ret0, _ := ret[0].(db.Verification) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MarkVerificationAsUsed indicates an expected call of MarkVerificationAsUsed. +func (mr *MockStoreMockRecorder) MarkVerificationAsUsed(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkVerificationAsUsed", reflect.TypeOf((*MockStore)(nil).MarkVerificationAsUsed), arg0, arg1) +} + +// QueryComment mocks base method. +func (m *MockStore) QueryComment(arg0 context.Context, arg1 db.QueryCommentParams) ([]db.QueryCommentRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryComment", arg0, arg1) + ret0, _ := ret[0].([]db.QueryCommentRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryComment indicates an expected call of QueryComment. +func (mr *MockStoreMockRecorder) QueryComment(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryComment", reflect.TypeOf((*MockStore)(nil).QueryComment), arg0, arg1) +} + +// QueryCommentReport mocks base method. +func (m *MockStore) QueryCommentReport(arg0 context.Context, arg1 db.QueryCommentReportParams) ([]db.QueryCommentReportRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryCommentReport", arg0, arg1) + ret0, _ := ret[0].([]db.QueryCommentReportRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryCommentReport indicates an expected call of QueryCommentReport. +func (mr *MockStoreMockRecorder) QueryCommentReport(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryCommentReport", reflect.TypeOf((*MockStore)(nil).QueryCommentReport), arg0, arg1) +} + +// QueryFollower mocks base method. +func (m *MockStore) QueryFollower(arg0 context.Context, arg1 db.QueryFollowerParams) ([]db.QueryFollowerRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryFollower", arg0, arg1) + ret0, _ := ret[0].([]db.QueryFollowerRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryFollower indicates an expected call of QueryFollower. +func (mr *MockStoreMockRecorder) QueryFollower(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryFollower", reflect.TypeOf((*MockStore)(nil).QueryFollower), arg0, arg1) +} + +// QueryFollowing mocks base method. +func (m *MockStore) QueryFollowing(arg0 context.Context, arg1 db.QueryFollowingParams) ([]db.QueryFollowingRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryFollowing", arg0, arg1) + ret0, _ := ret[0].([]db.QueryFollowingRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryFollowing indicates an expected call of QueryFollowing. +func (mr *MockStoreMockRecorder) QueryFollowing(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryFollowing", reflect.TypeOf((*MockStore)(nil).QueryFollowing), arg0, arg1) +} + +// QueryMarkdown mocks base method. +func (m *MockStore) QueryMarkdown(arg0 context.Context, arg1 db.QueryMarkdownParams) ([]db.QueryMarkdownRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryMarkdown", arg0, arg1) + ret0, _ := ret[0].([]db.QueryMarkdownRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryMarkdown indicates an expected call of QueryMarkdown. +func (mr *MockStoreMockRecorder) QueryMarkdown(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryMarkdown", reflect.TypeOf((*MockStore)(nil).QueryMarkdown), arg0, arg1) +} + +// QueryRepo mocks base method. +func (m *MockStore) QueryRepo(arg0 context.Context, arg1 db.QueryRepoParams) ([]db.QueryRepoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryRepo", arg0, arg1) + ret0, _ := ret[0].([]db.QueryRepoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryRepo indicates an expected call of QueryRepo. +func (mr *MockStoreMockRecorder) QueryRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryRepo", reflect.TypeOf((*MockStore)(nil).QueryRepo), arg0, arg1) +} + +// QueryRepoMarkdown mocks base method. +func (m *MockStore) QueryRepoMarkdown(arg0 context.Context, arg1 db.QueryRepoMarkdownParams) ([]db.QueryRepoMarkdownRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryRepoMarkdown", arg0, arg1) + ret0, _ := ret[0].([]db.QueryRepoMarkdownRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryRepoMarkdown indicates an expected call of QueryRepoMarkdown. +func (mr *MockStoreMockRecorder) QueryRepoMarkdown(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryRepoMarkdown", reflect.TypeOf((*MockStore)(nil).QueryRepoMarkdown), arg0, arg1) +} + +// QueryRepoVisibilityByRepo mocks base method. +func (m *MockStore) QueryRepoVisibilityByRepo(arg0 context.Context, arg1 db.QueryRepoVisibilityByRepoParams) ([]db.QueryRepoVisibilityByRepoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryRepoVisibilityByRepo", arg0, arg1) + ret0, _ := ret[0].([]db.QueryRepoVisibilityByRepoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryRepoVisibilityByRepo indicates an expected call of QueryRepoVisibilityByRepo. +func (mr *MockStoreMockRecorder) QueryRepoVisibilityByRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryRepoVisibilityByRepo", reflect.TypeOf((*MockStore)(nil).QueryRepoVisibilityByRepo), arg0, arg1) +} + +// QuerySession mocks base method. +func (m *MockStore) QuerySession(arg0 context.Context, arg1 db.QuerySessionParams) ([]db.QuerySessionRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QuerySession", arg0, arg1) + ret0, _ := ret[0].([]db.QuerySessionRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QuerySession indicates an expected call of QuerySession. +func (mr *MockStoreMockRecorder) QuerySession(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QuerySession", reflect.TypeOf((*MockStore)(nil).QuerySession), arg0, arg1) +} + +// QueryUser mocks base method. +func (m *MockStore) QueryUser(arg0 context.Context, arg1 db.QueryUserParams) ([]db.QueryUserRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryUser", arg0, arg1) + ret0, _ := ret[0].([]db.QueryUserRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryUser indicates an expected call of QueryUser. +func (mr *MockStoreMockRecorder) QueryUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryUser", reflect.TypeOf((*MockStore)(nil).QueryUser), arg0, arg1) +} + +// QueryUserLikeRepo mocks base method. +func (m *MockStore) QueryUserLikeRepo(arg0 context.Context, arg1 db.QueryUserLikeRepoParams) ([]db.QueryUserLikeRepoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryUserLikeRepo", arg0, arg1) + ret0, _ := ret[0].([]db.QueryUserLikeRepoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryUserLikeRepo indicates an expected call of QueryUserLikeRepo. +func (mr *MockStoreMockRecorder) QueryUserLikeRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryUserLikeRepo", reflect.TypeOf((*MockStore)(nil).QueryUserLikeRepo), arg0, arg1) +} + +// QueryUserMarkdown mocks base method. +func (m *MockStore) QueryUserMarkdown(arg0 context.Context, arg1 db.QueryUserMarkdownParams) ([]db.QueryUserMarkdownRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryUserMarkdown", arg0, arg1) + ret0, _ := ret[0].([]db.QueryUserMarkdownRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryUserMarkdown indicates an expected call of QueryUserMarkdown. +func (mr *MockStoreMockRecorder) QueryUserMarkdown(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryUserMarkdown", reflect.TypeOf((*MockStore)(nil).QueryUserMarkdown), arg0, arg1) +} + +// QueryUserOwnRepo mocks base method. +func (m *MockStore) QueryUserOwnRepo(arg0 context.Context, arg1 db.QueryUserOwnRepoParams) ([]db.QueryUserOwnRepoRow, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QueryUserOwnRepo", arg0, arg1) + ret0, _ := ret[0].([]db.QueryUserOwnRepoRow) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// QueryUserOwnRepo indicates an expected call of QueryUserOwnRepo. +func (mr *MockStoreMockRecorder) QueryUserOwnRepo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryUserOwnRepo", reflect.TypeOf((*MockStore)(nil).QueryUserOwnRepo), arg0, arg1) +} + +// ResetPasswordTx mocks base method. +func (m *MockStore) ResetPasswordTx(arg0 context.Context, arg1 db.ResetPasswordTxParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ResetPasswordTx", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ResetPasswordTx indicates an expected call of ResetPasswordTx. +func (mr *MockStoreMockRecorder) ResetPasswordTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetPasswordTx", reflect.TypeOf((*MockStore)(nil).ResetPasswordTx), arg0, arg1) +} + +// ResetUnreadCount mocks base method. +func (m *MockStore) ResetUnreadCount(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ResetUnreadCount", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ResetUnreadCount indicates an expected call of ResetUnreadCount. +func (mr *MockStoreMockRecorder) ResetUnreadCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetUnreadCount", reflect.TypeOf((*MockStore)(nil).ResetUnreadCount), arg0, arg1) +} + +// UpdateCommentReportStatus mocks base method. +func (m *MockStore) UpdateCommentReportStatus(arg0 context.Context, arg1 db.UpdateCommentReportStatusParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateCommentReportStatus", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateCommentReportStatus indicates an expected call of UpdateCommentReportStatus. +func (mr *MockStoreMockRecorder) UpdateCommentReportStatus(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCommentReportStatus", reflect.TypeOf((*MockStore)(nil).UpdateCommentReportStatus), arg0, arg1) +} + +// UpdateConfiguration mocks base method. +func (m *MockStore) UpdateConfiguration(arg0 context.Context, arg1 db.UpdateConfigurationParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateConfiguration", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateConfiguration indicates an expected call of UpdateConfiguration. +func (mr *MockStoreMockRecorder) UpdateConfiguration(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateConfiguration", reflect.TypeOf((*MockStore)(nil).UpdateConfiguration), arg0, arg1) +} + +// UpdateMarkdownMulti mocks base method. +func (m *MockStore) UpdateMarkdownMulti(arg0 context.Context, arg1 db.UpdateMarkdownMultiParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateMarkdownMulti", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateMarkdownMulti indicates an expected call of UpdateMarkdownMulti. +func (mr *MockStoreMockRecorder) UpdateMarkdownMulti(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMarkdownMulti", reflect.TypeOf((*MockStore)(nil).UpdateMarkdownMulti), arg0, arg1) +} + +// UpdateRepoConfig mocks base method. +func (m *MockStore) UpdateRepoConfig(arg0 context.Context, arg1 db.UpdateRepoConfigParams) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRepoConfig", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateRepoConfig indicates an expected call of UpdateRepoConfig. +func (mr *MockStoreMockRecorder) UpdateRepoConfig(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRepoConfig", reflect.TypeOf((*MockStore)(nil).UpdateRepoConfig), arg0, arg1) +} + +// UpdateRepoInfo mocks base method. +func (m *MockStore) UpdateRepoInfo(arg0 context.Context, arg1 db.UpdateRepoInfoParams) (db.Repo, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRepoInfo", arg0, arg1) + ret0, _ := ret[0].(db.Repo) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateRepoInfo indicates an expected call of UpdateRepoInfo. +func (mr *MockStoreMockRecorder) UpdateRepoInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRepoInfo", reflect.TypeOf((*MockStore)(nil).UpdateRepoInfo), arg0, arg1) +} + +// UpdateUnreadCount mocks base method. +func (m *MockStore) UpdateUnreadCount(arg0 context.Context, arg1 int64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateUnreadCount", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateUnreadCount indicates an expected call of UpdateUnreadCount. +func (mr *MockStoreMockRecorder) UpdateUnreadCount(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUnreadCount", reflect.TypeOf((*MockStore)(nil).UpdateUnreadCount), arg0, arg1) +} + +// UpdateUserBasicInfo mocks base method. +func (m *MockStore) UpdateUserBasicInfo(arg0 context.Context, arg1 db.UpdateUserBasicInfoParams) (db.User, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateUserBasicInfo", arg0, arg1) + ret0, _ := ret[0].(db.User) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateUserBasicInfo indicates an expected call of UpdateUserBasicInfo. +func (mr *MockStoreMockRecorder) UpdateUserBasicInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUserBasicInfo", reflect.TypeOf((*MockStore)(nil).UpdateUserBasicInfo), arg0, arg1) +} + +// VerifyEmailTx mocks base method. +func (m *MockStore) VerifyEmailTx(arg0 context.Context, arg1 string) (db.User, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "VerifyEmailTx", arg0, arg1) + ret0, _ := ret[0].(db.User) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// VerifyEmailTx indicates an expected call of VerifyEmailTx. +func (mr *MockStoreMockRecorder) VerifyEmailTx(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyEmailTx", reflect.TypeOf((*MockStore)(nil).VerifyEmailTx), arg0, arg1) +} diff --git a/zbook_backend/db/query/comment.sql b/zbook_backend/db/query/comment.sql new file mode 100644 index 0000000..a6dde43 --- /dev/null +++ b/zbook_backend/db/query/comment.sql @@ -0,0 +1,148 @@ +-- name: CreateComment :one +INSERT INTO comments ( + user_id, + repo_id, + markdown_id, + parent_id, + root_id, + comment_content +) VALUES ($1,$2,$3,$4,$5,$6) +RETURNING *; + + +-- name: DeleteComment :exec +DELETE FROM comments +WHERE comment_id = $1; + +-- name: GetCommentBasicInfo :one +SELECT comments.comment_id,comments.markdown_id,comments.user_id,comments.parent_id,comments.comment_content,comments.created_at,comments.root_id +FROM comments +WHERE comments.comment_id = $1 +LIMIT 1 +FOR NO KEY UPDATE; + +-- name: GetCommentRepoInfo :one +SELECT repos.* +FROM markdowns +JOIN comments on markdowns.markdown_id=comments.markdown_id +JOIN repos on markdowns.repo_id = repos.repo_id +WHERE comments.comment_id = $1 +LIMIT 1 +FOR NO KEY UPDATE; + + +-- name: GetCommentDetail :one +SELECT comments.*, + users.username,users.email,users.motto,users.created_at as user_created_at, + COUNT(DISTINCT CASE WHEN comment_relations.relation_type = 'like' THEN comment_relations.relation_id END) AS like_count, + (SELECT COUNT(*) FROM comments c2 WHERE c2.root_id = comments.comment_id) AS reply_count, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'like' and comment_relations.user_id = $2 ) as is_liked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'dislike' and comment_relations.user_id = $2 ) as is_disliked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'share' and comment_relations.user_id = $2 ) as is_shared, + EXISTS(SELECT 1 FROM comment_reports WHERE comment_reports.comment_id = comments.comment_id and comment_reports.user_id = $2 ) as is_reported +FROM comments +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.comment_id = $1 +GROUP BY comments.comment_id,users.user_id +LIMIT 1; + +-- name: ListCommentLevelOne :many +SELECT comments.*, + users.username,users.email,users.motto,users.created_at as user_created_at, + COUNT(DISTINCT CASE WHEN comment_relations.relation_type = 'like' THEN comment_relations.relation_id END) AS like_count, + (SELECT COUNT(*) FROM comments c2 WHERE c2.root_id = comments.comment_id) AS reply_count, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'like' and comment_relations.user_id = $4 ) as is_liked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'dislike' and comment_relations.user_id = $4 ) as is_disliked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'share' and comment_relations.user_id = $4 ) as is_shared, + EXISTS(SELECT 1 FROM comment_reports WHERE comment_reports.comment_id = comments.comment_id and comment_reports.user_id = $4 ) as is_reported +FROM comments +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.markdown_id = $1 AND comments.parent_id IS NULL +GROUP BY comments.comment_id,users.user_id +ORDER BY comments.created_at DESC +LIMIT $2 +OFFSET $3; + + +-- name: GetListCommentLevelOneCount :one +SELECT Count(*) +FROM comments +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.markdown_id = $1 AND comments.parent_id IS NULL; + + +-- name: ListCommentLevelTwo :many +SELECT comments.*, + users.username,users.email,users.motto,users.created_at as user_created_at, pu.username as pusername, + COUNT(DISTINCT CASE WHEN comment_relations.relation_type = 'like' THEN comment_relations.relation_id END) AS like_count, + (SELECT COUNT(*) FROM comments c2 WHERE c2.root_id = comments.comment_id) AS reply_count, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'like' and comment_relations.user_id = $4 ) as is_liked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'dislike' and comment_relations.user_id = $4 ) as is_disliked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'share' and comment_relations.user_id = $4 ) as is_shared, + EXISTS(SELECT 1 FROM comment_reports WHERE comment_reports.comment_id = comments.comment_id and comment_reports.user_id = $4 ) as is_reported +FROM comments +LEFT JOIN comments pc ON comments.parent_id = pc.comment_id +LEFT JOIN users pu ON pu.user_id = pc.user_id +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.root_id = $1 +GROUP BY comments.comment_id,users.user_id,pu.username +ORDER BY comments.created_at +LIMIT $2 +OFFSET $3; + + +-- name: GetListCommentLevelTwoCount :one +SELECT Count(*) +FROM comments +LEFT JOIN comments pc ON comments.parent_id = pc.comment_id +LEFT JOIN users pu ON pu.user_id = pc.user_id +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.root_id = $1; + +-- name: ListComment :many +SELECT comments.*, + users.username,users.email,users.created_at as user_created_at +FROM comments +JOIN markdowns on markdowns.markdown_id = comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ON comments.user_id = users.user_id +JOIN users as mu ON mu.user_id=repos.user_id +ORDER BY comments.created_at DESC +LIMIT $1 +OFFSET $2; + +-- name: GetListCommentCount :one +SELECT COUNT(*) +FROM comments +JOIN markdowns on markdowns.markdown_id = comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ON comments.user_id = users.user_id +JOIN users as mu ON mu.user_id=repos.user_id; + +-- name: QueryComment :many +SELECT comments.*, + ROUND(ts_rank(comments.fts_comment_zh, plainto_tsquery(@query))) + ROUND(ts_rank(comments.fts_comment_en, plainto_tsquery(@query))) as rank, + users.username,users.email,users.created_at as user_created_at +FROM comments +JOIN markdowns on markdowns.markdown_id = comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ON comments.user_id = users.user_id +JOIN users as mu ON mu.user_id=repos.user_id +WHERE (comments.fts_comment_zh @@ plainto_tsquery(@query) OR comments.fts_comment_en @@ plainto_tsquery(@query)) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2; + +-- name: GetQueryCommentCount :one +SELECT COUNT(*) +FROM comments +JOIN markdowns on markdowns.markdown_id = comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ON comments.user_id = users.user_id +JOIN users as mu ON mu.user_id=repos.user_id +WHERE (comments.fts_comment_zh @@ plainto_tsquery(@query) OR comments.fts_comment_en @@ plainto_tsquery(@query)); diff --git a/zbook_backend/db/query/comment_relation.sql b/zbook_backend/db/query/comment_relation.sql new file mode 100644 index 0000000..659d96f --- /dev/null +++ b/zbook_backend/db/query/comment_relation.sql @@ -0,0 +1,100 @@ +-- name: CreateCommentRelation :exec +INSERT INTO comment_relations ( + user_id, + comment_id, + relation_type +) VALUES ($1,$2,$3); + +-- name: DeleteCommentRelation :exec +DELETE FROM comment_relations +WHERE user_id=$1 and comment_id=$2 and relation_type=$3; + +-- name: CreateCommentReport :exec +INSERT INTO comment_reports ( + user_id, + comment_id, + report_content +) VALUES ($1,$2,$3); + + +-- name: GetListCommentReportCount :one +SELECT + COUNT(*) +FROM comment_reports +JOIN users ON users.user_id = comment_reports.user_id +JOIN comments ON comments.comment_id = comment_reports.comment_id +JOIN markdowns ON comments.markdown_id = markdowns.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ura ON ura.user_id = repos.user_id +JOIN users as uc ON comments.user_id = uc.user_id; + +-- name: ListCommentReport :many +SELECT + comment_reports.*,users.username,comments.comment_content, + repos.repo_name,ura.username as repo_username,markdowns.relative_path +FROM comment_reports +JOIN users ON users.user_id = comment_reports.user_id +JOIN comments ON comments.comment_id = comment_reports.comment_id +JOIN markdowns ON comments.markdown_id = markdowns.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users as ura ON ura.user_id = repos.user_id +JOIN users as uc ON comments.user_id = uc.user_id +ORDER BY comment_reports.created_at Desc +LIMIT $1 +OFFSET $2; + +-- name: QueryCommentReport :many +SELECT + comment_reports.*,ur.username,comments.comment_content, + repos.repo_name,ura.username as repo_username,markdowns.relative_path, + ROUND(ts_rank(comments.fts_comment_zh, plainto_tsquery(@query))) + + ROUND(ts_rank(comments.fts_comment_en, plainto_tsquery(@query))) + + ROUND(ts_rank(comment_reports.fts_report_zh, plainto_tsquery(@query))) + + ROUND(ts_rank(comment_reports.fts_report_en, plainto_tsquery(@query))) + + ROUND(ts_rank(ur.fts_username, plainto_tsquery(@query))) + + ROUND(ts_rank(uc.fts_username, plainto_tsquery(@query))) + + ROUND(ts_rank(repos.fts_repo_en, plainto_tsquery(@query))) + + ROUND(ts_rank(repos.fts_repo_zh, plainto_tsquery(@query))) + as rank +FROM comment_reports +JOIN users as ur ON ur.user_id = comment_reports.user_id +JOIN comments ON comments.comment_id = comment_reports.comment_id +JOIN markdowns ON comments.markdown_id = markdowns.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users as ura ON ura.user_id = repos.user_id +JOIN users as uc ON comments.user_id = uc.user_id +WHERE ( + comments.fts_comment_zh @@ plainto_tsquery(@query) + OR comments.fts_comment_en @@ plainto_tsquery(@query) + OR comment_reports.fts_report_zh @@ plainto_tsquery(@query) + OR comment_reports.fts_report_en @@ plainto_tsquery(@query) + OR uc.fts_username @@ plainto_tsquery(@query) + OR ur.fts_username @@ plainto_tsquery(@query) + OR repos.fts_repo_en @@ plainto_tsquery(@query) + OR repos.fts_repo_zh @@ plainto_tsquery(@query) + ) +ORDER BY rank Desc +LIMIT $1 +OFFSET $2; + +-- name: GetQueryCommentReportCount :one +SELECT + COUNT(*) +FROM comment_reports +JOIN users as ur ON ur.user_id = comment_reports.user_id +JOIN comments ON comments.comment_id = comment_reports.comment_id +JOIN markdowns ON comments.markdown_id = markdowns.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users as uc ON comments.user_id = uc.user_id +WHERE ( + comments.fts_comment_zh @@ plainto_tsquery(@query) + OR comments.fts_comment_en @@ plainto_tsquery(@query) + OR comment_reports.fts_report_zh @@ plainto_tsquery(@query) + OR comment_reports.fts_report_en @@ plainto_tsquery(@query) + OR uc.fts_username @@ plainto_tsquery(@query) + OR ur.fts_username @@ plainto_tsquery(@query) + ); +-- name: UpdateCommentReportStatus :exec +UPDATE comment_reports +SET processed=$2 +WHERE report_id = $1; diff --git a/zbook_backend/db/query/configuration.sql b/zbook_backend/db/query/configuration.sql new file mode 100644 index 0000000..e76ff43 --- /dev/null +++ b/zbook_backend/db/query/configuration.sql @@ -0,0 +1,10 @@ +-- name: UpdateConfiguration :exec +UPDATE configurations +SET config_value=$2,updated_at=now() +WHERE config_name=$1; + +-- name: GetConfiguration :one +SELECT * +FROM configurations +WHERE config_name=$1 +LIMIT 1; \ No newline at end of file diff --git a/zbook_backend/db/query/follow.sql b/zbook_backend/db/query/follow.sql new file mode 100644 index 0000000..e6ce2f9 --- /dev/null +++ b/zbook_backend/db/query/follow.sql @@ -0,0 +1,195 @@ +-- name: CreateFollow :one +INSERT INTO follows ( + follower_id, + following_id +) VALUES ($1, $2) +RETURNING *; + +-- name: IsFollowing :one +SELECT EXISTS ( + SELECT 1 + FROM follows + WHERE follower_id = $1 + AND following_id = $2 + LIMIT 1 +); + +-- name: DeleteFollow :one +DELETE FROM follows +WHERE follower_id= $1 and following_id=$2 +RETURNING follow_id; + +-- name: ListFollower :many +SELECT + u.*, + CASE WHEN MAX(ff.follower_id) IS NOT NULL THEN true ELSE false END AS is_following, + COUNT(DISTINCT r.repo_id) as repo_count +FROM + users u +JOIN + follows f ON f.follower_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = @cur_user_id AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = @cur_user_id OR @role::text='admin'))) +WHERE + f.following_id = @user_id AND (u.blocked='false' OR @role::text='admin') +GROUP BY + u.user_id,f.created_at +ORDER BY + f.created_at DESC +LIMIT $1 +OFFSET $2; + +-- name: GetListFollowerCount :one +SELECT + COUNT(*) +FROM + users u +JOIN + follows f ON f.follower_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = @cur_user_id AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = @cur_user_id OR @role::text='admin'))) +WHERE + f.following_id = @user_id AND (u.blocked='false' OR @role::text='admin'); + +-- name: QueryFollower :many +SELECT + u.*, + ts_rank(u.fts_username, plainto_tsquery(@query)) as rank, + CASE WHEN MAX(ff.follower_id) IS NOT NULL THEN true ELSE false END AS is_following, + COUNT(DISTINCT r.repo_id) as repo_count +FROM + users u +JOIN + follows f ON f.follower_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = @cur_user_id AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = @cur_user_id OR @role::text='admin'))) +WHERE + f.following_id = @user_id and u.fts_username @@ plainto_tsquery(@query) AND (u.blocked='false' OR @role::text='admin') +GROUP BY + u.user_id +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2; + + +-- name: GetQueryFollowerCount :one +SELECT + COUNT(*) +FROM + users u +JOIN + follows f ON f.follower_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = @cur_user_id AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = @cur_user_id OR @role::text='admin'))) +WHERE + f.following_id = @user_id and u.fts_username @@ plainto_tsquery(@query) AND (u.blocked='false' OR @role::text='admin'); + +-- name: ListFollowing :many +SELECT + u.*, + CASE WHEN MAX(ff.follower_id) IS NOT NULL THEN true ELSE false END AS is_following, + COUNT(DISTINCT r.repo_id) as repo_count +FROM + users u +JOIN + follows f ON f.following_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = @cur_user_id AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = @cur_user_id OR @role::text='admin'))) +WHERE + f.follower_id = @user_id AND (u.blocked='false' OR @role::text='admin') +GROUP BY + u.user_id,f.created_at +ORDER BY + f.created_at DESC +LIMIT $1 +OFFSET $2; + +-- name: GetListFollowingCount :one +SELECT + COUNT(*) +FROM + users u +JOIN + follows f ON f.following_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = @cur_user_id AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = @cur_user_id OR @role::text='admin'))) +WHERE + f.follower_id = @user_id AND (u.blocked='false' OR @role::text='admin'); + + + +-- name: QueryFollowing :many +SELECT + u.*, + ts_rank(u.fts_username, plainto_tsquery(@query)) as rank, + CASE WHEN MAX(ff.follower_id) IS NOT NULL THEN true ELSE false END AS is_following, + COUNT(DISTINCT r.repo_id) as repo_count +FROM + users u +JOIN + follows f ON f.following_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = @cur_user_id AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = @cur_user_id OR @role::text='admin'))) +WHERE + f.follower_id = @user_id and u.fts_username @@ plainto_tsquery(@query) AND (u.blocked='false' OR @role::text='admin') +GROUP BY + u.user_id +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2; + + + +-- name: GetQueryFollowingCount :one +SELECT + COUNT(*) +FROM + users u +JOIN + follows f ON f.following_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = @cur_user_id AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = @cur_user_id OR @role::text='admin'))) +WHERE + f.follower_id = @user_id and u.fts_username @@ plainto_tsquery(@query) AND (u.blocked='false' OR @role::text='admin'); \ No newline at end of file diff --git a/zbook_backend/db/query/geoio.sql b/zbook_backend/db/query/geoio.sql new file mode 100644 index 0000000..999e3e0 --- /dev/null +++ b/zbook_backend/db/query/geoio.sql @@ -0,0 +1,6 @@ +-- name: GetGeoInfo :one +SELECT * +FROM + geoip +WHERE + $1::inet << ip_range_cidr; \ No newline at end of file diff --git a/zbook_backend/db/query/invitation.sql b/zbook_backend/db/query/invitation.sql new file mode 100644 index 0000000..6efeeac --- /dev/null +++ b/zbook_backend/db/query/invitation.sql @@ -0,0 +1,22 @@ +-- name: CreateInvitation :one +INSERT INTO invitations ( + email, + invitation_url +) VALUES ( + $1, $2 +) RETURNING *; + +-- name: GetInvitation :one +SELECT * +FROM invitations +WHERE email = $1 AND invitation_url = $2; + +-- name: MarkInvitationAsUsed :one +UPDATE invitations +SET + is_used = TRUE +WHERE + email = $1 AND invitation_url = $2 + AND is_used = FALSE + AND expired_at > now() +RETURNING *; \ No newline at end of file diff --git a/zbook_backend/db/query/markdown.sql b/zbook_backend/db/query/markdown.sql new file mode 100644 index 0000000..f36fa6b --- /dev/null +++ b/zbook_backend/db/query/markdown.sql @@ -0,0 +1,137 @@ +-- name: CreateMarkdown :one +INSERT INTO markdowns ( + relative_path, + user_id, + repo_id, + main_content, + table_content +) VALUES ( + $1, $2, $3,$4,$5 +) RETURNING *; + +-- name: CreateMarkdownMulti :exec +INSERT INTO markdowns ( + relative_path, + user_id, + repo_id, + main_content, + table_content +) +SELECT unnest(@relative_path::text[]) AS relative_path, + unnest(@user_id::bigint[]) AS user_id, + unnest(@repo_id::bigint[]) AS repo_id, + unnest(@main_content::text[]) AS main_content, + unnest(@table_content::text[]) AS table_content; + + +-- name: GetMarkdownContent :one +SELECT + markdowns.* +FROM markdowns +WHERE markdowns.relative_path = $1 and markdowns.repo_id = $2 +LIMIT 1; + +-- name: GetMarkdownByID :one +SELECT * FROM markdowns +WHERE markdown_id = $1 LIMIT 1 +FOR NO KEY UPDATE; + + +-- name: GetMarkdownRepoID :one +SELECT + markdowns.repo_id +FROM + markdowns +WHERE + markdown_id = $1; + + +-- name: UpdateMarkdownMulti :exec +UPDATE markdowns AS m +SET main_content=tmp.main_content,table_content=tmp.table_content,relative_path=new_relative_path,updated_at=now() +FROM ( + SELECT + unnest(@relative_path::text[]) AS relative_path, + unnest(@new_relative_path::text[]) AS new_relative_path, + unnest(@main_content::text[]) AS main_content, + unnest(@table_content::text[]) AS table_content, + unnest(@repo_id::bigint[]) AS repo_id +) AS tmp +WHERE m.relative_path = tmp.relative_path and m.repo_id=tmp.repo_id; + +-- name: DeleteMarkdownMulti :exec +DELETE FROM markdowns +WHERE (relative_path, repo_id) IN ( + SELECT + unnest(@relative_path::text[]), + unnest(@repo_id::bigint[]) +); +-- name: QueryMarkdown :many +select + users.username,r.repo_name, markdown_id,relative_path,users.user_id,r.repo_id,main_content, + ROUND(ts_rank(fts_zh, plainto_tsquery($3))) + ROUND(ts_rank(fts_en, plainto_tsquery($3))) as rank, + COALESCE(ts_headline(main_content,plainto_tsquery($3),'MaxFragments=10, MaxWords=7, MinWords=3'),'') +from markdowns +JOIN repos as r on r.repo_id = markdowns.repo_id +JOIN users on users.user_id = r.user_id +where (fts_zh @@ plainto_tsquery($3) OR fts_en @@ plainto_tsquery($3)) + AND ( + (@role::text='admin' AND @signed::bool ) OR ( + users.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ) +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2; + + +-- name: QueryUserMarkdown :many +select + users.username,r.repo_name, markdown_id,relative_path,users.user_id,r.repo_id,main_content, + ROUND(ts_rank(fts_zh, plainto_tsquery($4))) + ROUND(ts_rank(fts_en, plainto_tsquery($4))) as rank, + COALESCE(ts_headline(main_content,plainto_tsquery($4),'MaxFragments=10, MaxWords=7, MinWords=3'),'') +from markdowns +JOIN repos as r on r.repo_id = markdowns.repo_id +JOIN users on users.user_id = r.user_id +where users.user_id = $3 and (fts_zh @@ plainto_tsquery($4) OR fts_en @@ plainto_tsquery($4)) + AND ( + (@role::text='admin' AND @signed::bool ) OR ( + users.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ) +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2; + +-- name: QueryRepoMarkdown :many +select + users.username,r.repo_name, markdown_id,relative_path,users.user_id,r.repo_id,main_content, + ROUND(ts_rank(fts_zh, plainto_tsquery($4))) + ROUND(ts_rank(fts_en, plainto_tsquery($4))) as rank, + COALESCE(ts_headline(main_content,plainto_tsquery($4),'MaxFragments=10, MaxWords=7, MinWords=3'),'') +from markdowns +JOIN repos as r on r.repo_id = markdowns.repo_id +JOIN users on users.user_id = r.user_id +where users.user_id = $3 and r.repo_id = $5 and (fts_zh @@ plainto_tsquery($4) OR fts_en @@ plainto_tsquery($4)) +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2; + diff --git a/zbook_backend/db/query/notifications.sql b/zbook_backend/db/query/notifications.sql new file mode 100644 index 0000000..3cb3fa8 --- /dev/null +++ b/zbook_backend/db/query/notifications.sql @@ -0,0 +1,158 @@ +-- name: CreateSystemNotification :one +INSERT INTO system_notifications ( + user_id, + title, + contents, + redirect_url +) VALUES ($1,$2,$3,$4) +RETURNING *; + +-- name: ListSystemNotification :many +SELECT system_notifications.noti_id,system_notifications.readed,system_notifications.created_at, + title,contents,redirect_url +FROM system_notifications +WHERE user_id=$1 AND (system_notifications.readed = 'false' OR system_notifications.created_at >= NOW() - INTERVAL '14 days') +ORDER BY system_notifications.created_at Desc +LIMIT $2 +OFFSET $3; + +-- name: GetListSystemNotificationUnReadedCount :one +SELECT Count(*) +FROM system_notifications +WHERE user_id=$1 AND (system_notifications.readed = 'false'); + +-- name: MarkSystemNotificationReaded :one +UPDATE system_notifications +SET readed = 'true' +WHERE noti_id = $1 AND user_id = $2 +RETURNING *; + +-- name: CreateFollowerNotification :one +INSERT INTO follower_notifications ( + user_id, + follower_id +) VALUES ($1,$2) +RETURNING *; + +-- name: DeleteFollowerNotification :one +DELETE FROM follower_notifications +WHERE user_id=$1 and follower_id=$2 +RETURNING *; + +-- name: MarkFollowerNotificationReaded :one +UPDATE follower_notifications +SET readed = 'true' +WHERE noti_id=$1 and user_id = $2 +RETURNING *; + +-- name: ListFollowerNotification :many +SELECT + users.username,users.email, + follower_notifications.readed,follower_notifications.noti_id,follower_notifications.created_at +FROM + users +JOIN + follower_notifications ON users.user_id = follower_notifications.follower_id +WHERE + follower_notifications.user_id=$1 AND (follower_notifications.readed = 'false' OR follower_notifications.created_at >= NOW() - INTERVAL '14 days') +ORDER BY + follower_notifications.created_at DESC +LIMIT $2 +OFFSET $3; + +-- name: GetListFollowerNotificationUnreadedCount :one +SELECT + Count(*) +FROM + users +JOIN + follower_notifications ON users.user_id = follower_notifications.follower_id +WHERE + follower_notifications.user_id=$1 AND (follower_notifications.readed = 'false'); + +-- name: CreateCommentNotification :one +INSERT INTO comment_notifications ( + user_id, + comment_id +) VALUES ($1,$2) +RETURNING *; + +-- name: MarkCommentNotificationReaded :one +UPDATE comment_notifications +SET readed = 'true' +WHERE noti_id=$1 and user_id = $2 +RETURNING *; + + +-- name: ListCommentNotification :many +SELECT + users.username,users.email,ru.username as repo_username, + comment_notifications.readed, comment_notifications.noti_id,comment_notifications.created_at, + markdowns.repo_id,markdowns.relative_path,comments.comment_content,repos.repo_name +FROM + users +JOIN + comments ON comments.user_id=users.user_id +JOIN + markdowns ON markdowns.markdown_id=comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users as ru ON repos.user_id = ru.user_id +JOIN + comment_notifications ON comment_notifications.comment_id=comments.comment_id +WHERE + comment_notifications.user_id=$1 AND (comment_notifications.readed = 'false' OR comment_notifications.created_at >= NOW() - INTERVAL '14 days') +ORDER BY + comment_notifications.created_at DESC +LIMIT $2 +OFFSET $3; + +-- name: GetListCommentNotificationUnreadedCount :one +SELECT + Count(*) +FROM + users +JOIN + comments ON comments.user_id=users.user_id +JOIN + markdowns ON markdowns.markdown_id=comments.markdown_id +JOIN + comment_notifications ON comment_notifications.comment_id=comments.comment_id +WHERE + comment_notifications.user_id=$1 AND (comment_notifications.readed = 'false'); + +-- name: CreateRepoNotification :one +INSERT INTO repo_notifications ( + user_id, + repo_id +) VALUES ($1,$2) +RETURNING *; + +-- name: MarkRepoNotificationReaded :one +UPDATE repo_notifications +SET readed = 'true' +WHERE noti_id=$1 and user_id = $2 +RETURNING *; + + +-- name: ListRepoNotification :many +SELECT + users.username,users.email, + repo_notifications.readed,repo_notifications.noti_id,repo_notifications.created_at, + repos.repo_id,repos.repo_name +FROM repo_notifications +JOIN repos ON repos.repo_id = repo_notifications.repo_id +JOIN users ON users.user_id = repos.user_id +WHERE repo_notifications.user_id=$1 AND (repo_notifications.readed = 'false' OR repo_notifications.created_at >= NOW() - INTERVAL '14 days') +ORDER BY repo_notifications.created_at DESC +LIMIT $2 +OFFSET $3; + +-- name: GetListRepoNotificationUnreadedCount :one +SELECT + Count(*) +FROM repo_notifications +JOIN repos ON repos.repo_id = repo_notifications.repo_id +JOIN users ON users.user_id = repos.user_id +WHERE repo_notifications.user_id=$1 AND (repo_notifications.readed = 'false' ); + + diff --git a/zbook_backend/db/query/oauth.sql b/zbook_backend/db/query/oauth.sql new file mode 100644 index 0000000..9139c21 --- /dev/null +++ b/zbook_backend/db/query/oauth.sql @@ -0,0 +1,29 @@ +-- name: CreateOAuth :one +INSERT INTO oauths ( + user_id, + oauth_type, + app_id +) VALUES ( + $1, $2, $3 +) RETURNING *; + +-- name: GetOAuthUser :one +SELECT * +FROM oauths +JOIN users ON oauths.user_id = users.user_id +WHERE oauth_type = $1 and app_id = $2 LIMIT 1 +FOR NO KEY UPDATE; + +-- name: CheckOAuthStatus :one +SELECT + COALESCE(COUNT(CASE WHEN "oauth_type" = 'github' THEN 1 END), 0) > 0 AS github_status, + COALESCE(COUNT(CASE WHEN "oauth_type" = 'google' THEN 1 END), 0) > 0 AS google_status +FROM + "oauths" +WHERE + "user_id" = $1; + +-- name: DeleteOAuth :one +DELETE FROM oauths +WHERE user_id=$1 and oauth_type=$2 +RETURNING *; diff --git a/zbook_backend/db/query/repo.sql b/zbook_backend/db/query/repo.sql new file mode 100644 index 0000000..a2fcce4 --- /dev/null +++ b/zbook_backend/db/query/repo.sql @@ -0,0 +1,395 @@ +-- name: CreateRepo :one +INSERT INTO repos ( + user_id, + git_protocol, + git_host, + git_username, + git_repo, + git_access_token, + repo_name, + theme_sidebar, + theme_color, + home_page, + repo_description, + sync_token, + commit_id, + visibility_level +) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14) +RETURNING *; + +-- name: UpdateRepoConfig :exec +UPDATE repos +SET config=$2,commit_id=$3,updated_at=now() +WHERE repo_id = $1; + +-- name: UpdateRepoInfo :one +UPDATE repos +SET +repo_name=COALESCE(sqlc.narg(repo_name),repo_name), +repo_description=COALESCE(sqlc.narg(repo_description),repo_description), +sync_token=COALESCE(sqlc.narg(sync_token),sync_token), +visibility_level=COALESCE(sqlc.narg(visibility_level),visibility_level), +git_access_token=COALESCE(sqlc.narg(git_access_token),git_access_token), +theme_sidebar=COALESCE(sqlc.narg(theme_sidebar),theme_sidebar), +theme_color=COALESCE(sqlc.narg(theme_color),theme_color), +home_page=COALESCE(sqlc.narg(home_page),home_page) +WHERE repo_id = sqlc.arg(repo_id) +RETURNING *; + +-- name: DeleteRepo :exec +DELETE FROM repos +WHERE repo_id = $1; + +-- name: GetRepo :one +SELECT * from repos +WHERE repo_id = $1; + +-- name: GetRepoID :one +SELECT repos.repo_id +from repos +JOIN users on users.user_id= repos.user_id +WHERE users.username=$1 AND repos.repo_name=$2; + +-- name: GetRepoByRepoName :one +SELECT * from repos +JOIN users on users.user_id= repos.user_id +WHERE users.username=$1 AND repos.repo_name=$2; + +-- name: GetRepoConfig :one +SELECT repos.repo_id,config,repos.user_id,visibility_level,repos.theme_sidebar,repos.theme_color FROM repos +JOIN users on users.user_id = repos.user_id +WHERE users.username=$1 AND repos.repo_name=$2; + + +-- name: GetRepoPermission :one +SELECT + repos.visibility_level as visibility_level, + users.user_id,users.blocked as user_blocked,users.username, + users.user_role as user_role, + repos.repo_id +FROM + repos +INNER JOIN users ON users.user_id = repos.user_id +WHERE + repo_id = $1; + +-- name: GetRepoBasicInfo :one +SELECT repos.*, + users.username, users.email +FROM repos +INNER JOIN users ON repos.user_id = users.user_id +WHERE users.username=$1 AND repos.repo_name=$2; + + +-- name: GetQueryRepoCount :one +SELECT + count(*) +FROM + repos r +JOIN + users u ON u.user_id = r.user_id +where (r.fts_repo_en @@ plainto_tsquery(@query) OR r.fts_repo_zh @@ plainto_tsquery(@query)) + AND ( + (@role::text='admin' AND @signed::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ); + +-- name: QueryRepo :many +select + r.*, + u.username, + ROUND(ts_rank(r.fts_repo_en, plainto_tsquery(@query))) + ROUND(ts_rank(r.fts_repo_zh, plainto_tsquery(@query))) as rank +FROM + repos r +JOIN + users u ON u.user_id = r.user_id +where (r.fts_repo_en @@ plainto_tsquery(@query) OR r.fts_repo_zh @@ plainto_tsquery(@query)) + AND ( + (@role::text='admin' AND @signed::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2; + + +-- name: GetListRepoCount :one +SELECT + count(*) +FROM + repos r +JOIN + users u ON u.user_id = r.user_id +WHERE + (@role::text='admin' AND @signed::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ); + +-- name: ListRepo :many +SELECT + r.*, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + u.username, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id and repo_relations.relation_type = 'like' and repo_relations.user_id = @cur_user_id ) as is_liked +FROM + repos r +JOIN + users u ON u.user_id = r.user_id +WHERE + (@role::text='admin' AND @signed::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + +ORDER BY r.created_at DESC +LIMIT $1 +OFFSET $2; + + +-- name: GetQueryUserOwnRepoCount :one +SELECT + COUNT(*) +FROM + repos r +JOIN + users as u ON u.user_id=r.user_id +WHERE + (r.fts_repo_en @@ plainto_tsquery(@query) OR r.fts_repo_zh @@ plainto_tsquery(@query)) AND u.user_id = @user_id AND ( + (@role::text='admin' AND @signed::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ); + +-- name: QueryUserOwnRepo :many +SELECT + r.*, + ROUND(ts_rank(r.fts_repo_en, plainto_tsquery(@query))) + ROUND(ts_rank(r.fts_repo_zh, plainto_tsquery(@query))) as rank, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id and repo_relations.relation_type = 'like' and repo_relations.user_id = @cur_user_id ) as is_liked +FROM + repos r +JOIN + users as u ON u.user_id=r.user_id +WHERE + (r.fts_repo_en @@ plainto_tsquery(@query) OR r.fts_repo_zh @@ plainto_tsquery(@query)) AND u.user_id = @user_id AND ( + (@role::text='admin' AND @signed::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2; + +-- name: ListUserOwnRepo :many +SELECT + r.*, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.relation_type = 'like' AND repo_relations.user_id = @cur_user_id) AS is_liked +FROM + repos r +JOIN + users as u ON u.user_id=r.user_id +WHERE + u.user_id = @user_id AND ( + (@role::text='admin' AND @signed::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ) +ORDER BY r.created_at DESC +LIMIT $1 +OFFSET $2; + +-- name: GetListUserOwnRepoCount :one +SELECT + COUNT(*) +FROM + repos r +JOIN + users as u ON u.user_id=r.user_id +WHERE + u.user_id = @user_id AND ( + (@role::text='admin' AND @signed::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ); + +-- name: QueryUserLikeRepo :many +SELECT + r.*,ur.username, + ROUND(ts_rank(r.fts_repo_en, plainto_tsquery(@query))) + ROUND(ts_rank(r.fts_repo_zh, plainto_tsquery(@query))) as rank, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id and repo_relations.relation_type = 'like' and repo_relations.user_id = @cur_user_id ) as is_liked +FROM + repos r +JOIN repo_relations AS rr ON r.repo_id = rr.repo_id +JOIN + users as ur ON ur.user_id=r.user_id +JOIN + users as uq ON uq.user_id=rr.user_id +WHERE + (r.fts_repo_en @@ plainto_tsquery(@query) OR r.fts_repo_zh @@ plainto_tsquery(@query)) AND uq.user_id = @user_id AND rr.relation_type='like' AND ( + (@role::text='admin' AND @signed::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2; + +-- name: GetQueryUserLikeRepoCount :one +SELECT + COUNT(*) +FROM + repos r +JOIN repo_relations AS rr ON r.repo_id = rr.repo_id +JOIN + users as ur ON ur.user_id=r.user_id +JOIN + users as uq ON uq.user_id=rr.user_id +WHERE + (r.fts_repo_en @@ plainto_tsquery(@query) OR r.fts_repo_zh @@ plainto_tsquery(@query)) AND uq.user_id = @user_id AND rr.relation_type='like' AND ( + (@role::text='admin' AND @signed::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ); + +-- name: ListUserLikeRepo :many +SELECT + r.*,ur.username, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id and repo_relations.relation_type = 'like' and repo_relations.user_id = @cur_user_id ) as is_liked +FROM + repos r +JOIN + repo_relations AS rr ON r.repo_id = rr.repo_id +JOIN + users as ur ON ur.user_id=r.user_id -- query user likes repo owner +JOIN + users as uq ON uq.user_id=rr.user_id -- query user +WHERE + uq.user_id = @user_id AND rr.relation_type='like' AND ( + (@role::text='admin' AND @signed::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ) +ORDER BY r.created_at DESC +LIMIT $1 +OFFSET $2; + +-- name: GetListUserLikeRepoCount :one +SELECT + COUNT(*) +FROM + repos r +JOIN repo_relations AS rr ON r.repo_id = rr.repo_id +JOIN + users as ur ON ur.user_id=r.user_id +JOIN + users as uq ON uq.user_id=rr.user_id +WHERE + uq.user_id = @user_id AND rr.relation_type='like' AND ( + (@role::text='admin' AND @signed::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ); \ No newline at end of file diff --git a/zbook_backend/db/query/repo_relation.sql b/zbook_backend/db/query/repo_relation.sql new file mode 100644 index 0000000..79053ff --- /dev/null +++ b/zbook_backend/db/query/repo_relation.sql @@ -0,0 +1,48 @@ +-- name: CreateRepoRelation :exec +INSERT INTO repo_relations ( + user_id, + repo_id, + relation_type +) VALUES ($1,$2,$3); + +-- name: DeleteRepoRelation :exec +DELETE FROM repo_relations +WHERE user_id=$1 and repo_id=$2 and relation_type = $3; + +-- name: GetRepoRelation :one +SELECT * +FROM repo_relations +WHERE user_id = $1 and repo_id=$2 and relation_type = $3; + + +-- name: GetRepoVisibilityByRepoCount :one +SELECT COUNT(*) +FROM repos as r +LEFT JOIN repo_relations as rr ON rr.repo_id=r.repo_id +JOIN users as u ON u.user_id = rr.user_id +WHERE r.repo_id=$1 AND rr.relation_type = 'visi'; + +-- name: ListRepoVisibilityByRepo :many +SELECT u.* +FROM repos as r +LEFT JOIN repo_relations as rr ON rr.repo_id=r.repo_id +JOIN users as u ON u.user_id = rr.user_id +WHERE r.repo_id=$3 AND rr.relation_type = 'visi' +ORDER BY rr.created_at DESC +LIMIT $1 +OFFSET $2; + + +-- name: QueryRepoVisibilityByRepo :many +SELECT + u.*, + CASE WHEN MAX(rr.user_id) IS NOT NULL THEN true ELSE false END AS is_visible +FROM + users as u +LEFT JOIN + repo_relations rr ON rr.user_id = u.user_id AND rr.repo_id=$3 +WHERE u.username=$4 +GROUP BY u.user_id,rr.created_at +ORDER BY rr.created_at DESC +LIMIT $1 +OFFSET $2; \ No newline at end of file diff --git a/zbook_backend/db/query/session.sql b/zbook_backend/db/query/session.sql new file mode 100644 index 0000000..6eecd39 --- /dev/null +++ b/zbook_backend/db/query/session.sql @@ -0,0 +1,57 @@ +-- name: CreateSession :one +INSERT INTO sessions ( + session_id, + user_id, + refresh_token, + user_agent, + client_ip, + expires_at +) VALUES ( + $1, $2, $3, $4, $5, $6 +) RETURNING *; + +-- name: GetSession :one +SELECT * FROM sessions +WHERE session_id = $1 LIMIT 1; + +-- name: GetListSessionCount :one +SELECT Count(*) FROM sessions; + +-- name: ListSession :many +SELECT + * +FROM + sessions +INNER JOIN users ON users.user_id = sessions.user_id +ORDER BY sessions.created_at DESC +LIMIT $1 +OFFSET $2; + +-- name: GetQuerySessionCount :one +select Count(*) +FROM + sessions +JOIN users ON users.user_id = sessions.user_id +WHERE fts_username @@ plainto_tsquery(@query); + +-- name: QuerySession :many +SELECT + sessions.*, + ts_rank(users.fts_username, plainto_tsquery(@query)) as rank, + users.* +FROM + sessions +JOIN users ON users.user_id = sessions.user_id +WHERE fts_username @@ plainto_tsquery(@query) +ORDER BY + rank DESC, + sessions.created_at DESC +LIMIT $1 +OFFSET $2; + +-- name: GetDailyActiveUserCount :many +SELECT (created_at AT TIME ZONE @timezone)::date AS registration_date, COUNT(DISTINCT user_id) AS active_users_count +FROM sessions +WHERE (created_at AT TIME ZONE @timezone) >= (CURRENT_DATE AT TIME ZONE @timezone) - (@interval_days || ' days')::INTERVAL +GROUP BY registration_date +ORDER BY registration_date DESC; \ No newline at end of file diff --git a/zbook_backend/db/query/user_query.sql b/zbook_backend/db/query/user_query.sql new file mode 100644 index 0000000..8daf1aa --- /dev/null +++ b/zbook_backend/db/query/user_query.sql @@ -0,0 +1,118 @@ +-- name: GetUserByUsername :one +SELECT * +FROM users +WHERE username = $1 +LIMIT 1; + +-- name: GetUserByEmail :one +SELECT * +FROM users +WHERE users.email = $1 +LIMIT 1; + +-- name: GetUnReadCount :one +SELECT unread_count +FROM users +WHERE username = $1 +LIMIT 1; + +-- name: ListUser :many +SELECT * +FROM users u +WHERE u.blocked = 'false' OR @role::text='admin' +ORDER BY u.created_at DESC +LIMIT $1 +OFFSET $2; + +-- name: GetListUserCount :one +SELECT COUNT(*) +FROM users +WHERE +users.blocked = 'false' OR @role::text='admin'; + +-- name: QueryUser :many +select users.*,ts_rank(fts_username, plainto_tsquery(@query)) as rank +from users +where (users.blocked='false' OR @role::text='admin') AND fts_username @@ plainto_tsquery(@query) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2; + +-- name: GetQueryUserCount :one +select COUNT(*) +from users +where (users.blocked='false' OR @role::text='admin') AND fts_username @@ plainto_tsquery(@query); + +-- name: GetDailyCreateUserCount :many +SELECT + (created_at AT TIME ZONE @timezone)::date AS registration_date, + COUNT(*) AS new_users_count +FROM users +WHERE + (created_at AT TIME ZONE @timezone) >= (CURRENT_DATE AT TIME ZONE @timezone) - (@interval_days || ' days')::INTERVAL +GROUP BY + registration_date +ORDER BY + registration_date DESC; + +-- name: GetUserInfo :one +WITH liked_repos_count AS ( + SELECT + Count(*) as like_count + FROM + repos r + JOIN + repo_relations AS rr ON r.repo_id = rr.repo_id + JOIN + users as ur ON ur.user_id=r.user_id + JOIN + users as uq ON uq.user_id=rr.user_id + WHERE + uq.user_id = @user_id AND rr.relation_type='like' AND ( + (@role::text='admin' AND @signed::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ) +), + owned_repos_count AS ( + SELECT + COUNT(*) as repo_count + FROM + repos r + JOIN + users as u ON u.user_id=r.user_id + WHERE + u.user_id = @user_id AND ( + (@role::text='admin' AND @signed::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND @signed::bool) + OR + (r.visibility_level = 'chosen' AND @signed::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = @cur_user_id AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = @cur_user_id AND @signed::bool) + ) + ) + ) +) +SELECT + u.*, + repo_count, + like_count, + (SELECT COUNT(*) FROM follows f1 JOIN users as uf ON uf.user_id = f1.follower_id WHERE f1.following_id = u.user_id and (uf.blocked = 'false' OR @role::text='admin')) AS follower_count, + (SELECT COUNT(*) FROM follows f2 JOIN users as uf ON uf.user_id = f2.following_id WHERE f2.follower_id = u.user_id and (uf.blocked = 'false' OR @role::text='admin')) AS following_count, + EXISTS(SELECT 1 FROM follows WHERE follows.follower_id = @cur_user_id AND follows.following_id = @user_id) AS is_following +FROM users u +JOIN liked_repos_count lrc ON 1=1 +JOIN owned_repos_count ownrc ON 1=1 +WHERE u.user_id = @user_id; diff --git a/zbook_backend/db/query/user_update.sql b/zbook_backend/db/query/user_update.sql new file mode 100644 index 0000000..4eb1430 --- /dev/null +++ b/zbook_backend/db/query/user_update.sql @@ -0,0 +1,62 @@ +-- name: CreateUser :one +INSERT INTO users ( + username, + email, + hashed_password +) VALUES ( + $1, $2, $3 +) RETURNING *; + +-- name: DeleteUser :exec +DELETE FROM users +WHERE username = $1; + +-- name: UpdateUnreadCount :exec +UPDATE users +SET unread_count = ( + SELECT COUNT(*) FROM ( + SELECT noti_id FROM follower_notifications + WHERE user_id = users.user_id AND created_at > users.unread_count_updated_at AND readed = false + UNION ALL + SELECT noti_id FROM comment_notifications + WHERE user_id = users.user_id AND created_at > users.unread_count_updated_at AND readed = false + UNION ALL + SELECT noti_id FROM system_notifications + WHERE user_id = users.user_id AND created_at > users.unread_count_updated_at AND readed = false + UNION ALL + SELECT noti_id FROM repo_notifications + WHERE user_id = users.user_id AND created_at > users.unread_count_updated_at AND readed = false + ) AS subquery +) +WHERE users.user_id = $1; + +-- name: ResetUnreadCount :exec +UPDATE users +SET unread_count_updated_at = now(), + unread_count = ( + SELECT COUNT(*) FROM ( + SELECT noti_id FROM follower_notifications + WHERE user_id = users.user_id AND created_at > now() AND readed = false + UNION ALL + SELECT noti_id FROM comment_notifications + WHERE user_id = users.user_id AND created_at > now() AND readed = false + UNION ALL + SELECT noti_id FROM system_notifications + WHERE user_id = users.user_id AND created_at > now() AND readed = false + UNION ALL + SELECT noti_id FROM repo_notifications + WHERE user_id = users.user_id AND created_at > now() AND readed = false + ) AS subquery +) +WHERE users.username = $1; + +-- name: UpdateUserBasicInfo :one +UPDATE users +SET motto=COALESCE(sqlc.narg(motto),motto), +hashed_password=COALESCE(sqlc.narg(hashed_password),hashed_password), +user_role=COALESCE(sqlc.narg(user_role),user_role), +onboarding=COALESCE(sqlc.narg(onboarding),onboarding), +blocked=COALESCE(sqlc.narg(blocked),blocked), +verified=COALESCE(sqlc.narg(verified),verified) +WHERE username = sqlc.arg(username) +RETURNING *; diff --git a/zbook_backend/db/query/verification.sql b/zbook_backend/db/query/verification.sql new file mode 100644 index 0000000..0a1445f --- /dev/null +++ b/zbook_backend/db/query/verification.sql @@ -0,0 +1,28 @@ +-- name: CreateVerification :one +INSERT INTO verifications ( + verification_url, + user_id, + verification_type +) VALUES ( + $1, $2,$3 +) RETURNING *; + +-- name: GetVerification :one +SELECT verifications.*,users.username,users.email +FROM verifications +JOIN users ON users.user_id = verifications.user_id +WHERE verification_url = $1 + AND is_used = FALSE + AND expired_at > now() + LIMIT 1 +FOR NO KEY UPDATE; + +-- name: MarkVerificationAsUsed :one +UPDATE verifications +SET + is_used = TRUE +WHERE + verification_url = @verification_url + AND is_used = FALSE + AND expired_at > now() +RETURNING *; \ No newline at end of file diff --git a/zbook_backend/db/sqlc/comment.sql.go b/zbook_backend/db/sqlc/comment.sql.go new file mode 100644 index 0000000..21aa390 --- /dev/null +++ b/zbook_backend/db/sqlc/comment.sql.go @@ -0,0 +1,624 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: comment.sql + +package db + +import ( + "context" + "time" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createComment = `-- name: CreateComment :one +INSERT INTO comments ( + user_id, + repo_id, + markdown_id, + parent_id, + root_id, + comment_content +) VALUES ($1,$2,$3,$4,$5,$6) +RETURNING comment_id, repo_id, markdown_id, parent_id, root_id, user_id, blocked, comment_content, created_at, fts_comment_zh, fts_comment_en +` + +type CreateCommentParams struct { + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + MarkdownID int64 `json:"markdown_id"` + ParentID pgtype.Int8 `json:"parent_id"` + RootID pgtype.Int8 `json:"root_id"` + CommentContent string `json:"comment_content"` +} + +func (q *Queries) CreateComment(ctx context.Context, arg CreateCommentParams) (Comment, error) { + row := q.db.QueryRow(ctx, createComment, + arg.UserID, + arg.RepoID, + arg.MarkdownID, + arg.ParentID, + arg.RootID, + arg.CommentContent, + ) + var i Comment + err := row.Scan( + &i.CommentID, + &i.RepoID, + &i.MarkdownID, + &i.ParentID, + &i.RootID, + &i.UserID, + &i.Blocked, + &i.CommentContent, + &i.CreatedAt, + &i.FtsCommentZh, + &i.FtsCommentEn, + ) + return i, err +} + +const deleteComment = `-- name: DeleteComment :exec +DELETE FROM comments +WHERE comment_id = $1 +` + +func (q *Queries) DeleteComment(ctx context.Context, commentID int64) error { + _, err := q.db.Exec(ctx, deleteComment, commentID) + return err +} + +const getCommentBasicInfo = `-- name: GetCommentBasicInfo :one +SELECT comments.comment_id,comments.markdown_id,comments.user_id,comments.parent_id,comments.comment_content,comments.created_at,comments.root_id +FROM comments +WHERE comments.comment_id = $1 +LIMIT 1 +FOR NO KEY UPDATE +` + +type GetCommentBasicInfoRow struct { + CommentID int64 `json:"comment_id"` + MarkdownID int64 `json:"markdown_id"` + UserID int64 `json:"user_id"` + ParentID pgtype.Int8 `json:"parent_id"` + CommentContent string `json:"comment_content"` + CreatedAt time.Time `json:"created_at"` + RootID pgtype.Int8 `json:"root_id"` +} + +func (q *Queries) GetCommentBasicInfo(ctx context.Context, commentID int64) (GetCommentBasicInfoRow, error) { + row := q.db.QueryRow(ctx, getCommentBasicInfo, commentID) + var i GetCommentBasicInfoRow + err := row.Scan( + &i.CommentID, + &i.MarkdownID, + &i.UserID, + &i.ParentID, + &i.CommentContent, + &i.CreatedAt, + &i.RootID, + ) + return i, err +} + +const getCommentDetail = `-- name: GetCommentDetail :one +SELECT comments.comment_id, comments.repo_id, comments.markdown_id, comments.parent_id, comments.root_id, comments.user_id, comments.blocked, comments.comment_content, comments.created_at, comments.fts_comment_zh, comments.fts_comment_en, + users.username,users.email,users.motto,users.created_at as user_created_at, + COUNT(DISTINCT CASE WHEN comment_relations.relation_type = 'like' THEN comment_relations.relation_id END) AS like_count, + (SELECT COUNT(*) FROM comments c2 WHERE c2.root_id = comments.comment_id) AS reply_count, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'like' and comment_relations.user_id = $2 ) as is_liked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'dislike' and comment_relations.user_id = $2 ) as is_disliked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'share' and comment_relations.user_id = $2 ) as is_shared, + EXISTS(SELECT 1 FROM comment_reports WHERE comment_reports.comment_id = comments.comment_id and comment_reports.user_id = $2 ) as is_reported +FROM comments +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.comment_id = $1 +GROUP BY comments.comment_id,users.user_id +LIMIT 1 +` + +type GetCommentDetailParams struct { + CommentID int64 `json:"comment_id"` + UserID int64 `json:"user_id"` +} + +type GetCommentDetailRow struct { + CommentID int64 `json:"comment_id"` + RepoID int64 `json:"repo_id"` + MarkdownID int64 `json:"markdown_id"` + ParentID pgtype.Int8 `json:"parent_id"` + RootID pgtype.Int8 `json:"root_id"` + UserID int64 `json:"user_id"` + Blocked bool `json:"blocked"` + CommentContent string `json:"comment_content"` + CreatedAt time.Time `json:"created_at"` + FtsCommentZh string `json:"fts_comment_zh"` + FtsCommentEn string `json:"fts_comment_en"` + Username string `json:"username"` + Email string `json:"email"` + Motto string `json:"motto"` + UserCreatedAt time.Time `json:"user_created_at"` + LikeCount int64 `json:"like_count"` + ReplyCount int64 `json:"reply_count"` + IsLiked bool `json:"is_liked"` + IsDisliked bool `json:"is_disliked"` + IsShared bool `json:"is_shared"` + IsReported bool `json:"is_reported"` +} + +func (q *Queries) GetCommentDetail(ctx context.Context, arg GetCommentDetailParams) (GetCommentDetailRow, error) { + row := q.db.QueryRow(ctx, getCommentDetail, arg.CommentID, arg.UserID) + var i GetCommentDetailRow + err := row.Scan( + &i.CommentID, + &i.RepoID, + &i.MarkdownID, + &i.ParentID, + &i.RootID, + &i.UserID, + &i.Blocked, + &i.CommentContent, + &i.CreatedAt, + &i.FtsCommentZh, + &i.FtsCommentEn, + &i.Username, + &i.Email, + &i.Motto, + &i.UserCreatedAt, + &i.LikeCount, + &i.ReplyCount, + &i.IsLiked, + &i.IsDisliked, + &i.IsShared, + &i.IsReported, + ) + return i, err +} + +const getCommentRepoInfo = `-- name: GetCommentRepoInfo :one +SELECT repos.repo_id, repos.user_id, repos.git_protocol, repos.git_host, repos.git_username, repos.git_repo, repos.git_access_token, repos.repo_name, repos.repo_description, repos.home_page, repos.sync_token, repos.visibility_level, repos.commit_id, repos.config, repos.theme_sidebar, repos.theme_color, repos.created_at, repos.updated_at, repos.fts_repo_en, repos.fts_repo_zh +FROM markdowns +JOIN comments on markdowns.markdown_id=comments.markdown_id +JOIN repos on markdowns.repo_id = repos.repo_id +WHERE comments.comment_id = $1 +LIMIT 1 +FOR NO KEY UPDATE +` + +func (q *Queries) GetCommentRepoInfo(ctx context.Context, commentID int64) (Repo, error) { + row := q.db.QueryRow(ctx, getCommentRepoInfo, commentID) + var i Repo + err := row.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + ) + return i, err +} + +const getListCommentCount = `-- name: GetListCommentCount :one +SELECT COUNT(*) +FROM comments +JOIN markdowns on markdowns.markdown_id = comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ON comments.user_id = users.user_id +JOIN users as mu ON mu.user_id=repos.user_id +` + +func (q *Queries) GetListCommentCount(ctx context.Context) (int64, error) { + row := q.db.QueryRow(ctx, getListCommentCount) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getListCommentLevelOneCount = `-- name: GetListCommentLevelOneCount :one +SELECT Count(*) +FROM comments +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.markdown_id = $1 AND comments.parent_id IS NULL +` + +func (q *Queries) GetListCommentLevelOneCount(ctx context.Context, markdownID int64) (int64, error) { + row := q.db.QueryRow(ctx, getListCommentLevelOneCount, markdownID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getListCommentLevelTwoCount = `-- name: GetListCommentLevelTwoCount :one +SELECT Count(*) +FROM comments +LEFT JOIN comments pc ON comments.parent_id = pc.comment_id +LEFT JOIN users pu ON pu.user_id = pc.user_id +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.root_id = $1 +` + +func (q *Queries) GetListCommentLevelTwoCount(ctx context.Context, rootID pgtype.Int8) (int64, error) { + row := q.db.QueryRow(ctx, getListCommentLevelTwoCount, rootID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getQueryCommentCount = `-- name: GetQueryCommentCount :one +SELECT COUNT(*) +FROM comments +JOIN markdowns on markdowns.markdown_id = comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ON comments.user_id = users.user_id +JOIN users as mu ON mu.user_id=repos.user_id +WHERE (comments.fts_comment_zh @@ plainto_tsquery($1) OR comments.fts_comment_en @@ plainto_tsquery($1)) +` + +func (q *Queries) GetQueryCommentCount(ctx context.Context, query string) (int64, error) { + row := q.db.QueryRow(ctx, getQueryCommentCount, query) + var count int64 + err := row.Scan(&count) + return count, err +} + +const listComment = `-- name: ListComment :many +SELECT comments.comment_id, comments.repo_id, comments.markdown_id, comments.parent_id, comments.root_id, comments.user_id, comments.blocked, comments.comment_content, comments.created_at, comments.fts_comment_zh, comments.fts_comment_en, + users.username,users.email,users.created_at as user_created_at +FROM comments +JOIN markdowns on markdowns.markdown_id = comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ON comments.user_id = users.user_id +JOIN users as mu ON mu.user_id=repos.user_id +ORDER BY comments.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type ListCommentParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` +} + +type ListCommentRow struct { + CommentID int64 `json:"comment_id"` + RepoID int64 `json:"repo_id"` + MarkdownID int64 `json:"markdown_id"` + ParentID pgtype.Int8 `json:"parent_id"` + RootID pgtype.Int8 `json:"root_id"` + UserID int64 `json:"user_id"` + Blocked bool `json:"blocked"` + CommentContent string `json:"comment_content"` + CreatedAt time.Time `json:"created_at"` + FtsCommentZh string `json:"fts_comment_zh"` + FtsCommentEn string `json:"fts_comment_en"` + Username string `json:"username"` + Email string `json:"email"` + UserCreatedAt time.Time `json:"user_created_at"` +} + +func (q *Queries) ListComment(ctx context.Context, arg ListCommentParams) ([]ListCommentRow, error) { + rows, err := q.db.Query(ctx, listComment, arg.Limit, arg.Offset) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListCommentRow{} + for rows.Next() { + var i ListCommentRow + if err := rows.Scan( + &i.CommentID, + &i.RepoID, + &i.MarkdownID, + &i.ParentID, + &i.RootID, + &i.UserID, + &i.Blocked, + &i.CommentContent, + &i.CreatedAt, + &i.FtsCommentZh, + &i.FtsCommentEn, + &i.Username, + &i.Email, + &i.UserCreatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listCommentLevelOne = `-- name: ListCommentLevelOne :many +SELECT comments.comment_id, comments.repo_id, comments.markdown_id, comments.parent_id, comments.root_id, comments.user_id, comments.blocked, comments.comment_content, comments.created_at, comments.fts_comment_zh, comments.fts_comment_en, + users.username,users.email,users.motto,users.created_at as user_created_at, + COUNT(DISTINCT CASE WHEN comment_relations.relation_type = 'like' THEN comment_relations.relation_id END) AS like_count, + (SELECT COUNT(*) FROM comments c2 WHERE c2.root_id = comments.comment_id) AS reply_count, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'like' and comment_relations.user_id = $4 ) as is_liked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'dislike' and comment_relations.user_id = $4 ) as is_disliked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'share' and comment_relations.user_id = $4 ) as is_shared, + EXISTS(SELECT 1 FROM comment_reports WHERE comment_reports.comment_id = comments.comment_id and comment_reports.user_id = $4 ) as is_reported +FROM comments +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.markdown_id = $1 AND comments.parent_id IS NULL +GROUP BY comments.comment_id,users.user_id +ORDER BY comments.created_at DESC +LIMIT $2 +OFFSET $3 +` + +type ListCommentLevelOneParams struct { + MarkdownID int64 `json:"markdown_id"` + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + UserID int64 `json:"user_id"` +} + +type ListCommentLevelOneRow struct { + CommentID int64 `json:"comment_id"` + RepoID int64 `json:"repo_id"` + MarkdownID int64 `json:"markdown_id"` + ParentID pgtype.Int8 `json:"parent_id"` + RootID pgtype.Int8 `json:"root_id"` + UserID int64 `json:"user_id"` + Blocked bool `json:"blocked"` + CommentContent string `json:"comment_content"` + CreatedAt time.Time `json:"created_at"` + FtsCommentZh string `json:"fts_comment_zh"` + FtsCommentEn string `json:"fts_comment_en"` + Username string `json:"username"` + Email string `json:"email"` + Motto string `json:"motto"` + UserCreatedAt time.Time `json:"user_created_at"` + LikeCount int64 `json:"like_count"` + ReplyCount int64 `json:"reply_count"` + IsLiked bool `json:"is_liked"` + IsDisliked bool `json:"is_disliked"` + IsShared bool `json:"is_shared"` + IsReported bool `json:"is_reported"` +} + +func (q *Queries) ListCommentLevelOne(ctx context.Context, arg ListCommentLevelOneParams) ([]ListCommentLevelOneRow, error) { + rows, err := q.db.Query(ctx, listCommentLevelOne, + arg.MarkdownID, + arg.Limit, + arg.Offset, + arg.UserID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListCommentLevelOneRow{} + for rows.Next() { + var i ListCommentLevelOneRow + if err := rows.Scan( + &i.CommentID, + &i.RepoID, + &i.MarkdownID, + &i.ParentID, + &i.RootID, + &i.UserID, + &i.Blocked, + &i.CommentContent, + &i.CreatedAt, + &i.FtsCommentZh, + &i.FtsCommentEn, + &i.Username, + &i.Email, + &i.Motto, + &i.UserCreatedAt, + &i.LikeCount, + &i.ReplyCount, + &i.IsLiked, + &i.IsDisliked, + &i.IsShared, + &i.IsReported, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listCommentLevelTwo = `-- name: ListCommentLevelTwo :many +SELECT comments.comment_id, comments.repo_id, comments.markdown_id, comments.parent_id, comments.root_id, comments.user_id, comments.blocked, comments.comment_content, comments.created_at, comments.fts_comment_zh, comments.fts_comment_en, + users.username,users.email,users.motto,users.created_at as user_created_at, pu.username as pusername, + COUNT(DISTINCT CASE WHEN comment_relations.relation_type = 'like' THEN comment_relations.relation_id END) AS like_count, + (SELECT COUNT(*) FROM comments c2 WHERE c2.root_id = comments.comment_id) AS reply_count, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'like' and comment_relations.user_id = $4 ) as is_liked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'dislike' and comment_relations.user_id = $4 ) as is_disliked, + EXISTS(SELECT 1 FROM comment_relations WHERE comment_relations.comment_id = comments.comment_id and comment_relations.relation_type = 'share' and comment_relations.user_id = $4 ) as is_shared, + EXISTS(SELECT 1 FROM comment_reports WHERE comment_reports.comment_id = comments.comment_id and comment_reports.user_id = $4 ) as is_reported +FROM comments +LEFT JOIN comments pc ON comments.parent_id = pc.comment_id +LEFT JOIN users pu ON pu.user_id = pc.user_id +LEFT JOIN comment_relations ON comments.comment_id = comment_relations.comment_id +JOIN users ON comments.user_id = users.user_id +WHERE comments.root_id = $1 +GROUP BY comments.comment_id,users.user_id,pu.username +ORDER BY comments.created_at +LIMIT $2 +OFFSET $3 +` + +type ListCommentLevelTwoParams struct { + RootID pgtype.Int8 `json:"root_id"` + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + UserID int64 `json:"user_id"` +} + +type ListCommentLevelTwoRow struct { + CommentID int64 `json:"comment_id"` + RepoID int64 `json:"repo_id"` + MarkdownID int64 `json:"markdown_id"` + ParentID pgtype.Int8 `json:"parent_id"` + RootID pgtype.Int8 `json:"root_id"` + UserID int64 `json:"user_id"` + Blocked bool `json:"blocked"` + CommentContent string `json:"comment_content"` + CreatedAt time.Time `json:"created_at"` + FtsCommentZh string `json:"fts_comment_zh"` + FtsCommentEn string `json:"fts_comment_en"` + Username string `json:"username"` + Email string `json:"email"` + Motto string `json:"motto"` + UserCreatedAt time.Time `json:"user_created_at"` + Pusername pgtype.Text `json:"pusername"` + LikeCount int64 `json:"like_count"` + ReplyCount int64 `json:"reply_count"` + IsLiked bool `json:"is_liked"` + IsDisliked bool `json:"is_disliked"` + IsShared bool `json:"is_shared"` + IsReported bool `json:"is_reported"` +} + +func (q *Queries) ListCommentLevelTwo(ctx context.Context, arg ListCommentLevelTwoParams) ([]ListCommentLevelTwoRow, error) { + rows, err := q.db.Query(ctx, listCommentLevelTwo, + arg.RootID, + arg.Limit, + arg.Offset, + arg.UserID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListCommentLevelTwoRow{} + for rows.Next() { + var i ListCommentLevelTwoRow + if err := rows.Scan( + &i.CommentID, + &i.RepoID, + &i.MarkdownID, + &i.ParentID, + &i.RootID, + &i.UserID, + &i.Blocked, + &i.CommentContent, + &i.CreatedAt, + &i.FtsCommentZh, + &i.FtsCommentEn, + &i.Username, + &i.Email, + &i.Motto, + &i.UserCreatedAt, + &i.Pusername, + &i.LikeCount, + &i.ReplyCount, + &i.IsLiked, + &i.IsDisliked, + &i.IsShared, + &i.IsReported, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryComment = `-- name: QueryComment :many +SELECT comments.comment_id, comments.repo_id, comments.markdown_id, comments.parent_id, comments.root_id, comments.user_id, comments.blocked, comments.comment_content, comments.created_at, comments.fts_comment_zh, comments.fts_comment_en, + ROUND(ts_rank(comments.fts_comment_zh, plainto_tsquery($3))) + ROUND(ts_rank(comments.fts_comment_en, plainto_tsquery($3))) as rank, + users.username,users.email,users.created_at as user_created_at +FROM comments +JOIN markdowns on markdowns.markdown_id = comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ON comments.user_id = users.user_id +JOIN users as mu ON mu.user_id=repos.user_id +WHERE (comments.fts_comment_zh @@ plainto_tsquery($3) OR comments.fts_comment_en @@ plainto_tsquery($3)) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryCommentParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Query string `json:"query"` +} + +type QueryCommentRow struct { + CommentID int64 `json:"comment_id"` + RepoID int64 `json:"repo_id"` + MarkdownID int64 `json:"markdown_id"` + ParentID pgtype.Int8 `json:"parent_id"` + RootID pgtype.Int8 `json:"root_id"` + UserID int64 `json:"user_id"` + Blocked bool `json:"blocked"` + CommentContent string `json:"comment_content"` + CreatedAt time.Time `json:"created_at"` + FtsCommentZh string `json:"fts_comment_zh"` + FtsCommentEn string `json:"fts_comment_en"` + Rank int32 `json:"rank"` + Username string `json:"username"` + Email string `json:"email"` + UserCreatedAt time.Time `json:"user_created_at"` +} + +func (q *Queries) QueryComment(ctx context.Context, arg QueryCommentParams) ([]QueryCommentRow, error) { + rows, err := q.db.Query(ctx, queryComment, arg.Limit, arg.Offset, arg.Query) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryCommentRow{} + for rows.Next() { + var i QueryCommentRow + if err := rows.Scan( + &i.CommentID, + &i.RepoID, + &i.MarkdownID, + &i.ParentID, + &i.RootID, + &i.UserID, + &i.Blocked, + &i.CommentContent, + &i.CreatedAt, + &i.FtsCommentZh, + &i.FtsCommentEn, + &i.Rank, + &i.Username, + &i.Email, + &i.UserCreatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/zbook_backend/db/sqlc/comment_relation.sql.go b/zbook_backend/db/sqlc/comment_relation.sql.go new file mode 100644 index 0000000..fa95ac4 --- /dev/null +++ b/zbook_backend/db/sqlc/comment_relation.sql.go @@ -0,0 +1,290 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: comment_relation.sql + +package db + +import ( + "context" + "time" +) + +const createCommentRelation = `-- name: CreateCommentRelation :exec +INSERT INTO comment_relations ( + user_id, + comment_id, + relation_type +) VALUES ($1,$2,$3) +` + +type CreateCommentRelationParams struct { + UserID int64 `json:"user_id"` + CommentID int64 `json:"comment_id"` + RelationType string `json:"relation_type"` +} + +func (q *Queries) CreateCommentRelation(ctx context.Context, arg CreateCommentRelationParams) error { + _, err := q.db.Exec(ctx, createCommentRelation, arg.UserID, arg.CommentID, arg.RelationType) + return err +} + +const createCommentReport = `-- name: CreateCommentReport :exec +INSERT INTO comment_reports ( + user_id, + comment_id, + report_content +) VALUES ($1,$2,$3) +` + +type CreateCommentReportParams struct { + UserID int64 `json:"user_id"` + CommentID int64 `json:"comment_id"` + ReportContent string `json:"report_content"` +} + +func (q *Queries) CreateCommentReport(ctx context.Context, arg CreateCommentReportParams) error { + _, err := q.db.Exec(ctx, createCommentReport, arg.UserID, arg.CommentID, arg.ReportContent) + return err +} + +const deleteCommentRelation = `-- name: DeleteCommentRelation :exec +DELETE FROM comment_relations +WHERE user_id=$1 and comment_id=$2 and relation_type=$3 +` + +type DeleteCommentRelationParams struct { + UserID int64 `json:"user_id"` + CommentID int64 `json:"comment_id"` + RelationType string `json:"relation_type"` +} + +func (q *Queries) DeleteCommentRelation(ctx context.Context, arg DeleteCommentRelationParams) error { + _, err := q.db.Exec(ctx, deleteCommentRelation, arg.UserID, arg.CommentID, arg.RelationType) + return err +} + +const getListCommentReportCount = `-- name: GetListCommentReportCount :one +SELECT + COUNT(*) +FROM comment_reports +JOIN users ON users.user_id = comment_reports.user_id +JOIN comments ON comments.comment_id = comment_reports.comment_id +JOIN markdowns ON comments.markdown_id = markdowns.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users ura ON ura.user_id = repos.user_id +JOIN users as uc ON comments.user_id = uc.user_id +` + +func (q *Queries) GetListCommentReportCount(ctx context.Context) (int64, error) { + row := q.db.QueryRow(ctx, getListCommentReportCount) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getQueryCommentReportCount = `-- name: GetQueryCommentReportCount :one +SELECT + COUNT(*) +FROM comment_reports +JOIN users as ur ON ur.user_id = comment_reports.user_id +JOIN comments ON comments.comment_id = comment_reports.comment_id +JOIN markdowns ON comments.markdown_id = markdowns.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users as uc ON comments.user_id = uc.user_id +WHERE ( + comments.fts_comment_zh @@ plainto_tsquery($1) + OR comments.fts_comment_en @@ plainto_tsquery($1) + OR comment_reports.fts_report_zh @@ plainto_tsquery($1) + OR comment_reports.fts_report_en @@ plainto_tsquery($1) + OR uc.fts_username @@ plainto_tsquery($1) + OR ur.fts_username @@ plainto_tsquery($1) + ) +` + +func (q *Queries) GetQueryCommentReportCount(ctx context.Context, query string) (int64, error) { + row := q.db.QueryRow(ctx, getQueryCommentReportCount, query) + var count int64 + err := row.Scan(&count) + return count, err +} + +const listCommentReport = `-- name: ListCommentReport :many +SELECT + comment_reports.report_id, comment_reports.user_id, comment_reports.comment_id, comment_reports.report_content, comment_reports.processed, comment_reports.created_at, comment_reports.fts_report_zh, comment_reports.fts_report_en,users.username,comments.comment_content, + repos.repo_name,ura.username as repo_username,markdowns.relative_path +FROM comment_reports +JOIN users ON users.user_id = comment_reports.user_id +JOIN comments ON comments.comment_id = comment_reports.comment_id +JOIN markdowns ON comments.markdown_id = markdowns.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users as ura ON ura.user_id = repos.user_id +JOIN users as uc ON comments.user_id = uc.user_id +ORDER BY comment_reports.created_at Desc +LIMIT $1 +OFFSET $2 +` + +type ListCommentReportParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` +} + +type ListCommentReportRow struct { + ReportID int64 `json:"report_id"` + UserID int64 `json:"user_id"` + CommentID int64 `json:"comment_id"` + ReportContent string `json:"report_content"` + Processed bool `json:"processed"` + CreatedAt time.Time `json:"created_at"` + FtsReportZh string `json:"fts_report_zh"` + FtsReportEn string `json:"fts_report_en"` + Username string `json:"username"` + CommentContent string `json:"comment_content"` + RepoName string `json:"repo_name"` + RepoUsername string `json:"repo_username"` + RelativePath string `json:"relative_path"` +} + +func (q *Queries) ListCommentReport(ctx context.Context, arg ListCommentReportParams) ([]ListCommentReportRow, error) { + rows, err := q.db.Query(ctx, listCommentReport, arg.Limit, arg.Offset) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListCommentReportRow{} + for rows.Next() { + var i ListCommentReportRow + if err := rows.Scan( + &i.ReportID, + &i.UserID, + &i.CommentID, + &i.ReportContent, + &i.Processed, + &i.CreatedAt, + &i.FtsReportZh, + &i.FtsReportEn, + &i.Username, + &i.CommentContent, + &i.RepoName, + &i.RepoUsername, + &i.RelativePath, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryCommentReport = `-- name: QueryCommentReport :many +SELECT + comment_reports.report_id, comment_reports.user_id, comment_reports.comment_id, comment_reports.report_content, comment_reports.processed, comment_reports.created_at, comment_reports.fts_report_zh, comment_reports.fts_report_en,ur.username,comments.comment_content, + repos.repo_name,ura.username as repo_username,markdowns.relative_path, + ROUND(ts_rank(comments.fts_comment_zh, plainto_tsquery($3))) + + ROUND(ts_rank(comments.fts_comment_en, plainto_tsquery($3))) + + ROUND(ts_rank(comment_reports.fts_report_zh, plainto_tsquery($3))) + + ROUND(ts_rank(comment_reports.fts_report_en, plainto_tsquery($3))) + + ROUND(ts_rank(ur.fts_username, plainto_tsquery($3))) + + ROUND(ts_rank(uc.fts_username, plainto_tsquery($3))) + + ROUND(ts_rank(repos.fts_repo_en, plainto_tsquery($3))) + + ROUND(ts_rank(repos.fts_repo_zh, plainto_tsquery($3))) + as rank +FROM comment_reports +JOIN users as ur ON ur.user_id = comment_reports.user_id +JOIN comments ON comments.comment_id = comment_reports.comment_id +JOIN markdowns ON comments.markdown_id = markdowns.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users as ura ON ura.user_id = repos.user_id +JOIN users as uc ON comments.user_id = uc.user_id +WHERE ( + comments.fts_comment_zh @@ plainto_tsquery($3) + OR comments.fts_comment_en @@ plainto_tsquery($3) + OR comment_reports.fts_report_zh @@ plainto_tsquery($3) + OR comment_reports.fts_report_en @@ plainto_tsquery($3) + OR uc.fts_username @@ plainto_tsquery($3) + OR ur.fts_username @@ plainto_tsquery($3) + OR repos.fts_repo_en @@ plainto_tsquery($3) + OR repos.fts_repo_zh @@ plainto_tsquery($3) + ) +ORDER BY rank Desc +LIMIT $1 +OFFSET $2 +` + +type QueryCommentReportParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Query string `json:"query"` +} + +type QueryCommentReportRow struct { + ReportID int64 `json:"report_id"` + UserID int64 `json:"user_id"` + CommentID int64 `json:"comment_id"` + ReportContent string `json:"report_content"` + Processed bool `json:"processed"` + CreatedAt time.Time `json:"created_at"` + FtsReportZh string `json:"fts_report_zh"` + FtsReportEn string `json:"fts_report_en"` + Username string `json:"username"` + CommentContent string `json:"comment_content"` + RepoName string `json:"repo_name"` + RepoUsername string `json:"repo_username"` + RelativePath string `json:"relative_path"` + Rank int32 `json:"rank"` +} + +func (q *Queries) QueryCommentReport(ctx context.Context, arg QueryCommentReportParams) ([]QueryCommentReportRow, error) { + rows, err := q.db.Query(ctx, queryCommentReport, arg.Limit, arg.Offset, arg.Query) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryCommentReportRow{} + for rows.Next() { + var i QueryCommentReportRow + if err := rows.Scan( + &i.ReportID, + &i.UserID, + &i.CommentID, + &i.ReportContent, + &i.Processed, + &i.CreatedAt, + &i.FtsReportZh, + &i.FtsReportEn, + &i.Username, + &i.CommentContent, + &i.RepoName, + &i.RepoUsername, + &i.RelativePath, + &i.Rank, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateCommentReportStatus = `-- name: UpdateCommentReportStatus :exec +UPDATE comment_reports +SET processed=$2 +WHERE report_id = $1 +` + +type UpdateCommentReportStatusParams struct { + ReportID int64 `json:"report_id"` + Processed bool `json:"processed"` +} + +func (q *Queries) UpdateCommentReportStatus(ctx context.Context, arg UpdateCommentReportStatusParams) error { + _, err := q.db.Exec(ctx, updateCommentReportStatus, arg.ReportID, arg.Processed) + return err +} diff --git a/zbook_backend/db/sqlc/comment_relation_test.go b/zbook_backend/db/sqlc/comment_relation_test.go new file mode 100644 index 0000000..a5d1612 --- /dev/null +++ b/zbook_backend/db/sqlc/comment_relation_test.go @@ -0,0 +1,22 @@ +package db + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func TestCreateCommentReport(t *testing.T) { + user2 := createRandomUser(t) + comment := testCreateRandomComment(t) + + arg_report := CreateCommentReportParams{ + UserID: user2.UserID, + CommentID: comment.CommentID, + ReportContent: util.RandomString(368), + } + err := testStore.CreateCommentReport(context.Background(), arg_report) + require.NoError(t, err) +} diff --git a/zbook_backend/db/sqlc/comment_test.go b/zbook_backend/db/sqlc/comment_test.go new file mode 100644 index 0000000..f59814b --- /dev/null +++ b/zbook_backend/db/sqlc/comment_test.go @@ -0,0 +1,113 @@ +package db + +import ( + "context" + "fmt" + "testing" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/stretchr/testify/require" +) + +func testCreateRandomComment(t *testing.T) Comment { + user := createRandomUser(t) + markdown := testCreateRandomMarkdown(t) + arg := CreateCommentParams{ + UserID: user.UserID, + RepoID: markdown.RepoID, + MarkdownID: markdown.MarkdownID, + ParentID: pgtype.Int8{Int64: int64(0), Valid: false}, + RootID: pgtype.Int8{Int64: int64(0), Valid: false}, + CommentContent: "hhhh", + } + comment, err := testStore.CreateComment(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, comment.UserID, user.UserID) + + arg_second := CreateCommentParams{ + UserID: user.UserID, + RepoID: markdown.RepoID, + MarkdownID: markdown.MarkdownID, + ParentID: pgtype.Int8{Int64: int64(0), Valid: false}, + RootID: pgtype.Int8{Int64: int64(0), Valid: false}, + CommentContent: "bbb", + } + comment, err = testStore.CreateComment(context.Background(), arg_second) + require.NoError(t, err) + require.Equal(t, comment.UserID, user.UserID) + return comment +} +func testCreateRandomCommentOnMd(t *testing.T, markdown Markdown) Comment { + user := createRandomUser(t) + + arg := CreateCommentParams{ + UserID: user.UserID, + RepoID: markdown.RepoID, + MarkdownID: markdown.MarkdownID, + ParentID: pgtype.Int8{Int64: int64(0), Valid: false}, + RootID: pgtype.Int8{Int64: int64(0), Valid: false}, + CommentContent: "hhhh", + } + comment, err := testStore.CreateComment(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, comment.UserID, user.UserID) + + arg_second := CreateCommentParams{ + UserID: user.UserID, + RepoID: markdown.RepoID, + MarkdownID: markdown.MarkdownID, + ParentID: pgtype.Int8{Int64: int64(0), Valid: false}, + RootID: pgtype.Int8{Int64: int64(0), Valid: false}, + CommentContent: "bbb", + } + comment, err = testStore.CreateComment(context.Background(), arg_second) + require.NoError(t, err) + require.Equal(t, comment.UserID, user.UserID) + return comment +} +func TestCreateComment(t *testing.T) { + testCreateRandomComment(t) +} +func TestListCommentLevelOne(t *testing.T) { + md := testCreateRandomMarkdown(t) + testCreateRandomCommentOnMd(t, md) + testCreateRandomCommentOnMd(t, md) + testCreateRandomCommentOnMd(t, md) + arg := ListCommentLevelOneParams{ + MarkdownID: md.MarkdownID, + Limit: 10, + Offset: 0, + UserID: int64(md.UserID), + } + comments, error := testStore.ListCommentLevelOne(context.Background(), arg) + require.NoError(t, error) + require.Equal(t, len(comments), 6) + for i := 0; i < len(comments); i++ { + comment := comments[i] + fmt.Println("comment i:", comment.IsLiked, comment.IsDisliked) + } +} +func TestGetCommentDetail(t *testing.T) { + commenta := testCreateRandomComment(t) + arg := GetCommentDetailParams{ + CommentID: commenta.CommentID, + UserID: commenta.UserID, + } + comment, err := testStore.GetCommentDetail(context.Background(), arg) + require.NoError(t, err) + fmt.Println("comment:", comment.IsLiked) + fmt.Print("comment:", comment.IsDisliked) +} + +func TestDeleteComment(t *testing.T) { + commenta := testCreateRandomComment(t) + arg := GetCommentDetailParams{ + CommentID: commenta.CommentID, + UserID: commenta.UserID, + } + err := testStore.DeleteComment(context.Background(), commenta.CommentID) + require.NoError(t, err) + _, err = testStore.GetCommentDetail(context.Background(), arg) + require.Error(t, err, ErrRecordNotFound) + +} diff --git a/zbook_backend/db/sqlc/configuration.sql.go b/zbook_backend/db/sqlc/configuration.sql.go new file mode 100644 index 0000000..be50400 --- /dev/null +++ b/zbook_backend/db/sqlc/configuration.sql.go @@ -0,0 +1,45 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: configuration.sql + +package db + +import ( + "context" +) + +const getConfiguration = `-- name: GetConfiguration :one +SELECT config_name, config_value, created_at, updated_at +FROM configurations +WHERE config_name=$1 +LIMIT 1 +` + +func (q *Queries) GetConfiguration(ctx context.Context, configName string) (Configuration, error) { + row := q.db.QueryRow(ctx, getConfiguration, configName) + var i Configuration + err := row.Scan( + &i.ConfigName, + &i.ConfigValue, + &i.CreatedAt, + &i.UpdatedAt, + ) + return i, err +} + +const updateConfiguration = `-- name: UpdateConfiguration :exec +UPDATE configurations +SET config_value=$2,updated_at=now() +WHERE config_name=$1 +` + +type UpdateConfigurationParams struct { + ConfigName string `json:"config_name"` + ConfigValue bool `json:"config_value"` +} + +func (q *Queries) UpdateConfiguration(ctx context.Context, arg UpdateConfigurationParams) error { + _, err := q.db.Exec(ctx, updateConfiguration, arg.ConfigName, arg.ConfigValue) + return err +} diff --git a/zbook_backend/db/sqlc/convert_db.go b/zbook_backend/db/sqlc/convert_db.go new file mode 100644 index 0000000..8da68a1 --- /dev/null +++ b/zbook_backend/db/sqlc/convert_db.go @@ -0,0 +1,188 @@ +package db + +import ( + "context" + "encoding/json" + "fmt" + "os" + "strings" + "time" + + "github.com/rs/zerolog/log" + convert "github.com/zizdlp/zbook/markdown/convert" + md "github.com/zizdlp/zbook/markdown/render" + "github.com/zizdlp/zbook/operations" + "github.com/zizdlp/zbook/util" +) + +func ConvertFile2DB(ctx context.Context, q *Queries, cloneDir string, repoID int64, userID int64, lastCommit string, addedFiles []string, modifiedFiles []string, deletedFiles []string, renameFiles []string) error { + startTime := time.Now() + allowedExtensions := map[string]bool{ + ".md": true, + } + + markdown := md.GetMarkdownConfig() + createParams := &util.CreateParams{} + updateParams := &util.UpdateParams{} + deleteParams := &util.DeleteParams{} + + // Helper function to process files + processFiles := func(files []string, isCreate bool) { + filteredMarkdowns := util.FilterDiffFilesByExtensions(files, allowedExtensions) + for _, filteredMarkdown := range filteredMarkdowns { + data, err := os.ReadFile(cloneDir + "/" + filteredMarkdown) + if err != nil { + continue + } + table, main, err := convert.ConvertMarkdownBuffer(data, markdown) + if err != nil { + continue + } + html := main.String() + htmlList := table.String() + relativePath := strings.ToLower(strings.TrimSuffix(filteredMarkdown, ".md")) + if isCreate { + createParams.Append(relativePath, userID, repoID, html, htmlList) + } else { + updateParams.Append(relativePath, relativePath, repoID, html, htmlList) + } + } + } + + // Process added and modified files + processFiles(addedFiles, true) + processFiles(modifiedFiles, false) + fmt.Println("addfiles:", addedFiles) + fmt.Println("modifiles:", modifiedFiles) + fmt.Println("deletfile:", deletedFiles) + fmt.Println("renamefiles:", renameFiles) + // Process deleted files + filteredMarkdowns := util.FilterDiffFilesByExtensions(deletedFiles, allowedExtensions) + for _, filteredMarkdown := range filteredMarkdowns { + relativePath := strings.ToLower(strings.TrimSuffix(filteredMarkdown, ".md")) + deleteParams.Append(relativePath, repoID) + } + // Process renamed files + for i := 0; i < len(renameFiles); i += 2 { + relativePath := strings.ToLower(strings.TrimSuffix(renameFiles[i], ".md")) + newrelativePath := strings.ToLower(strings.TrimSuffix(renameFiles[i+1], ".md")) + data, err := os.ReadFile(cloneDir + "/" + renameFiles[i+1]) + if err != nil { + continue + } + table, main, err := convert.ConvertMarkdownBuffer(data, markdown) + if err != nil { + continue + } + html := main.String() + htmlList := table.String() + updateParams.Append(relativePath, newrelativePath, repoID, html, htmlList) + } + + // Execute database operations + if err := executeDBOperations(ctx, q, createParams, updateParams, deleteParams); err != nil { + return err + } + + configFromFile, err := util.ReadRepoConfig(cloneDir + "/" + "zbook.json") + if err != nil { + // Generate config + mdFiles, err := operations.ListMarkdownFiles(cloneDir) + if err != nil { + return fmt.Errorf("read layout failed: %v", err) + } + config := &util.RepoConfig{} + layout := util.CreateLayout(mdFiles) + config.Layout = layout + configJSON, err := json.MarshalIndent(config, "", " ") + if err != nil { + return fmt.Errorf("generate repo config failed: %v", err) + } + arg_update_repo_config := UpdateRepoConfigParams{ + RepoID: repoID, + Config: string(configJSON), + CommitID: lastCommit, + } + if err := q.UpdateRepoConfig(ctx, arg_update_repo_config); err != nil { + return fmt.Errorf("update repo config failed: %v", err) + } + log.Info().Msgf("convert md repo to db: total execution time:%s", time.Since(startTime)) + return nil + } + configJSON, err := json.MarshalIndent(configFromFile, "", " ") + if err != nil { + return fmt.Errorf("generate repo config failed: %v", err) + } + arg_update_repo_config := UpdateRepoConfigParams{ + RepoID: repoID, + Config: string(configJSON), + CommitID: lastCommit, + } + if err := q.UpdateRepoConfig(ctx, arg_update_repo_config); err != nil { + return fmt.Errorf("update repo config failed: %v", err) + } + log.Info().Msgf("convert md repo to db: total execution time:%s", time.Since(startTime)) + return nil +} + +// Helper function to execute database operations +func executeDBOperations(ctx context.Context, q *Queries, createParams *util.CreateParams, updateParams *util.UpdateParams, deleteParams *util.DeleteParams) error { + if err := createMarkdownFiles(ctx, q, createParams); err != nil { + fmt.Println("RelativePaths:") + for _, path := range createParams.RelativePath { + fmt.Println(path) + } + return fmt.Errorf("create markdown failed: %v", err) + } + if err := updateMarkdownFiles(ctx, q, updateParams); err != nil { + return fmt.Errorf("update markdown failed: %v", err) + } + if err := deleteMarkdownFiles(ctx, q, deleteParams); err != nil { + return fmt.Errorf("delete markdown failed: %v", err) + } + return nil +} + +func createMarkdownFiles(ctx context.Context, q *Queries, params *util.CreateParams) error { + argCreate := CreateMarkdownMultiParams{ + RelativePath: params.RelativePath, + UserID: params.UserID, + RepoID: params.RepoID, + MainContent: params.MainContent, + TableContent: params.TableContent, + } + err := q.CreateMarkdownMulti(ctx, argCreate) + if err != nil { + return err + } + return nil +} + +func updateMarkdownFiles(ctx context.Context, q *Queries, params *util.UpdateParams) error { + argUpdate := UpdateMarkdownMultiParams{ + RelativePath: params.RelativePath, + NewRelativePath: params.NewRelativePath, + RepoID: params.RepoID, + MainContent: params.MainContent, + TableContent: params.TableContent, + } + err := q.UpdateMarkdownMulti(ctx, argUpdate) + if err != nil { + return err + } + return nil +} + +func deleteMarkdownFiles(ctx context.Context, q *Queries, params *util.DeleteParams) error { + + argDelete := DeleteMarkdownMultiParams{ + RelativePath: params.RelativePath, + RepoID: params.RepoID, + } + err := q.DeleteMarkdownMulti(ctx, argDelete) + if err != nil { + return err + } + + return nil +} diff --git a/zbook_backend/db/sqlc/db.go b/zbook_backend/db/sqlc/db.go new file mode 100644 index 0000000..5b8c8f5 --- /dev/null +++ b/zbook_backend/db/sqlc/db.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 + +package db + +import ( + "context" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/zbook_backend/db/sqlc/error.go b/zbook_backend/db/sqlc/error.go new file mode 100644 index 0000000..392c22b --- /dev/null +++ b/zbook_backend/db/sqlc/error.go @@ -0,0 +1,27 @@ +package db + +import ( + "errors" + + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgconn" +) + +const ( + ForeignKeyViolation = "23503" + UniqueViolation = "23505" +) + +var ErrRecordNotFound = pgx.ErrNoRows + +var ErrUniqueViolation = &pgconn.PgError{ + Code: UniqueViolation, +} + +func ErrorCode(err error) string { + var pgErr *pgconn.PgError + if errors.As(err, &pgErr) { + return pgErr.Code + } + return "" +} diff --git a/zbook_backend/db/sqlc/exec_tx.go b/zbook_backend/db/sqlc/exec_tx.go new file mode 100644 index 0000000..804b7fa --- /dev/null +++ b/zbook_backend/db/sqlc/exec_tx.go @@ -0,0 +1,25 @@ +package db + +import ( + "context" + "fmt" +) + +// ExecTx executes a function within a database transaction +func (store *SQLStore) execTx(ctx context.Context, fn func(*Queries) error) error { + tx, err := store.connPool.Begin(ctx) + if err != nil { + return err + } + + q := New(tx) + err = fn(q) + if err != nil { + if rbErr := tx.Rollback(ctx); rbErr != nil { + return fmt.Errorf("tx err: %v, rb err: %v", err, rbErr) + } + return err + } + + return tx.Commit(ctx) +} diff --git a/zbook_backend/db/sqlc/follow.sql.go b/zbook_backend/db/sqlc/follow.sql.go new file mode 100644 index 0000000..15e9bc4 --- /dev/null +++ b/zbook_backend/db/sqlc/follow.sql.go @@ -0,0 +1,606 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: follow.sql + +package db + +import ( + "context" + "time" +) + +const createFollow = `-- name: CreateFollow :one +INSERT INTO follows ( + follower_id, + following_id +) VALUES ($1, $2) +RETURNING follow_id, follower_id, following_id, created_at +` + +type CreateFollowParams struct { + FollowerID int64 `json:"follower_id"` + FollowingID int64 `json:"following_id"` +} + +func (q *Queries) CreateFollow(ctx context.Context, arg CreateFollowParams) (Follow, error) { + row := q.db.QueryRow(ctx, createFollow, arg.FollowerID, arg.FollowingID) + var i Follow + err := row.Scan( + &i.FollowID, + &i.FollowerID, + &i.FollowingID, + &i.CreatedAt, + ) + return i, err +} + +const deleteFollow = `-- name: DeleteFollow :one +DELETE FROM follows +WHERE follower_id= $1 and following_id=$2 +RETURNING follow_id +` + +type DeleteFollowParams struct { + FollowerID int64 `json:"follower_id"` + FollowingID int64 `json:"following_id"` +} + +func (q *Queries) DeleteFollow(ctx context.Context, arg DeleteFollowParams) (int64, error) { + row := q.db.QueryRow(ctx, deleteFollow, arg.FollowerID, arg.FollowingID) + var follow_id int64 + err := row.Scan(&follow_id) + return follow_id, err +} + +const getListFollowerCount = `-- name: GetListFollowerCount :one +SELECT + COUNT(*) +FROM + users u +JOIN + follows f ON f.follower_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = $1 AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $1 AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = $1 OR $2::text='admin'))) +WHERE + f.following_id = $3 AND (u.blocked='false' OR $2::text='admin') +` + +type GetListFollowerCountParams struct { + CurUserID int64 `json:"cur_user_id"` + Role string `json:"role"` + UserID int64 `json:"user_id"` +} + +func (q *Queries) GetListFollowerCount(ctx context.Context, arg GetListFollowerCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getListFollowerCount, arg.CurUserID, arg.Role, arg.UserID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getListFollowingCount = `-- name: GetListFollowingCount :one +SELECT + COUNT(*) +FROM + users u +JOIN + follows f ON f.following_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = $1 AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $1 AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = $1 OR $2::text='admin'))) +WHERE + f.follower_id = $3 AND (u.blocked='false' OR $2::text='admin') +` + +type GetListFollowingCountParams struct { + CurUserID int64 `json:"cur_user_id"` + Role string `json:"role"` + UserID int64 `json:"user_id"` +} + +func (q *Queries) GetListFollowingCount(ctx context.Context, arg GetListFollowingCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getListFollowingCount, arg.CurUserID, arg.Role, arg.UserID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getQueryFollowerCount = `-- name: GetQueryFollowerCount :one +SELECT + COUNT(*) +FROM + users u +JOIN + follows f ON f.follower_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = $1 AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $1 AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = $1 OR $2::text='admin'))) +WHERE + f.following_id = $3 and u.fts_username @@ plainto_tsquery($4) AND (u.blocked='false' OR $2::text='admin') +` + +type GetQueryFollowerCountParams struct { + CurUserID int64 `json:"cur_user_id"` + Role string `json:"role"` + UserID int64 `json:"user_id"` + Query string `json:"query"` +} + +func (q *Queries) GetQueryFollowerCount(ctx context.Context, arg GetQueryFollowerCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getQueryFollowerCount, + arg.CurUserID, + arg.Role, + arg.UserID, + arg.Query, + ) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getQueryFollowingCount = `-- name: GetQueryFollowingCount :one +SELECT + COUNT(*) +FROM + users u +JOIN + follows f ON f.following_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = $1 AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $1 AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = $1 OR $2::text='admin'))) +WHERE + f.follower_id = $3 and u.fts_username @@ plainto_tsquery($4) AND (u.blocked='false' OR $2::text='admin') +` + +type GetQueryFollowingCountParams struct { + CurUserID int64 `json:"cur_user_id"` + Role string `json:"role"` + UserID int64 `json:"user_id"` + Query string `json:"query"` +} + +func (q *Queries) GetQueryFollowingCount(ctx context.Context, arg GetQueryFollowingCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getQueryFollowingCount, + arg.CurUserID, + arg.Role, + arg.UserID, + arg.Query, + ) + var count int64 + err := row.Scan(&count) + return count, err +} + +const isFollowing = `-- name: IsFollowing :one +SELECT EXISTS ( + SELECT 1 + FROM follows + WHERE follower_id = $1 + AND following_id = $2 + LIMIT 1 +) +` + +type IsFollowingParams struct { + FollowerID int64 `json:"follower_id"` + FollowingID int64 `json:"following_id"` +} + +func (q *Queries) IsFollowing(ctx context.Context, arg IsFollowingParams) (bool, error) { + row := q.db.QueryRow(ctx, isFollowing, arg.FollowerID, arg.FollowingID) + var exists bool + err := row.Scan(&exists) + return exists, err +} + +const listFollower = `-- name: ListFollower :many +SELECT + u.user_id, u.username, u.email, u.hashed_password, u.blocked, u.verified, u.motto, u.user_role, u.onboarding, u.created_at, u.updated_at, u.unread_count, u.unread_count_updated_at, u.fts_username, + CASE WHEN MAX(ff.follower_id) IS NOT NULL THEN true ELSE false END AS is_following, + COUNT(DISTINCT r.repo_id) as repo_count +FROM + users u +JOIN + follows f ON f.follower_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = $3 AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $3 AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = $3 OR $4::text='admin'))) +WHERE + f.following_id = $5 AND (u.blocked='false' OR $4::text='admin') +GROUP BY + u.user_id,f.created_at +ORDER BY + f.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type ListFollowerParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + CurUserID int64 `json:"cur_user_id"` + Role string `json:"role"` + UserID int64 `json:"user_id"` +} + +type ListFollowerRow struct { + UserID int64 `json:"user_id"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` + IsFollowing bool `json:"is_following"` + RepoCount int64 `json:"repo_count"` +} + +func (q *Queries) ListFollower(ctx context.Context, arg ListFollowerParams) ([]ListFollowerRow, error) { + rows, err := q.db.Query(ctx, listFollower, + arg.Limit, + arg.Offset, + arg.CurUserID, + arg.Role, + arg.UserID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListFollowerRow{} + for rows.Next() { + var i ListFollowerRow + if err := rows.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + &i.IsFollowing, + &i.RepoCount, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listFollowing = `-- name: ListFollowing :many +SELECT + u.user_id, u.username, u.email, u.hashed_password, u.blocked, u.verified, u.motto, u.user_role, u.onboarding, u.created_at, u.updated_at, u.unread_count, u.unread_count_updated_at, u.fts_username, + CASE WHEN MAX(ff.follower_id) IS NOT NULL THEN true ELSE false END AS is_following, + COUNT(DISTINCT r.repo_id) as repo_count +FROM + users u +JOIN + follows f ON f.following_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = $3 AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $3 AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = $3 OR $4::text='admin'))) +WHERE + f.follower_id = $5 AND (u.blocked='false' OR $4::text='admin') +GROUP BY + u.user_id,f.created_at +ORDER BY + f.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type ListFollowingParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + CurUserID int64 `json:"cur_user_id"` + Role string `json:"role"` + UserID int64 `json:"user_id"` +} + +type ListFollowingRow struct { + UserID int64 `json:"user_id"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` + IsFollowing bool `json:"is_following"` + RepoCount int64 `json:"repo_count"` +} + +func (q *Queries) ListFollowing(ctx context.Context, arg ListFollowingParams) ([]ListFollowingRow, error) { + rows, err := q.db.Query(ctx, listFollowing, + arg.Limit, + arg.Offset, + arg.CurUserID, + arg.Role, + arg.UserID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListFollowingRow{} + for rows.Next() { + var i ListFollowingRow + if err := rows.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + &i.IsFollowing, + &i.RepoCount, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryFollower = `-- name: QueryFollower :many +SELECT + u.user_id, u.username, u.email, u.hashed_password, u.blocked, u.verified, u.motto, u.user_role, u.onboarding, u.created_at, u.updated_at, u.unread_count, u.unread_count_updated_at, u.fts_username, + ts_rank(u.fts_username, plainto_tsquery($3)) as rank, + CASE WHEN MAX(ff.follower_id) IS NOT NULL THEN true ELSE false END AS is_following, + COUNT(DISTINCT r.repo_id) as repo_count +FROM + users u +JOIN + follows f ON f.follower_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = $4 AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $4 AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = $4 OR $5::text='admin'))) +WHERE + f.following_id = $6 and u.fts_username @@ plainto_tsquery($3) AND (u.blocked='false' OR $5::text='admin') +GROUP BY + u.user_id +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryFollowerParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Query string `json:"query"` + CurUserID int64 `json:"cur_user_id"` + Role string `json:"role"` + UserID int64 `json:"user_id"` +} + +type QueryFollowerRow struct { + UserID int64 `json:"user_id"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` + Rank float32 `json:"rank"` + IsFollowing bool `json:"is_following"` + RepoCount int64 `json:"repo_count"` +} + +func (q *Queries) QueryFollower(ctx context.Context, arg QueryFollowerParams) ([]QueryFollowerRow, error) { + rows, err := q.db.Query(ctx, queryFollower, + arg.Limit, + arg.Offset, + arg.Query, + arg.CurUserID, + arg.Role, + arg.UserID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryFollowerRow{} + for rows.Next() { + var i QueryFollowerRow + if err := rows.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + &i.Rank, + &i.IsFollowing, + &i.RepoCount, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryFollowing = `-- name: QueryFollowing :many +SELECT + u.user_id, u.username, u.email, u.hashed_password, u.blocked, u.verified, u.motto, u.user_role, u.onboarding, u.created_at, u.updated_at, u.unread_count, u.unread_count_updated_at, u.fts_username, + ts_rank(u.fts_username, plainto_tsquery($3)) as rank, + CASE WHEN MAX(ff.follower_id) IS NOT NULL THEN true ELSE false END AS is_following, + COUNT(DISTINCT r.repo_id) as repo_count +FROM + users u +JOIN + follows f ON f.following_id = u.user_id +LEFT JOIN + follows ff ON ff.follower_id = $4 AND ff.following_id = u.user_id +LEFT JOIN repos r ON r.user_id = u.user_id AND ( + r.visibility_level = 'public' OR + r.visibility_level = 'signed' OR + (r.visibility_level = 'chosen' AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $4 AND repo_relations.relation_type = 'visi')) OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND (r.user_id = $4 OR $5::text='admin'))) +WHERE + f.follower_id = $6 and u.fts_username @@ plainto_tsquery($3) AND (u.blocked='false' OR $5::text='admin') +GROUP BY + u.user_id +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryFollowingParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Query string `json:"query"` + CurUserID int64 `json:"cur_user_id"` + Role string `json:"role"` + UserID int64 `json:"user_id"` +} + +type QueryFollowingRow struct { + UserID int64 `json:"user_id"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` + Rank float32 `json:"rank"` + IsFollowing bool `json:"is_following"` + RepoCount int64 `json:"repo_count"` +} + +func (q *Queries) QueryFollowing(ctx context.Context, arg QueryFollowingParams) ([]QueryFollowingRow, error) { + rows, err := q.db.Query(ctx, queryFollowing, + arg.Limit, + arg.Offset, + arg.Query, + arg.CurUserID, + arg.Role, + arg.UserID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryFollowingRow{} + for rows.Next() { + var i QueryFollowingRow + if err := rows.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + &i.Rank, + &i.IsFollowing, + &i.RepoCount, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/zbook_backend/db/sqlc/follow_test.go b/zbook_backend/db/sqlc/follow_test.go new file mode 100644 index 0000000..8da967f --- /dev/null +++ b/zbook_backend/db/sqlc/follow_test.go @@ -0,0 +1,712 @@ +package db + +import ( + "context" + "testing" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func createFollowByUser(t *testing.T, follower User, following User) Follow { + arg := CreateFollowParams{ + FollowerID: follower.UserID, + FollowingID: following.UserID, + } + + Follow, err := testStore.CreateFollow(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, Follow) + require.Equal(t, arg.FollowingID, Follow.FollowingID) + require.Equal(t, arg.FollowerID, Follow.FollowerID) + require.NotZero(t, Follow.CreatedAt) + return Follow +} + +func TestCreateFollow(t *testing.T) { + user1 := createRandomUser(t) + user2 := createRandomUser(t) + createFollowByUser(t, user1, user2) +} +func TestIsFollowing(t *testing.T) { + user1 := createRandomUser(t) + user2 := createRandomUser(t) + createFollowByUser(t, user1, user2) + + IsFollowing, err := testStore.IsFollowing(context.Background(), + IsFollowingParams{ + FollowerID: user1.UserID, + FollowingID: user2.UserID}) + require.NoError(t, err) + require.Equal(t, IsFollowing, true) +} + +func TestDeleteFollow(t *testing.T) { + user1 := createRandomUser(t) + user2 := createRandomUser(t) + createFollowByUser(t, user1, user2) + arg_delete := DeleteFollowParams{ + FollowerID: user1.UserID, + FollowingID: user2.UserID, + } + _, err := testStore.DeleteFollow(context.Background(), arg_delete) + require.NoError(t, err) + IsFollowing, err := testStore.IsFollowing(context.Background(), + IsFollowingParams{ + FollowerID: user1.UserID, + FollowingID: user2.UserID}) + require.NoError(t, err) + require.Equal(t, IsFollowing, false) +} + +func TestListFollower(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + user5 := createRandomUser(t) + + _ = createFollowByUser(t, user2, user1) + _ = createFollowByUser(t, user3, user1) + _ = createFollowByUser(t, user4, user1) + _ = createFollowByUser(t, user5, user1) + // blocked 2 + arg_update_user := UpdateUserBasicInfoParams{ + Username: user2.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + // deleted 3 + testStore.DeleteUser(context.Background(), user3.Username) + + repo51 := createUserRandomRepo(t, user5) + updateRepoVisibility(t, repo51, util.VisibilityPrivate) + repo52 := createUserRandomRepo(t, user5) + updateRepoVisibility(t, repo52, util.VisibilityChosed) + arg_repoV := CreateRepoRelationParams{ + RepoID: repo52.RepoID, + UserID: cur_user.UserID, + RelationType: util.RelationTypeVisi, + } + testStore.CreateRepoRelation(context.Background(), arg_repoV) + + repo53 := createUserRandomRepo(t, user5) + updateRepoVisibility(t, repo53, util.VisibilitySigned) + repo54 := createUserRandomRepo(t, user5) + updateRepoVisibility(t, repo54, util.VisibilityPublic) + { + arg := ListFollowerParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Role: cur_user.UserRole, + } + followers, err := testStore.ListFollower(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followers) + require.Equal(t, len(followers), 2) + require.Equal(t, followers[0].IsFollowing, false) + require.Equal(t, followers[0].UserID, user5.UserID) + require.Equal(t, followers[0].RepoCount, int64(3)) + } + { + cur_user2 := createRandomUser(t) + arg := ListFollowerParams{ + CurUserID: cur_user2.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Role: cur_user2.UserRole, + } + followers, err := testStore.ListFollower(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followers) + require.Equal(t, len(followers), 2) + require.Equal(t, followers[0].IsFollowing, false) + require.Equal(t, followers[0].UserID, user5.UserID) + require.Equal(t, followers[0].RepoCount, int64(2)) + } + { + cur_user3 := createRandomUser(t) + arg_basic := UpdateUserBasicInfoParams{ + Username: cur_user3.Username, + UserRole: pgtype.Text{String: util.AdminRole, Valid: true}, + } + user, err := testStore.UpdateUserBasicInfo(context.Background(), arg_basic) + require.NoError(t, err) + require.Equal(t, user.UserID, cur_user3.UserID) + arg := ListFollowerParams{ + CurUserID: user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Role: user.UserRole, + } + followers, err := testStore.ListFollower(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followers) + require.Equal(t, len(followers), 3) + require.Equal(t, followers[0].IsFollowing, false) + require.Equal(t, followers[0].UserID, user5.UserID) + require.Equal(t, int64(4), followers[0].RepoCount) + } + +} + +func TestQueryFollower(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + _ = createFollowByUser(t, user2, user1) + _ = createFollowByUser(t, user3, user1) + _ = createFollowByUser(t, user4, user1) + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user2.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := QueryFollowerParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Query: user2.Username, + Role: cur_user.UserRole, + } + followers, err := testStore.QueryFollower(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followers) + require.Equal(t, len(followers), 1) + require.Equal(t, followers[0].IsFollowing, false) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := QueryFollowerParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Query: user2.Username, + Role: cur_user.UserRole, + } + createFollowByUser(t, cur_user, user2) + followers, err := testStore.QueryFollower(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followers) + require.Equal(t, len(followers), 1) + require.Equal(t, followers[0].UserID, user2.UserID) + require.Equal(t, true, followers[0].IsFollowing) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Blocked: pgtype.Bool{Bool: false, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := QueryFollowerParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Query: user2.Username, + Role: cur_user.UserRole, + } + followers, err := testStore.QueryFollower(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followers) + require.Equal(t, len(followers), 1) + } + { + + testStore.DeleteUser(context.Background(), user4.Username) + arg := QueryFollowerParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Query: user4.Username, + Role: cur_user.UserRole, + } + followers, err := testStore.QueryFollower(context.Background(), arg) + require.NoError(t, err) + require.Empty(t, followers) + require.Equal(t, len(followers), 0) + } +} + +func TestGetListFollowerCount(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + _ = createFollowByUser(t, user2, user1) + _ = createFollowByUser(t, user3, user1) + _ = createFollowByUser(t, user4, user1) + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user2.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetListFollowerCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Role: cur_user.UserRole, + } + count, err := testStore.GetListFollowerCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(3)) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetListFollowerCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Role: cur_user.UserRole, + } + count, err := testStore.GetListFollowerCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(2)) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Blocked: pgtype.Bool{Bool: false, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + + arg := GetListFollowerCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Role: cur_user.UserRole, + } + count, err := testStore.GetListFollowerCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(3)) + } + { + testStore.DeleteUser(context.Background(), user4.Username) + arg := GetListFollowerCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Role: cur_user.UserRole, + } + count, err := testStore.GetListFollowerCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(2)) + } +} + +func TestGetQueryFollowerCount(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + _ = createFollowByUser(t, user2, user1) + _ = createFollowByUser(t, user3, user1) + _ = createFollowByUser(t, user4, user1) + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user2.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetQueryFollowerCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Query: user2.Username, + Role: cur_user.UserRole, + } + count, err := testStore.GetQueryFollowerCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(1)) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetQueryFollowerCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Query: user2.Username, + Role: cur_user.UserRole, + } + count, err := testStore.GetQueryFollowerCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(1)) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Blocked: pgtype.Bool{Bool: false, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetQueryFollowerCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Query: user2.Username, + Role: cur_user.UserRole, + } + count, err := testStore.GetQueryFollowerCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(1)) + } + { + testStore.DeleteUser(context.Background(), user4.Username) + arg := GetQueryFollowerCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Query: user4.Username, + Role: cur_user.UserRole, + } + count, err := testStore.GetQueryFollowerCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(0)) + } +} + +func TestListFollowing(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + user5 := createRandomUser(t) + + _ = createFollowByUser(t, user1, user2) + _ = createFollowByUser(t, user1, user3) + _ = createFollowByUser(t, user1, user4) + _ = createFollowByUser(t, user1, user5) + // blocked 2 + arg_update_user := UpdateUserBasicInfoParams{ + Username: user2.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + // deleted 3 + testStore.DeleteUser(context.Background(), user3.Username) + + repo51 := createUserRandomRepo(t, user5) + updateRepoVisibility(t, repo51, util.VisibilityPrivate) + repo52 := createUserRandomRepo(t, user5) + updateRepoVisibility(t, repo52, util.VisibilityChosed) + arg_repoV := CreateRepoRelationParams{ + RepoID: repo52.RepoID, + UserID: cur_user.UserID, + RelationType: util.RelationTypeVisi, + } + testStore.CreateRepoRelation(context.Background(), arg_repoV) + + repo53 := createUserRandomRepo(t, user5) + updateRepoVisibility(t, repo53, util.VisibilitySigned) + repo54 := createUserRandomRepo(t, user5) + updateRepoVisibility(t, repo54, util.VisibilityPublic) + { + arg := ListFollowingParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Role: cur_user.UserRole, + } + followings, err := testStore.ListFollowing(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followings) + require.Equal(t, len(followings), 2) + require.Equal(t, followings[0].IsFollowing, false) + require.Equal(t, followings[0].UserID, user5.UserID) + require.Equal(t, followings[0].RepoCount, int64(3)) + } + { + cur_user2 := createRandomUser(t) + arg := ListFollowingParams{ + CurUserID: cur_user2.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Role: cur_user2.UserRole, + } + followings, err := testStore.ListFollowing(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followings) + require.Equal(t, len(followings), 2) + require.Equal(t, followings[0].IsFollowing, false) + require.Equal(t, followings[0].UserID, user5.UserID) + require.Equal(t, followings[0].RepoCount, int64(2)) + } + { + cur_user3 := createRandomUser(t) + arg_basic := UpdateUserBasicInfoParams{ + Username: cur_user3.Username, + UserRole: pgtype.Text{String: util.AdminRole, Valid: true}, + } + user, err := testStore.UpdateUserBasicInfo(context.Background(), arg_basic) + require.NoError(t, err) + require.Equal(t, user.UserID, cur_user3.UserID) + arg := ListFollowingParams{ + CurUserID: user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Role: user.UserRole, + } + followings, err := testStore.ListFollowing(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followings) + require.Equal(t, len(followings), 3) + require.Equal(t, followings[0].IsFollowing, false) + require.Equal(t, followings[0].UserID, user5.UserID) + require.Equal(t, int64(4), followings[0].RepoCount) + } +} + +func TestQueryFollowing(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + _ = createFollowByUser(t, user1, user2) + _ = createFollowByUser(t, user1, user3) + _ = createFollowByUser(t, user1, user4) + + { + arg := QueryFollowingParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Query: user2.Username, + Role: cur_user.UserRole, + } + followers, err := testStore.QueryFollowing(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followers) + require.Equal(t, len(followers), 1) + require.Equal(t, followers[0].IsFollowing, false) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := QueryFollowingParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Query: user2.Username, + Role: cur_user.UserRole, + } + createFollowByUser(t, cur_user, user2) + followers, err := testStore.QueryFollowing(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followers) + require.Equal(t, len(followers), 1) + require.Equal(t, followers[0].UserID, user2.UserID) + require.Equal(t, true, followers[0].IsFollowing) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Blocked: pgtype.Bool{Bool: false, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := QueryFollowingParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Query: user2.Username, + Role: cur_user.UserRole, + } + followers, err := testStore.QueryFollowing(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, followers) + require.Equal(t, len(followers), 1) + } + { + + testStore.DeleteUser(context.Background(), user4.Username) + arg := QueryFollowingParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Limit: 5, + Offset: 0, + Query: user4.Username, + Role: cur_user.UserRole, + } + followers, err := testStore.QueryFollowing(context.Background(), arg) + require.NoError(t, err) + require.Empty(t, followers) + require.Equal(t, len(followers), 0) + } +} + +func TestGetListFollowingCount(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + _ = createFollowByUser(t, user1, user2) + _ = createFollowByUser(t, user1, user3) + _ = createFollowByUser(t, user1, user4) + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user2.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetListFollowingCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Role: cur_user.UserRole, + } + count, err := testStore.GetListFollowingCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(3)) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetListFollowingCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Role: cur_user.UserRole, + } + count, err := testStore.GetListFollowingCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(2)) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Blocked: pgtype.Bool{Bool: false, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + + arg := GetListFollowingCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Role: cur_user.UserRole, + } + count, err := testStore.GetListFollowingCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(3)) + } +} + +func TestGetQueryFollowingCount(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + _ = createFollowByUser(t, user1, user2) + _ = createFollowByUser(t, user1, user3) + _ = createFollowByUser(t, user1, user4) + { + arg := GetQueryFollowingCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Query: user2.Username, + Role: cur_user.UserRole, + } + count, err := testStore.GetQueryFollowingCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(1)) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user2.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetQueryFollowingCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Query: user2.Username, + Role: cur_user.UserRole, + } + count, err := testStore.GetQueryFollowingCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(1)) + + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetQueryFollowingCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Query: user2.Username, + Role: cur_user.UserRole, + } + count, err := testStore.GetQueryFollowingCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(1)) + } + { + arg_update_user := UpdateUserBasicInfoParams{ + Username: user3.Username, + Blocked: pgtype.Bool{Bool: false, Valid: true}, + } + testStore.UpdateUserBasicInfo(context.Background(), arg_update_user) + arg := GetQueryFollowingCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Query: user2.Username, + Role: cur_user.UserRole, + } + count, err := testStore.GetQueryFollowingCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(1)) + } + { + + testStore.DeleteUser(context.Background(), user4.Username) + arg := GetQueryFollowingCountParams{ + CurUserID: cur_user.UserID, + UserID: user1.UserID, + Query: user4.Username, + Role: cur_user.UserRole, + } + count, err := testStore.GetQueryFollowingCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count, int64(0)) + } +} diff --git a/zbook_backend/db/sqlc/geoio.sql.go b/zbook_backend/db/sqlc/geoio.sql.go new file mode 100644 index 0000000..782cada --- /dev/null +++ b/zbook_backend/db/sqlc/geoio.sql.go @@ -0,0 +1,32 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: geoio.sql + +package db + +import ( + "context" + "net/netip" +) + +const getGeoInfo = `-- name: GetGeoInfo :one +SELECT ip_range_cidr, city_name_en, city_name_zh_cn, latitude, longitude +FROM + geoip +WHERE + $1::inet << ip_range_cidr +` + +func (q *Queries) GetGeoInfo(ctx context.Context, dollar_1 netip.Addr) (Geoip, error) { + row := q.db.QueryRow(ctx, getGeoInfo, dollar_1) + var i Geoip + err := row.Scan( + &i.IpRangeCidr, + &i.CityNameEn, + &i.CityNameZhCn, + &i.Latitude, + &i.Longitude, + ) + return i, err +} diff --git a/zbook_backend/db/sqlc/geoip_test.go b/zbook_backend/db/sqlc/geoip_test.go new file mode 100644 index 0000000..e05e122 --- /dev/null +++ b/zbook_backend/db/sqlc/geoip_test.go @@ -0,0 +1,29 @@ +package db + +import ( + "context" + "fmt" + "net/netip" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestGetGeoInfo(t *testing.T) { + if testing.Short() { + fmt.Println("***** TestGetGeoInfo is ignored *****") + t.Skip() + } + + // 测试 IP + ipStr := "116.204.73.62" + + // 将字符串 IP 转换为 netip.Addr 类型 + ip, err := netip.ParseAddr(ipStr) + require.NoError(t, err) + + // 从数据库中查询对应的地理信息 + _, err = testStore.GetGeoInfo(context.Background(), ip) + require.NoError(t, err) + +} diff --git a/zbook_backend/db/sqlc/invitation.sql.go b/zbook_backend/db/sqlc/invitation.sql.go new file mode 100644 index 0000000..36b4f9b --- /dev/null +++ b/zbook_backend/db/sqlc/invitation.sql.go @@ -0,0 +1,93 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: invitation.sql + +package db + +import ( + "context" +) + +const createInvitation = `-- name: CreateInvitation :one +INSERT INTO invitations ( + email, + invitation_url +) VALUES ( + $1, $2 +) RETURNING invitation_id, email, invitation_url, is_used, created_at, expired_at +` + +type CreateInvitationParams struct { + Email string `json:"email"` + InvitationUrl string `json:"invitation_url"` +} + +func (q *Queries) CreateInvitation(ctx context.Context, arg CreateInvitationParams) (Invitation, error) { + row := q.db.QueryRow(ctx, createInvitation, arg.Email, arg.InvitationUrl) + var i Invitation + err := row.Scan( + &i.InvitationID, + &i.Email, + &i.InvitationUrl, + &i.IsUsed, + &i.CreatedAt, + &i.ExpiredAt, + ) + return i, err +} + +const getInvitation = `-- name: GetInvitation :one +SELECT invitation_id, email, invitation_url, is_used, created_at, expired_at +FROM invitations +WHERE email = $1 AND invitation_url = $2 +` + +type GetInvitationParams struct { + Email string `json:"email"` + InvitationUrl string `json:"invitation_url"` +} + +func (q *Queries) GetInvitation(ctx context.Context, arg GetInvitationParams) (Invitation, error) { + row := q.db.QueryRow(ctx, getInvitation, arg.Email, arg.InvitationUrl) + var i Invitation + err := row.Scan( + &i.InvitationID, + &i.Email, + &i.InvitationUrl, + &i.IsUsed, + &i.CreatedAt, + &i.ExpiredAt, + ) + return i, err +} + +const markInvitationAsUsed = `-- name: MarkInvitationAsUsed :one +UPDATE invitations +SET + is_used = TRUE +WHERE + email = $1 AND invitation_url = $2 + AND is_used = FALSE + AND expired_at > now() +RETURNING invitation_id, email, invitation_url, is_used, created_at, expired_at +` + +type MarkInvitationAsUsedParams struct { + Email string `json:"email"` + InvitationUrl string `json:"invitation_url"` +} + +func (q *Queries) MarkInvitationAsUsed(ctx context.Context, arg MarkInvitationAsUsedParams) (Invitation, error) { + row := q.db.QueryRow(ctx, markInvitationAsUsed, arg.Email, arg.InvitationUrl) + var i Invitation + err := row.Scan( + &i.InvitationID, + &i.Email, + &i.InvitationUrl, + &i.IsUsed, + &i.CreatedAt, + &i.ExpiredAt, + ) + return i, err +} diff --git a/zbook_backend/db/sqlc/main_test.go b/zbook_backend/db/sqlc/main_test.go new file mode 100644 index 0000000..7bcd9f2 --- /dev/null +++ b/zbook_backend/db/sqlc/main_test.go @@ -0,0 +1,28 @@ +package db + +import ( + "context" + "log" + "os" + "testing" + + "github.com/jackc/pgx/v5/pgxpool" + "github.com/zizdlp/zbook/util" +) + +var testStore Store + +func TestMain(m *testing.M) { + config, err := util.LoadConfig("../..") + if err != nil { + log.Fatal("cannot load config:", err) + } + + connPool, err := pgxpool.New(context.Background(), config.DBSource) + if err != nil { + log.Fatal("cannot connect to db:", err) + } + + testStore = NewStore(connPool) + os.Exit(m.Run()) +} diff --git a/zbook_backend/db/sqlc/markdown.sql.go b/zbook_backend/db/sqlc/markdown.sql.go new file mode 100644 index 0000000..c081cf8 --- /dev/null +++ b/zbook_backend/db/sqlc/markdown.sql.go @@ -0,0 +1,456 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: markdown.sql + +package db + +import ( + "context" +) + +const createMarkdown = `-- name: CreateMarkdown :one +INSERT INTO markdowns ( + relative_path, + user_id, + repo_id, + main_content, + table_content +) VALUES ( + $1, $2, $3,$4,$5 +) RETURNING markdown_id, relative_path, user_id, repo_id, main_content, table_content, updated_at, created_at, fts_zh, fts_en +` + +type CreateMarkdownParams struct { + RelativePath string `json:"relative_path"` + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + MainContent string `json:"main_content"` + TableContent string `json:"table_content"` +} + +func (q *Queries) CreateMarkdown(ctx context.Context, arg CreateMarkdownParams) (Markdown, error) { + row := q.db.QueryRow(ctx, createMarkdown, + arg.RelativePath, + arg.UserID, + arg.RepoID, + arg.MainContent, + arg.TableContent, + ) + var i Markdown + err := row.Scan( + &i.MarkdownID, + &i.RelativePath, + &i.UserID, + &i.RepoID, + &i.MainContent, + &i.TableContent, + &i.UpdatedAt, + &i.CreatedAt, + &i.FtsZh, + &i.FtsEn, + ) + return i, err +} + +const createMarkdownMulti = `-- name: CreateMarkdownMulti :exec +INSERT INTO markdowns ( + relative_path, + user_id, + repo_id, + main_content, + table_content +) +SELECT unnest($1::text[]) AS relative_path, + unnest($2::bigint[]) AS user_id, + unnest($3::bigint[]) AS repo_id, + unnest($4::text[]) AS main_content, + unnest($5::text[]) AS table_content +` + +type CreateMarkdownMultiParams struct { + RelativePath []string `json:"relative_path"` + UserID []int64 `json:"user_id"` + RepoID []int64 `json:"repo_id"` + MainContent []string `json:"main_content"` + TableContent []string `json:"table_content"` +} + +func (q *Queries) CreateMarkdownMulti(ctx context.Context, arg CreateMarkdownMultiParams) error { + _, err := q.db.Exec(ctx, createMarkdownMulti, + arg.RelativePath, + arg.UserID, + arg.RepoID, + arg.MainContent, + arg.TableContent, + ) + return err +} + +const deleteMarkdownMulti = `-- name: DeleteMarkdownMulti :exec +DELETE FROM markdowns +WHERE (relative_path, repo_id) IN ( + SELECT + unnest($1::text[]), + unnest($2::bigint[]) +) +` + +type DeleteMarkdownMultiParams struct { + RelativePath []string `json:"relative_path"` + RepoID []int64 `json:"repo_id"` +} + +func (q *Queries) DeleteMarkdownMulti(ctx context.Context, arg DeleteMarkdownMultiParams) error { + _, err := q.db.Exec(ctx, deleteMarkdownMulti, arg.RelativePath, arg.RepoID) + return err +} + +const getMarkdownByID = `-- name: GetMarkdownByID :one +SELECT markdown_id, relative_path, user_id, repo_id, main_content, table_content, updated_at, created_at, fts_zh, fts_en FROM markdowns +WHERE markdown_id = $1 LIMIT 1 +FOR NO KEY UPDATE +` + +func (q *Queries) GetMarkdownByID(ctx context.Context, markdownID int64) (Markdown, error) { + row := q.db.QueryRow(ctx, getMarkdownByID, markdownID) + var i Markdown + err := row.Scan( + &i.MarkdownID, + &i.RelativePath, + &i.UserID, + &i.RepoID, + &i.MainContent, + &i.TableContent, + &i.UpdatedAt, + &i.CreatedAt, + &i.FtsZh, + &i.FtsEn, + ) + return i, err +} + +const getMarkdownContent = `-- name: GetMarkdownContent :one +SELECT + markdowns.markdown_id, markdowns.relative_path, markdowns.user_id, markdowns.repo_id, markdowns.main_content, markdowns.table_content, markdowns.updated_at, markdowns.created_at, markdowns.fts_zh, markdowns.fts_en +FROM markdowns +WHERE markdowns.relative_path = $1 and markdowns.repo_id = $2 +LIMIT 1 +` + +type GetMarkdownContentParams struct { + RelativePath string `json:"relative_path"` + RepoID int64 `json:"repo_id"` +} + +func (q *Queries) GetMarkdownContent(ctx context.Context, arg GetMarkdownContentParams) (Markdown, error) { + row := q.db.QueryRow(ctx, getMarkdownContent, arg.RelativePath, arg.RepoID) + var i Markdown + err := row.Scan( + &i.MarkdownID, + &i.RelativePath, + &i.UserID, + &i.RepoID, + &i.MainContent, + &i.TableContent, + &i.UpdatedAt, + &i.CreatedAt, + &i.FtsZh, + &i.FtsEn, + ) + return i, err +} + +const getMarkdownRepoID = `-- name: GetMarkdownRepoID :one +SELECT + markdowns.repo_id +FROM + markdowns +WHERE + markdown_id = $1 +` + +func (q *Queries) GetMarkdownRepoID(ctx context.Context, markdownID int64) (int64, error) { + row := q.db.QueryRow(ctx, getMarkdownRepoID, markdownID) + var repo_id int64 + err := row.Scan(&repo_id) + return repo_id, err +} + +const queryMarkdown = `-- name: QueryMarkdown :many +select + users.username,r.repo_name, markdown_id,relative_path,users.user_id,r.repo_id,main_content, + ROUND(ts_rank(fts_zh, plainto_tsquery($3))) + ROUND(ts_rank(fts_en, plainto_tsquery($3))) as rank, + COALESCE(ts_headline(main_content,plainto_tsquery($3),'MaxFragments=10, MaxWords=7, MinWords=3'),'') +from markdowns +JOIN repos as r on r.repo_id = markdowns.repo_id +JOIN users on users.user_id = r.user_id +where (fts_zh @@ plainto_tsquery($3) OR fts_en @@ plainto_tsquery($3)) + AND ( + ($4::text='admin' AND $5::bool ) OR ( + users.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $5::bool) + OR + (r.visibility_level = 'chosen' AND $5::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $6 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $6 AND $5::bool) + ) + ) + ) +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryMarkdownParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + PlaintoTsquery string `json:"plainto_tsquery"` + Role string `json:"role"` + Signed bool `json:"signed"` + CurUserID int64 `json:"cur_user_id"` +} + +type QueryMarkdownRow struct { + Username string `json:"username"` + RepoName string `json:"repo_name"` + MarkdownID int64 `json:"markdown_id"` + RelativePath string `json:"relative_path"` + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + MainContent string `json:"main_content"` + Rank int32 `json:"rank"` + Coalesce interface{} `json:"coalesce"` +} + +func (q *Queries) QueryMarkdown(ctx context.Context, arg QueryMarkdownParams) ([]QueryMarkdownRow, error) { + rows, err := q.db.Query(ctx, queryMarkdown, + arg.Limit, + arg.Offset, + arg.PlaintoTsquery, + arg.Role, + arg.Signed, + arg.CurUserID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryMarkdownRow{} + for rows.Next() { + var i QueryMarkdownRow + if err := rows.Scan( + &i.Username, + &i.RepoName, + &i.MarkdownID, + &i.RelativePath, + &i.UserID, + &i.RepoID, + &i.MainContent, + &i.Rank, + &i.Coalesce, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryRepoMarkdown = `-- name: QueryRepoMarkdown :many +select + users.username,r.repo_name, markdown_id,relative_path,users.user_id,r.repo_id,main_content, + ROUND(ts_rank(fts_zh, plainto_tsquery($4))) + ROUND(ts_rank(fts_en, plainto_tsquery($4))) as rank, + COALESCE(ts_headline(main_content,plainto_tsquery($4),'MaxFragments=10, MaxWords=7, MinWords=3'),'') +from markdowns +JOIN repos as r on r.repo_id = markdowns.repo_id +JOIN users on users.user_id = r.user_id +where users.user_id = $3 and r.repo_id = $5 and (fts_zh @@ plainto_tsquery($4) OR fts_en @@ plainto_tsquery($4)) +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryRepoMarkdownParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + UserID int64 `json:"user_id"` + PlaintoTsquery string `json:"plainto_tsquery"` + RepoID int64 `json:"repo_id"` +} + +type QueryRepoMarkdownRow struct { + Username string `json:"username"` + RepoName string `json:"repo_name"` + MarkdownID int64 `json:"markdown_id"` + RelativePath string `json:"relative_path"` + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + MainContent string `json:"main_content"` + Rank int32 `json:"rank"` + Coalesce interface{} `json:"coalesce"` +} + +func (q *Queries) QueryRepoMarkdown(ctx context.Context, arg QueryRepoMarkdownParams) ([]QueryRepoMarkdownRow, error) { + rows, err := q.db.Query(ctx, queryRepoMarkdown, + arg.Limit, + arg.Offset, + arg.UserID, + arg.PlaintoTsquery, + arg.RepoID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryRepoMarkdownRow{} + for rows.Next() { + var i QueryRepoMarkdownRow + if err := rows.Scan( + &i.Username, + &i.RepoName, + &i.MarkdownID, + &i.RelativePath, + &i.UserID, + &i.RepoID, + &i.MainContent, + &i.Rank, + &i.Coalesce, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryUserMarkdown = `-- name: QueryUserMarkdown :many +select + users.username,r.repo_name, markdown_id,relative_path,users.user_id,r.repo_id,main_content, + ROUND(ts_rank(fts_zh, plainto_tsquery($4))) + ROUND(ts_rank(fts_en, plainto_tsquery($4))) as rank, + COALESCE(ts_headline(main_content,plainto_tsquery($4),'MaxFragments=10, MaxWords=7, MinWords=3'),'') +from markdowns +JOIN repos as r on r.repo_id = markdowns.repo_id +JOIN users on users.user_id = r.user_id +where users.user_id = $3 and (fts_zh @@ plainto_tsquery($4) OR fts_en @@ plainto_tsquery($4)) + AND ( + ($5::text='admin' AND $6::bool ) OR ( + users.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $6::bool) + OR + (r.visibility_level = 'chosen' AND $6::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $7 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $7 AND $6::bool) + ) + ) + ) +ORDER BY + rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryUserMarkdownParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + UserID int64 `json:"user_id"` + PlaintoTsquery string `json:"plainto_tsquery"` + Role string `json:"role"` + Signed bool `json:"signed"` + CurUserID int64 `json:"cur_user_id"` +} + +type QueryUserMarkdownRow struct { + Username string `json:"username"` + RepoName string `json:"repo_name"` + MarkdownID int64 `json:"markdown_id"` + RelativePath string `json:"relative_path"` + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + MainContent string `json:"main_content"` + Rank int32 `json:"rank"` + Coalesce interface{} `json:"coalesce"` +} + +func (q *Queries) QueryUserMarkdown(ctx context.Context, arg QueryUserMarkdownParams) ([]QueryUserMarkdownRow, error) { + rows, err := q.db.Query(ctx, queryUserMarkdown, + arg.Limit, + arg.Offset, + arg.UserID, + arg.PlaintoTsquery, + arg.Role, + arg.Signed, + arg.CurUserID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryUserMarkdownRow{} + for rows.Next() { + var i QueryUserMarkdownRow + if err := rows.Scan( + &i.Username, + &i.RepoName, + &i.MarkdownID, + &i.RelativePath, + &i.UserID, + &i.RepoID, + &i.MainContent, + &i.Rank, + &i.Coalesce, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateMarkdownMulti = `-- name: UpdateMarkdownMulti :exec +UPDATE markdowns AS m +SET main_content=tmp.main_content,table_content=tmp.table_content,relative_path=new_relative_path,updated_at=now() +FROM ( + SELECT + unnest($1::text[]) AS relative_path, + unnest($2::text[]) AS new_relative_path, + unnest($3::text[]) AS main_content, + unnest($4::text[]) AS table_content, + unnest($5::bigint[]) AS repo_id +) AS tmp +WHERE m.relative_path = tmp.relative_path and m.repo_id=tmp.repo_id +` + +type UpdateMarkdownMultiParams struct { + RelativePath []string `json:"relative_path"` + NewRelativePath []string `json:"new_relative_path"` + MainContent []string `json:"main_content"` + TableContent []string `json:"table_content"` + RepoID []int64 `json:"repo_id"` +} + +func (q *Queries) UpdateMarkdownMulti(ctx context.Context, arg UpdateMarkdownMultiParams) error { + _, err := q.db.Exec(ctx, updateMarkdownMulti, + arg.RelativePath, + arg.NewRelativePath, + arg.MainContent, + arg.TableContent, + arg.RepoID, + ) + return err +} diff --git a/zbook_backend/db/sqlc/markdown_test.go b/zbook_backend/db/sqlc/markdown_test.go new file mode 100644 index 0000000..1de59f0 --- /dev/null +++ b/zbook_backend/db/sqlc/markdown_test.go @@ -0,0 +1,276 @@ +package db + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func testCreateRandomMarkdown(t *testing.T) Markdown { + repo := createRandomRepo(t) + arg := CreateMarkdownParams{ + RelativePath: util.RandomString(32), + UserID: repo.UserID, + RepoID: repo.RepoID, + MainContent: util.RandomString(32), + TableContent: util.RandomString(32), + } + markdown, err := testStore.CreateMarkdown(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, markdown.RepoID, arg.RepoID) + return markdown +} +func TestCreateMarkdown(t *testing.T) { + testCreateRandomMarkdown(t) +} +func TestCreateMarkdownMulti(t *testing.T) { + + user := createRandomUser(t) + arg_repo := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: "zizdlp", + GitRepo: "zbook-user-guide", + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + GitAccessToken: pgtype.Text{String: "", Valid: true}, + RepoName: util.RandomString(36), + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.RandomRepoVisibility(), + } + repo, err := testStore.CreateRepo(context.Background(), arg_repo) + require.NoError(t, err) + + lens := 10 + RelativePath := make([]string, 0) + UserID := make([]int64, 0) + RepoID := make([]int64, 0) + MainContent := make([]string, 0) + TableContent := make([]string, 0) + + for i := 0; i < lens; i++ { + RelativePath = append(RelativePath, util.RandomString(32)+".md") + UserID = append(UserID, user.UserID) + RepoID = append(RepoID, repo.RepoID) + MainContent = append(MainContent, util.RandomString(32000)) + TableContent = append(TableContent, util.RandomString(320)) + } + arg := CreateMarkdownMultiParams{ + RelativePath: RelativePath, + UserID: UserID, + RepoID: RepoID, + MainContent: MainContent, + TableContent: TableContent, + } + + s := time.Now() + err = testStore.CreateMarkdownMulti(context.Background(), arg) + e := time.Since(s) + fmt.Println("createmarkdownmulti time:", e) + require.NoError(t, err) +} + +func TestGetMarkdownContent(t *testing.T) { + markdown := testCreateRandomMarkdown(t) + arg := GetMarkdownContentParams{ + RelativePath: markdown.RelativePath, + RepoID: markdown.RepoID, + } + ret, err := testStore.GetMarkdownContent(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, markdown.MarkdownID, ret.MarkdownID) + require.Equal(t, markdown.RelativePath, ret.RelativePath) + require.Equal(t, markdown.RepoID, ret.RepoID) + require.Equal(t, markdown.MainContent, ret.MainContent) +} + +func TestGetMarkdownByID(t *testing.T) { + markdown := testCreateRandomMarkdown(t) + ret, err := testStore.GetMarkdownByID(context.Background(), markdown.MarkdownID) + require.NoError(t, err) + require.Equal(t, markdown.MarkdownID, ret.MarkdownID) + require.Equal(t, markdown.RelativePath, ret.RelativePath) + require.Equal(t, markdown.RepoID, ret.RepoID) +} +func TestGetMarkdownRepoID(t *testing.T) { + markdown := testCreateRandomMarkdown(t) + repoID, err := testStore.GetMarkdownRepoID(context.Background(), markdown.MarkdownID) + require.NoError(t, err) + require.Equal(t, markdown.RepoID, repoID) +} + +func TestUpdateMarkdownMulti(t *testing.T) { + + user := createRandomUser(t) + arg_repo := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: "zizdlp", + GitRepo: "zbook-user-guide", + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + GitAccessToken: pgtype.Text{String: "", Valid: true}, + RepoName: util.RandomString(36), + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.RandomRepoVisibility(), + } + repo, err := testStore.CreateRepo(context.Background(), arg_repo) + require.NoError(t, err) + + lens := 20000 + RelativePath := []string{} + UserID := []int64{} + RepoID := []int64{} + MainContent := []string{} + TableContent := []string{} + + for i := 0; i < lens; i++ { + RelativePath = append(RelativePath, util.RandomString(32)+".md") + UserID = append(UserID, user.UserID) + RepoID = append(RepoID, repo.RepoID) + MainContent = append(MainContent, util.RandomString(32)) + TableContent = append(TableContent, util.RandomString(32)) + + } + arg := CreateMarkdownMultiParams{ + RelativePath: RelativePath, + UserID: UserID, + RepoID: RepoID, + MainContent: MainContent, + TableContent: TableContent, + } + + s := time.Now() + err = testStore.CreateMarkdownMulti(context.Background(), arg) + e := time.Since(s) + fmt.Println("createmarkdownmulti time:", e) + require.NoError(t, err) + + for i := 0; i < lens; i++ { + MainContent[i] = "newmain_content" + TableContent[i] = "newtable_content" + } + arg_key := UpdateMarkdownMultiParams{ + RelativePath: RelativePath, + NewRelativePath: RelativePath, + MainContent: MainContent, + TableContent: TableContent, + RepoID: RepoID, + } + s = time.Now() + err = testStore.UpdateMarkdownMulti(context.Background(), arg_key) + e = time.Since(s) + fmt.Println("updatemdkeymulti time:", e) + require.NoError(t, err) +} + +func TestDeleteMarkdownMulti(t *testing.T) { + + user := createRandomUser(t) + arg_repo := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: "zizdlp", + GitRepo: "zbook-user-guide", + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + GitAccessToken: pgtype.Text{String: "", Valid: true}, + RepoName: util.RandomString(36), + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.RandomRepoVisibility(), + } + repo, err := testStore.CreateRepo(context.Background(), arg_repo) + require.NoError(t, err) + + lens := 10 + RelativePath := make([]string, 0) + UserID := make([]int64, 0) + RepoID := make([]int64, 0) + MainContent := make([]string, 0) + TableContent := make([]string, 0) + + for i := 0; i < lens; i++ { + RelativePath = append(RelativePath, util.RandomString(32)+".md") + UserID = append(UserID, user.UserID) + RepoID = append(RepoID, repo.RepoID) + MainContent = append(MainContent, util.RandomString(32000)) + TableContent = append(TableContent, util.RandomString(320)) + } + arg := CreateMarkdownMultiParams{ + RelativePath: RelativePath, + UserID: UserID, + RepoID: RepoID, + MainContent: MainContent, + TableContent: TableContent, + } + + s := time.Now() + err = testStore.CreateMarkdownMulti(context.Background(), arg) + e := time.Since(s) + fmt.Println("createmarkdownmulti time:", e) + require.NoError(t, err) + + arg_delete := DeleteMarkdownMultiParams{ + RelativePath: RelativePath, + RepoID: RepoID, + } + + err = testStore.DeleteMarkdownMulti(context.Background(), arg_delete) + require.NoError(t, err) +} +func testCreateRandomMarkdownForQuery(t *testing.T) Markdown { + repo := createRandomRepo(t) + arg := CreateMarkdownParams{ + RelativePath: util.RandomString(32), + UserID: repo.UserID, + RepoID: repo.RepoID, + MainContent: "fox", + TableContent: util.RandomString(32), + } + markdown, err := testStore.CreateMarkdown(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, markdown.RepoID, arg.RepoID) + return markdown +} + +func TestQueryUserMarkdown(t *testing.T) { + m1 := testCreateRandomMarkdownForQuery(t) + arg := QueryUserMarkdownParams{ + Limit: 10, + Offset: 0, + UserID: m1.UserID, + PlaintoTsquery: m1.MainContent, + Role: util.AdminRole, + Signed: true, + CurUserID: 0, + } + rets, err := testStore.QueryUserMarkdown(context.Background(), arg) + require.NoError(t, err) + require.True(t, len(rets) > 0) + require.Equal(t, rets[0].RepoID, m1.RepoID) +} +func TestQueryRepoMarkdown(t *testing.T) { + m1 := testCreateRandomMarkdownForQuery(t) + arg := QueryRepoMarkdownParams{ + Limit: 10, + Offset: 0, + UserID: m1.UserID, + RepoID: m1.RepoID, + PlaintoTsquery: m1.MainContent, + } + rets, err := testStore.QueryRepoMarkdown(context.Background(), arg) + require.NoError(t, err) + require.True(t, len(rets) > 0) + require.Equal(t, rets[0].RepoID, m1.RepoID) +} diff --git a/zbook_backend/db/sqlc/models.go b/zbook_backend/db/sqlc/models.go new file mode 100644 index 0000000..50e7bb2 --- /dev/null +++ b/zbook_backend/db/sqlc/models.go @@ -0,0 +1,200 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 + +package db + +import ( + "net/netip" + "time" + + "github.com/google/uuid" + "github.com/jackc/pgx/v5/pgtype" +) + +type Comment struct { + CommentID int64 `json:"comment_id"` + RepoID int64 `json:"repo_id"` + MarkdownID int64 `json:"markdown_id"` + ParentID pgtype.Int8 `json:"parent_id"` + RootID pgtype.Int8 `json:"root_id"` + UserID int64 `json:"user_id"` + Blocked bool `json:"blocked"` + CommentContent string `json:"comment_content"` + CreatedAt time.Time `json:"created_at"` + FtsCommentZh string `json:"fts_comment_zh"` + FtsCommentEn string `json:"fts_comment_en"` +} + +type CommentNotification struct { + NotiID int64 `json:"noti_id"` + UserID int64 `json:"user_id"` + CommentID int64 `json:"comment_id"` + Readed bool `json:"readed"` + CreatedAt time.Time `json:"created_at"` +} + +type CommentRelation struct { + RelationID int64 `json:"relation_id"` + RelationType string `json:"relation_type"` + UserID int64 `json:"user_id"` + CommentID int64 `json:"comment_id"` + CreatedAt time.Time `json:"created_at"` +} + +type CommentReport struct { + ReportID int64 `json:"report_id"` + UserID int64 `json:"user_id"` + CommentID int64 `json:"comment_id"` + ReportContent string `json:"report_content"` + Processed bool `json:"processed"` + CreatedAt time.Time `json:"created_at"` + FtsReportZh string `json:"fts_report_zh"` + FtsReportEn string `json:"fts_report_en"` +} + +type Configuration struct { + ConfigName string `json:"config_name"` + ConfigValue bool `json:"config_value"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` +} + +type Follow struct { + FollowID int64 `json:"follow_id"` + FollowerID int64 `json:"follower_id"` + FollowingID int64 `json:"following_id"` + CreatedAt time.Time `json:"created_at"` +} + +type FollowerNotification struct { + NotiID int64 `json:"noti_id"` + UserID int64 `json:"user_id"` + FollowerID int64 `json:"follower_id"` + Readed bool `json:"readed"` + CreatedAt time.Time `json:"created_at"` +} + +type Geoip struct { + IpRangeCidr netip.Prefix `json:"ip_range_cidr"` + CityNameEn pgtype.Text `json:"city_name_en"` + CityNameZhCn pgtype.Text `json:"city_name_zh_cn"` + Latitude pgtype.Float8 `json:"latitude"` + Longitude pgtype.Float8 `json:"longitude"` +} + +type Invitation struct { + InvitationID int64 `json:"invitation_id"` + Email string `json:"email"` + InvitationUrl string `json:"invitation_url"` + IsUsed bool `json:"is_used"` + CreatedAt time.Time `json:"created_at"` + ExpiredAt time.Time `json:"expired_at"` +} + +type Markdown struct { + MarkdownID int64 `json:"markdown_id"` + RelativePath string `json:"relative_path"` + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + MainContent string `json:"main_content"` + TableContent string `json:"table_content"` + UpdatedAt time.Time `json:"updated_at"` + CreatedAt time.Time `json:"created_at"` + FtsZh string `json:"fts_zh"` + FtsEn string `json:"fts_en"` +} + +type Oauth struct { + OauthID int64 `json:"oauth_id"` + UserID int64 `json:"user_id"` + OauthType string `json:"oauth_type"` + AppID string `json:"app_id"` + CreatedAt time.Time `json:"created_at"` +} + +type Repo struct { + RepoID int64 `json:"repo_id"` + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + RepoDescription string `json:"repo_description"` + HomePage string `json:"home_page"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel string `json:"visibility_level"` + CommitID string `json:"commit_id"` + Config string `json:"config"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + FtsRepoEn string `json:"fts_repo_en"` + FtsRepoZh string `json:"fts_repo_zh"` +} + +type RepoNotification struct { + NotiID int64 `json:"noti_id"` + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + Readed bool `json:"readed"` + CreatedAt time.Time `json:"created_at"` +} + +type RepoRelation struct { + RelationID int64 `json:"relation_id"` + RelationType string `json:"relation_type"` + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + CreatedAt time.Time `json:"created_at"` +} + +type Session struct { + SessionID uuid.UUID `json:"session_id"` + UserID int64 `json:"user_id"` + RefreshToken string `json:"refresh_token"` + UserAgent string `json:"user_agent"` + ClientIp string `json:"client_ip"` + ExpiresAt time.Time `json:"expires_at"` + CreatedAt time.Time `json:"created_at"` +} + +type SystemNotification struct { + NotiID int64 `json:"noti_id"` + UserID int64 `json:"user_id"` + Title string `json:"title"` + Contents string `json:"contents"` + RedirectUrl pgtype.Text `json:"redirect_url"` + Readed bool `json:"readed"` + CreatedAt time.Time `json:"created_at"` +} + +type User struct { + UserID int64 `json:"user_id"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` +} + +type Verification struct { + VerificationID int64 `json:"verification_id"` + VerificationUrl string `json:"verification_url"` + VerificationType string `json:"verification_type"` + UserID int64 `json:"user_id"` + IsUsed bool `json:"is_used"` + CreatedAt time.Time `json:"created_at"` + ExpiredAt time.Time `json:"expired_at"` +} diff --git a/zbook_backend/db/sqlc/notification_test.go b/zbook_backend/db/sqlc/notification_test.go new file mode 100644 index 0000000..78b1ae4 --- /dev/null +++ b/zbook_backend/db/sqlc/notification_test.go @@ -0,0 +1,289 @@ +package db + +import ( + "context" + "testing" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func createRandomSystemNotificationByUser(t *testing.T, user User) SystemNotification { + arg := CreateSystemNotificationParams{ + UserID: user.UserID, + Title: util.RandomString(8), + Contents: util.RandomString(32), + RedirectUrl: pgtype.Text{String: util.RandomString(6), Valid: util.RandomBool()}, + } + notification, err := testStore.CreateSystemNotification(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, notification) + require.Equal(t, arg.Contents, notification.Contents) + require.Equal(t, arg.UserID, notification.UserID) + return notification +} +func createRandomSystemNotification(t *testing.T) SystemNotification { + user := createRandomUser(t) + arg := CreateSystemNotificationParams{ + UserID: user.UserID, + Title: util.RandomString(8), + Contents: util.RandomString(32), + RedirectUrl: pgtype.Text{String: util.RandomString(6), Valid: util.RandomBool()}, + } + notification, err := testStore.CreateSystemNotification(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, notification) + require.Equal(t, arg.Contents, notification.Contents) + require.Equal(t, arg.UserID, notification.UserID) + return notification +} +func TestCreateRandomSystemNotification(t *testing.T) { + createRandomSystemNotification(t) +} +func TestMarkSystemNotificationReaded(t *testing.T) { + notification := createRandomSystemNotification(t) + require.Equal(t, false, notification.Readed) + arg := MarkSystemNotificationReadedParams{ + NotiID: notification.NotiID, + UserID: notification.UserID, + } + updated_notification, err := testStore.MarkSystemNotificationReaded(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, true, updated_notification.Readed) +} + +func TestListSystemNotification(t *testing.T) { + user := createRandomUser(t) + notification_1 := createRandomSystemNotificationByUser(t, user) + notification_2 := createRandomSystemNotificationByUser(t, user) + notification_3 := createRandomSystemNotificationByUser(t, user) + arg := ListSystemNotificationParams{ + UserID: user.UserID, + Limit: 10, + Offset: 0, + } + notifications, err := testStore.ListSystemNotification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 3, len(notifications)) + require.Equal(t, notification_1.NotiID, notifications[2].NotiID) + require.Equal(t, notification_2.NotiID, notifications[1].NotiID) + require.Equal(t, notification_3.NotiID, notifications[0].NotiID) + + arg_mark := MarkSystemNotificationReadedParams{ + NotiID: notification_2.NotiID, + UserID: user.UserID, + } + _, err = testStore.MarkSystemNotificationReaded(context.Background(), arg_mark) + require.NoError(t, err) + + updated_notifications, err := testStore.ListSystemNotification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 3, len(updated_notifications)) + require.Equal(t, notification_2.NotiID, updated_notifications[1].NotiID) + require.Equal(t, notification_3.NotiID, updated_notifications[0].NotiID) +} + +func createRandomFollowerNotificationByUser(t *testing.T, user User) FollowerNotification { + follower := createRandomUser(t) + arg := CreateFollowerNotificationParams{ + UserID: user.UserID, + FollowerID: follower.UserID, + } + notification, err := testStore.CreateFollowerNotification(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, notification) + require.Equal(t, arg.FollowerID, notification.FollowerID) + require.Equal(t, arg.UserID, notification.UserID) + return notification +} +func createRandomFollowerNotification(t *testing.T) FollowerNotification { + user := createRandomUser(t) + notification := createRandomFollowerNotificationByUser(t, user) + return notification +} +func TestCreateFollowerSystemNotification(t *testing.T) { + createRandomFollowerNotification(t) +} + +func TestDeleteFollowerSystemNotification(t *testing.T) { + notification := createRandomFollowerNotification(t) + arg := DeleteFollowerNotificationParams{ + UserID: notification.UserID, + FollowerID: notification.FollowerID, + } + updated_notification, err := testStore.DeleteFollowerNotification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, updated_notification.NotiID, notification.NotiID) + _, err = testStore.DeleteFollowerNotification(context.Background(), arg) + require.Error(t, err) +} +func TestMarkFollowerNotificationReaded(t *testing.T) { + notification := createRandomFollowerNotification(t) + require.Equal(t, false, notification.Readed) + arg := MarkFollowerNotificationReadedParams{ + NotiID: notification.NotiID, + UserID: notification.UserID, + } + updated_notification, err := testStore.MarkFollowerNotificationReaded(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, true, updated_notification.Readed) +} + +func TestListFollowerNotification(t *testing.T) { + user := createRandomUser(t) + notification_1 := createRandomFollowerNotificationByUser(t, user) + notification_2 := createRandomFollowerNotificationByUser(t, user) + notification_3 := createRandomFollowerNotificationByUser(t, user) + arg := ListFollowerNotificationParams{ + UserID: user.UserID, + Limit: 10, + Offset: 0, + } + notifications, err := testStore.ListFollowerNotification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 3, len(notifications)) + require.Equal(t, notification_1.NotiID, notifications[2].NotiID) + require.Equal(t, notification_2.NotiID, notifications[1].NotiID) + require.Equal(t, notification_3.NotiID, notifications[0].NotiID) + + arg_delete := DeleteFollowerNotificationParams{ + FollowerID: notification_2.FollowerID, + UserID: user.UserID, + } + _, err = testStore.DeleteFollowerNotification(context.Background(), arg_delete) + require.NoError(t, err) + + updated_notifications, err := testStore.ListFollowerNotification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 2, len(updated_notifications)) + require.Equal(t, notification_1.NotiID, updated_notifications[1].NotiID) + require.Equal(t, notification_3.NotiID, updated_notifications[0].NotiID) +} + +func createRandomRepoNotificationByUser(t *testing.T, user User) RepoNotification { + repo := createUserRandomRepo(t, user) + arg := CreateRepoNotificationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + } + notification, err := testStore.CreateRepoNotification(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, notification) + require.Equal(t, arg.RepoID, notification.RepoID) + require.Equal(t, arg.UserID, notification.UserID) + return notification +} +func createRandomRepoNotification(t *testing.T) RepoNotification { + user := createRandomUser(t) + notification := createRandomRepoNotificationByUser(t, user) + return notification +} +func TestCreateRepoNotification(t *testing.T) { + createRandomRepoNotification(t) +} +func TestMarkRepoNotificationReaded(t *testing.T) { + notification := createRandomRepoNotification(t) + require.Equal(t, false, notification.Readed) + arg := MarkRepoNotificationReadedParams{ + NotiID: notification.NotiID, + UserID: notification.UserID, + } + updated_notification, err := testStore.MarkRepoNotificationReaded(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, true, updated_notification.Readed) +} +func TestListRepoNotification(t *testing.T) { + user := createRandomUser(t) + notification_1 := createRandomRepoNotificationByUser(t, user) + notification_2 := createRandomRepoNotificationByUser(t, user) + notification_3 := createRandomRepoNotificationByUser(t, user) + arg := ListRepoNotificationParams{ + UserID: user.UserID, + Limit: 10, + Offset: 0, + } + notifications, err := testStore.ListRepoNotification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 3, len(notifications)) + require.Equal(t, notification_1.NotiID, notifications[2].NotiID) + require.Equal(t, notification_2.NotiID, notifications[1].NotiID) + require.Equal(t, notification_3.NotiID, notifications[0].NotiID) + + arg_mark := MarkRepoNotificationReadedParams{ + NotiID: notification_2.NotiID, + UserID: user.UserID, + } + _, err = testStore.MarkRepoNotificationReaded(context.Background(), arg_mark) + require.NoError(t, err) + + updated_notifications, err := testStore.ListRepoNotification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 3, len(updated_notifications)) + require.Equal(t, notification_2.NotiID, updated_notifications[1].NotiID) + require.Equal(t, notification_3.NotiID, updated_notifications[0].NotiID) +} +func createRandomCommentNotificationByUser(t *testing.T, user User) CommentNotification { + md := testCreateRandomMarkdown(t) + comment := testCreateRandomCommentOnMd(t, md) + arg := CreateCommentNotificationParams{ + UserID: user.UserID, + CommentID: comment.CommentID, + } + notification, err := testStore.CreateCommentNotification(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, notification) + require.Equal(t, arg.CommentID, notification.CommentID) + require.Equal(t, arg.UserID, notification.UserID) + return notification +} +func createRandomCommentNotification(t *testing.T) CommentNotification { + user := createRandomUser(t) + notification := createRandomCommentNotificationByUser(t, user) + return notification +} +func TestCreateCommentNotification(t *testing.T) { + createRandomCommentNotification(t) +} +func TestMarkCommentNotificationReaded(t *testing.T) { + notification := createRandomCommentNotification(t) + require.Equal(t, false, notification.Readed) + arg := MarkCommentNotificationReadedParams{ + NotiID: notification.NotiID, + UserID: notification.UserID, + } + updated_notification, err := testStore.MarkCommentNotificationReaded(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, true, updated_notification.Readed) +} + +func TestListCommentNotification(t *testing.T) { + user := createRandomUser(t) + notification_1 := createRandomCommentNotificationByUser(t, user) + notification_2 := createRandomCommentNotificationByUser(t, user) + notification_3 := createRandomCommentNotificationByUser(t, user) + arg := ListCommentNotificationParams{ + UserID: user.UserID, + Limit: 10, + Offset: 0, + } + notifications, err := testStore.ListCommentNotification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 3, len(notifications)) + require.Equal(t, notification_1.NotiID, notifications[2].NotiID) + require.Equal(t, notification_2.NotiID, notifications[1].NotiID) + require.Equal(t, notification_3.NotiID, notifications[0].NotiID) + + arg_mark := MarkCommentNotificationReadedParams{ + NotiID: notification_2.NotiID, + UserID: user.UserID, + } + _, err = testStore.MarkCommentNotificationReaded(context.Background(), arg_mark) + require.NoError(t, err) + + updated_notifications, err := testStore.ListCommentNotification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 3, len(updated_notifications)) + require.Equal(t, notification_2.NotiID, updated_notifications[1].NotiID) + require.Equal(t, notification_3.NotiID, updated_notifications[0].NotiID) +} diff --git a/zbook_backend/db/sqlc/notifications.sql.go b/zbook_backend/db/sqlc/notifications.sql.go new file mode 100644 index 0000000..5277bf8 --- /dev/null +++ b/zbook_backend/db/sqlc/notifications.sql.go @@ -0,0 +1,562 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: notifications.sql + +package db + +import ( + "context" + "time" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createCommentNotification = `-- name: CreateCommentNotification :one +INSERT INTO comment_notifications ( + user_id, + comment_id +) VALUES ($1,$2) +RETURNING noti_id, user_id, comment_id, readed, created_at +` + +type CreateCommentNotificationParams struct { + UserID int64 `json:"user_id"` + CommentID int64 `json:"comment_id"` +} + +func (q *Queries) CreateCommentNotification(ctx context.Context, arg CreateCommentNotificationParams) (CommentNotification, error) { + row := q.db.QueryRow(ctx, createCommentNotification, arg.UserID, arg.CommentID) + var i CommentNotification + err := row.Scan( + &i.NotiID, + &i.UserID, + &i.CommentID, + &i.Readed, + &i.CreatedAt, + ) + return i, err +} + +const createFollowerNotification = `-- name: CreateFollowerNotification :one +INSERT INTO follower_notifications ( + user_id, + follower_id +) VALUES ($1,$2) +RETURNING noti_id, user_id, follower_id, readed, created_at +` + +type CreateFollowerNotificationParams struct { + UserID int64 `json:"user_id"` + FollowerID int64 `json:"follower_id"` +} + +func (q *Queries) CreateFollowerNotification(ctx context.Context, arg CreateFollowerNotificationParams) (FollowerNotification, error) { + row := q.db.QueryRow(ctx, createFollowerNotification, arg.UserID, arg.FollowerID) + var i FollowerNotification + err := row.Scan( + &i.NotiID, + &i.UserID, + &i.FollowerID, + &i.Readed, + &i.CreatedAt, + ) + return i, err +} + +const createRepoNotification = `-- name: CreateRepoNotification :one +INSERT INTO repo_notifications ( + user_id, + repo_id +) VALUES ($1,$2) +RETURNING noti_id, user_id, repo_id, readed, created_at +` + +type CreateRepoNotificationParams struct { + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` +} + +func (q *Queries) CreateRepoNotification(ctx context.Context, arg CreateRepoNotificationParams) (RepoNotification, error) { + row := q.db.QueryRow(ctx, createRepoNotification, arg.UserID, arg.RepoID) + var i RepoNotification + err := row.Scan( + &i.NotiID, + &i.UserID, + &i.RepoID, + &i.Readed, + &i.CreatedAt, + ) + return i, err +} + +const createSystemNotification = `-- name: CreateSystemNotification :one +INSERT INTO system_notifications ( + user_id, + title, + contents, + redirect_url +) VALUES ($1,$2,$3,$4) +RETURNING noti_id, user_id, title, contents, redirect_url, readed, created_at +` + +type CreateSystemNotificationParams struct { + UserID int64 `json:"user_id"` + Title string `json:"title"` + Contents string `json:"contents"` + RedirectUrl pgtype.Text `json:"redirect_url"` +} + +func (q *Queries) CreateSystemNotification(ctx context.Context, arg CreateSystemNotificationParams) (SystemNotification, error) { + row := q.db.QueryRow(ctx, createSystemNotification, + arg.UserID, + arg.Title, + arg.Contents, + arg.RedirectUrl, + ) + var i SystemNotification + err := row.Scan( + &i.NotiID, + &i.UserID, + &i.Title, + &i.Contents, + &i.RedirectUrl, + &i.Readed, + &i.CreatedAt, + ) + return i, err +} + +const deleteFollowerNotification = `-- name: DeleteFollowerNotification :one +DELETE FROM follower_notifications +WHERE user_id=$1 and follower_id=$2 +RETURNING noti_id, user_id, follower_id, readed, created_at +` + +type DeleteFollowerNotificationParams struct { + UserID int64 `json:"user_id"` + FollowerID int64 `json:"follower_id"` +} + +func (q *Queries) DeleteFollowerNotification(ctx context.Context, arg DeleteFollowerNotificationParams) (FollowerNotification, error) { + row := q.db.QueryRow(ctx, deleteFollowerNotification, arg.UserID, arg.FollowerID) + var i FollowerNotification + err := row.Scan( + &i.NotiID, + &i.UserID, + &i.FollowerID, + &i.Readed, + &i.CreatedAt, + ) + return i, err +} + +const getListCommentNotificationUnreadedCount = `-- name: GetListCommentNotificationUnreadedCount :one +SELECT + Count(*) +FROM + users +JOIN + comments ON comments.user_id=users.user_id +JOIN + markdowns ON markdowns.markdown_id=comments.markdown_id +JOIN + comment_notifications ON comment_notifications.comment_id=comments.comment_id +WHERE + comment_notifications.user_id=$1 AND (comment_notifications.readed = 'false') +` + +func (q *Queries) GetListCommentNotificationUnreadedCount(ctx context.Context, userID int64) (int64, error) { + row := q.db.QueryRow(ctx, getListCommentNotificationUnreadedCount, userID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getListFollowerNotificationUnreadedCount = `-- name: GetListFollowerNotificationUnreadedCount :one +SELECT + Count(*) +FROM + users +JOIN + follower_notifications ON users.user_id = follower_notifications.follower_id +WHERE + follower_notifications.user_id=$1 AND (follower_notifications.readed = 'false') +` + +func (q *Queries) GetListFollowerNotificationUnreadedCount(ctx context.Context, userID int64) (int64, error) { + row := q.db.QueryRow(ctx, getListFollowerNotificationUnreadedCount, userID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getListRepoNotificationUnreadedCount = `-- name: GetListRepoNotificationUnreadedCount :one +SELECT + Count(*) +FROM repo_notifications +JOIN repos ON repos.repo_id = repo_notifications.repo_id +JOIN users ON users.user_id = repos.user_id +WHERE repo_notifications.user_id=$1 AND (repo_notifications.readed = 'false' ) +` + +func (q *Queries) GetListRepoNotificationUnreadedCount(ctx context.Context, userID int64) (int64, error) { + row := q.db.QueryRow(ctx, getListRepoNotificationUnreadedCount, userID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getListSystemNotificationUnReadedCount = `-- name: GetListSystemNotificationUnReadedCount :one +SELECT Count(*) +FROM system_notifications +WHERE user_id=$1 AND (system_notifications.readed = 'false') +` + +func (q *Queries) GetListSystemNotificationUnReadedCount(ctx context.Context, userID int64) (int64, error) { + row := q.db.QueryRow(ctx, getListSystemNotificationUnReadedCount, userID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const listCommentNotification = `-- name: ListCommentNotification :many +SELECT + users.username,users.email,ru.username as repo_username, + comment_notifications.readed, comment_notifications.noti_id,comment_notifications.created_at, + markdowns.repo_id,markdowns.relative_path,comments.comment_content,repos.repo_name +FROM + users +JOIN + comments ON comments.user_id=users.user_id +JOIN + markdowns ON markdowns.markdown_id=comments.markdown_id +JOIN repos ON repos.repo_id = markdowns.repo_id +JOIN users as ru ON repos.user_id = ru.user_id +JOIN + comment_notifications ON comment_notifications.comment_id=comments.comment_id +WHERE + comment_notifications.user_id=$1 AND (comment_notifications.readed = 'false' OR comment_notifications.created_at >= NOW() - INTERVAL '14 days') +ORDER BY + comment_notifications.created_at DESC +LIMIT $2 +OFFSET $3 +` + +type ListCommentNotificationParams struct { + UserID int64 `json:"user_id"` + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` +} + +type ListCommentNotificationRow struct { + Username string `json:"username"` + Email string `json:"email"` + RepoUsername string `json:"repo_username"` + Readed bool `json:"readed"` + NotiID int64 `json:"noti_id"` + CreatedAt time.Time `json:"created_at"` + RepoID int64 `json:"repo_id"` + RelativePath string `json:"relative_path"` + CommentContent string `json:"comment_content"` + RepoName string `json:"repo_name"` +} + +func (q *Queries) ListCommentNotification(ctx context.Context, arg ListCommentNotificationParams) ([]ListCommentNotificationRow, error) { + rows, err := q.db.Query(ctx, listCommentNotification, arg.UserID, arg.Limit, arg.Offset) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListCommentNotificationRow{} + for rows.Next() { + var i ListCommentNotificationRow + if err := rows.Scan( + &i.Username, + &i.Email, + &i.RepoUsername, + &i.Readed, + &i.NotiID, + &i.CreatedAt, + &i.RepoID, + &i.RelativePath, + &i.CommentContent, + &i.RepoName, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listFollowerNotification = `-- name: ListFollowerNotification :many +SELECT + users.username,users.email, + follower_notifications.readed,follower_notifications.noti_id,follower_notifications.created_at +FROM + users +JOIN + follower_notifications ON users.user_id = follower_notifications.follower_id +WHERE + follower_notifications.user_id=$1 AND (follower_notifications.readed = 'false' OR follower_notifications.created_at >= NOW() - INTERVAL '14 days') +ORDER BY + follower_notifications.created_at DESC +LIMIT $2 +OFFSET $3 +` + +type ListFollowerNotificationParams struct { + UserID int64 `json:"user_id"` + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` +} + +type ListFollowerNotificationRow struct { + Username string `json:"username"` + Email string `json:"email"` + Readed bool `json:"readed"` + NotiID int64 `json:"noti_id"` + CreatedAt time.Time `json:"created_at"` +} + +func (q *Queries) ListFollowerNotification(ctx context.Context, arg ListFollowerNotificationParams) ([]ListFollowerNotificationRow, error) { + rows, err := q.db.Query(ctx, listFollowerNotification, arg.UserID, arg.Limit, arg.Offset) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListFollowerNotificationRow{} + for rows.Next() { + var i ListFollowerNotificationRow + if err := rows.Scan( + &i.Username, + &i.Email, + &i.Readed, + &i.NotiID, + &i.CreatedAt, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listRepoNotification = `-- name: ListRepoNotification :many +SELECT + users.username,users.email, + repo_notifications.readed,repo_notifications.noti_id,repo_notifications.created_at, + repos.repo_id,repos.repo_name +FROM repo_notifications +JOIN repos ON repos.repo_id = repo_notifications.repo_id +JOIN users ON users.user_id = repos.user_id +WHERE repo_notifications.user_id=$1 AND (repo_notifications.readed = 'false' OR repo_notifications.created_at >= NOW() - INTERVAL '14 days') +ORDER BY repo_notifications.created_at DESC +LIMIT $2 +OFFSET $3 +` + +type ListRepoNotificationParams struct { + UserID int64 `json:"user_id"` + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` +} + +type ListRepoNotificationRow struct { + Username string `json:"username"` + Email string `json:"email"` + Readed bool `json:"readed"` + NotiID int64 `json:"noti_id"` + CreatedAt time.Time `json:"created_at"` + RepoID int64 `json:"repo_id"` + RepoName string `json:"repo_name"` +} + +func (q *Queries) ListRepoNotification(ctx context.Context, arg ListRepoNotificationParams) ([]ListRepoNotificationRow, error) { + rows, err := q.db.Query(ctx, listRepoNotification, arg.UserID, arg.Limit, arg.Offset) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListRepoNotificationRow{} + for rows.Next() { + var i ListRepoNotificationRow + if err := rows.Scan( + &i.Username, + &i.Email, + &i.Readed, + &i.NotiID, + &i.CreatedAt, + &i.RepoID, + &i.RepoName, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listSystemNotification = `-- name: ListSystemNotification :many +SELECT system_notifications.noti_id,system_notifications.readed,system_notifications.created_at, + title,contents,redirect_url +FROM system_notifications +WHERE user_id=$1 AND (system_notifications.readed = 'false' OR system_notifications.created_at >= NOW() - INTERVAL '14 days') +ORDER BY system_notifications.created_at Desc +LIMIT $2 +OFFSET $3 +` + +type ListSystemNotificationParams struct { + UserID int64 `json:"user_id"` + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` +} + +type ListSystemNotificationRow struct { + NotiID int64 `json:"noti_id"` + Readed bool `json:"readed"` + CreatedAt time.Time `json:"created_at"` + Title string `json:"title"` + Contents string `json:"contents"` + RedirectUrl pgtype.Text `json:"redirect_url"` +} + +func (q *Queries) ListSystemNotification(ctx context.Context, arg ListSystemNotificationParams) ([]ListSystemNotificationRow, error) { + rows, err := q.db.Query(ctx, listSystemNotification, arg.UserID, arg.Limit, arg.Offset) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListSystemNotificationRow{} + for rows.Next() { + var i ListSystemNotificationRow + if err := rows.Scan( + &i.NotiID, + &i.Readed, + &i.CreatedAt, + &i.Title, + &i.Contents, + &i.RedirectUrl, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const markCommentNotificationReaded = `-- name: MarkCommentNotificationReaded :one +UPDATE comment_notifications +SET readed = 'true' +WHERE noti_id=$1 and user_id = $2 +RETURNING noti_id, user_id, comment_id, readed, created_at +` + +type MarkCommentNotificationReadedParams struct { + NotiID int64 `json:"noti_id"` + UserID int64 `json:"user_id"` +} + +func (q *Queries) MarkCommentNotificationReaded(ctx context.Context, arg MarkCommentNotificationReadedParams) (CommentNotification, error) { + row := q.db.QueryRow(ctx, markCommentNotificationReaded, arg.NotiID, arg.UserID) + var i CommentNotification + err := row.Scan( + &i.NotiID, + &i.UserID, + &i.CommentID, + &i.Readed, + &i.CreatedAt, + ) + return i, err +} + +const markFollowerNotificationReaded = `-- name: MarkFollowerNotificationReaded :one +UPDATE follower_notifications +SET readed = 'true' +WHERE noti_id=$1 and user_id = $2 +RETURNING noti_id, user_id, follower_id, readed, created_at +` + +type MarkFollowerNotificationReadedParams struct { + NotiID int64 `json:"noti_id"` + UserID int64 `json:"user_id"` +} + +func (q *Queries) MarkFollowerNotificationReaded(ctx context.Context, arg MarkFollowerNotificationReadedParams) (FollowerNotification, error) { + row := q.db.QueryRow(ctx, markFollowerNotificationReaded, arg.NotiID, arg.UserID) + var i FollowerNotification + err := row.Scan( + &i.NotiID, + &i.UserID, + &i.FollowerID, + &i.Readed, + &i.CreatedAt, + ) + return i, err +} + +const markRepoNotificationReaded = `-- name: MarkRepoNotificationReaded :one +UPDATE repo_notifications +SET readed = 'true' +WHERE noti_id=$1 and user_id = $2 +RETURNING noti_id, user_id, repo_id, readed, created_at +` + +type MarkRepoNotificationReadedParams struct { + NotiID int64 `json:"noti_id"` + UserID int64 `json:"user_id"` +} + +func (q *Queries) MarkRepoNotificationReaded(ctx context.Context, arg MarkRepoNotificationReadedParams) (RepoNotification, error) { + row := q.db.QueryRow(ctx, markRepoNotificationReaded, arg.NotiID, arg.UserID) + var i RepoNotification + err := row.Scan( + &i.NotiID, + &i.UserID, + &i.RepoID, + &i.Readed, + &i.CreatedAt, + ) + return i, err +} + +const markSystemNotificationReaded = `-- name: MarkSystemNotificationReaded :one +UPDATE system_notifications +SET readed = 'true' +WHERE noti_id = $1 AND user_id = $2 +RETURNING noti_id, user_id, title, contents, redirect_url, readed, created_at +` + +type MarkSystemNotificationReadedParams struct { + NotiID int64 `json:"noti_id"` + UserID int64 `json:"user_id"` +} + +func (q *Queries) MarkSystemNotificationReaded(ctx context.Context, arg MarkSystemNotificationReadedParams) (SystemNotification, error) { + row := q.db.QueryRow(ctx, markSystemNotificationReaded, arg.NotiID, arg.UserID) + var i SystemNotification + err := row.Scan( + &i.NotiID, + &i.UserID, + &i.Title, + &i.Contents, + &i.RedirectUrl, + &i.Readed, + &i.CreatedAt, + ) + return i, err +} diff --git a/zbook_backend/db/sqlc/oauth.sql.go b/zbook_backend/db/sqlc/oauth.sql.go new file mode 100644 index 0000000..b59d2c3 --- /dev/null +++ b/zbook_backend/db/sqlc/oauth.sql.go @@ -0,0 +1,148 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: oauth.sql + +package db + +import ( + "context" + "time" +) + +const checkOAuthStatus = `-- name: CheckOAuthStatus :one +SELECT + COALESCE(COUNT(CASE WHEN "oauth_type" = 'github' THEN 1 END), 0) > 0 AS github_status, + COALESCE(COUNT(CASE WHEN "oauth_type" = 'google' THEN 1 END), 0) > 0 AS google_status +FROM + "oauths" +WHERE + "user_id" = $1 +` + +type CheckOAuthStatusRow struct { + GithubStatus bool `json:"github_status"` + GoogleStatus bool `json:"google_status"` +} + +func (q *Queries) CheckOAuthStatus(ctx context.Context, userID int64) (CheckOAuthStatusRow, error) { + row := q.db.QueryRow(ctx, checkOAuthStatus, userID) + var i CheckOAuthStatusRow + err := row.Scan(&i.GithubStatus, &i.GoogleStatus) + return i, err +} + +const createOAuth = `-- name: CreateOAuth :one +INSERT INTO oauths ( + user_id, + oauth_type, + app_id +) VALUES ( + $1, $2, $3 +) RETURNING oauth_id, user_id, oauth_type, app_id, created_at +` + +type CreateOAuthParams struct { + UserID int64 `json:"user_id"` + OauthType string `json:"oauth_type"` + AppID string `json:"app_id"` +} + +func (q *Queries) CreateOAuth(ctx context.Context, arg CreateOAuthParams) (Oauth, error) { + row := q.db.QueryRow(ctx, createOAuth, arg.UserID, arg.OauthType, arg.AppID) + var i Oauth + err := row.Scan( + &i.OauthID, + &i.UserID, + &i.OauthType, + &i.AppID, + &i.CreatedAt, + ) + return i, err +} + +const deleteOAuth = `-- name: DeleteOAuth :one +DELETE FROM oauths +WHERE user_id=$1 and oauth_type=$2 +RETURNING oauth_id, user_id, oauth_type, app_id, created_at +` + +type DeleteOAuthParams struct { + UserID int64 `json:"user_id"` + OauthType string `json:"oauth_type"` +} + +func (q *Queries) DeleteOAuth(ctx context.Context, arg DeleteOAuthParams) (Oauth, error) { + row := q.db.QueryRow(ctx, deleteOAuth, arg.UserID, arg.OauthType) + var i Oauth + err := row.Scan( + &i.OauthID, + &i.UserID, + &i.OauthType, + &i.AppID, + &i.CreatedAt, + ) + return i, err +} + +const getOAuthUser = `-- name: GetOAuthUser :one +SELECT oauth_id, oauths.user_id, oauth_type, app_id, oauths.created_at, users.user_id, username, email, hashed_password, blocked, verified, motto, user_role, onboarding, users.created_at, updated_at, unread_count, unread_count_updated_at, fts_username +FROM oauths +JOIN users ON oauths.user_id = users.user_id +WHERE oauth_type = $1 and app_id = $2 LIMIT 1 +FOR NO KEY UPDATE +` + +type GetOAuthUserParams struct { + OauthType string `json:"oauth_type"` + AppID string `json:"app_id"` +} + +type GetOAuthUserRow struct { + OauthID int64 `json:"oauth_id"` + UserID int64 `json:"user_id"` + OauthType string `json:"oauth_type"` + AppID string `json:"app_id"` + CreatedAt time.Time `json:"created_at"` + UserID_2 int64 `json:"user_id_2"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt_2 time.Time `json:"created_at_2"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` +} + +func (q *Queries) GetOAuthUser(ctx context.Context, arg GetOAuthUserParams) (GetOAuthUserRow, error) { + row := q.db.QueryRow(ctx, getOAuthUser, arg.OauthType, arg.AppID) + var i GetOAuthUserRow + err := row.Scan( + &i.OauthID, + &i.UserID, + &i.OauthType, + &i.AppID, + &i.CreatedAt, + &i.UserID_2, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt_2, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ) + return i, err +} diff --git a/zbook_backend/db/sqlc/oauth_test.go b/zbook_backend/db/sqlc/oauth_test.go new file mode 100644 index 0000000..0dc7060 --- /dev/null +++ b/zbook_backend/db/sqlc/oauth_test.go @@ -0,0 +1,81 @@ +package db + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func createRandomOAuth(t *testing.T) Oauth { + randomOAuthType := util.RandomOAuth() + user := createRandomUser(t) + arg := CreateOAuthParams{ + UserID: user.UserID, + OauthType: randomOAuthType, + AppID: util.RandomString(32), + } + oauth, err := testStore.CreateOAuth(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, oauth.UserID, user.UserID) + require.Equal(t, oauth.OauthType, randomOAuthType) + return oauth +} +func createOAuthUserOAuth(t *testing.T, user User, oauthType string) Oauth { + + arg := CreateOAuthParams{ + UserID: user.UserID, + OauthType: oauthType, + AppID: util.RandomString(32), + } + oauth, err := testStore.CreateOAuth(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, oauth.UserID, user.UserID) + require.Equal(t, oauth.OauthType, oauthType) + return oauth +} + +func TestCreateOAuth(t *testing.T) { + createRandomOAuth(t) +} + +func TestGetOAuthUser(t *testing.T) { + oauth := createRandomOAuth(t) + arg := GetOAuthUserParams{ + OauthType: oauth.OauthType, + AppID: oauth.AppID, + } + oauthRow, err := testStore.GetOAuthUser(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, oauthRow.UserID, oauth.UserID) + require.Equal(t, oauthRow.OauthType, oauth.OauthType) + require.Equal(t, oauthRow.AppID, oauth.AppID) +} +func TestCheckOAuthStatus(t *testing.T) { + user := createRandomUser(t) + createOAuthUserOAuth(t, user, util.OAuthTypeGithub) + createOAuthUserOAuth(t, user, util.OAuthTypeGoogle) + status, err := testStore.CheckOAuthStatus(context.Background(), user.UserID) + require.NoError(t, err) + require.Equal(t, status.GithubStatus, true) + require.Equal(t, status.GoogleStatus, true) +} + +func TestDeleteOAuth(t *testing.T) { + oauth := createRandomOAuth(t) + arg := DeleteOAuthParams{ + UserID: oauth.UserID, + OauthType: oauth.OauthType, + } + _, err := testStore.DeleteOAuth(context.Background(), arg) + require.NoError(t, err) + + arg_get := GetOAuthUserParams{ + OauthType: oauth.OauthType, + AppID: oauth.AppID, + } + oauthRow, err := testStore.GetOAuthUser(context.Background(), arg_get) + require.Error(t, err) + require.Empty(t, oauthRow) +} diff --git a/zbook_backend/db/sqlc/querier.go b/zbook_backend/db/sqlc/querier.go new file mode 100644 index 0000000..f61b9b1 --- /dev/null +++ b/zbook_backend/db/sqlc/querier.go @@ -0,0 +1,139 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 + +package db + +import ( + "context" + "net/netip" + + "github.com/google/uuid" + "github.com/jackc/pgx/v5/pgtype" +) + +type Querier interface { + CheckOAuthStatus(ctx context.Context, userID int64) (CheckOAuthStatusRow, error) + CreateComment(ctx context.Context, arg CreateCommentParams) (Comment, error) + CreateCommentNotification(ctx context.Context, arg CreateCommentNotificationParams) (CommentNotification, error) + CreateCommentRelation(ctx context.Context, arg CreateCommentRelationParams) error + CreateCommentReport(ctx context.Context, arg CreateCommentReportParams) error + CreateFollow(ctx context.Context, arg CreateFollowParams) (Follow, error) + CreateFollowerNotification(ctx context.Context, arg CreateFollowerNotificationParams) (FollowerNotification, error) + CreateInvitation(ctx context.Context, arg CreateInvitationParams) (Invitation, error) + CreateMarkdown(ctx context.Context, arg CreateMarkdownParams) (Markdown, error) + CreateMarkdownMulti(ctx context.Context, arg CreateMarkdownMultiParams) error + CreateOAuth(ctx context.Context, arg CreateOAuthParams) (Oauth, error) + CreateRepo(ctx context.Context, arg CreateRepoParams) (Repo, error) + CreateRepoNotification(ctx context.Context, arg CreateRepoNotificationParams) (RepoNotification, error) + CreateRepoRelation(ctx context.Context, arg CreateRepoRelationParams) error + CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) + CreateSystemNotification(ctx context.Context, arg CreateSystemNotificationParams) (SystemNotification, error) + CreateUser(ctx context.Context, arg CreateUserParams) (User, error) + CreateVerification(ctx context.Context, arg CreateVerificationParams) (Verification, error) + DeleteComment(ctx context.Context, commentID int64) error + DeleteCommentRelation(ctx context.Context, arg DeleteCommentRelationParams) error + DeleteFollow(ctx context.Context, arg DeleteFollowParams) (int64, error) + DeleteFollowerNotification(ctx context.Context, arg DeleteFollowerNotificationParams) (FollowerNotification, error) + DeleteMarkdownMulti(ctx context.Context, arg DeleteMarkdownMultiParams) error + DeleteOAuth(ctx context.Context, arg DeleteOAuthParams) (Oauth, error) + DeleteRepo(ctx context.Context, repoID int64) error + DeleteRepoRelation(ctx context.Context, arg DeleteRepoRelationParams) error + DeleteUser(ctx context.Context, username string) error + GetCommentBasicInfo(ctx context.Context, commentID int64) (GetCommentBasicInfoRow, error) + GetCommentDetail(ctx context.Context, arg GetCommentDetailParams) (GetCommentDetailRow, error) + GetCommentRepoInfo(ctx context.Context, commentID int64) (Repo, error) + GetConfiguration(ctx context.Context, configName string) (Configuration, error) + GetDailyActiveUserCount(ctx context.Context, arg GetDailyActiveUserCountParams) ([]GetDailyActiveUserCountRow, error) + GetDailyCreateUserCount(ctx context.Context, arg GetDailyCreateUserCountParams) ([]GetDailyCreateUserCountRow, error) + GetGeoInfo(ctx context.Context, dollar_1 netip.Addr) (Geoip, error) + GetInvitation(ctx context.Context, arg GetInvitationParams) (Invitation, error) + GetListCommentCount(ctx context.Context) (int64, error) + GetListCommentLevelOneCount(ctx context.Context, markdownID int64) (int64, error) + GetListCommentLevelTwoCount(ctx context.Context, rootID pgtype.Int8) (int64, error) + GetListCommentNotificationUnreadedCount(ctx context.Context, userID int64) (int64, error) + GetListCommentReportCount(ctx context.Context) (int64, error) + GetListFollowerCount(ctx context.Context, arg GetListFollowerCountParams) (int64, error) + GetListFollowerNotificationUnreadedCount(ctx context.Context, userID int64) (int64, error) + GetListFollowingCount(ctx context.Context, arg GetListFollowingCountParams) (int64, error) + GetListRepoCount(ctx context.Context, arg GetListRepoCountParams) (int64, error) + GetListRepoNotificationUnreadedCount(ctx context.Context, userID int64) (int64, error) + GetListSessionCount(ctx context.Context) (int64, error) + GetListSystemNotificationUnReadedCount(ctx context.Context, userID int64) (int64, error) + GetListUserCount(ctx context.Context, role string) (int64, error) + GetListUserLikeRepoCount(ctx context.Context, arg GetListUserLikeRepoCountParams) (int64, error) + GetListUserOwnRepoCount(ctx context.Context, arg GetListUserOwnRepoCountParams) (int64, error) + GetMarkdownByID(ctx context.Context, markdownID int64) (Markdown, error) + GetMarkdownContent(ctx context.Context, arg GetMarkdownContentParams) (Markdown, error) + GetMarkdownRepoID(ctx context.Context, markdownID int64) (int64, error) + GetOAuthUser(ctx context.Context, arg GetOAuthUserParams) (GetOAuthUserRow, error) + GetQueryCommentCount(ctx context.Context, query string) (int64, error) + GetQueryCommentReportCount(ctx context.Context, query string) (int64, error) + GetQueryFollowerCount(ctx context.Context, arg GetQueryFollowerCountParams) (int64, error) + GetQueryFollowingCount(ctx context.Context, arg GetQueryFollowingCountParams) (int64, error) + GetQueryRepoCount(ctx context.Context, arg GetQueryRepoCountParams) (int64, error) + GetQuerySessionCount(ctx context.Context, query string) (int64, error) + GetQueryUserCount(ctx context.Context, arg GetQueryUserCountParams) (int64, error) + GetQueryUserLikeRepoCount(ctx context.Context, arg GetQueryUserLikeRepoCountParams) (int64, error) + GetQueryUserOwnRepoCount(ctx context.Context, arg GetQueryUserOwnRepoCountParams) (int64, error) + GetRepo(ctx context.Context, repoID int64) (Repo, error) + GetRepoBasicInfo(ctx context.Context, arg GetRepoBasicInfoParams) (GetRepoBasicInfoRow, error) + GetRepoByRepoName(ctx context.Context, arg GetRepoByRepoNameParams) (GetRepoByRepoNameRow, error) + GetRepoConfig(ctx context.Context, arg GetRepoConfigParams) (GetRepoConfigRow, error) + GetRepoID(ctx context.Context, arg GetRepoIDParams) (int64, error) + GetRepoPermission(ctx context.Context, repoID int64) (GetRepoPermissionRow, error) + GetRepoRelation(ctx context.Context, arg GetRepoRelationParams) (RepoRelation, error) + GetRepoVisibilityByRepoCount(ctx context.Context, repoID int64) (int64, error) + GetSession(ctx context.Context, sessionID uuid.UUID) (Session, error) + GetUnReadCount(ctx context.Context, username string) (int32, error) + GetUserByEmail(ctx context.Context, email string) (User, error) + GetUserByUsername(ctx context.Context, username string) (User, error) + GetUserInfo(ctx context.Context, arg GetUserInfoParams) (GetUserInfoRow, error) + GetVerification(ctx context.Context, verificationUrl string) (GetVerificationRow, error) + IsFollowing(ctx context.Context, arg IsFollowingParams) (bool, error) + ListComment(ctx context.Context, arg ListCommentParams) ([]ListCommentRow, error) + ListCommentLevelOne(ctx context.Context, arg ListCommentLevelOneParams) ([]ListCommentLevelOneRow, error) + ListCommentLevelTwo(ctx context.Context, arg ListCommentLevelTwoParams) ([]ListCommentLevelTwoRow, error) + ListCommentNotification(ctx context.Context, arg ListCommentNotificationParams) ([]ListCommentNotificationRow, error) + ListCommentReport(ctx context.Context, arg ListCommentReportParams) ([]ListCommentReportRow, error) + ListFollower(ctx context.Context, arg ListFollowerParams) ([]ListFollowerRow, error) + ListFollowerNotification(ctx context.Context, arg ListFollowerNotificationParams) ([]ListFollowerNotificationRow, error) + ListFollowing(ctx context.Context, arg ListFollowingParams) ([]ListFollowingRow, error) + ListRepo(ctx context.Context, arg ListRepoParams) ([]ListRepoRow, error) + ListRepoNotification(ctx context.Context, arg ListRepoNotificationParams) ([]ListRepoNotificationRow, error) + ListRepoVisibilityByRepo(ctx context.Context, arg ListRepoVisibilityByRepoParams) ([]User, error) + ListSession(ctx context.Context, arg ListSessionParams) ([]ListSessionRow, error) + ListSystemNotification(ctx context.Context, arg ListSystemNotificationParams) ([]ListSystemNotificationRow, error) + ListUser(ctx context.Context, arg ListUserParams) ([]User, error) + ListUserLikeRepo(ctx context.Context, arg ListUserLikeRepoParams) ([]ListUserLikeRepoRow, error) + ListUserOwnRepo(ctx context.Context, arg ListUserOwnRepoParams) ([]ListUserOwnRepoRow, error) + MarkCommentNotificationReaded(ctx context.Context, arg MarkCommentNotificationReadedParams) (CommentNotification, error) + MarkFollowerNotificationReaded(ctx context.Context, arg MarkFollowerNotificationReadedParams) (FollowerNotification, error) + MarkInvitationAsUsed(ctx context.Context, arg MarkInvitationAsUsedParams) (Invitation, error) + MarkRepoNotificationReaded(ctx context.Context, arg MarkRepoNotificationReadedParams) (RepoNotification, error) + MarkSystemNotificationReaded(ctx context.Context, arg MarkSystemNotificationReadedParams) (SystemNotification, error) + MarkVerificationAsUsed(ctx context.Context, verificationUrl string) (Verification, error) + QueryComment(ctx context.Context, arg QueryCommentParams) ([]QueryCommentRow, error) + QueryCommentReport(ctx context.Context, arg QueryCommentReportParams) ([]QueryCommentReportRow, error) + QueryFollower(ctx context.Context, arg QueryFollowerParams) ([]QueryFollowerRow, error) + QueryFollowing(ctx context.Context, arg QueryFollowingParams) ([]QueryFollowingRow, error) + QueryMarkdown(ctx context.Context, arg QueryMarkdownParams) ([]QueryMarkdownRow, error) + QueryRepo(ctx context.Context, arg QueryRepoParams) ([]QueryRepoRow, error) + QueryRepoMarkdown(ctx context.Context, arg QueryRepoMarkdownParams) ([]QueryRepoMarkdownRow, error) + QueryRepoVisibilityByRepo(ctx context.Context, arg QueryRepoVisibilityByRepoParams) ([]QueryRepoVisibilityByRepoRow, error) + QuerySession(ctx context.Context, arg QuerySessionParams) ([]QuerySessionRow, error) + QueryUser(ctx context.Context, arg QueryUserParams) ([]QueryUserRow, error) + QueryUserLikeRepo(ctx context.Context, arg QueryUserLikeRepoParams) ([]QueryUserLikeRepoRow, error) + QueryUserMarkdown(ctx context.Context, arg QueryUserMarkdownParams) ([]QueryUserMarkdownRow, error) + QueryUserOwnRepo(ctx context.Context, arg QueryUserOwnRepoParams) ([]QueryUserOwnRepoRow, error) + ResetUnreadCount(ctx context.Context, username string) error + UpdateCommentReportStatus(ctx context.Context, arg UpdateCommentReportStatusParams) error + UpdateConfiguration(ctx context.Context, arg UpdateConfigurationParams) error + UpdateMarkdownMulti(ctx context.Context, arg UpdateMarkdownMultiParams) error + UpdateRepoConfig(ctx context.Context, arg UpdateRepoConfigParams) error + UpdateRepoInfo(ctx context.Context, arg UpdateRepoInfoParams) (Repo, error) + UpdateUnreadCount(ctx context.Context, userID int64) error + UpdateUserBasicInfo(ctx context.Context, arg UpdateUserBasicInfoParams) (User, error) +} + +var _ Querier = (*Queries)(nil) diff --git a/zbook_backend/db/sqlc/repo.sql.go b/zbook_backend/db/sqlc/repo.sql.go new file mode 100644 index 0000000..ea21f97 --- /dev/null +++ b/zbook_backend/db/sqlc/repo.sql.go @@ -0,0 +1,1416 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: repo.sql + +package db + +import ( + "context" + "time" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createRepo = `-- name: CreateRepo :one +INSERT INTO repos ( + user_id, + git_protocol, + git_host, + git_username, + git_repo, + git_access_token, + repo_name, + theme_sidebar, + theme_color, + home_page, + repo_description, + sync_token, + commit_id, + visibility_level +) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14) +RETURNING repo_id, user_id, git_protocol, git_host, git_username, git_repo, git_access_token, repo_name, repo_description, home_page, sync_token, visibility_level, commit_id, config, theme_sidebar, theme_color, created_at, updated_at, fts_repo_en, fts_repo_zh +` + +type CreateRepoParams struct { + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + HomePage string `json:"home_page"` + RepoDescription string `json:"repo_description"` + SyncToken pgtype.Text `json:"sync_token"` + CommitID string `json:"commit_id"` + VisibilityLevel string `json:"visibility_level"` +} + +func (q *Queries) CreateRepo(ctx context.Context, arg CreateRepoParams) (Repo, error) { + row := q.db.QueryRow(ctx, createRepo, + arg.UserID, + arg.GitProtocol, + arg.GitHost, + arg.GitUsername, + arg.GitRepo, + arg.GitAccessToken, + arg.RepoName, + arg.ThemeSidebar, + arg.ThemeColor, + arg.HomePage, + arg.RepoDescription, + arg.SyncToken, + arg.CommitID, + arg.VisibilityLevel, + ) + var i Repo + err := row.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + ) + return i, err +} + +const deleteRepo = `-- name: DeleteRepo :exec +DELETE FROM repos +WHERE repo_id = $1 +` + +func (q *Queries) DeleteRepo(ctx context.Context, repoID int64) error { + _, err := q.db.Exec(ctx, deleteRepo, repoID) + return err +} + +const getListRepoCount = `-- name: GetListRepoCount :one +SELECT + count(*) +FROM + repos r +JOIN + users u ON u.user_id = r.user_id +WHERE + ($1::text='admin' AND $2::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $2::bool) + OR + (r.visibility_level = 'chosen' AND $2::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $3 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $3 AND $2::bool) + ) + ) +` + +type GetListRepoCountParams struct { + Role string `json:"role"` + Signed bool `json:"signed"` + CurUserID int64 `json:"cur_user_id"` +} + +func (q *Queries) GetListRepoCount(ctx context.Context, arg GetListRepoCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getListRepoCount, arg.Role, arg.Signed, arg.CurUserID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getListUserLikeRepoCount = `-- name: GetListUserLikeRepoCount :one +SELECT + COUNT(*) +FROM + repos r +JOIN repo_relations AS rr ON r.repo_id = rr.repo_id +JOIN + users as ur ON ur.user_id=r.user_id +JOIN + users as uq ON uq.user_id=rr.user_id +WHERE + uq.user_id = $1 AND rr.relation_type='like' AND ( + ($2::text='admin' AND $3::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND $3::bool) + OR + (r.visibility_level = 'chosen' AND $3::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $4 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $4 AND $3::bool) + ) + ) + ) +` + +type GetListUserLikeRepoCountParams struct { + UserID int64 `json:"user_id"` + Role string `json:"role"` + Signed bool `json:"signed"` + CurUserID int64 `json:"cur_user_id"` +} + +func (q *Queries) GetListUserLikeRepoCount(ctx context.Context, arg GetListUserLikeRepoCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getListUserLikeRepoCount, + arg.UserID, + arg.Role, + arg.Signed, + arg.CurUserID, + ) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getListUserOwnRepoCount = `-- name: GetListUserOwnRepoCount :one +SELECT + COUNT(*) +FROM + repos r +JOIN + users as u ON u.user_id=r.user_id +WHERE + u.user_id = $1 AND ( + ($2::text='admin' AND $3::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $3::bool) + OR + (r.visibility_level = 'chosen' AND $3::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $4 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $4 AND $3::bool) + ) + ) + ) +` + +type GetListUserOwnRepoCountParams struct { + UserID int64 `json:"user_id"` + Role string `json:"role"` + Signed bool `json:"signed"` + CurUserID int64 `json:"cur_user_id"` +} + +func (q *Queries) GetListUserOwnRepoCount(ctx context.Context, arg GetListUserOwnRepoCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getListUserOwnRepoCount, + arg.UserID, + arg.Role, + arg.Signed, + arg.CurUserID, + ) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getQueryRepoCount = `-- name: GetQueryRepoCount :one +SELECT + count(*) +FROM + repos r +JOIN + users u ON u.user_id = r.user_id +where (r.fts_repo_en @@ plainto_tsquery($1) OR r.fts_repo_zh @@ plainto_tsquery($1)) + AND ( + ($2::text='admin' AND $3::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $3::bool) + OR + (r.visibility_level = 'chosen' AND $3::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $4 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $4 AND $3::bool) + ) + ) + ) +` + +type GetQueryRepoCountParams struct { + Query string `json:"query"` + Role string `json:"role"` + Signed bool `json:"signed"` + CurUserID int64 `json:"cur_user_id"` +} + +func (q *Queries) GetQueryRepoCount(ctx context.Context, arg GetQueryRepoCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getQueryRepoCount, + arg.Query, + arg.Role, + arg.Signed, + arg.CurUserID, + ) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getQueryUserLikeRepoCount = `-- name: GetQueryUserLikeRepoCount :one +SELECT + COUNT(*) +FROM + repos r +JOIN repo_relations AS rr ON r.repo_id = rr.repo_id +JOIN + users as ur ON ur.user_id=r.user_id +JOIN + users as uq ON uq.user_id=rr.user_id +WHERE + (r.fts_repo_en @@ plainto_tsquery($1) OR r.fts_repo_zh @@ plainto_tsquery($1)) AND uq.user_id = $2 AND rr.relation_type='like' AND ( + ($3::text='admin' AND $4::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND $4::bool) + OR + (r.visibility_level = 'chosen' AND $4::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $5 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $5 AND $4::bool) + ) + ) + ) +` + +type GetQueryUserLikeRepoCountParams struct { + Query string `json:"query"` + UserID int64 `json:"user_id"` + Role string `json:"role"` + Signed bool `json:"signed"` + CurUserID int64 `json:"cur_user_id"` +} + +func (q *Queries) GetQueryUserLikeRepoCount(ctx context.Context, arg GetQueryUserLikeRepoCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getQueryUserLikeRepoCount, + arg.Query, + arg.UserID, + arg.Role, + arg.Signed, + arg.CurUserID, + ) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getQueryUserOwnRepoCount = `-- name: GetQueryUserOwnRepoCount :one +SELECT + COUNT(*) +FROM + repos r +JOIN + users as u ON u.user_id=r.user_id +WHERE + (r.fts_repo_en @@ plainto_tsquery($1) OR r.fts_repo_zh @@ plainto_tsquery($1)) AND u.user_id = $2 AND ( + ($3::text='admin' AND $4::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $4::bool) + OR + (r.visibility_level = 'chosen' AND $4::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $5 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $5 AND $4::bool) + ) + ) + ) +` + +type GetQueryUserOwnRepoCountParams struct { + Query string `json:"query"` + UserID int64 `json:"user_id"` + Role string `json:"role"` + Signed bool `json:"signed"` + CurUserID int64 `json:"cur_user_id"` +} + +func (q *Queries) GetQueryUserOwnRepoCount(ctx context.Context, arg GetQueryUserOwnRepoCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getQueryUserOwnRepoCount, + arg.Query, + arg.UserID, + arg.Role, + arg.Signed, + arg.CurUserID, + ) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getRepo = `-- name: GetRepo :one +SELECT repo_id, user_id, git_protocol, git_host, git_username, git_repo, git_access_token, repo_name, repo_description, home_page, sync_token, visibility_level, commit_id, config, theme_sidebar, theme_color, created_at, updated_at, fts_repo_en, fts_repo_zh from repos +WHERE repo_id = $1 +` + +func (q *Queries) GetRepo(ctx context.Context, repoID int64) (Repo, error) { + row := q.db.QueryRow(ctx, getRepo, repoID) + var i Repo + err := row.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + ) + return i, err +} + +const getRepoBasicInfo = `-- name: GetRepoBasicInfo :one +SELECT repos.repo_id, repos.user_id, repos.git_protocol, repos.git_host, repos.git_username, repos.git_repo, repos.git_access_token, repos.repo_name, repos.repo_description, repos.home_page, repos.sync_token, repos.visibility_level, repos.commit_id, repos.config, repos.theme_sidebar, repos.theme_color, repos.created_at, repos.updated_at, repos.fts_repo_en, repos.fts_repo_zh, + users.username, users.email +FROM repos +INNER JOIN users ON repos.user_id = users.user_id +WHERE users.username=$1 AND repos.repo_name=$2 +` + +type GetRepoBasicInfoParams struct { + Username string `json:"username"` + RepoName string `json:"repo_name"` +} + +type GetRepoBasicInfoRow struct { + RepoID int64 `json:"repo_id"` + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + RepoDescription string `json:"repo_description"` + HomePage string `json:"home_page"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel string `json:"visibility_level"` + CommitID string `json:"commit_id"` + Config string `json:"config"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + FtsRepoEn string `json:"fts_repo_en"` + FtsRepoZh string `json:"fts_repo_zh"` + Username string `json:"username"` + Email string `json:"email"` +} + +func (q *Queries) GetRepoBasicInfo(ctx context.Context, arg GetRepoBasicInfoParams) (GetRepoBasicInfoRow, error) { + row := q.db.QueryRow(ctx, getRepoBasicInfo, arg.Username, arg.RepoName) + var i GetRepoBasicInfoRow + err := row.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + &i.Username, + &i.Email, + ) + return i, err +} + +const getRepoByRepoName = `-- name: GetRepoByRepoName :one +SELECT repo_id, repos.user_id, git_protocol, git_host, git_username, git_repo, git_access_token, repo_name, repo_description, home_page, sync_token, visibility_level, commit_id, config, theme_sidebar, theme_color, repos.created_at, repos.updated_at, fts_repo_en, fts_repo_zh, users.user_id, username, email, hashed_password, blocked, verified, motto, user_role, onboarding, users.created_at, users.updated_at, unread_count, unread_count_updated_at, fts_username from repos +JOIN users on users.user_id= repos.user_id +WHERE users.username=$1 AND repos.repo_name=$2 +` + +type GetRepoByRepoNameParams struct { + Username string `json:"username"` + RepoName string `json:"repo_name"` +} + +type GetRepoByRepoNameRow struct { + RepoID int64 `json:"repo_id"` + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + RepoDescription string `json:"repo_description"` + HomePage string `json:"home_page"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel string `json:"visibility_level"` + CommitID string `json:"commit_id"` + Config string `json:"config"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + FtsRepoEn string `json:"fts_repo_en"` + FtsRepoZh string `json:"fts_repo_zh"` + UserID_2 int64 `json:"user_id_2"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt_2 time.Time `json:"created_at_2"` + UpdatedAt_2 time.Time `json:"updated_at_2"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` +} + +func (q *Queries) GetRepoByRepoName(ctx context.Context, arg GetRepoByRepoNameParams) (GetRepoByRepoNameRow, error) { + row := q.db.QueryRow(ctx, getRepoByRepoName, arg.Username, arg.RepoName) + var i GetRepoByRepoNameRow + err := row.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + &i.UserID_2, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt_2, + &i.UpdatedAt_2, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ) + return i, err +} + +const getRepoConfig = `-- name: GetRepoConfig :one +SELECT repos.repo_id,config,repos.user_id,visibility_level,repos.theme_sidebar,repos.theme_color FROM repos +JOIN users on users.user_id = repos.user_id +WHERE users.username=$1 AND repos.repo_name=$2 +` + +type GetRepoConfigParams struct { + Username string `json:"username"` + RepoName string `json:"repo_name"` +} + +type GetRepoConfigRow struct { + RepoID int64 `json:"repo_id"` + Config string `json:"config"` + UserID int64 `json:"user_id"` + VisibilityLevel string `json:"visibility_level"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` +} + +func (q *Queries) GetRepoConfig(ctx context.Context, arg GetRepoConfigParams) (GetRepoConfigRow, error) { + row := q.db.QueryRow(ctx, getRepoConfig, arg.Username, arg.RepoName) + var i GetRepoConfigRow + err := row.Scan( + &i.RepoID, + &i.Config, + &i.UserID, + &i.VisibilityLevel, + &i.ThemeSidebar, + &i.ThemeColor, + ) + return i, err +} + +const getRepoID = `-- name: GetRepoID :one +SELECT repos.repo_id +from repos +JOIN users on users.user_id= repos.user_id +WHERE users.username=$1 AND repos.repo_name=$2 +` + +type GetRepoIDParams struct { + Username string `json:"username"` + RepoName string `json:"repo_name"` +} + +func (q *Queries) GetRepoID(ctx context.Context, arg GetRepoIDParams) (int64, error) { + row := q.db.QueryRow(ctx, getRepoID, arg.Username, arg.RepoName) + var repo_id int64 + err := row.Scan(&repo_id) + return repo_id, err +} + +const getRepoPermission = `-- name: GetRepoPermission :one +SELECT + repos.visibility_level as visibility_level, + users.user_id,users.blocked as user_blocked,users.username, + users.user_role as user_role, + repos.repo_id +FROM + repos +INNER JOIN users ON users.user_id = repos.user_id +WHERE + repo_id = $1 +` + +type GetRepoPermissionRow struct { + VisibilityLevel string `json:"visibility_level"` + UserID int64 `json:"user_id"` + UserBlocked bool `json:"user_blocked"` + Username string `json:"username"` + UserRole string `json:"user_role"` + RepoID int64 `json:"repo_id"` +} + +func (q *Queries) GetRepoPermission(ctx context.Context, repoID int64) (GetRepoPermissionRow, error) { + row := q.db.QueryRow(ctx, getRepoPermission, repoID) + var i GetRepoPermissionRow + err := row.Scan( + &i.VisibilityLevel, + &i.UserID, + &i.UserBlocked, + &i.Username, + &i.UserRole, + &i.RepoID, + ) + return i, err +} + +const listRepo = `-- name: ListRepo :many +SELECT + r.repo_id, r.user_id, r.git_protocol, r.git_host, r.git_username, r.git_repo, r.git_access_token, r.repo_name, r.repo_description, r.home_page, r.sync_token, r.visibility_level, r.commit_id, r.config, r.theme_sidebar, r.theme_color, r.created_at, r.updated_at, r.fts_repo_en, r.fts_repo_zh, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + u.username, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id and repo_relations.relation_type = 'like' and repo_relations.user_id = $3 ) as is_liked +FROM + repos r +JOIN + users u ON u.user_id = r.user_id +WHERE + ($4::text='admin' AND $5::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $5::bool) + OR + (r.visibility_level = 'chosen' AND $5::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $3 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $3 AND $5::bool) + ) + ) + +ORDER BY r.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type ListRepoParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + CurUserID int64 `json:"cur_user_id"` + Role string `json:"role"` + Signed bool `json:"signed"` +} + +type ListRepoRow struct { + RepoID int64 `json:"repo_id"` + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + RepoDescription string `json:"repo_description"` + HomePage string `json:"home_page"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel string `json:"visibility_level"` + CommitID string `json:"commit_id"` + Config string `json:"config"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + FtsRepoEn string `json:"fts_repo_en"` + FtsRepoZh string `json:"fts_repo_zh"` + LikeCount int64 `json:"like_count"` + Username string `json:"username"` + IsLiked bool `json:"is_liked"` +} + +func (q *Queries) ListRepo(ctx context.Context, arg ListRepoParams) ([]ListRepoRow, error) { + rows, err := q.db.Query(ctx, listRepo, + arg.Limit, + arg.Offset, + arg.CurUserID, + arg.Role, + arg.Signed, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListRepoRow{} + for rows.Next() { + var i ListRepoRow + if err := rows.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + &i.LikeCount, + &i.Username, + &i.IsLiked, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listUserLikeRepo = `-- name: ListUserLikeRepo :many +SELECT + r.repo_id, r.user_id, r.git_protocol, r.git_host, r.git_username, r.git_repo, r.git_access_token, r.repo_name, r.repo_description, r.home_page, r.sync_token, r.visibility_level, r.commit_id, r.config, r.theme_sidebar, r.theme_color, r.created_at, r.updated_at, r.fts_repo_en, r.fts_repo_zh,ur.username, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id and repo_relations.relation_type = 'like' and repo_relations.user_id = $3 ) as is_liked +FROM + repos r +JOIN + repo_relations AS rr ON r.repo_id = rr.repo_id +JOIN + users as ur ON ur.user_id=r.user_id -- query user likes repo owner +JOIN + users as uq ON uq.user_id=rr.user_id -- query user +WHERE + uq.user_id = $4 AND rr.relation_type='like' AND ( + ($5::text='admin' AND $6::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND $6::bool) + OR + (r.visibility_level = 'chosen' AND $6::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $3 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $3 AND $6::bool) + ) + ) + ) +ORDER BY r.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type ListUserLikeRepoParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + CurUserID int64 `json:"cur_user_id"` + UserID int64 `json:"user_id"` + Role string `json:"role"` + Signed bool `json:"signed"` +} + +type ListUserLikeRepoRow struct { + RepoID int64 `json:"repo_id"` + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + RepoDescription string `json:"repo_description"` + HomePage string `json:"home_page"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel string `json:"visibility_level"` + CommitID string `json:"commit_id"` + Config string `json:"config"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + FtsRepoEn string `json:"fts_repo_en"` + FtsRepoZh string `json:"fts_repo_zh"` + Username string `json:"username"` + LikeCount int64 `json:"like_count"` + IsLiked bool `json:"is_liked"` +} + +func (q *Queries) ListUserLikeRepo(ctx context.Context, arg ListUserLikeRepoParams) ([]ListUserLikeRepoRow, error) { + rows, err := q.db.Query(ctx, listUserLikeRepo, + arg.Limit, + arg.Offset, + arg.CurUserID, + arg.UserID, + arg.Role, + arg.Signed, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListUserLikeRepoRow{} + for rows.Next() { + var i ListUserLikeRepoRow + if err := rows.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + &i.Username, + &i.LikeCount, + &i.IsLiked, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const listUserOwnRepo = `-- name: ListUserOwnRepo :many +SELECT + r.repo_id, r.user_id, r.git_protocol, r.git_host, r.git_username, r.git_repo, r.git_access_token, r.repo_name, r.repo_description, r.home_page, r.sync_token, r.visibility_level, r.commit_id, r.config, r.theme_sidebar, r.theme_color, r.created_at, r.updated_at, r.fts_repo_en, r.fts_repo_zh, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.relation_type = 'like' AND repo_relations.user_id = $3) AS is_liked +FROM + repos r +JOIN + users as u ON u.user_id=r.user_id +WHERE + u.user_id = $4 AND ( + ($5::text='admin' AND $6::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $6::bool) + OR + (r.visibility_level = 'chosen' AND $6::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $3 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $3 AND $6::bool) + ) + ) + ) +ORDER BY r.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type ListUserOwnRepoParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + CurUserID int64 `json:"cur_user_id"` + UserID int64 `json:"user_id"` + Role string `json:"role"` + Signed bool `json:"signed"` +} + +type ListUserOwnRepoRow struct { + RepoID int64 `json:"repo_id"` + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + RepoDescription string `json:"repo_description"` + HomePage string `json:"home_page"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel string `json:"visibility_level"` + CommitID string `json:"commit_id"` + Config string `json:"config"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + FtsRepoEn string `json:"fts_repo_en"` + FtsRepoZh string `json:"fts_repo_zh"` + LikeCount int64 `json:"like_count"` + IsLiked bool `json:"is_liked"` +} + +func (q *Queries) ListUserOwnRepo(ctx context.Context, arg ListUserOwnRepoParams) ([]ListUserOwnRepoRow, error) { + rows, err := q.db.Query(ctx, listUserOwnRepo, + arg.Limit, + arg.Offset, + arg.CurUserID, + arg.UserID, + arg.Role, + arg.Signed, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListUserOwnRepoRow{} + for rows.Next() { + var i ListUserOwnRepoRow + if err := rows.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + &i.LikeCount, + &i.IsLiked, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryRepo = `-- name: QueryRepo :many +select + r.repo_id, r.user_id, r.git_protocol, r.git_host, r.git_username, r.git_repo, r.git_access_token, r.repo_name, r.repo_description, r.home_page, r.sync_token, r.visibility_level, r.commit_id, r.config, r.theme_sidebar, r.theme_color, r.created_at, r.updated_at, r.fts_repo_en, r.fts_repo_zh, + u.username, + ROUND(ts_rank(r.fts_repo_en, plainto_tsquery($3))) + ROUND(ts_rank(r.fts_repo_zh, plainto_tsquery($3))) as rank +FROM + repos r +JOIN + users u ON u.user_id = r.user_id +where (r.fts_repo_en @@ plainto_tsquery($3) OR r.fts_repo_zh @@ plainto_tsquery($3)) + AND ( + ($4::text='admin' AND $5::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $5::bool) + OR + (r.visibility_level = 'chosen' AND $5::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $6 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $6 AND $5::bool) + ) + ) + ) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryRepoParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Query string `json:"query"` + Role string `json:"role"` + Signed bool `json:"signed"` + CurUserID int64 `json:"cur_user_id"` +} + +type QueryRepoRow struct { + RepoID int64 `json:"repo_id"` + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + RepoDescription string `json:"repo_description"` + HomePage string `json:"home_page"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel string `json:"visibility_level"` + CommitID string `json:"commit_id"` + Config string `json:"config"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + FtsRepoEn string `json:"fts_repo_en"` + FtsRepoZh string `json:"fts_repo_zh"` + Username string `json:"username"` + Rank int32 `json:"rank"` +} + +func (q *Queries) QueryRepo(ctx context.Context, arg QueryRepoParams) ([]QueryRepoRow, error) { + rows, err := q.db.Query(ctx, queryRepo, + arg.Limit, + arg.Offset, + arg.Query, + arg.Role, + arg.Signed, + arg.CurUserID, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryRepoRow{} + for rows.Next() { + var i QueryRepoRow + if err := rows.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + &i.Username, + &i.Rank, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryUserLikeRepo = `-- name: QueryUserLikeRepo :many +SELECT + r.repo_id, r.user_id, r.git_protocol, r.git_host, r.git_username, r.git_repo, r.git_access_token, r.repo_name, r.repo_description, r.home_page, r.sync_token, r.visibility_level, r.commit_id, r.config, r.theme_sidebar, r.theme_color, r.created_at, r.updated_at, r.fts_repo_en, r.fts_repo_zh,ur.username, + ROUND(ts_rank(r.fts_repo_en, plainto_tsquery($3))) + ROUND(ts_rank(r.fts_repo_zh, plainto_tsquery($3))) as rank, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id and repo_relations.relation_type = 'like' and repo_relations.user_id = $4 ) as is_liked +FROM + repos r +JOIN repo_relations AS rr ON r.repo_id = rr.repo_id +JOIN + users as ur ON ur.user_id=r.user_id +JOIN + users as uq ON uq.user_id=rr.user_id +WHERE + (r.fts_repo_en @@ plainto_tsquery($3) OR r.fts_repo_zh @@ plainto_tsquery($3)) AND uq.user_id = $5 AND rr.relation_type='like' AND ( + ($6::text='admin' AND $7::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND $7::bool) + OR + (r.visibility_level = 'chosen' AND $7::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $4 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $4 AND $7::bool) + ) + ) + ) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryUserLikeRepoParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Query string `json:"query"` + CurUserID int64 `json:"cur_user_id"` + UserID int64 `json:"user_id"` + Role string `json:"role"` + Signed bool `json:"signed"` +} + +type QueryUserLikeRepoRow struct { + RepoID int64 `json:"repo_id"` + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + RepoDescription string `json:"repo_description"` + HomePage string `json:"home_page"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel string `json:"visibility_level"` + CommitID string `json:"commit_id"` + Config string `json:"config"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + FtsRepoEn string `json:"fts_repo_en"` + FtsRepoZh string `json:"fts_repo_zh"` + Username string `json:"username"` + Rank int32 `json:"rank"` + LikeCount int64 `json:"like_count"` + IsLiked bool `json:"is_liked"` +} + +func (q *Queries) QueryUserLikeRepo(ctx context.Context, arg QueryUserLikeRepoParams) ([]QueryUserLikeRepoRow, error) { + rows, err := q.db.Query(ctx, queryUserLikeRepo, + arg.Limit, + arg.Offset, + arg.Query, + arg.CurUserID, + arg.UserID, + arg.Role, + arg.Signed, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryUserLikeRepoRow{} + for rows.Next() { + var i QueryUserLikeRepoRow + if err := rows.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + &i.Username, + &i.Rank, + &i.LikeCount, + &i.IsLiked, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryUserOwnRepo = `-- name: QueryUserOwnRepo :many +SELECT + r.repo_id, r.user_id, r.git_protocol, r.git_host, r.git_username, r.git_repo, r.git_access_token, r.repo_name, r.repo_description, r.home_page, r.sync_token, r.visibility_level, r.commit_id, r.config, r.theme_sidebar, r.theme_color, r.created_at, r.updated_at, r.fts_repo_en, r.fts_repo_zh, + ROUND(ts_rank(r.fts_repo_en, plainto_tsquery($3))) + ROUND(ts_rank(r.fts_repo_zh, plainto_tsquery($3))) as rank, + (SELECT COUNT(*) FROM repo_relations WHERE repo_id = r.repo_id and relation_type = 'like') AS like_count, + EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id and repo_relations.relation_type = 'like' and repo_relations.user_id = $4 ) as is_liked +FROM + repos r +JOIN + users as u ON u.user_id=r.user_id +WHERE + (r.fts_repo_en @@ plainto_tsquery($3) OR r.fts_repo_zh @@ plainto_tsquery($3)) AND u.user_id = $5 AND ( + ($6::text='admin' AND $7::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $7::bool) + OR + (r.visibility_level = 'chosen' AND $7::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $4 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $4 AND $7::bool) + ) + ) + ) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryUserOwnRepoParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Query string `json:"query"` + CurUserID int64 `json:"cur_user_id"` + UserID int64 `json:"user_id"` + Role string `json:"role"` + Signed bool `json:"signed"` +} + +type QueryUserOwnRepoRow struct { + RepoID int64 `json:"repo_id"` + UserID int64 `json:"user_id"` + GitProtocol string `json:"git_protocol"` + GitHost string `json:"git_host"` + GitUsername string `json:"git_username"` + GitRepo string `json:"git_repo"` + GitAccessToken pgtype.Text `json:"git_access_token"` + RepoName string `json:"repo_name"` + RepoDescription string `json:"repo_description"` + HomePage string `json:"home_page"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel string `json:"visibility_level"` + CommitID string `json:"commit_id"` + Config string `json:"config"` + ThemeSidebar string `json:"theme_sidebar"` + ThemeColor string `json:"theme_color"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + FtsRepoEn string `json:"fts_repo_en"` + FtsRepoZh string `json:"fts_repo_zh"` + Rank int32 `json:"rank"` + LikeCount int64 `json:"like_count"` + IsLiked bool `json:"is_liked"` +} + +func (q *Queries) QueryUserOwnRepo(ctx context.Context, arg QueryUserOwnRepoParams) ([]QueryUserOwnRepoRow, error) { + rows, err := q.db.Query(ctx, queryUserOwnRepo, + arg.Limit, + arg.Offset, + arg.Query, + arg.CurUserID, + arg.UserID, + arg.Role, + arg.Signed, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryUserOwnRepoRow{} + for rows.Next() { + var i QueryUserOwnRepoRow + if err := rows.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + &i.Rank, + &i.LikeCount, + &i.IsLiked, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateRepoConfig = `-- name: UpdateRepoConfig :exec +UPDATE repos +SET config=$2,commit_id=$3,updated_at=now() +WHERE repo_id = $1 +` + +type UpdateRepoConfigParams struct { + RepoID int64 `json:"repo_id"` + Config string `json:"config"` + CommitID string `json:"commit_id"` +} + +func (q *Queries) UpdateRepoConfig(ctx context.Context, arg UpdateRepoConfigParams) error { + _, err := q.db.Exec(ctx, updateRepoConfig, arg.RepoID, arg.Config, arg.CommitID) + return err +} + +const updateRepoInfo = `-- name: UpdateRepoInfo :one +UPDATE repos +SET +repo_name=COALESCE($1,repo_name), +repo_description=COALESCE($2,repo_description), +sync_token=COALESCE($3,sync_token), +visibility_level=COALESCE($4,visibility_level), +git_access_token=COALESCE($5,git_access_token), +theme_sidebar=COALESCE($6,theme_sidebar), +theme_color=COALESCE($7,theme_color), +home_page=COALESCE($8,home_page) +WHERE repo_id = $9 +RETURNING repo_id, user_id, git_protocol, git_host, git_username, git_repo, git_access_token, repo_name, repo_description, home_page, sync_token, visibility_level, commit_id, config, theme_sidebar, theme_color, created_at, updated_at, fts_repo_en, fts_repo_zh +` + +type UpdateRepoInfoParams struct { + RepoName pgtype.Text `json:"repo_name"` + RepoDescription pgtype.Text `json:"repo_description"` + SyncToken pgtype.Text `json:"sync_token"` + VisibilityLevel pgtype.Text `json:"visibility_level"` + GitAccessToken pgtype.Text `json:"git_access_token"` + ThemeSidebar pgtype.Text `json:"theme_sidebar"` + ThemeColor pgtype.Text `json:"theme_color"` + HomePage pgtype.Text `json:"home_page"` + RepoID int64 `json:"repo_id"` +} + +func (q *Queries) UpdateRepoInfo(ctx context.Context, arg UpdateRepoInfoParams) (Repo, error) { + row := q.db.QueryRow(ctx, updateRepoInfo, + arg.RepoName, + arg.RepoDescription, + arg.SyncToken, + arg.VisibilityLevel, + arg.GitAccessToken, + arg.ThemeSidebar, + arg.ThemeColor, + arg.HomePage, + arg.RepoID, + ) + var i Repo + err := row.Scan( + &i.RepoID, + &i.UserID, + &i.GitProtocol, + &i.GitHost, + &i.GitUsername, + &i.GitRepo, + &i.GitAccessToken, + &i.RepoName, + &i.RepoDescription, + &i.HomePage, + &i.SyncToken, + &i.VisibilityLevel, + &i.CommitID, + &i.Config, + &i.ThemeSidebar, + &i.ThemeColor, + &i.CreatedAt, + &i.UpdatedAt, + &i.FtsRepoEn, + &i.FtsRepoZh, + ) + return i, err +} diff --git a/zbook_backend/db/sqlc/repo_relation.sql.go b/zbook_backend/db/sqlc/repo_relation.sql.go new file mode 100644 index 0000000..4eb932c --- /dev/null +++ b/zbook_backend/db/sqlc/repo_relation.sql.go @@ -0,0 +1,219 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: repo_relation.sql + +package db + +import ( + "context" + "time" +) + +const createRepoRelation = `-- name: CreateRepoRelation :exec +INSERT INTO repo_relations ( + user_id, + repo_id, + relation_type +) VALUES ($1,$2,$3) +` + +type CreateRepoRelationParams struct { + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + RelationType string `json:"relation_type"` +} + +func (q *Queries) CreateRepoRelation(ctx context.Context, arg CreateRepoRelationParams) error { + _, err := q.db.Exec(ctx, createRepoRelation, arg.UserID, arg.RepoID, arg.RelationType) + return err +} + +const deleteRepoRelation = `-- name: DeleteRepoRelation :exec +DELETE FROM repo_relations +WHERE user_id=$1 and repo_id=$2 and relation_type = $3 +` + +type DeleteRepoRelationParams struct { + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + RelationType string `json:"relation_type"` +} + +func (q *Queries) DeleteRepoRelation(ctx context.Context, arg DeleteRepoRelationParams) error { + _, err := q.db.Exec(ctx, deleteRepoRelation, arg.UserID, arg.RepoID, arg.RelationType) + return err +} + +const getRepoRelation = `-- name: GetRepoRelation :one +SELECT relation_id, relation_type, user_id, repo_id, created_at +FROM repo_relations +WHERE user_id = $1 and repo_id=$2 and relation_type = $3 +` + +type GetRepoRelationParams struct { + UserID int64 `json:"user_id"` + RepoID int64 `json:"repo_id"` + RelationType string `json:"relation_type"` +} + +func (q *Queries) GetRepoRelation(ctx context.Context, arg GetRepoRelationParams) (RepoRelation, error) { + row := q.db.QueryRow(ctx, getRepoRelation, arg.UserID, arg.RepoID, arg.RelationType) + var i RepoRelation + err := row.Scan( + &i.RelationID, + &i.RelationType, + &i.UserID, + &i.RepoID, + &i.CreatedAt, + ) + return i, err +} + +const getRepoVisibilityByRepoCount = `-- name: GetRepoVisibilityByRepoCount :one +SELECT COUNT(*) +FROM repos as r +LEFT JOIN repo_relations as rr ON rr.repo_id=r.repo_id +JOIN users as u ON u.user_id = rr.user_id +WHERE r.repo_id=$1 AND rr.relation_type = 'visi' +` + +func (q *Queries) GetRepoVisibilityByRepoCount(ctx context.Context, repoID int64) (int64, error) { + row := q.db.QueryRow(ctx, getRepoVisibilityByRepoCount, repoID) + var count int64 + err := row.Scan(&count) + return count, err +} + +const listRepoVisibilityByRepo = `-- name: ListRepoVisibilityByRepo :many +SELECT u.user_id, u.username, u.email, u.hashed_password, u.blocked, u.verified, u.motto, u.user_role, u.onboarding, u.created_at, u.updated_at, u.unread_count, u.unread_count_updated_at, u.fts_username +FROM repos as r +LEFT JOIN repo_relations as rr ON rr.repo_id=r.repo_id +JOIN users as u ON u.user_id = rr.user_id +WHERE r.repo_id=$3 AND rr.relation_type = 'visi' +ORDER BY rr.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type ListRepoVisibilityByRepoParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + RepoID int64 `json:"repo_id"` +} + +func (q *Queries) ListRepoVisibilityByRepo(ctx context.Context, arg ListRepoVisibilityByRepoParams) ([]User, error) { + rows, err := q.db.Query(ctx, listRepoVisibilityByRepo, arg.Limit, arg.Offset, arg.RepoID) + if err != nil { + return nil, err + } + defer rows.Close() + items := []User{} + for rows.Next() { + var i User + if err := rows.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryRepoVisibilityByRepo = `-- name: QueryRepoVisibilityByRepo :many +SELECT + u.user_id, u.username, u.email, u.hashed_password, u.blocked, u.verified, u.motto, u.user_role, u.onboarding, u.created_at, u.updated_at, u.unread_count, u.unread_count_updated_at, u.fts_username, + CASE WHEN MAX(rr.user_id) IS NOT NULL THEN true ELSE false END AS is_visible +FROM + users as u +LEFT JOIN + repo_relations rr ON rr.user_id = u.user_id AND rr.repo_id=$3 +WHERE u.username=$4 +GROUP BY u.user_id,rr.created_at +ORDER BY rr.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type QueryRepoVisibilityByRepoParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + RepoID int64 `json:"repo_id"` + Username string `json:"username"` +} + +type QueryRepoVisibilityByRepoRow struct { + UserID int64 `json:"user_id"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` + IsVisible bool `json:"is_visible"` +} + +func (q *Queries) QueryRepoVisibilityByRepo(ctx context.Context, arg QueryRepoVisibilityByRepoParams) ([]QueryRepoVisibilityByRepoRow, error) { + rows, err := q.db.Query(ctx, queryRepoVisibilityByRepo, + arg.Limit, + arg.Offset, + arg.RepoID, + arg.Username, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryRepoVisibilityByRepoRow{} + for rows.Next() { + var i QueryRepoVisibilityByRepoRow + if err := rows.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + &i.IsVisible, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/zbook_backend/db/sqlc/repo_relation_test.go b/zbook_backend/db/sqlc/repo_relation_test.go new file mode 100644 index 0000000..a326d8b --- /dev/null +++ b/zbook_backend/db/sqlc/repo_relation_test.go @@ -0,0 +1,134 @@ +package db + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func testCreateRelationUserRepoRelation(t *testing.T, user User, repo Repo, relation string) { + arg := CreateRepoRelationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + RelationType: relation, + } + err := testStore.CreateRepoRelation(context.Background(), arg) + require.NoError(t, err) +} +func testCreateUserRepoRelation(t *testing.T, user User, repo Repo) { + arg := CreateRepoRelationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + RelationType: util.RelationTypeLike, + } + err := testStore.CreateRepoRelation(context.Background(), arg) + require.NoError(t, err) +} +func TestCreateRepoRelation(t *testing.T) { + user := createRandomUser(t) + repo := createRandomRepo(t) + testCreateUserRepoRelation(t, user, repo) +} +func TestDelteRepoRelation(t *testing.T) { + user := createRandomUser(t) + repo := createRandomRepo(t) + arg := CreateRepoRelationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + RelationType: util.RelationTypeLike, + } + err := testStore.CreateRepoRelation(context.Background(), arg) + require.NoError(t, err) + arg_delete := DeleteRepoRelationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + RelationType: util.RelationTypeLike, + } + err = testStore.DeleteRepoRelation(context.Background(), arg_delete) + require.NoError(t, err) +} + +func TestGetRepoRelation(t *testing.T) { + user := createRandomUser(t) + repo := createRandomRepo(t) + arg := CreateRepoRelationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + RelationType: util.RelationTypeLike, + } + err := testStore.CreateRepoRelation(context.Background(), arg) + require.NoError(t, err) + + arg_get := GetRepoRelationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + RelationType: arg.RelationType, + } + relation, err := testStore.GetRepoRelation(context.Background(), arg_get) + require.NoError(t, err) + require.Equal(t, relation.RelationType, arg_get.RelationType) + require.Equal(t, relation.UserID, arg_get.UserID) + require.Equal(t, relation.RepoID, arg_get.RepoID) +} + +func TestGetRepoVisibilityByRepoCount(t *testing.T) { + user := createRandomUser(t) + repo := createRandomRepo(t) + arg := CreateRepoRelationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + RelationType: util.RelationTypeVisi, + } + err := testStore.CreateRepoRelation(context.Background(), arg) + require.NoError(t, err) + + count, err := testStore.GetRepoVisibilityByRepoCount(context.Background(), arg.RepoID) + require.NoError(t, err) + require.Equal(t, count, int64(1)) +} +func TestListRepoVisibilityByRepo(t *testing.T) { + user := createRandomUser(t) + repo := createRandomRepo(t) + arg := CreateRepoRelationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + RelationType: util.RelationTypeVisi, + } + err := testStore.CreateRepoRelation(context.Background(), arg) + require.NoError(t, err) + + arg_list := ListRepoVisibilityByRepoParams{ + Limit: 5, + Offset: 0, + RepoID: arg.RepoID, + } + rets, err := testStore.ListRepoVisibilityByRepo(context.Background(), arg_list) + require.NoError(t, err) + require.Equal(t, len(rets), 1) + require.Equal(t, rets[0].UserID, user.UserID) +} + +func TestQueryRepoVisibilityByRepo(t *testing.T) { + user := createRandomUser(t) + repo := createRandomRepo(t) + arg := CreateRepoRelationParams{ + UserID: user.UserID, + RepoID: repo.RepoID, + RelationType: util.RelationTypeVisi, + } + err := testStore.CreateRepoRelation(context.Background(), arg) + require.NoError(t, err) + + arg_list := QueryRepoVisibilityByRepoParams{ + Limit: 5, + Offset: 0, + RepoID: arg.RepoID, + Username: user.Username, + } + rets, err := testStore.QueryRepoVisibilityByRepo(context.Background(), arg_list) + require.NoError(t, err) + require.Equal(t, len(rets), 1) + require.Equal(t, rets[0].UserID, user.UserID) +} diff --git a/zbook_backend/db/sqlc/repo_test.go b/zbook_backend/db/sqlc/repo_test.go new file mode 100644 index 0000000..7ae291f --- /dev/null +++ b/zbook_backend/db/sqlc/repo_test.go @@ -0,0 +1,742 @@ +package db + +import ( + "context" + "testing" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func createRandomRepo(t *testing.T) Repo { + user := createRandomUser(t) + arg := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: util.RandomString(6), + GitRepo: util.RandomString(6), + GitAccessToken: pgtype.Text{String: "", Valid: true}, + RepoName: util.RandomString(16), + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.RandomRepoVisibility(), + } + repo, err := testStore.CreateRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo.UserID, user.UserID) + require.Equal(t, repo.ThemeColor, arg.ThemeColor) + return repo +} +func TestCreateRepo(t *testing.T) { + createRandomRepo(t) +} +func TestUpdateRepoLayout(t *testing.T) { + repo := createRandomRepo(t) + arg := UpdateRepoConfigParams{ + RepoID: repo.RepoID, + Config: util.RandomString(32), + } + err := testStore.UpdateRepoConfig(context.Background(), arg) + require.NoError(t, err) +} +func TestUpdateRepoInfo(t *testing.T) { + repo := createRandomRepo(t) + arg := UpdateRepoInfoParams{ + RepoID: repo.RepoID, + RepoName: pgtype.Text{String: util.RandomString(6), Valid: true}, + RepoDescription: pgtype.Text{String: util.RandomString(6), Valid: true}, + SyncToken: pgtype.Text{String: util.RandomString(6), Valid: true}, + GitAccessToken: pgtype.Text{String: util.RandomString(6), Valid: true}, + VisibilityLevel: pgtype.Text{String: util.RandomRepoVisibility(), Valid: true}, + } + repo, err := testStore.UpdateRepoInfo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo.RepoID, arg.RepoID) + require.Equal(t, repo.VisibilityLevel, arg.VisibilityLevel.String) +} +func TestDeleteRepo(t *testing.T) { + repo := createRandomRepo(t) + err := testStore.DeleteRepo(context.Background(), repo.RepoID) + require.NoError(t, err) + repo, err = testStore.GetRepo(context.Background(), repo.RepoID) + require.EqualError(t, err, "no rows in result set") + require.Empty(t, repo) +} +func TestGetRepo(t *testing.T) { + user := createRandomUser(t) + arg := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: util.RandomString(6), + GitRepo: util.RandomString(6), + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + GitAccessToken: pgtype.Text{String: "", Valid: true}, + RepoName: util.RandomString(16), + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.VisibilityPublic, + } + repo, err := testStore.CreateRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo.UserID, user.UserID) + repo_ret, err := testStore.GetRepo(context.Background(), repo.RepoID) + require.NoError(t, err) + require.Equal(t, repo_ret.RepoID, repo.RepoID) +} +func TestGetRepoID(t *testing.T) { + user := createRandomUser(t) + arg := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: util.RandomString(6), + GitRepo: util.RandomString(6), + GitAccessToken: pgtype.Text{String: "", Valid: true}, + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + RepoName: util.RandomString(16), + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.VisibilityPublic, + } + repo, err := testStore.CreateRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo.UserID, user.UserID) + arg_get := GetRepoIDParams{ + Username: user.Username, + RepoName: repo.RepoName, + } + repo_id, err := testStore.GetRepoID(context.Background(), arg_get) + require.NoError(t, err) + require.Equal(t, repo_id, repo.RepoID) +} +func TestGetRepoByRepoName(t *testing.T) { + user := createRandomUser(t) + arg := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: util.RandomString(6), + GitRepo: util.RandomString(6), + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + GitAccessToken: pgtype.Text{String: "", Valid: true}, + RepoName: util.RandomString(16), + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.VisibilityPublic, + } + repo, err := testStore.CreateRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo.UserID, user.UserID) + arg_get := GetRepoByRepoNameParams{ + Username: user.Username, + RepoName: repo.RepoName, + } + repo_ret, err := testStore.GetRepoByRepoName(context.Background(), arg_get) + require.NoError(t, err) + require.Equal(t, repo_ret.RepoID, repo.RepoID) +} + +func TestGetRepoLayout(t *testing.T) { + user := createRandomUser(t) + arg := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: util.RandomString(6), + GitRepo: util.RandomString(6), + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + GitAccessToken: pgtype.Text{String: "", Valid: true}, + RepoName: util.RandomString(16), + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.VisibilityPublic, + } + repo, err := testStore.CreateRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo.UserID, user.UserID) + arg_get := GetRepoConfigParams{ + Username: user.Username, + RepoName: repo.RepoName, + } + repo_ret, err := testStore.GetRepoConfig(context.Background(), arg_get) + require.NoError(t, err) + require.Equal(t, repo_ret.RepoID, repo.RepoID) + require.Equal(t, repo_ret.Config, repo.Config) +} + +func TestGetRepoPermission(t *testing.T) { + user := createRandomUser(t) + arg := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: util.RandomString(6), + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + GitRepo: util.RandomString(6), + GitAccessToken: pgtype.Text{String: "", Valid: true}, + RepoName: util.RandomString(16), + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.VisibilityPublic, + } + repo, err := testStore.CreateRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo.UserID, user.UserID) + repo_ret, err := testStore.GetRepoPermission(context.Background(), repo.RepoID) + require.NoError(t, err) + require.Equal(t, repo_ret.RepoID, repo.RepoID) + require.Equal(t, repo_ret.VisibilityLevel, repo.VisibilityLevel) +} +func TestGetRepoBasicInfo(t *testing.T) { + user := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + repo := createUserRandomRepo(t, user) + testStore.CreateRepoRelation(context.Background(), CreateRepoRelationParams{UserID: user.UserID, RepoID: repo.RepoID, RelationType: util.RelationTypeLike}) + testStore.CreateRepoRelation(context.Background(), CreateRepoRelationParams{UserID: user2.UserID, RepoID: repo.RepoID, RelationType: util.RelationTypeLike}) + testStore.CreateRepoRelation(context.Background(), CreateRepoRelationParams{UserID: user3.UserID, RepoID: repo.RepoID, RelationType: util.RelationTypeDislike}) + testStore.CreateRepoRelation(context.Background(), CreateRepoRelationParams{UserID: user4.UserID, RepoID: repo.RepoID, RelationType: util.RelationTypeDislike}) + { + arg := GetRepoBasicInfoParams{ + Username: user.Username, + RepoName: repo.RepoName, + } + repo_info, err := testStore.GetRepoBasicInfo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo_info.RepoID, repo.RepoID) + require.Equal(t, repo_info.VisibilityLevel, repo.VisibilityLevel) + } + +} + +func TestGetQueryRepoCount(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + repo1 := createUserRandomRepo(t, user1) + arg_update := UpdateRepoInfoParams{ + RepoID: repo1.RepoID, + VisibilityLevel: pgtype.Text{String: util.VisibilityPublic, Valid: true}, + } + testStore.UpdateRepoInfo(context.Background(), arg_update) + arg := GetQueryRepoCountParams{ + Query: repo1.RepoName, + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + count1, err := testStore.GetQueryRepoCount(context.Background(), arg) + require.NoError(t, err) + require.True(t, count1 > 0) +} + +func TestQueryRepo(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + repo1 := createUserRandomRepo(t, user1) + arg_update := UpdateRepoInfoParams{ + RepoID: repo1.RepoID, + VisibilityLevel: pgtype.Text{String: util.VisibilityPublic, Valid: true}, + } + testStore.UpdateRepoInfo(context.Background(), arg_update) + + arg := QueryRepoParams{ + Limit: 5, + Offset: 0, + Query: repo1.RepoName, + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + count1, err := testStore.QueryRepo(context.Background(), arg) + require.NoError(t, err) + require.True(t, len(count1) > 0) +} + +func TestGetListRepoCount(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + repo := createUserRandomRepo(t, user1) + arg_update := UpdateRepoInfoParams{ + RepoID: repo.RepoID, + VisibilityLevel: pgtype.Text{String: util.VisibilityPublic, Valid: true}, + } + testStore.UpdateRepoInfo(context.Background(), arg_update) + arg := GetListRepoCountParams{ + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + count1, err := testStore.GetListRepoCount(context.Background(), arg) + require.NoError(t, err) + repo2 := createUserRandomRepo(t, user1) + + arg_update = UpdateRepoInfoParams{ + RepoID: repo2.RepoID, + VisibilityLevel: pgtype.Text{String: util.VisibilityPublic, Valid: true}, + } + testStore.UpdateRepoInfo(context.Background(), arg_update) + count2, err := testStore.GetListRepoCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count2, count1+1) + + arg_update = UpdateRepoInfoParams{ + RepoID: repo2.RepoID, + VisibilityLevel: pgtype.Text{String: util.VisibilityPrivate, Valid: true}, + } + testStore.UpdateRepoInfo(context.Background(), arg_update) + count3, err := testStore.GetListRepoCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count3, count1) + +} + +func TestListRepo(t *testing.T) { + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + repo12 := createUserRandomRepo(t, user1) + repo13 := createUserRandomRepo(t, user1) + repo14 := createUserRandomRepo(t, user1) + repo21 := createUserRandomRepo(t, user2) + repo22 := createUserRandomRepo(t, user2) + repo31 := createUserRandomRepo(t, user3) + repo32 := createUserRandomRepo(t, user3) + updateRepoVisibility(t, repo11, util.VisibilityPrivate) + updateRepoVisibility(t, repo12, util.VisibilityPublic) + updateRepoVisibility(t, repo13, util.VisibilityPublic) + updateRepoVisibility(t, repo14, util.VisibilitySigned) + + updateRepoVisibility(t, repo21, util.VisibilityPrivate) + updateRepoVisibility(t, repo22, util.VisibilityPublic) + updateRepoVisibility(t, repo31, util.VisibilityPublic) + updateRepoVisibility(t, repo32, util.VisibilitySigned) + arg := ListRepoParams{Limit: 10, Offset: 0, CurUserID: user1.UserID, Role: util.UserRole, Signed: true} + repos, err := testStore.ListRepo(context.Background(), arg) + require.NoError(t, err) + require.True(t, len(repos) >= 6) + require.Equal(t, repos[0].RepoID, repo32.RepoID) +} + +func TestGetQueryUserOwnRepoCount(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + updateRepoVisibility(t, repo11, util.VisibilityPublic) + arg := GetQueryUserOwnRepoCountParams{ + Query: repo11.RepoName, + UserID: user1.UserID, + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + count1, err := testStore.GetQueryUserOwnRepoCount(context.Background(), arg) + require.NoError(t, err) + updateRepoVisibility(t, repo11, util.VisibilityPrivate) + arg = GetQueryUserOwnRepoCountParams{ + Query: repo11.RepoName, + UserID: user1.UserID, + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + count2, err := testStore.GetQueryUserOwnRepoCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count1, int64(1)) + require.Equal(t, count2, int64(0)) +} +func TestQueryUserOwnRepo(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + updateRepoVisibility(t, repo11, util.VisibilityPublic) + arg := QueryUserOwnRepoParams{ + Limit: 5, + Offset: 0, + Query: repo11.RepoName, + UserID: user1.UserID, + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + repos1, err := testStore.QueryUserOwnRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 1, len(repos1)) +} + +func TestGetListUserOwnRepoCount(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + updateRepoVisibility(t, repo11, util.VisibilityPublic) + arg := GetListUserOwnRepoCountParams{ + UserID: user1.UserID, + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + count1, err := testStore.GetListUserOwnRepoCount(context.Background(), arg) + require.NoError(t, err) + updateRepoVisibility(t, repo11, util.VisibilityPrivate) + arg = GetListUserOwnRepoCountParams{ + UserID: user1.UserID, + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + count2, err := testStore.GetListUserOwnRepoCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count1, int64(1)) + require.Equal(t, count2, int64(0)) +} +func TestListUserOwnRepo(t *testing.T) { + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + repo12 := createUserRandomRepo(t, user1) + repo13 := createUserRandomRepo(t, user1) + repo14 := createUserRandomRepo(t, user1) + repo21 := createUserRandomRepo(t, user2) + repo22 := createUserRandomRepo(t, user2) + repo31 := createUserRandomRepo(t, user3) + repo32 := createUserRandomRepo(t, user3) + updateRepoVisibility(t, repo11, util.VisibilityPrivate) + updateRepoVisibility(t, repo12, util.VisibilityPublic) + updateRepoVisibility(t, repo13, util.VisibilityChosed) + updateRepoVisibility(t, repo14, util.VisibilitySigned) + + updateRepoVisibility(t, repo21, util.VisibilityPrivate) + updateRepoVisibility(t, repo22, util.VisibilityPublic) + updateRepoVisibility(t, repo31, util.VisibilityPublic) + updateRepoVisibility(t, repo32, util.VisibilitySigned) + + { + // other in group + arg_visiblility := CreateRepoRelationParams{ + UserID: user2.UserID, + RepoID: repo13.RepoID, + RelationType: util.RelationTypeVisi, + } + testStore.CreateRepoRelation(context.Background(), arg_visiblility) + arg := ListUserOwnRepoParams{ + Limit: 10, + Offset: 0, + UserID: user1.UserID, + Role: util.UserRole, + Signed: true, + CurUserID: user2.UserID, + } + repos, err := testStore.ListUserOwnRepo(context.Background(), arg) + require.NoError(t, err) + require.True(t, len(repos) == 3) + + } + + { + // self + arg := ListUserOwnRepoParams{ + Limit: 10, + Offset: 0, + UserID: user1.UserID, + Role: util.UserRole, + Signed: true, + CurUserID: user1.UserID, + } + repos, err := testStore.ListUserOwnRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, len(repos), 4) + } + + { + // signed other + arg := ListUserOwnRepoParams{ + Limit: 10, + Offset: 0, + UserID: user1.UserID, + Role: user4.UserRole, + Signed: true, + CurUserID: user4.UserID, + } + repos, err := testStore.ListUserOwnRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, len(repos), 2) + } + + { + // sign out + arg := ListUserOwnRepoParams{ + Limit: 10, + Offset: 0, + UserID: user1.UserID, + Role: util.UserRole, + Signed: false, + CurUserID: 0, + } + repos, err := testStore.ListUserOwnRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, len(repos), 1) + } +} + +func TestGetListUserLikeRepoCount(t *testing.T) { + + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + repo12 := createUserRandomRepo(t, user1) + repo13 := createUserRandomRepo(t, user1) + repo14 := createUserRandomRepo(t, user1) + repo21 := createUserRandomRepo(t, user2) + repo22 := createUserRandomRepo(t, user2) + repo31 := createUserRandomRepo(t, user3) + repo32 := createUserRandomRepo(t, user3) + + testCreateRelationUserRepoRelation(t, user1, repo11, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo12, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo13, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo14, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo21, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo22, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo31, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo32, util.RelationTypeLike) + + updateRepoVisibility(t, repo11, util.VisibilityPrivate) + updateRepoVisibility(t, repo12, util.VisibilityPublic) + updateRepoVisibility(t, repo13, util.VisibilityChosed) + updateRepoVisibility(t, repo14, util.VisibilitySigned) + + updateRepoVisibility(t, repo21, util.VisibilityPrivate) + updateRepoVisibility(t, repo22, util.VisibilityPublic) + updateRepoVisibility(t, repo31, util.VisibilityPublic) + updateRepoVisibility(t, repo32, util.VisibilitySigned) + + { + // sign out + arg := GetListUserLikeRepoCountParams{ + UserID: user1.UserID, + Role: util.RandomUserRole(), + Signed: false, + CurUserID: 0, + } + counts, err := testStore.GetListUserLikeRepoCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, counts, int64(3)) + } + + { + // signed + arg := GetListUserLikeRepoCountParams{ + UserID: user1.UserID, + Role: user4.UserRole, + Signed: true, + CurUserID: user4.UserID, + } + counts, err := testStore.GetListUserLikeRepoCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, counts, int64(5)) + } + + { + // other in group + arg := GetListUserLikeRepoCountParams{ + UserID: user1.UserID, + Role: user2.UserRole, + Signed: true, + CurUserID: user2.UserID, + } + counts, err := testStore.GetListUserLikeRepoCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, counts, int64(6)) + } + + { + // self + arg := GetListUserLikeRepoCountParams{ + UserID: user1.UserID, + Role: user1.UserRole, + Signed: true, + CurUserID: user1.UserID, + } + counts, err := testStore.GetListUserLikeRepoCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, counts, int64(7)) + } +} +func TestListUserLikeRepo(t *testing.T) { + + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + user4 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + repo12 := createUserRandomRepo(t, user1) + repo13 := createUserRandomRepo(t, user1) + repo14 := createUserRandomRepo(t, user1) + repo21 := createUserRandomRepo(t, user2) + repo22 := createUserRandomRepo(t, user2) + repo31 := createUserRandomRepo(t, user3) + repo32 := createUserRandomRepo(t, user3) + + testCreateRelationUserRepoRelation(t, user1, repo11, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo12, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo13, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo14, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo21, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo22, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo31, util.RelationTypeLike) + testCreateRelationUserRepoRelation(t, user1, repo32, util.RelationTypeLike) + + updateRepoVisibility(t, repo11, util.VisibilityPrivate) + updateRepoVisibility(t, repo12, util.VisibilityPublic) + updateRepoVisibility(t, repo13, util.VisibilityChosed) + updateRepoVisibility(t, repo14, util.VisibilitySigned) + + updateRepoVisibility(t, repo21, util.VisibilityPrivate) + updateRepoVisibility(t, repo22, util.VisibilityPublic) + updateRepoVisibility(t, repo31, util.VisibilityPublic) + updateRepoVisibility(t, repo32, util.VisibilitySigned) + + { + // sign out + arg := ListUserLikeRepoParams{ + Limit: 10, + Offset: 0, + UserID: user1.UserID, + Role: util.RandomUserRole(), + Signed: false, + CurUserID: 0, + } + repos, err := testStore.ListUserLikeRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, len(repos), 3) + } + + { + // signed + arg := ListUserLikeRepoParams{ + Limit: 10, + Offset: 0, + UserID: user1.UserID, + Role: user4.UserRole, + Signed: true, + CurUserID: user4.UserID, + } + repos, err := testStore.ListUserLikeRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, len(repos), 5) + } + + { + // other in group + arg := ListUserLikeRepoParams{ + Limit: 10, + Offset: 0, + UserID: user1.UserID, + Role: user2.UserRole, + Signed: true, + CurUserID: user2.UserID, + } + repos, err := testStore.ListUserLikeRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, len(repos), 6) + } + + { + // self + arg := ListUserLikeRepoParams{ + Limit: 10, + Offset: 0, + UserID: user1.UserID, + Role: user1.UserRole, + Signed: true, + CurUserID: user1.UserID, + } + repos, err := testStore.ListUserLikeRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, len(repos), 7) + } +} + +func TestQueryUserLikeRepoCount(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + testCreateRelationUserRepoRelation(t, user1, repo11, util.RelationTypeLike) + updateRepoVisibility(t, repo11, util.VisibilityPublic) + arg := GetQueryUserLikeRepoCountParams{ + Query: repo11.RepoName, + UserID: user1.UserID, + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + counts, err := testStore.GetQueryUserLikeRepoCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, int64(1), counts) +} + +func TestQueryUserLikeRepo(t *testing.T) { + cur_user := createRandomUser(t) + user1 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + testCreateRelationUserRepoRelation(t, user1, repo11, util.RelationTypeLike) + updateRepoVisibility(t, repo11, util.VisibilityPublic) + arg := QueryUserLikeRepoParams{ + Limit: 5, + Offset: 0, + Query: repo11.RepoName, + UserID: user1.UserID, + Role: cur_user.UserRole, + Signed: true, + CurUserID: cur_user.UserID, + } + repos1, err := testStore.QueryUserLikeRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 1, len(repos1)) +} + +func createUserRandomRepo(t *testing.T, user User) Repo { + arg := CreateRepoParams{ + UserID: user.UserID, + GitProtocol: "http", + GitHost: "github.com", + GitUsername: "zizdlp", + GitRepo: "zbook-user-guide", + ThemeSidebar: util.ThemeSideBarFold, + ThemeColor: util.ThemeColorSky, + GitAccessToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + RepoName: util.RandomString(16), + RepoDescription: util.RandomString(200), + SyncToken: pgtype.Text{String: util.RandomString(32), Valid: true}, + VisibilityLevel: util.RandomRepoVisibility(), + } + repo, err := testStore.CreateRepo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo.UserID, user.UserID) + return repo +} +func updateRepoVisibility(t *testing.T, repo Repo, visibility string) { + arg := UpdateRepoInfoParams{ + RepoID: repo.RepoID, + VisibilityLevel: pgtype.Text{String: visibility, Valid: true}, + } + repo, err := testStore.UpdateRepoInfo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, repo.RepoID, arg.RepoID) + require.Equal(t, repo.VisibilityLevel, arg.VisibilityLevel.String) +} diff --git a/zbook_backend/db/sqlc/session.sql.go b/zbook_backend/db/sqlc/session.sql.go new file mode 100644 index 0000000..a1ba9f9 --- /dev/null +++ b/zbook_backend/db/sqlc/session.sql.go @@ -0,0 +1,314 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: session.sql + +package db + +import ( + "context" + "time" + + "github.com/google/uuid" + "github.com/jackc/pgx/v5/pgtype" +) + +const createSession = `-- name: CreateSession :one +INSERT INTO sessions ( + session_id, + user_id, + refresh_token, + user_agent, + client_ip, + expires_at +) VALUES ( + $1, $2, $3, $4, $5, $6 +) RETURNING session_id, user_id, refresh_token, user_agent, client_ip, expires_at, created_at +` + +type CreateSessionParams struct { + SessionID uuid.UUID `json:"session_id"` + UserID int64 `json:"user_id"` + RefreshToken string `json:"refresh_token"` + UserAgent string `json:"user_agent"` + ClientIp string `json:"client_ip"` + ExpiresAt time.Time `json:"expires_at"` +} + +func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (Session, error) { + row := q.db.QueryRow(ctx, createSession, + arg.SessionID, + arg.UserID, + arg.RefreshToken, + arg.UserAgent, + arg.ClientIp, + arg.ExpiresAt, + ) + var i Session + err := row.Scan( + &i.SessionID, + &i.UserID, + &i.RefreshToken, + &i.UserAgent, + &i.ClientIp, + &i.ExpiresAt, + &i.CreatedAt, + ) + return i, err +} + +const getDailyActiveUserCount = `-- name: GetDailyActiveUserCount :many +SELECT (created_at AT TIME ZONE $1)::date AS registration_date, COUNT(DISTINCT user_id) AS active_users_count +FROM sessions +WHERE (created_at AT TIME ZONE $1) >= (CURRENT_DATE AT TIME ZONE $1) - ($2 || ' days')::INTERVAL +GROUP BY registration_date +ORDER BY registration_date DESC +` + +type GetDailyActiveUserCountParams struct { + Timezone string `json:"timezone"` + IntervalDays pgtype.Text `json:"interval_days"` +} + +type GetDailyActiveUserCountRow struct { + RegistrationDate pgtype.Date `json:"registration_date"` + ActiveUsersCount int64 `json:"active_users_count"` +} + +func (q *Queries) GetDailyActiveUserCount(ctx context.Context, arg GetDailyActiveUserCountParams) ([]GetDailyActiveUserCountRow, error) { + rows, err := q.db.Query(ctx, getDailyActiveUserCount, arg.Timezone, arg.IntervalDays) + if err != nil { + return nil, err + } + defer rows.Close() + items := []GetDailyActiveUserCountRow{} + for rows.Next() { + var i GetDailyActiveUserCountRow + if err := rows.Scan(&i.RegistrationDate, &i.ActiveUsersCount); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getListSessionCount = `-- name: GetListSessionCount :one +SELECT Count(*) FROM sessions +` + +func (q *Queries) GetListSessionCount(ctx context.Context) (int64, error) { + row := q.db.QueryRow(ctx, getListSessionCount) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getQuerySessionCount = `-- name: GetQuerySessionCount :one +select Count(*) +FROM + sessions +JOIN users ON users.user_id = sessions.user_id +WHERE fts_username @@ plainto_tsquery($1) +` + +func (q *Queries) GetQuerySessionCount(ctx context.Context, query string) (int64, error) { + row := q.db.QueryRow(ctx, getQuerySessionCount, query) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getSession = `-- name: GetSession :one +SELECT session_id, user_id, refresh_token, user_agent, client_ip, expires_at, created_at FROM sessions +WHERE session_id = $1 LIMIT 1 +` + +func (q *Queries) GetSession(ctx context.Context, sessionID uuid.UUID) (Session, error) { + row := q.db.QueryRow(ctx, getSession, sessionID) + var i Session + err := row.Scan( + &i.SessionID, + &i.UserID, + &i.RefreshToken, + &i.UserAgent, + &i.ClientIp, + &i.ExpiresAt, + &i.CreatedAt, + ) + return i, err +} + +const listSession = `-- name: ListSession :many +SELECT + session_id, sessions.user_id, refresh_token, user_agent, client_ip, expires_at, sessions.created_at, users.user_id, username, email, hashed_password, blocked, verified, motto, user_role, onboarding, users.created_at, updated_at, unread_count, unread_count_updated_at, fts_username +FROM + sessions +INNER JOIN users ON users.user_id = sessions.user_id +ORDER BY sessions.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type ListSessionParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` +} + +type ListSessionRow struct { + SessionID uuid.UUID `json:"session_id"` + UserID int64 `json:"user_id"` + RefreshToken string `json:"refresh_token"` + UserAgent string `json:"user_agent"` + ClientIp string `json:"client_ip"` + ExpiresAt time.Time `json:"expires_at"` + CreatedAt time.Time `json:"created_at"` + UserID_2 int64 `json:"user_id_2"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt_2 time.Time `json:"created_at_2"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` +} + +func (q *Queries) ListSession(ctx context.Context, arg ListSessionParams) ([]ListSessionRow, error) { + rows, err := q.db.Query(ctx, listSession, arg.Limit, arg.Offset) + if err != nil { + return nil, err + } + defer rows.Close() + items := []ListSessionRow{} + for rows.Next() { + var i ListSessionRow + if err := rows.Scan( + &i.SessionID, + &i.UserID, + &i.RefreshToken, + &i.UserAgent, + &i.ClientIp, + &i.ExpiresAt, + &i.CreatedAt, + &i.UserID_2, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt_2, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const querySession = `-- name: QuerySession :many +SELECT + sessions.session_id, sessions.user_id, sessions.refresh_token, sessions.user_agent, sessions.client_ip, sessions.expires_at, sessions.created_at, + ts_rank(users.fts_username, plainto_tsquery($3)) as rank, + users.user_id, users.username, users.email, users.hashed_password, users.blocked, users.verified, users.motto, users.user_role, users.onboarding, users.created_at, users.updated_at, users.unread_count, users.unread_count_updated_at, users.fts_username +FROM + sessions +JOIN users ON users.user_id = sessions.user_id +WHERE fts_username @@ plainto_tsquery($3) +ORDER BY + rank DESC, + sessions.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type QuerySessionParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Query string `json:"query"` +} + +type QuerySessionRow struct { + SessionID uuid.UUID `json:"session_id"` + UserID int64 `json:"user_id"` + RefreshToken string `json:"refresh_token"` + UserAgent string `json:"user_agent"` + ClientIp string `json:"client_ip"` + ExpiresAt time.Time `json:"expires_at"` + CreatedAt time.Time `json:"created_at"` + Rank float32 `json:"rank"` + UserID_2 int64 `json:"user_id_2"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt_2 time.Time `json:"created_at_2"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` +} + +func (q *Queries) QuerySession(ctx context.Context, arg QuerySessionParams) ([]QuerySessionRow, error) { + rows, err := q.db.Query(ctx, querySession, arg.Limit, arg.Offset, arg.Query) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QuerySessionRow{} + for rows.Next() { + var i QuerySessionRow + if err := rows.Scan( + &i.SessionID, + &i.UserID, + &i.RefreshToken, + &i.UserAgent, + &i.ClientIp, + &i.ExpiresAt, + &i.CreatedAt, + &i.Rank, + &i.UserID_2, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt_2, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/zbook_backend/db/sqlc/session_test.go b/zbook_backend/db/sqlc/session_test.go new file mode 100644 index 0000000..bfc60bc --- /dev/null +++ b/zbook_backend/db/sqlc/session_test.go @@ -0,0 +1,120 @@ +package db + +import ( + "context" + "testing" + "time" + + "github.com/google/uuid" + "github.com/jackc/pgx/v5/pgtype" + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func createRandomSession(t *testing.T, user User) Session { + arg := CreateSessionParams{ + SessionID: uuid.New(), + UserID: user.UserID, + RefreshToken: util.RandomString(32), + UserAgent: util.RandomString(6), + ClientIp: util.RandomString(6), + ExpiresAt: time.Now(), + } + + session, err := testStore.CreateSession(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, session) + require.Equal(t, arg.SessionID, session.SessionID) + require.Equal(t, arg.UserAgent, session.UserAgent) + require.Equal(t, arg.UserID, session.UserID) + require.Equal(t, arg.RefreshToken, session.RefreshToken) + require.Equal(t, arg.ClientIp, session.ClientIp) + require.NotZero(t, user.CreatedAt) + return session +} + +func TestCreateSession(t *testing.T) { + user := createRandomUser(t) + createRandomSession(t, user) +} + +func TestGetSession(t *testing.T) { + user := createRandomUser(t) + session := createRandomSession(t, user) + + session2, err := testStore.GetSession(context.Background(), session.SessionID) + require.NoError(t, err) + require.NotEmpty(t, session2) + require.Equal(t, session2.SessionID, session.SessionID) +} + +func TestGetListSessionCount(t *testing.T) { + user := createRandomUser(t) + createRandomSession(t, user) + count1, err := testStore.GetListSessionCount(context.Background()) + require.NoError(t, err) + createRandomSession(t, user) + count2, err := testStore.GetListSessionCount(context.Background()) + require.NoError(t, err) + require.Equal(t, count2, count1+1) +} +func TestListSession(t *testing.T) { + user := createRandomUser(t) + session1 := createRandomSession(t, user) + session2 := createRandomSession(t, user) + arg := ListSessionParams{ + Limit: 2, + Offset: 0, + } + sessions, err := testStore.ListSession(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 2, len(sessions)) + require.Equal(t, sessions[0].SessionID, session2.SessionID) + require.Equal(t, sessions[1].SessionID, session1.SessionID) +} + +func TestGetQuerySessionCount(t *testing.T) { + user := createRandomUser(t) + createRandomSession(t, user) + count1, err := testStore.GetQuerySessionCount(context.Background(), user.Username) + require.NoError(t, err) + createRandomSession(t, user) + count2, err := testStore.GetQuerySessionCount(context.Background(), user.Username) + require.NoError(t, err) + require.Equal(t, count2, count1+1) +} +func TestQuerySession(t *testing.T) { + user := createRandomUser(t) + session1 := createRandomSession(t, user) + session2 := createRandomSession(t, user) + arg := QuerySessionParams{ + Limit: 2, + Offset: 0, + Query: user.Username, + } + sessions, err := testStore.QuerySession(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, 2, len(sessions)) + require.Equal(t, sessions[0].SessionID, session2.SessionID) + require.Equal(t, sessions[1].SessionID, session1.SessionID) +} + +func TestGetDailyActiveUserCount(t *testing.T) { + user := createRandomUser(t) + createRandomSession(t, user) + timezone := "America/New_York" + arg := GetDailyActiveUserCountParams{ + Timezone: timezone, + IntervalDays: pgtype.Text{String: "7", Valid: true}, + } + count1, err := testStore.GetDailyActiveUserCount(context.Background(), arg) + require.NoError(t, err) + require.True(t, len(count1) > 0) + + user2 := createRandomUser(t) + createRandomSession(t, user2) + count2, err := testStore.GetDailyActiveUserCount(context.Background(), arg) + require.NoError(t, err) + require.True(t, len(count2) > 0) + require.Equal(t, count2[0].ActiveUsersCount, count1[0].ActiveUsersCount+1) +} diff --git a/zbook_backend/db/sqlc/store.go b/zbook_backend/db/sqlc/store.go new file mode 100644 index 0000000..8e563a3 --- /dev/null +++ b/zbook_backend/db/sqlc/store.go @@ -0,0 +1,36 @@ +package db + +import ( + "context" + + "github.com/jackc/pgx/v5/pgxpool" +) + +type Store interface { + Querier + CreateUserTx(ctx context.Context, arg CreateUserTxParams) (CreateUserTxResult, error) + VerifyEmailTx(ctx context.Context, verification_url string) (User, error) + CreateFollowTx(ctx context.Context, arg CreateFollowTxParams) (CreateFollowTxResult, error) + DeleteFollowTx(ctx context.Context, arg DeleteFollowTxParams) (DeleteFollowTxResult, error) + CreateCommentTx(ctx context.Context, arg CreateCommentTxParams) (CreateCommentTxResult, error) + DeleteRepoTx(ctx context.Context, arg DeleteRepoTxParams) error + DeleteUserTx(ctx context.Context, arg DeleteUserTxParams) error + CreateSystemNotificationTx(ctx context.Context, arg CreateSystemNotificationTxParams) error + CreateRepoTx(ctx context.Context, arg CreateRepoTxParams) (CreateRepoTxResult, error) + ManualSyncRepoTx(ctx context.Context, arg ManualSyncRepoTxParams) error + ResetPasswordTx(ctx context.Context, arg ResetPasswordTxParams) error +} + +// SQLstore provides all functions to execute SQL queries and transactions +type SQLStore struct { + connPool *pgxpool.Pool + *Queries +} + +// NewStore creates a new store +func NewStore(connPool *pgxpool.Pool) Store { + return &SQLStore{ + connPool: connPool, + Queries: New(connPool), + } +} diff --git a/zbook_backend/db/sqlc/tx_create_comment.go b/zbook_backend/db/sqlc/tx_create_comment.go new file mode 100644 index 0000000..29ef1cc --- /dev/null +++ b/zbook_backend/db/sqlc/tx_create_comment.go @@ -0,0 +1,127 @@ +package db + +import ( + "context" + "fmt" + + "github.com/jackc/pgx/v5/pgtype" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type CreateCommentTxParams struct { + UserID int64 + MarkdownID int64 + ParentID int64 + RootID int64 + CommentContent string +} + +type CreateCommentTxResult struct { + Comment Comment +} + +func (store *SQLStore) CreateCommentTx(ctx context.Context, arg CreateCommentTxParams) (CreateCommentTxResult, error) { + var result CreateCommentTxResult + + err := store.execTx(ctx, func(q *Queries) error { + var err error + + comment, err := q.GetMarkdownByID(ctx, arg.MarkdownID) + if err != nil { + return err + } + arg_create := CreateCommentParams{ + UserID: arg.UserID, + RepoID: comment.RepoID, + MarkdownID: arg.MarkdownID, + ParentID: pgtype.Int8{Int64: arg.ParentID, Valid: arg.ParentID != 0}, + RootID: pgtype.Int8{Int64: arg.RootID, Valid: arg.RootID != 0}, + CommentContent: arg.CommentContent, + } + result.Comment, err = q.CreateComment(ctx, arg_create) + + if err != nil { + if ErrorCode(err) == UniqueViolation || ErrorCode(err) == ForeignKeyViolation { + return status.Errorf(codes.AlreadyExists, "Comment already exist: %s", err) + } + + return status.Errorf(codes.Internal, "fail to create Comment: %s", err) + } + + // 父评论user,root 评论user,repo user + // notify post owner + if comment.UserID != arg_create.UserID { + arg_noti_post := CreateCommentNotificationParams{ + UserID: comment.UserID, + CommentID: result.Comment.CommentID, + } + _, err = q.CreateCommentNotification(ctx, arg_noti_post) + if err != nil { + fmt.Println("mydebug:create post comment noti error:", err) + return err + } else { + err = q.UpdateUnreadCount(ctx, comment.UserID) + if err != nil { + fmt.Println("mydebug:update unread count error:", err) + return err + } + } + } + + if arg_create.ParentID.Valid { + // parentid 应该校验 + pcomment, err := q.GetCommentBasicInfo(ctx, arg_create.ParentID.Int64) + if err != nil { + return err + } + + if pcomment.MarkdownID != result.Comment.MarkdownID { + return status.Errorf(codes.Internal, "pcomment error: pcomment not belong to this post") + } + + // notify pcomment user, + if pcomment.UserID != comment.UserID && pcomment.UserID != arg_create.UserID { + arg_noti := CreateCommentNotificationParams{ + UserID: pcomment.UserID, + CommentID: result.Comment.CommentID, + } + _, err = q.CreateCommentNotification(ctx, arg_noti) + if err != nil { + return err + } + err = q.UpdateUnreadCount(ctx, pcomment.UserID) + if err != nil { + fmt.Println("mydebug:update unread count error:", err) + return err + } + } + + // noti root comment user + if pcomment.RootID.Valid && pcomment.RootID.Int64 != pcomment.CommentID { + // rootid 应该校验 + rootComment, err := q.GetCommentBasicInfo(ctx, pcomment.RootID.Int64) + if err != nil { + return err + } + if rootComment.UserID != pcomment.UserID && rootComment.UserID != comment.UserID && rootComment.UserID != arg_create.UserID { + arg_noti := CreateCommentNotificationParams{ + UserID: rootComment.UserID, + CommentID: result.Comment.CommentID, + } + _, err = q.CreateCommentNotification(ctx, arg_noti) + if err != nil { + return err + } + err = q.UpdateUnreadCount(ctx, rootComment.UserID) + if err != nil { + return err + } + } + } + } + return nil + }) + + return result, err +} diff --git a/zbook_backend/db/sqlc/tx_create_follow.go b/zbook_backend/db/sqlc/tx_create_follow.go new file mode 100644 index 0000000..5fedede --- /dev/null +++ b/zbook_backend/db/sqlc/tx_create_follow.go @@ -0,0 +1,43 @@ +package db + +import ( + "context" +) + +type CreateFollowTxParams struct { + CreateFollowParams +} + +type CreateFollowTxResult struct { + Follow Follow +} + +func (store *SQLStore) CreateFollowTx(ctx context.Context, arg CreateFollowTxParams) (CreateFollowTxResult, error) { + var result CreateFollowTxResult + + err := store.execTx(ctx, func(q *Queries) error { + var err error + result.Follow, err = q.CreateFollow(ctx, arg.CreateFollowParams) + if err != nil { + return err + } + + arg_noti := CreateFollowerNotificationParams{ + UserID: result.Follow.FollowingID, + FollowerID: result.Follow.FollowerID, + } + + _, err = q.CreateFollowerNotification(ctx, arg_noti) + if err != nil { + return err + } else { + err = q.UpdateUnreadCount(ctx, result.Follow.FollowingID) + if err != nil { + return err + } + } + return nil + }) + + return result, err +} diff --git a/zbook_backend/db/sqlc/tx_create_repo.go b/zbook_backend/db/sqlc/tx_create_repo.go new file mode 100644 index 0000000..7f89991 --- /dev/null +++ b/zbook_backend/db/sqlc/tx_create_repo.go @@ -0,0 +1,134 @@ +package db + +import ( + "context" + "os" + "time" + + "github.com/rs/zerolog/log" + "github.com/zizdlp/zbook/operations" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// with go modules disabled +type CreateRepoTxParams struct { + CreateRepoParams + Username string + AfterCreate func(cloneDir string, repoID int64, userID int64, addedFiles []string, modifiedFiles []string, deletedFiles []string) error +} + +type CreateRepoTxResult struct { + Repo Repo +} + +func (store *SQLStore) CreateRepoTx(ctx context.Context, arg CreateRepoTxParams) (CreateRepoTxResult, error) { + var result CreateRepoTxResult + + err := store.execTx(ctx, func(q *Queries) error { + var err error + result.Repo, err = q.CreateRepo(ctx, arg.CreateRepoParams) + if err != nil { + return err + } + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(32) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + log.Info().Msgf("clone repo to:%s", cloneDir) + startTime := time.Now() + // 调用 Clone 函数 + gitURL := util.GetGitURL(result.Repo.GitProtocol, result.Repo.GitHost, result.Repo.GitUsername, result.Repo.GitRepo) + if arg.GitAccessToken.Valid { + if result.Repo.GitHost == "github" { + err = operations.CloneWithToken(gitURL, cloneDir, arg.GitAccessToken.String) + if err != nil { + return status.Errorf(codes.Internal, "clone repo failed: %s", err) + } + } else { + err = operations.CloneWithPassword(gitURL, cloneDir, arg.GitUsername, arg.GitAccessToken.String) + if err != nil { + return status.Errorf(codes.Internal, "clone repo failed: %s", err) + } + } + } else { + err = operations.Clone(gitURL, cloneDir) + if err != nil { + return status.Errorf(codes.Internal, "clone repo failed: %s", err) + } + } + endTime := time.Now() + + // 计算耗时并输出 + elapsedTime := endTime.Sub(startTime) + log.Info().Msgf("clone repo done, time consume:%s", elapsedTime) + + lastCommit, err := operations.GetLatestCommit(cloneDir) + if err != nil { + return err + } + + // 调用 GetDiffFiles 函数 + addedFiles, modifiedFiles, deletedFiles, renameFiles, err := operations.GetDiffFiles("", lastCommit, cloneDir) + if err != nil { + return err + } + + err = ConvertFile2DB(ctx, q, cloneDir, result.Repo.RepoID, arg.UserID, lastCommit, addedFiles, modifiedFiles, deletedFiles, renameFiles) + if err != nil { + return status.Errorf(codes.Internal, "无法转换文件数据到db: %s", err) + } + + user, err := q.GetUserByUsername(ctx, arg.Username) + if err != nil { + return nil + } + if !user.Blocked && arg.VisibilityLevel == "public" || arg.VisibilityLevel == "signin" { + + arg := GetListFollowerCountParams{ + CurUserID: arg.UserID, + UserID: arg.UserID, + } + + count, err := store.GetListFollowerCount(ctx, arg) + if err != nil { + return nil + } + + for page := 1; page <= int((count+9)/10); page++ { + arg := ListFollowerParams{ + CurUserID: arg.UserID, + UserID: arg.UserID, + Limit: 10, + Offset: int32((page - 1) * 10), + } + follows, err := q.ListFollower(ctx, arg) + if err != nil { + break + } + for i := 0; i < len(follows); i++ { + arg_noti_follower := CreateRepoNotificationParams{ + UserID: follows[i].UserID, + RepoID: result.Repo.RepoID, + } + _, err = q.CreateRepoNotification(ctx, arg_noti_follower) + if err != nil { + return nil + } else { + err = q.UpdateUnreadCount(ctx, follows[i].UserID) + if err != nil { + return nil + } + } + } + } + } + return arg.AfterCreate(cloneDir, result.Repo.RepoID, result.Repo.UserID, addedFiles, modifiedFiles, deletedFiles) + }) + return result, err +} diff --git a/zbook_backend/db/sqlc/tx_create_system_noti.go b/zbook_backend/db/sqlc/tx_create_system_noti.go new file mode 100644 index 0000000..1003cfe --- /dev/null +++ b/zbook_backend/db/sqlc/tx_create_system_noti.go @@ -0,0 +1,27 @@ +package db + +import ( + "context" +) + +type CreateSystemNotificationTxParams struct { + CreateSystemNotificationParams +} + +func (store *SQLStore) CreateSystemNotificationTx(ctx context.Context, arg CreateSystemNotificationTxParams) error { + + err := store.execTx(ctx, func(q *Queries) error { + var err error + _, err = q.CreateSystemNotification(ctx, arg.CreateSystemNotificationParams) + if err != nil { + return err + } + err = q.UpdateUnreadCount(ctx, arg.CreateSystemNotificationParams.UserID) + if err != nil { + return err + } + return nil + }) + + return err +} diff --git a/zbook_backend/db/sqlc/tx_create_user.go b/zbook_backend/db/sqlc/tx_create_user.go new file mode 100644 index 0000000..9fbf2ff --- /dev/null +++ b/zbook_backend/db/sqlc/tx_create_user.go @@ -0,0 +1,42 @@ +package db + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/zizdlp/zbook/util" +) + +type CreateUserTxParams struct { + CreateUserParams + AfterCreate func(user User) error +} + +type CreateUserTxResult struct { + User User +} + +func (store *SQLStore) CreateUserTx(ctx context.Context, arg CreateUserTxParams) (CreateUserTxResult, error) { + var result CreateUserTxResult + + err := store.execTx(ctx, func(q *Queries) error { + var err error + result.User, err = q.CreateUser(ctx, arg.CreateUserParams) + if err != nil { + return err + } + if arg.CreateUserParams.Username == "admin" { + arg_update_user_role := UpdateUserBasicInfoParams{ + Username: "admin", + UserRole: pgtype.Text{String: util.AdminRole, Valid: true}, + } + result.User, err = q.UpdateUserBasicInfo(ctx, arg_update_user_role) + if err != nil { + return err + } + } + return arg.AfterCreate(result.User) + }) + + return result, err +} diff --git a/zbook_backend/db/sqlc/tx_delete_follow.go b/zbook_backend/db/sqlc/tx_delete_follow.go new file mode 100644 index 0000000..5a66851 --- /dev/null +++ b/zbook_backend/db/sqlc/tx_delete_follow.go @@ -0,0 +1,51 @@ +package db + +import ( + "context" + "errors" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type DeleteFollowTxParams struct { + DeleteFollowParams +} + +type DeleteFollowTxResult struct { + Follow Follow +} + +func (store *SQLStore) DeleteFollowTx(ctx context.Context, arg DeleteFollowTxParams) (DeleteFollowTxResult, error) { + var result DeleteFollowTxResult + + err := store.execTx(ctx, func(q *Queries) error { + var err error + _, err = q.DeleteFollow(ctx, arg.DeleteFollowParams) + if err != nil { + return status.Errorf(codes.Internal, "delete follow failed: %s", err) + } + + arg_noti := DeleteFollowerNotificationParams{ + UserID: arg.FollowingID, + FollowerID: arg.FollowerID, + } + + _, err = q.DeleteFollowerNotification(ctx, arg_noti) + if err != nil { + if errors.Is(err, ErrRecordNotFound) { + return status.Errorf(codes.NotFound, "follow notification not found: %s", err) + } + return status.Errorf(codes.NotFound, "delete follow notification failed: %s", err) + } + + err = q.UpdateUnreadCount(ctx, arg.FollowingID) + if err != nil { + return status.Errorf(codes.Internal, "update unread count failed: %s", err) + } + + return nil + }) + + return result, err +} diff --git a/zbook_backend/db/sqlc/tx_delete_repo.go b/zbook_backend/db/sqlc/tx_delete_repo.go new file mode 100644 index 0000000..031cf49 --- /dev/null +++ b/zbook_backend/db/sqlc/tx_delete_repo.go @@ -0,0 +1,28 @@ +package db + +import ( + "context" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type DeleteRepoTxParams struct { + RepoID int64 + UserID int64 + AfterDelte func(repoID int64, userID int64) error +} + +func (store *SQLStore) DeleteRepoTx(ctx context.Context, arg DeleteRepoTxParams) error { + + err := store.execTx(ctx, func(q *Queries) error { + + err := q.DeleteRepo(ctx, arg.RepoID) + if err != nil { + return status.Errorf(codes.Internal, "delete repo failed: %s", err) + } + return arg.AfterDelte(arg.RepoID, arg.UserID) + }) + + return err +} diff --git a/zbook_backend/db/sqlc/tx_delete_user.go b/zbook_backend/db/sqlc/tx_delete_user.go new file mode 100644 index 0000000..c614b00 --- /dev/null +++ b/zbook_backend/db/sqlc/tx_delete_user.go @@ -0,0 +1,28 @@ +package db + +import ( + "context" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type DeleteUserTxParams struct { + UserID int64 + Username string + AfterDelte func(userID int64, username string) error +} + +func (store *SQLStore) DeleteUserTx(ctx context.Context, arg DeleteUserTxParams) error { + + err := store.execTx(ctx, func(q *Queries) error { + + err := q.DeleteUser(ctx, arg.Username) + if err != nil { + return status.Errorf(codes.Internal, "delete repo failed: %s", err) + } + return arg.AfterDelte(arg.UserID, arg.Username) + }) + + return err +} diff --git a/zbook_backend/db/sqlc/tx_manual_sync_repo.go b/zbook_backend/db/sqlc/tx_manual_sync_repo.go new file mode 100644 index 0000000..5f67b03 --- /dev/null +++ b/zbook_backend/db/sqlc/tx_manual_sync_repo.go @@ -0,0 +1,84 @@ +package db + +import ( + "context" + "fmt" + "os" + "time" + + "github.com/rs/zerolog/log" + "github.com/zizdlp/zbook/operations" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type ManualSyncRepoTxParams struct { + RepoID int64 + AfterCreate func(cloneDir string, repoID int64, userID int64, addedFiles []string, modifiedFiles []string, deletedFiles []string) error +} + +func (store *SQLStore) ManualSyncRepoTx(ctx context.Context, arg ManualSyncRepoTxParams) error { + err := store.execTx(ctx, func(q *Queries) error { + var err error + + repo, err := q.GetRepo(ctx, arg.RepoID) + if err != nil { + return status.Errorf(codes.Internal, "get repo failed: %s", err) + } + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(32) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + log.Info().Msgf("clone repo to:%s", cloneDir) + startTime := time.Now() + // 调用 Clone 函数 + gitURL := util.GetGitURL(repo.GitProtocol, repo.GitHost, repo.GitUsername, repo.GitRepo) + if repo.GitAccessToken.Valid { + if repo.GitHost == "github" { + err = operations.CloneWithToken(gitURL, cloneDir, repo.GitAccessToken.String) + if err != nil { + return status.Errorf(codes.Internal, "clone repo failed: %s", err) + } + } else { + err = operations.CloneWithPassword(gitURL, cloneDir, repo.GitUsername, repo.GitAccessToken.String) + if err != nil { + return status.Errorf(codes.Internal, "clone repo failed: %s", err) + } + } + } else { + err = operations.Clone(gitURL, cloneDir) + if err != nil { + return status.Errorf(codes.Internal, "clone repo failed: %s", err) + } + } + endTime := time.Now() + + // 计算耗时并输出 + elapsedTime := endTime.Sub(startTime) + log.Info().Msgf("clone repo done, time consume:%s", elapsedTime) + + lastCommit, err := operations.GetLatestCommit(cloneDir) + if err != nil { + return err + } + + // 调用 GetDiffFiles 函数 + addedFiles, modifiedFiles, deletedFiles, renameFiles, err := operations.GetDiffFiles(repo.CommitID, lastCommit, cloneDir) + if err != nil { + return err + } + fmt.Println("lastcommit:", lastCommit, repo.CommitID) + err = ConvertFile2DB(ctx, q, cloneDir, repo.RepoID, repo.UserID, lastCommit, addedFiles, modifiedFiles, deletedFiles, renameFiles) + if err != nil { + return status.Errorf(codes.Internal, "failed to convert file to db: %s", err) + } + return arg.AfterCreate(cloneDir, repo.RepoID, repo.UserID, addedFiles, modifiedFiles, deletedFiles) + + }) + return err +} diff --git a/zbook_backend/db/sqlc/tx_reset_password.go b/zbook_backend/db/sqlc/tx_reset_password.go new file mode 100644 index 0000000..3c8f43d --- /dev/null +++ b/zbook_backend/db/sqlc/tx_reset_password.go @@ -0,0 +1,60 @@ +package db + +import ( + "context" + "errors" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type ResetPasswordTxParams struct { + VerificationUrl string + Password string + Email string +} + +func (store *SQLStore) ResetPasswordTx(ctx context.Context, arg ResetPasswordTxParams) error { + + err := store.execTx(ctx, func(q *Queries) error { + var err error + + verification, err := q.GetVerification(ctx, arg.VerificationUrl) + if err != nil { + return status.Errorf(codes.Internal, "get verification failed:%v", err) + } + if verification.VerificationType != util.VerifyTypeResetPassword { + return status.Errorf(codes.InvalidArgument, "invalid VerificationType: %s", verification.VerificationType) + } + + _, err = q.MarkVerificationAsUsed(ctx, arg.VerificationUrl) + if err != nil { + return status.Errorf(codes.Internal, "mark verify as used failed:%v", err) + } + + hashedPassword, err := util.HashPassword(arg.Password) + if err != nil { + return status.Errorf(codes.Internal, "password cannot be hashed: %s", err) + } + if arg.Email != verification.Email { + return status.Errorf(codes.PermissionDenied, "email is not belong to this verification") + } + arg := UpdateUserBasicInfoParams{ + Username: verification.Username, + HashedPassword: pgtype.Text{String: hashedPassword, Valid: true}, + } + + _, err = q.UpdateUserBasicInfo(ctx, arg) + if err != nil { + if errors.Is(err, ErrRecordNotFound) { + return status.Errorf(codes.NotFound, "user not exist: %s", err) + } + return status.Errorf(codes.Internal, "reset password failed: %s", err) + } + return err + + }) + return err +} diff --git a/zbook_backend/db/sqlc/tx_verify_email.go b/zbook_backend/db/sqlc/tx_verify_email.go new file mode 100644 index 0000000..e8969f0 --- /dev/null +++ b/zbook_backend/db/sqlc/tx_verify_email.go @@ -0,0 +1,41 @@ +package db + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (store *SQLStore) VerifyEmailTx(ctx context.Context, VerificationUrl string) (User, error) { + var user User + + err := store.execTx(ctx, func(q *Queries) error { + var err error + + verification, err := q.GetVerification(ctx, VerificationUrl) + if err != nil { + return status.Errorf(codes.Internal, "get verification failed:%v", err) + } + if verification.VerificationType != util.VerifyTypeVerifyEmail { + return status.Errorf(codes.Internal, "invalid VerificationType") + } + + _, err = q.MarkVerificationAsUsed(ctx, VerificationUrl) + if err != nil { + return status.Errorf(codes.Internal, "mark verification used failed: %s", err) + } + arg := UpdateUserBasicInfoParams{ + Username: verification.Username, + Verified: pgtype.Bool{Bool: true, Valid: true}, + } + user, err = q.UpdateUserBasicInfo(ctx, arg) + if err != nil { + return status.Errorf(codes.Internal, "update user failed: %s", err) + } + return nil + }) + return user, err +} diff --git a/zbook_backend/db/sqlc/user_query.sql.go b/zbook_backend/db/sqlc/user_query.sql.go new file mode 100644 index 0000000..49fef21 --- /dev/null +++ b/zbook_backend/db/sqlc/user_query.sql.go @@ -0,0 +1,409 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: user_query.sql + +package db + +import ( + "context" + "time" + + "github.com/jackc/pgx/v5/pgtype" +) + +const getDailyCreateUserCount = `-- name: GetDailyCreateUserCount :many +SELECT + (created_at AT TIME ZONE $1)::date AS registration_date, + COUNT(*) AS new_users_count +FROM users +WHERE + (created_at AT TIME ZONE $1) >= (CURRENT_DATE AT TIME ZONE $1) - ($2 || ' days')::INTERVAL +GROUP BY + registration_date +ORDER BY + registration_date DESC +` + +type GetDailyCreateUserCountParams struct { + Timezone string `json:"timezone"` + IntervalDays pgtype.Text `json:"interval_days"` +} + +type GetDailyCreateUserCountRow struct { + RegistrationDate pgtype.Date `json:"registration_date"` + NewUsersCount int64 `json:"new_users_count"` +} + +func (q *Queries) GetDailyCreateUserCount(ctx context.Context, arg GetDailyCreateUserCountParams) ([]GetDailyCreateUserCountRow, error) { + rows, err := q.db.Query(ctx, getDailyCreateUserCount, arg.Timezone, arg.IntervalDays) + if err != nil { + return nil, err + } + defer rows.Close() + items := []GetDailyCreateUserCountRow{} + for rows.Next() { + var i GetDailyCreateUserCountRow + if err := rows.Scan(&i.RegistrationDate, &i.NewUsersCount); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getListUserCount = `-- name: GetListUserCount :one +SELECT COUNT(*) +FROM users +WHERE +users.blocked = 'false' OR $1::text='admin' +` + +func (q *Queries) GetListUserCount(ctx context.Context, role string) (int64, error) { + row := q.db.QueryRow(ctx, getListUserCount, role) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getQueryUserCount = `-- name: GetQueryUserCount :one +select COUNT(*) +from users +where (users.blocked='false' OR $1::text='admin') AND fts_username @@ plainto_tsquery($2) +` + +type GetQueryUserCountParams struct { + Role string `json:"role"` + Query string `json:"query"` +} + +func (q *Queries) GetQueryUserCount(ctx context.Context, arg GetQueryUserCountParams) (int64, error) { + row := q.db.QueryRow(ctx, getQueryUserCount, arg.Role, arg.Query) + var count int64 + err := row.Scan(&count) + return count, err +} + +const getUnReadCount = `-- name: GetUnReadCount :one +SELECT unread_count +FROM users +WHERE username = $1 +LIMIT 1 +` + +func (q *Queries) GetUnReadCount(ctx context.Context, username string) (int32, error) { + row := q.db.QueryRow(ctx, getUnReadCount, username) + var unread_count int32 + err := row.Scan(&unread_count) + return unread_count, err +} + +const getUserByEmail = `-- name: GetUserByEmail :one +SELECT user_id, username, email, hashed_password, blocked, verified, motto, user_role, onboarding, created_at, updated_at, unread_count, unread_count_updated_at, fts_username +FROM users +WHERE users.email = $1 +LIMIT 1 +` + +func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error) { + row := q.db.QueryRow(ctx, getUserByEmail, email) + var i User + err := row.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ) + return i, err +} + +const getUserByUsername = `-- name: GetUserByUsername :one +SELECT user_id, username, email, hashed_password, blocked, verified, motto, user_role, onboarding, created_at, updated_at, unread_count, unread_count_updated_at, fts_username +FROM users +WHERE username = $1 +LIMIT 1 +` + +func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error) { + row := q.db.QueryRow(ctx, getUserByUsername, username) + var i User + err := row.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ) + return i, err +} + +const getUserInfo = `-- name: GetUserInfo :one +WITH liked_repos_count AS ( + SELECT + Count(*) as like_count + FROM + repos r + JOIN + repo_relations AS rr ON r.repo_id = rr.repo_id + JOIN + users as ur ON ur.user_id=r.user_id + JOIN + users as uq ON uq.user_id=rr.user_id + WHERE + uq.user_id = $3 AND rr.relation_type='like' AND ( + ($1::text='admin' AND $4::bool ) OR ( + uq.blocked = FALSE AND ur.blocked =FALSE AND + ( + (r.visibility_level = 'public' ) + OR + (r.visibility_level = 'signed' AND $4::bool) + OR + (r.visibility_level = 'chosen' AND $4::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $2 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $2 AND $4::bool) + ) + ) + ) +), + owned_repos_count AS ( + SELECT + COUNT(*) as repo_count + FROM + repos r + JOIN + users as u ON u.user_id=r.user_id + WHERE + u.user_id = $3 AND ( + ($1::text='admin' AND $4::bool ) OR ( + u.blocked='false' AND ( + r.visibility_level = 'public' + OR + (r.visibility_level = 'signed' AND $4::bool) + OR + (r.visibility_level = 'chosen' AND $4::bool AND EXISTS(SELECT 1 FROM repo_relations WHERE repo_relations.repo_id = r.repo_id AND repo_relations.user_id = $2 AND repo_relations.relation_type = 'visi')) + OR + ((r.visibility_level = 'private' OR r.visibility_level = 'chosen') AND r.user_id = $2 AND $4::bool) + ) + ) + ) +) +SELECT + u.user_id, u.username, u.email, u.hashed_password, u.blocked, u.verified, u.motto, u.user_role, u.onboarding, u.created_at, u.updated_at, u.unread_count, u.unread_count_updated_at, u.fts_username, + repo_count, + like_count, + (SELECT COUNT(*) FROM follows f1 JOIN users as uf ON uf.user_id = f1.follower_id WHERE f1.following_id = u.user_id and (uf.blocked = 'false' OR $1::text='admin')) AS follower_count, + (SELECT COUNT(*) FROM follows f2 JOIN users as uf ON uf.user_id = f2.following_id WHERE f2.follower_id = u.user_id and (uf.blocked = 'false' OR $1::text='admin')) AS following_count, + EXISTS(SELECT 1 FROM follows WHERE follows.follower_id = $2 AND follows.following_id = $3) AS is_following +FROM users u +JOIN liked_repos_count lrc ON 1=1 +JOIN owned_repos_count ownrc ON 1=1 +WHERE u.user_id = $3 +` + +type GetUserInfoParams struct { + Role string `json:"role"` + CurUserID int64 `json:"cur_user_id"` + UserID int64 `json:"user_id"` + Signed bool `json:"signed"` +} + +type GetUserInfoRow struct { + UserID int64 `json:"user_id"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` + RepoCount int64 `json:"repo_count"` + LikeCount int64 `json:"like_count"` + FollowerCount int64 `json:"follower_count"` + FollowingCount int64 `json:"following_count"` + IsFollowing bool `json:"is_following"` +} + +func (q *Queries) GetUserInfo(ctx context.Context, arg GetUserInfoParams) (GetUserInfoRow, error) { + row := q.db.QueryRow(ctx, getUserInfo, + arg.Role, + arg.CurUserID, + arg.UserID, + arg.Signed, + ) + var i GetUserInfoRow + err := row.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + &i.RepoCount, + &i.LikeCount, + &i.FollowerCount, + &i.FollowingCount, + &i.IsFollowing, + ) + return i, err +} + +const listUser = `-- name: ListUser :many +SELECT user_id, username, email, hashed_password, blocked, verified, motto, user_role, onboarding, created_at, updated_at, unread_count, unread_count_updated_at, fts_username +FROM users u +WHERE u.blocked = 'false' OR $3::text='admin' +ORDER BY u.created_at DESC +LIMIT $1 +OFFSET $2 +` + +type ListUserParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Role string `json:"role"` +} + +func (q *Queries) ListUser(ctx context.Context, arg ListUserParams) ([]User, error) { + rows, err := q.db.Query(ctx, listUser, arg.Limit, arg.Offset, arg.Role) + if err != nil { + return nil, err + } + defer rows.Close() + items := []User{} + for rows.Next() { + var i User + if err := rows.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const queryUser = `-- name: QueryUser :many +select users.user_id, users.username, users.email, users.hashed_password, users.blocked, users.verified, users.motto, users.user_role, users.onboarding, users.created_at, users.updated_at, users.unread_count, users.unread_count_updated_at, users.fts_username,ts_rank(fts_username, plainto_tsquery($3)) as rank +from users +where (users.blocked='false' OR $4::text='admin') AND fts_username @@ plainto_tsquery($3) +ORDER BY rank DESC +LIMIT $1 +OFFSET $2 +` + +type QueryUserParams struct { + Limit int32 `json:"limit"` + Offset int32 `json:"offset"` + Query string `json:"query"` + Role string `json:"role"` +} + +type QueryUserRow struct { + UserID int64 `json:"user_id"` + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` + Blocked bool `json:"blocked"` + Verified bool `json:"verified"` + Motto string `json:"motto"` + UserRole string `json:"user_role"` + Onboarding bool `json:"onboarding"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + UnreadCount int32 `json:"unread_count"` + UnreadCountUpdatedAt time.Time `json:"unread_count_updated_at"` + FtsUsername string `json:"fts_username"` + Rank float32 `json:"rank"` +} + +func (q *Queries) QueryUser(ctx context.Context, arg QueryUserParams) ([]QueryUserRow, error) { + rows, err := q.db.Query(ctx, queryUser, + arg.Limit, + arg.Offset, + arg.Query, + arg.Role, + ) + if err != nil { + return nil, err + } + defer rows.Close() + items := []QueryUserRow{} + for rows.Next() { + var i QueryUserRow + if err := rows.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + &i.Rank, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} diff --git a/zbook_backend/db/sqlc/user_query_test.go b/zbook_backend/db/sqlc/user_query_test.go new file mode 100644 index 0000000..7b3bfa2 --- /dev/null +++ b/zbook_backend/db/sqlc/user_query_test.go @@ -0,0 +1,223 @@ +package db + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func TestGetUserByUsername(t *testing.T) { + user1 := createRandomUser(t) + user2, err := testStore.GetUserByUsername(context.Background(), user1.Username) + require.NoError(t, err) + require.NotEmpty(t, user2) + require.Equal(t, user1.Username, user2.Username) + require.Equal(t, user1.HashedPassword, user2.HashedPassword) + require.Equal(t, user1.Email, user2.Email) + require.Equal(t, user1.Motto, user2.Motto) + require.WithinDuration(t, user1.CreatedAt, user2.CreatedAt, time.Second) +} +func TestGetUserByEmail(t *testing.T) { + user1 := createRandomUser(t) + user2, err := testStore.GetUserByEmail(context.Background(), user1.Email) + require.NoError(t, err) + require.NotEmpty(t, user2) + require.Equal(t, user1.Username, user2.Username) + require.Equal(t, user1.HashedPassword, user2.HashedPassword) + require.Equal(t, user1.Email, user2.Email) + require.Equal(t, user1.Motto, user2.Motto) + require.WithinDuration(t, user1.CreatedAt, user2.CreatedAt, time.Second) +} + +func TestGetUnreadCount(t *testing.T) { + user1 := createRandomUser(t) + user2 := createRandomUser(t) + arg_follow := CreateFollowTxParams{ + CreateFollowParams: CreateFollowParams{FollowerID: user2.UserID, FollowingID: user1.UserID}, + } + _, err := testStore.CreateFollowTx(context.Background(), arg_follow) + require.NoError(t, err) + testStore.UpdateUnreadCount(context.Background(), user1.UserID) + unreadCount, err := testStore.GetUnReadCount(context.Background(), user1.Username) + require.NoError(t, err) + require.Equal(t, int32(1), unreadCount) +} + +func TestListUser(t *testing.T) { + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + + arg := ListUserParams{ + Limit: 3, + Offset: 0, + } + users, err := testStore.ListUser(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, len(users), 3) + require.Equal(t, user3.UserID, users[0].UserID) + require.Equal(t, user2.UserID, users[1].UserID) + require.Equal(t, user1.UserID, users[2].UserID) +} + +func TestGetListUserCount(t *testing.T) { + + count1, err := testStore.GetListUserCount(context.Background(), util.AdminRole) + require.NoError(t, err) + createRandomUser(t) + count2, err := testStore.GetListUserCount(context.Background(), util.AdminRole) + require.NoError(t, err) + require.Equal(t, count2, count1+1) + + count3, err := testStore.GetListUserCount(context.Background(), util.UserRole) + require.NoError(t, err) + + user3 := createRandomUser(t) + arg_block := UpdateUserBasicInfoParams{ + Username: user3.Username, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + _, err = testStore.UpdateUserBasicInfo(context.Background(), arg_block) + require.NoError(t, err) + count4, err := testStore.GetListUserCount(context.Background(), util.UserRole) + require.NoError(t, err) + require.Equal(t, count4, count3) +} + +func TestQueryUser(t *testing.T) { + user1 := createRandomUser(t) + arg := QueryUserParams{ + Limit: 10, + Offset: 0, + Query: user1.Username, + } + users, err := testStore.QueryUser(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, users) + require.Equal(t, users[0].UserID, user1.UserID) +} +func TestGetQueryUserCount(t *testing.T) { + user1 := createRandomUser(t) + arg := GetQueryUserCountParams{ + Role: util.AdminRole, + Query: user1.Username, + } + count, err := testStore.GetQueryUserCount(context.Background(), arg) + require.NoError(t, err) + require.True(t, count > 0) +} +func TestDailyCreateUserCount(t *testing.T) { + createRandomUser(t) + timezone := "Asia/Shanghai" + arg := GetDailyCreateUserCountParams{ + Timezone: timezone, + IntervalDays: pgtype.Text{String: "7", Valid: true}, + } + count1, err := testStore.GetDailyCreateUserCount(context.Background(), arg) + fmt.Println("count1:", count1) + require.NoError(t, err) + require.True(t, len(count1) > 0) + createRandomUser(t) + count2, err := testStore.GetDailyCreateUserCount(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, count2[0].NewUsersCount, count1[0].NewUsersCount+1) +} + +func TestGetUserInfoByID(t *testing.T) { + // user1:4 repo + // user2:4 repo + // user3:4 repo,blocked + + user1 := createRandomUser(t) + user2 := createRandomUser(t) + user3 := createRandomUser(t) + repo11 := createUserRandomRepo(t, user1) + repo12 := createUserRandomRepo(t, user1) + repo13 := createUserRandomRepo(t, user1) + repo14 := createUserRandomRepo(t, user1) + + updateRepoVisibility(t, repo11, util.VisibilityChosed) + updateRepoVisibility(t, repo12, util.VisibilityPrivate) + updateRepoVisibility(t, repo13, util.VisibilityPublic) + updateRepoVisibility(t, repo14, util.VisibilitySigned) + + repo21 := createUserRandomRepo(t, user2) + repo22 := createUserRandomRepo(t, user2) + repo23 := createUserRandomRepo(t, user2) + repo24 := createUserRandomRepo(t, user2) + + updateRepoVisibility(t, repo21, util.VisibilityChosed) + updateRepoVisibility(t, repo22, util.VisibilityPrivate) + updateRepoVisibility(t, repo23, util.VisibilityPublic) + updateRepoVisibility(t, repo24, util.VisibilitySigned) + + repo31 := createUserRandomRepo(t, user3) + repo32 := createUserRandomRepo(t, user3) + repo33 := createUserRandomRepo(t, user3) + repo34 := createUserRandomRepo(t, user3) + + updateRepoVisibility(t, repo31, util.VisibilityChosed) + updateRepoVisibility(t, repo32, util.VisibilityPrivate) + updateRepoVisibility(t, repo33, util.VisibilityPublic) + updateRepoVisibility(t, repo34, util.VisibilitySigned) + + testCreateRelationUserRepoRelation(t, user1, repo23, util.RelationTypeDislike) + testCreateRelationUserRepoRelation(t, user1, repo34, util.RelationTypeLike) //like +1 + testCreateRelationUserRepoRelation(t, user1, repo11, util.RelationTypeLike) //like +1 + testCreateRelationUserRepoRelation(t, user1, repo14, util.RelationTypeLike) //like +1 + + // user2 see user1: + arg := GetUserInfoParams{ + CurUserID: user2.UserID, + UserID: user1.UserID, + Signed: true, + Role: user2.UserRole, + } + user_info, err := testStore.GetUserInfo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, user_info.UserID, user1.UserID) + require.Equal(t, user_info.RepoCount, int64(2)) + require.Equal(t, user_info.LikeCount, int64(2)) + require.Equal(t, user_info.IsFollowing, false) + + // user1 see user1: + arg = GetUserInfoParams{ + CurUserID: user1.UserID, + UserID: user1.UserID, + Signed: true, + Role: user1.UserRole, + } + user_info, err = testStore.GetUserInfo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, user_info.UserID, user1.UserID) + require.Equal(t, user_info.RepoCount, int64(4)) + require.Equal(t, user_info.LikeCount, int64(3)) + require.Equal(t, user_info.IsFollowing, false) + + // update user3 to block + arg_block := UpdateUserBasicInfoParams{ + Username: user3.Username, + Blocked: pgtype.Bool{Bool: true, Valid: true}, + } + _, err = testStore.UpdateUserBasicInfo(context.Background(), arg_block) + require.NoError(t, err) + + arg = GetUserInfoParams{ + CurUserID: user1.UserID, + UserID: user1.UserID, + Signed: true, + Role: user1.UserRole, + } + user_info, err = testStore.GetUserInfo(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, user_info.UserID, user1.UserID) + require.Equal(t, user_info.RepoCount, int64(4)) + require.Equal(t, user_info.LikeCount, int64(2)) //block one + require.Equal(t, user_info.IsFollowing, false) + +} diff --git a/zbook_backend/db/sqlc/user_update.sql.go b/zbook_backend/db/sqlc/user_update.sql.go new file mode 100644 index 0000000..767972b --- /dev/null +++ b/zbook_backend/db/sqlc/user_update.sql.go @@ -0,0 +1,163 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: user_update.sql + +package db + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" +) + +const createUser = `-- name: CreateUser :one +INSERT INTO users ( + username, + email, + hashed_password +) VALUES ( + $1, $2, $3 +) RETURNING user_id, username, email, hashed_password, blocked, verified, motto, user_role, onboarding, created_at, updated_at, unread_count, unread_count_updated_at, fts_username +` + +type CreateUserParams struct { + Username string `json:"username"` + Email string `json:"email"` + HashedPassword string `json:"hashed_password"` +} + +func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) { + row := q.db.QueryRow(ctx, createUser, arg.Username, arg.Email, arg.HashedPassword) + var i User + err := row.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ) + return i, err +} + +const deleteUser = `-- name: DeleteUser :exec +DELETE FROM users +WHERE username = $1 +` + +func (q *Queries) DeleteUser(ctx context.Context, username string) error { + _, err := q.db.Exec(ctx, deleteUser, username) + return err +} + +const resetUnreadCount = `-- name: ResetUnreadCount :exec +UPDATE users +SET unread_count_updated_at = now(), + unread_count = ( + SELECT COUNT(*) FROM ( + SELECT noti_id FROM follower_notifications + WHERE user_id = users.user_id AND created_at > now() AND readed = false + UNION ALL + SELECT noti_id FROM comment_notifications + WHERE user_id = users.user_id AND created_at > now() AND readed = false + UNION ALL + SELECT noti_id FROM system_notifications + WHERE user_id = users.user_id AND created_at > now() AND readed = false + UNION ALL + SELECT noti_id FROM repo_notifications + WHERE user_id = users.user_id AND created_at > now() AND readed = false + ) AS subquery +) +WHERE users.username = $1 +` + +func (q *Queries) ResetUnreadCount(ctx context.Context, username string) error { + _, err := q.db.Exec(ctx, resetUnreadCount, username) + return err +} + +const updateUnreadCount = `-- name: UpdateUnreadCount :exec +UPDATE users +SET unread_count = ( + SELECT COUNT(*) FROM ( + SELECT noti_id FROM follower_notifications + WHERE user_id = users.user_id AND created_at > users.unread_count_updated_at AND readed = false + UNION ALL + SELECT noti_id FROM comment_notifications + WHERE user_id = users.user_id AND created_at > users.unread_count_updated_at AND readed = false + UNION ALL + SELECT noti_id FROM system_notifications + WHERE user_id = users.user_id AND created_at > users.unread_count_updated_at AND readed = false + UNION ALL + SELECT noti_id FROM repo_notifications + WHERE user_id = users.user_id AND created_at > users.unread_count_updated_at AND readed = false + ) AS subquery +) +WHERE users.user_id = $1 +` + +func (q *Queries) UpdateUnreadCount(ctx context.Context, userID int64) error { + _, err := q.db.Exec(ctx, updateUnreadCount, userID) + return err +} + +const updateUserBasicInfo = `-- name: UpdateUserBasicInfo :one +UPDATE users +SET motto=COALESCE($1,motto), +hashed_password=COALESCE($2,hashed_password), +user_role=COALESCE($3,user_role), +onboarding=COALESCE($4,onboarding), +blocked=COALESCE($5,blocked), +verified=COALESCE($6,verified) +WHERE username = $7 +RETURNING user_id, username, email, hashed_password, blocked, verified, motto, user_role, onboarding, created_at, updated_at, unread_count, unread_count_updated_at, fts_username +` + +type UpdateUserBasicInfoParams struct { + Motto pgtype.Text `json:"motto"` + HashedPassword pgtype.Text `json:"hashed_password"` + UserRole pgtype.Text `json:"user_role"` + Onboarding pgtype.Bool `json:"onboarding"` + Blocked pgtype.Bool `json:"blocked"` + Verified pgtype.Bool `json:"verified"` + Username string `json:"username"` +} + +func (q *Queries) UpdateUserBasicInfo(ctx context.Context, arg UpdateUserBasicInfoParams) (User, error) { + row := q.db.QueryRow(ctx, updateUserBasicInfo, + arg.Motto, + arg.HashedPassword, + arg.UserRole, + arg.Onboarding, + arg.Blocked, + arg.Verified, + arg.Username, + ) + var i User + err := row.Scan( + &i.UserID, + &i.Username, + &i.Email, + &i.HashedPassword, + &i.Blocked, + &i.Verified, + &i.Motto, + &i.UserRole, + &i.Onboarding, + &i.CreatedAt, + &i.UpdatedAt, + &i.UnreadCount, + &i.UnreadCountUpdatedAt, + &i.FtsUsername, + ) + return i, err +} diff --git a/zbook_backend/db/sqlc/user_update_test.go b/zbook_backend/db/sqlc/user_update_test.go new file mode 100644 index 0000000..3022ce2 --- /dev/null +++ b/zbook_backend/db/sqlc/user_update_test.go @@ -0,0 +1,77 @@ +package db + +import ( + "context" + "testing" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func createRandomUser(t *testing.T) User { + hashedPassword, err := util.HashPassword(util.RandomString(6)) + require.NoError(t, err) + + arg := CreateUserParams{ + Username: util.RandomUsername(), + Email: util.RandomEmail(), + HashedPassword: hashedPassword, + } + user, err := testStore.CreateUser(context.Background(), arg) + require.NoError(t, err) + require.NotEmpty(t, user) + require.Equal(t, arg.Username, user.Username) + require.Equal(t, arg.HashedPassword, user.HashedPassword) + require.Equal(t, arg.Email, user.Email) + require.NotZero(t, user.CreatedAt) + require.Equal(t, user.UserRole, util.UserRole) + return user +} + +func TestCreateUser(t *testing.T) { + createRandomUser(t) +} + +func TestUpdateUserBasicInfo(t *testing.T) { + user1 := createRandomUser(t) + + motto := util.RandomString(6) + hashedPassword, _ := util.HashPassword(util.RandomString(6)) + + arg := UpdateUserBasicInfoParams{ + Username: user1.Username, + Motto: pgtype.Text{ + String: motto, + Valid: true, + }, + HashedPassword: pgtype.Text{ + String: hashedPassword, + Valid: true, + }, + UserRole: pgtype.Text{ + String: util.RandomUserRole(), + Valid: util.RandomBool(), + }, + Onboarding: util.RandomPGBool(), + Blocked: util.RandomPGBool(), + Verified: util.RandomPGBool(), + } + user2, err := testStore.UpdateUserBasicInfo(context.Background(), arg) + + require.NoError(t, err) + require.NotEmpty(t, user2) + require.Equal(t, user2.Username, arg.Username) + require.Equal(t, user2.HashedPassword, hashedPassword) + require.Equal(t, user2.Motto, motto) +} +func TestUpdateUnreadCount(t *testing.T) { + user1 := createRandomUser(t) + err := testStore.UpdateUnreadCount(context.Background(), user1.UserID) + require.NoError(t, err) +} +func TestResetnreadCount(t *testing.T) { + user1 := createRandomUser(t) + err := testStore.ResetUnreadCount(context.Background(), user1.Username) + require.NoError(t, err) +} diff --git a/zbook_backend/db/sqlc/verification.sql.go b/zbook_backend/db/sqlc/verification.sql.go new file mode 100644 index 0000000..c1fc1bc --- /dev/null +++ b/zbook_backend/db/sqlc/verification.sql.go @@ -0,0 +1,108 @@ +// Code generated by sqlc. DO NOT EDIT. +// versions: +// sqlc v1.26.0 +// source: verification.sql + +package db + +import ( + "context" + "time" +) + +const createVerification = `-- name: CreateVerification :one +INSERT INTO verifications ( + verification_url, + user_id, + verification_type +) VALUES ( + $1, $2,$3 +) RETURNING verification_id, verification_url, verification_type, user_id, is_used, created_at, expired_at +` + +type CreateVerificationParams struct { + VerificationUrl string `json:"verification_url"` + UserID int64 `json:"user_id"` + VerificationType string `json:"verification_type"` +} + +func (q *Queries) CreateVerification(ctx context.Context, arg CreateVerificationParams) (Verification, error) { + row := q.db.QueryRow(ctx, createVerification, arg.VerificationUrl, arg.UserID, arg.VerificationType) + var i Verification + err := row.Scan( + &i.VerificationID, + &i.VerificationUrl, + &i.VerificationType, + &i.UserID, + &i.IsUsed, + &i.CreatedAt, + &i.ExpiredAt, + ) + return i, err +} + +const getVerification = `-- name: GetVerification :one +SELECT verifications.verification_id, verifications.verification_url, verifications.verification_type, verifications.user_id, verifications.is_used, verifications.created_at, verifications.expired_at,users.username,users.email +FROM verifications +JOIN users ON users.user_id = verifications.user_id +WHERE verification_url = $1 + AND is_used = FALSE + AND expired_at > now() + LIMIT 1 +FOR NO KEY UPDATE +` + +type GetVerificationRow struct { + VerificationID int64 `json:"verification_id"` + VerificationUrl string `json:"verification_url"` + VerificationType string `json:"verification_type"` + UserID int64 `json:"user_id"` + IsUsed bool `json:"is_used"` + CreatedAt time.Time `json:"created_at"` + ExpiredAt time.Time `json:"expired_at"` + Username string `json:"username"` + Email string `json:"email"` +} + +func (q *Queries) GetVerification(ctx context.Context, verificationUrl string) (GetVerificationRow, error) { + row := q.db.QueryRow(ctx, getVerification, verificationUrl) + var i GetVerificationRow + err := row.Scan( + &i.VerificationID, + &i.VerificationUrl, + &i.VerificationType, + &i.UserID, + &i.IsUsed, + &i.CreatedAt, + &i.ExpiredAt, + &i.Username, + &i.Email, + ) + return i, err +} + +const markVerificationAsUsed = `-- name: MarkVerificationAsUsed :one +UPDATE verifications +SET + is_used = TRUE +WHERE + verification_url = $1 + AND is_used = FALSE + AND expired_at > now() +RETURNING verification_id, verification_url, verification_type, user_id, is_used, created_at, expired_at +` + +func (q *Queries) MarkVerificationAsUsed(ctx context.Context, verificationUrl string) (Verification, error) { + row := q.db.QueryRow(ctx, markVerificationAsUsed, verificationUrl) + var i Verification + err := row.Scan( + &i.VerificationID, + &i.VerificationUrl, + &i.VerificationType, + &i.UserID, + &i.IsUsed, + &i.CreatedAt, + &i.ExpiredAt, + ) + return i, err +} diff --git a/zbook_backend/db/sqlc/verification_test.go b/zbook_backend/db/sqlc/verification_test.go new file mode 100644 index 0000000..68b70f3 --- /dev/null +++ b/zbook_backend/db/sqlc/verification_test.go @@ -0,0 +1,44 @@ +package db + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func CreateRandomVerification(t *testing.T) Verification { + user := createRandomUser(t) + + verificationType := util.RandomVerificationType() + + arg := CreateVerificationParams{VerificationUrl: util.RandomString(32), UserID: user.UserID, VerificationType: verificationType} + verification, err := testStore.CreateVerification(context.Background(), arg) + require.NoError(t, err) + require.Equal(t, verification.IsUsed, false) + require.Equal(t, verification.UserID, user.UserID) + require.Equal(t, verification.VerificationType, verificationType) + return verification +} +func TestCreateVerification(t *testing.T) { + CreateRandomVerification(t) +} +func TestGetVerification(t *testing.T) { + verification := CreateRandomVerification(t) + v2, err := testStore.GetVerification(context.Background(), verification.VerificationUrl) + require.NoError(t, err) + require.Equal(t, v2.UserID, verification.UserID) + require.Equal(t, v2.IsUsed, verification.IsUsed) + require.Equal(t, v2.CreatedAt, verification.CreatedAt) + require.Equal(t, v2.VerificationType, verification.VerificationType) +} +func TestMarkVerificationAsUsed(t *testing.T) { + verification := CreateRandomVerification(t) + v2, err := testStore.MarkVerificationAsUsed(context.Background(), verification.VerificationUrl) + require.NoError(t, err) + require.Equal(t, v2.UserID, verification.UserID) + require.Equal(t, v2.IsUsed, true) + require.Equal(t, v2.CreatedAt, verification.CreatedAt) + require.Equal(t, v2.VerificationType, verification.VerificationType) +} diff --git a/zbook_backend/doc/swagger/models/comment.swagger.json b/zbook_backend/doc/swagger/models/comment.swagger.json new file mode 100644 index 0000000..1bb5311 --- /dev/null +++ b/zbook_backend/doc/swagger/models/comment.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "models/comment.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/models/comment_relation.swagger.json b/zbook_backend/doc/swagger/models/comment_relation.swagger.json new file mode 100644 index 0000000..1ca273d --- /dev/null +++ b/zbook_backend/doc/swagger/models/comment_relation.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "models/comment_relation.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/models/follow.swagger.json b/zbook_backend/doc/swagger/models/follow.swagger.json new file mode 100644 index 0000000..4ffc6c9 --- /dev/null +++ b/zbook_backend/doc/swagger/models/follow.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "models/follow.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/models/markdown.swagger.json b/zbook_backend/doc/swagger/models/markdown.swagger.json new file mode 100644 index 0000000..1bbea4e --- /dev/null +++ b/zbook_backend/doc/swagger/models/markdown.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "models/markdown.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/models/notification.swagger.json b/zbook_backend/doc/swagger/models/notification.swagger.json new file mode 100644 index 0000000..d3da550 --- /dev/null +++ b/zbook_backend/doc/swagger/models/notification.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "models/notification.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/models/repo.swagger.json b/zbook_backend/doc/swagger/models/repo.swagger.json new file mode 100644 index 0000000..f582658 --- /dev/null +++ b/zbook_backend/doc/swagger/models/repo.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "models/repo.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/models/repo_relation.swagger.json b/zbook_backend/doc/swagger/models/repo_relation.swagger.json new file mode 100644 index 0000000..ea99e56 --- /dev/null +++ b/zbook_backend/doc/swagger/models/repo_relation.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "models/repo_relation.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/models/session.swagger.json b/zbook_backend/doc/swagger/models/session.swagger.json new file mode 100644 index 0000000..6bfd877 --- /dev/null +++ b/zbook_backend/doc/swagger/models/session.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "models/session.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/models/user.swagger.json b/zbook_backend/doc/swagger/models/user.swagger.json new file mode 100644 index 0000000..a5da2d8 --- /dev/null +++ b/zbook_backend/doc/swagger/models/user.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "models/user.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_admin.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_admin.swagger.json new file mode 100644 index 0000000..80b0d52 --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_admin.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_admin.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_comment.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_comment.swagger.json new file mode 100644 index 0000000..44f71a3 --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_comment.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_comment.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_comment_relation.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_comment_relation.swagger.json new file mode 100644 index 0000000..50cca0b --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_comment_relation.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_comment_relation.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_follow.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_follow.swagger.json new file mode 100644 index 0000000..01ba7e6 --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_follow.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_follow.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_markdown.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_markdown.swagger.json new file mode 100644 index 0000000..41d42d1 --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_markdown.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_markdown.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_notification.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_notification.swagger.json new file mode 100644 index 0000000..850f797 --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_notification.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_notification.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_oauth.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_oauth.swagger.json new file mode 100644 index 0000000..984ad80 --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_oauth.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_oauth.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_repo.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_repo.swagger.json new file mode 100644 index 0000000..e4694da --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_repo.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_repo.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_repo_relation.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_repo_relation.swagger.json new file mode 100644 index 0000000..1496478 --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_repo_relation.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_repo_relation.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_user.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_user.swagger.json new file mode 100644 index 0000000..fd1a5f9 --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_user.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_user.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/rpcs/rpc_verification.swagger.json b/zbook_backend/doc/swagger/rpcs/rpc_verification.swagger.json new file mode 100644 index 0000000..52763e8 --- /dev/null +++ b/zbook_backend/doc/swagger/rpcs/rpc_verification.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "rpcs/rpc_verification.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_admin.swagger.json b/zbook_backend/doc/swagger/service_zbook_admin.swagger.json new file mode 100644 index 0000000..08e11d4 --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_admin.swagger.json @@ -0,0 +1,1157 @@ +{ + "swagger": "2.0", + "info": { + "title": "zbook api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookAdmin" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/create_invitation": { + "post": { + "summary": "send invitation", + "description": "Use this api to send invitation", + "operationId": "ZBookAdmin_SendInvitation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbSendInvitationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbSendInvitationRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/create_system_notification": { + "post": { + "summary": "create system noti", + "description": "Use this api to create system noti", + "operationId": "ZBookAdmin_CreateSystemNotification", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateSystemNotificationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateSystemNotificationRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/delete_user": { + "post": { + "summary": "ban user", + "description": "Use this api to ban user", + "operationId": "ZBookAdmin_DeleteUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeleteUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbDeleteUserRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/get_configuration": { + "post": { + "summary": "parse ip", + "description": "Use this api to get configuration", + "operationId": "ZBookAdmin_GetConfiguration", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetConfigurationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetConfigurationRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/get_daily_active_user_count": { + "post": { + "summary": "get details of user", + "description": "Use this api to get details of user", + "operationId": "ZBookAdmin_GetDailyActiveUserCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetDailyActiveUserCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetDailyActiveUserCountRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/get_daily_create_user_count": { + "post": { + "summary": "get details of user", + "description": "Use this api to get details of user", + "operationId": "ZBookAdmin_GetDailyCreateUserCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetDailyCreateUserCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetDailyCreateUserCountRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/get_daily_visitor_count": { + "post": { + "summary": "get details of user", + "description": "Use this api to get details of user", + "operationId": "ZBookAdmin_GetDailyVisitorCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetDailyVisitorCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetDailyVisitorCountRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/get_daily_visitors": { + "post": { + "summary": "parse ip", + "description": "Use this api to parse ip", + "operationId": "ZBookAdmin_GetDailyVisitors", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetDailyVisitorsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetDailyVisitorsRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/get_list_comment_count": { + "post": { + "summary": "GetUserPrivateCountResponse", + "description": "Use this api to GetUserPrivateCountResponse", + "operationId": "ZBookAdmin_GetListCommentCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListCommentCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListCommentCountRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/get_list_comment_report_count": { + "post": { + "summary": "GetListCommentReportCountRequest", + "description": "Use this api to GetListCommentReportCountRequest", + "operationId": "ZBookAdmin_GetListCommentReportCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListCommentReportCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListCommentReportCountRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/get_list_session_count": { + "post": { + "summary": "GetSessionCountRequest", + "description": "Use this api to GetSessionCountRequest", + "operationId": "ZBookAdmin_GetListSessionCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListSessionCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListSessionCountRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/list_comment": { + "post": { + "summary": "list_repo_report", + "description": "Use this api to list_repo_report", + "operationId": "ZBookAdmin_ListComment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListCommentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListCommentRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/list_comment_report": { + "post": { + "summary": "list_comment_report", + "description": "Use this api to list_all_comment_report", + "operationId": "ZBookAdmin_ListCommentReport", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListCommentReportResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListCommentReportRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/list_session": { + "post": { + "summary": "list active session", + "description": "Use this api to list active session", + "operationId": "ZBookAdmin_ListSession", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListSessionResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListSessionRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/log_visitor": { + "post": { + "summary": "get details of user", + "description": "Use this api to get details of user", + "operationId": "ZBookAdmin_LogVisitor", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbLogVisitorResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbLogVisitorRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/update_comment_report_status": { + "post": { + "summary": " list user", + "description": "Use this api to ban user", + "operationId": "ZBookAdmin_UpdateCommentReportStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUpdateCommentReportStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUpdateCommentReportStatusRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/update_configuration": { + "post": { + "summary": "parse ip", + "description": "Use this api to parse ip", + "operationId": "ZBookAdmin_UpdateConfiguration", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUpdateConfigurationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUpdateConfigurationRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + }, + "/v1/update_user_block": { + "post": { + "summary": "ban user", + "description": "Use this api to ban user", + "operationId": "ZBookAdmin_UpdateUserBlock", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUpdateUserBlockResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUpdateUserBlockRequest" + } + } + ], + "tags": [ + "ZBookAdmin" + ] + } + } + }, + "definitions": { + "pbCreateSystemNotificationRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "title": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "redirectUrl": { + "type": "string" + } + }, + "title": "3.CreateSystemNotification" + }, + "pbCreateSystemNotificationResponse": { + "type": "object" + }, + "pbDeleteUserRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + } + }, + "title": "2.DeleteUser" + }, + "pbDeleteUserResponse": { + "type": "object" + }, + "pbGetConfigurationRequest": { + "type": "object", + "properties": { + "configName": { + "type": "string" + } + }, + "title": "17.GetConfiguration" + }, + "pbGetConfigurationResponse": { + "type": "object", + "properties": { + "configValue": { + "type": "boolean" + } + } + }, + "pbGetDailyActiveUserCountRequest": { + "type": "object", + "properties": { + "timeZone": { + "type": "string" + }, + "ndays": { + "type": "integer", + "format": "int32" + } + }, + "title": "12.GetDailyActiveUserCount" + }, + "pbGetDailyActiveUserCountResponse": { + "type": "object", + "properties": { + "dates": { + "type": "array", + "items": { + "type": "string" + } + }, + "counts": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + } + }, + "pbGetDailyCreateUserCountRequest": { + "type": "object", + "properties": { + "timeZone": { + "type": "string" + }, + "ndays": { + "type": "integer", + "format": "int32" + } + }, + "title": "13.GetDailyCreateUserCount" + }, + "pbGetDailyCreateUserCountResponse": { + "type": "object", + "properties": { + "dates": { + "type": "array", + "items": { + "type": "string" + } + }, + "counts": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + } + }, + "pbGetDailyVisitorCountRequest": { + "type": "object", + "properties": { + "timeZone": { + "type": "string" + }, + "ndays": { + "type": "integer", + "format": "int32" + } + }, + "title": "11.GetDailyVisitorCount" + }, + "pbGetDailyVisitorCountResponse": { + "type": "object", + "properties": { + "dates": { + "type": "array", + "items": { + "type": "string" + } + }, + "counts": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + } + } + }, + "pbGetDailyVisitorsRequest": { + "type": "object", + "properties": { + "ndays": { + "type": "integer", + "format": "int32" + }, + "lang": { + "type": "string" + } + }, + "title": "16.GetDailyVisitors" + }, + "pbGetDailyVisitorsResponse": { + "type": "object", + "properties": { + "visitors": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbVisitor" + } + } + } + }, + "pbGetListCommentCountRequest": { + "type": "object", + "properties": { + "query": { + "type": "string" + } + }, + "title": "8.GetListCommentCount" + }, + "pbGetListCommentCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetListCommentReportCountRequest": { + "type": "object", + "title": "10.GetListCommentReportCount" + }, + "pbGetListCommentReportCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetListSessionCountRequest": { + "type": "object", + "properties": { + "query": { + "type": "string" + } + }, + "title": "6.GetListSessionCount" + }, + "pbGetListSessionCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbListAdminCommentInfo": { + "type": "object", + "properties": { + "commentId": { + "type": "string", + "format": "int64" + }, + "commentContent": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, + "pbListCommentReportInfo": { + "type": "object", + "properties": { + "reportId": { + "type": "string", + "format": "int64" + }, + "commentId": { + "type": "string", + "format": "int64" + }, + "repoName": { + "type": "string" + }, + "repoUsername": { + "type": "string" + }, + "relativePath": { + "type": "string" + }, + "reportContent": { + "type": "string" + }, + "commentContent": { + "type": "string" + }, + "processed": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "username": { + "type": "string" + } + } + }, + "pbListCommentReportRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "9.ListCommentReport" + }, + "pbListCommentReportResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListCommentReportInfo" + } + } + } + }, + "pbListCommentRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "7.ListComment" + }, + "pbListCommentResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListAdminCommentInfo" + } + } + } + }, + "pbListSessionRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "5.ListSession" + }, + "pbListSessionResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbSessionInfo" + } + } + } + }, + "pbLogVisitorRequest": { + "type": "object", + "title": "14.LogVisitor" + }, + "pbLogVisitorResponse": { + "type": "object" + }, + "pbSendInvitationRequest": { + "type": "object", + "properties": { + "email": { + "type": "string" + } + }, + "title": "19.SendInvitation" + }, + "pbSendInvitationResponse": { + "type": "object", + "properties": { + "isSend": { + "type": "boolean" + } + } + }, + "pbSessionInfo": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "userAgent": { + "type": "string" + }, + "clientIp": { + "type": "string" + }, + "email": { + "type": "string" + }, + "expiresAt": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, + "pbUpdateCommentReportStatusRequest": { + "type": "object", + "properties": { + "reportId": { + "type": "string", + "format": "int64" + }, + "processed": { + "type": "boolean" + } + }, + "title": "4.UpdateCommentReportStatus" + }, + "pbUpdateCommentReportStatusResponse": { + "type": "object" + }, + "pbUpdateConfigurationRequest": { + "type": "object", + "properties": { + "configName": { + "type": "string" + }, + "configValue": { + "type": "boolean" + } + }, + "title": "18.UpdateConfiguration" + }, + "pbUpdateConfigurationResponse": { + "type": "object" + }, + "pbUpdateUserBlockRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "blocked": { + "type": "boolean" + } + }, + "title": "1.UpdateUserBlock" + }, + "pbUpdateUserBlockResponse": { + "type": "object", + "properties": { + "blocked": { + "type": "boolean" + } + } + }, + "pbVisitor": { + "type": "object", + "properties": { + "IP": { + "type": "string" + }, + "Agent": { + "type": "string" + }, + "Count": { + "type": "integer", + "format": "int32" + }, + "city": { + "type": "string" + }, + "lat": { + "type": "number", + "format": "double" + }, + "long": { + "type": "number", + "format": "double" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_comment.swagger.json b/zbook_backend/doc/swagger/service_zbook_comment.swagger.json new file mode 100644 index 0000000..41d3668 --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_comment.swagger.json @@ -0,0 +1,537 @@ +{ + "swagger": "2.0", + "info": { + "title": "zbook api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookComment" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/create_comment": { + "post": { + "summary": "创建一级评论", + "description": "创建评论", + "operationId": "ZBookComment_CreateComment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateCommentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateCommentRequest" + } + } + ], + "tags": [ + "ZBookComment" + ] + } + }, + "/v1/delete_comment": { + "post": { + "summary": "delete comment", + "description": "Use this api to delete comment", + "operationId": "ZBookComment_DeleteComment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeleteCommentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbDeleteCommentRequest" + } + } + ], + "tags": [ + "ZBookComment" + ] + } + }, + "/v1/get_comment_count_info": { + "post": { + "summary": "get details of comment", + "description": "Use this api to get count info of comment", + "operationId": "ZBookComment_GetCommentCountInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetCommentCountInfoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetCommentCountInfoRequest" + } + } + ], + "tags": [ + "ZBookComment" + ] + } + }, + "/v1/get_list_comment_level_one_count": { + "post": { + "summary": "list level one comment", + "description": "Use this api to list level one comment", + "operationId": "ZBookComment_GetListCommentLevelOneCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListCommentLevelCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListCommentLevelOneCountRequest" + } + } + ], + "tags": [ + "ZBookComment" + ] + } + }, + "/v1/get_list_comment_level_two_count": { + "post": { + "summary": "list_comment_level_two", + "description": "Use this api to list_comment_level_two", + "operationId": "ZBookComment_GetListCommentLevelTwoCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListCommentLevelCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListCommentLevelTwoCountRequest" + } + } + ], + "tags": [ + "ZBookComment" + ] + } + }, + "/v1/list_comment_level_one": { + "post": { + "summary": "list level one comment", + "description": "Use this api to list level one comment", + "operationId": "ZBookComment_ListCommentLevelOne", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListCommentLevelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListCommentLevelOneRequest" + } + } + ], + "tags": [ + "ZBookComment" + ] + } + }, + "/v1/list_comment_level_two": { + "post": { + "summary": "list_comment_level_two", + "description": "Use this api to list_comment_level_two", + "operationId": "ZBookComment_ListCommentLevelTwo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListCommentLevelResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListCommentLevelTwoRequest" + } + } + ], + "tags": [ + "ZBookComment" + ] + } + } + }, + "definitions": { + "pbCommentBasicInfo": { + "type": "object", + "properties": { + "commentId": { + "type": "string", + "format": "int64" + }, + "markdownId": { + "type": "string", + "format": "int64" + }, + "userId": { + "type": "string", + "format": "int64" + }, + "parentId": { + "type": "string", + "format": "int64" + }, + "rootId": { + "type": "string", + "format": "int64" + }, + "commentContent": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, + "pbCommentCountInfo": { + "type": "object", + "properties": { + "commentId": { + "type": "string", + "format": "int64" + }, + "likeCount": { + "type": "integer", + "format": "int32" + }, + "replyCount": { + "type": "integer", + "format": "int32" + }, + "isLiked": { + "type": "boolean" + }, + "isDisliked": { + "type": "boolean" + }, + "isShared": { + "type": "boolean" + }, + "isReported": { + "type": "boolean" + } + } + }, + "pbCreateCommentRequest": { + "type": "object", + "properties": { + "markdownId": { + "type": "string", + "format": "int64" + }, + "parentId": { + "type": "string", + "format": "int64" + }, + "commentContent": { + "type": "string" + } + }, + "title": "1.CreateComment" + }, + "pbCreateCommentResponse": { + "type": "object", + "properties": { + "comment": { + "$ref": "#/definitions/pbCommentBasicInfo" + } + } + }, + "pbDeleteCommentRequest": { + "type": "object", + "properties": { + "commentId": { + "type": "string", + "format": "int64" + } + }, + "title": "2.DeleteComment" + }, + "pbDeleteCommentResponse": { + "type": "object" + }, + "pbGetCommentCountInfoRequest": { + "type": "object", + "properties": { + "commentId": { + "type": "string", + "format": "int64" + } + }, + "title": "5.GetCommentCountInfo" + }, + "pbGetCommentCountInfoResponse": { + "type": "object", + "properties": { + "commentCountInfo": { + "$ref": "#/definitions/pbCommentCountInfo" + } + } + }, + "pbGetListCommentLevelCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetListCommentLevelOneCountRequest": { + "type": "object", + "properties": { + "markdownId": { + "type": "string", + "format": "int64" + } + }, + "title": "3.GetListCommentLevelOneCount" + }, + "pbGetListCommentLevelTwoCountRequest": { + "type": "object", + "properties": { + "rootId": { + "type": "string", + "format": "int64" + } + }, + "title": "4.GetListCommentLevelTwoCount" + }, + "pbListCommentInfo": { + "type": "object", + "properties": { + "markdownId": { + "type": "string", + "format": "int64" + }, + "parentId": { + "type": "string", + "format": "int64" + }, + "username": { + "type": "string" + }, + "pusername": { + "type": "string" + }, + "commentContent": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "likeCount": { + "type": "string", + "format": "int64" + }, + "replyCount": { + "type": "string", + "format": "int64" + }, + "isLiked": { + "type": "boolean" + }, + "isDisliked": { + "type": "boolean" + }, + "isShared": { + "type": "boolean" + }, + "isReported": { + "type": "boolean" + }, + "commentId": { + "type": "string", + "format": "int64" + } + } + }, + "pbListCommentLevelOneRequest": { + "type": "object", + "properties": { + "markdownId": { + "type": "string", + "format": "int64" + }, + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + } + }, + "title": "3.ListCommentLevelOne" + }, + "pbListCommentLevelResponse": { + "type": "object", + "properties": { + "comments": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListCommentInfo" + } + } + } + }, + "pbListCommentLevelTwoRequest": { + "type": "object", + "properties": { + "rootId": { + "type": "string", + "format": "int64" + }, + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + } + }, + "title": "4.ListCommentLevelTwo" + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_comment_relation.swagger.json b/zbook_backend/doc/swagger/service_zbook_comment_relation.swagger.json new file mode 100644 index 0000000..cb0d919 --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_comment_relation.swagger.json @@ -0,0 +1,217 @@ +{ + "swagger": "2.0", + "info": { + "title": "zbook api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookCommentRelation" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/create_comment_relation": { + "post": { + "summary": "create like on comment", + "description": "Use this api to create like on comment", + "operationId": "ZBookCommentRelation_CreateCommentRelation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateCommentRelationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateCommentRelationRequest" + } + } + ], + "tags": [ + "ZBookCommentRelation" + ] + } + }, + "/v1/create_comment_report": { + "post": { + "summary": "create report on comment", + "description": "Use this api to create report on comment", + "operationId": "ZBookCommentRelation_CreateCommentReport", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateCommentReportResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateCommentReportRequest" + } + } + ], + "tags": [ + "ZBookCommentRelation" + ] + } + }, + "/v1/delete_comment_relation": { + "post": { + "summary": "delete like on comment", + "description": "Use this api to delete like on comment", + "operationId": "ZBookCommentRelation_DeleteCommentRelation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeleteCommentRelationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbDeleteCommentRelationRequest" + } + } + ], + "tags": [ + "ZBookCommentRelation" + ] + } + } + }, + "definitions": { + "pbCreateCommentRelationRequest": { + "type": "object", + "properties": { + "commentId": { + "type": "string", + "format": "int64" + }, + "relationType": { + "type": "string" + } + }, + "title": "1.CreateCommentRelation" + }, + "pbCreateCommentRelationResponse": { + "type": "object", + "properties": { + "likeId": { + "type": "string", + "format": "int64" + } + } + }, + "pbCreateCommentReportRequest": { + "type": "object", + "properties": { + "commentId": { + "type": "string", + "format": "int64" + }, + "reportContent": { + "type": "string" + } + }, + "title": "3.DeleteCommentRelation" + }, + "pbCreateCommentReportResponse": { + "type": "object", + "properties": { + "commentId": { + "type": "string", + "format": "int64" + } + } + }, + "pbDeleteCommentRelationRequest": { + "type": "object", + "properties": { + "commentId": { + "type": "string", + "format": "int64" + }, + "relationType": { + "type": "string" + } + }, + "title": "2.CreateCommentReport" + }, + "pbDeleteCommentRelationResponse": { + "type": "object" + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_follow.swagger.json b/zbook_backend/doc/swagger/service_zbook_follow.swagger.json new file mode 100644 index 0000000..70be4c6 --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_follow.swagger.json @@ -0,0 +1,497 @@ +{ + "swagger": "2.0", + "info": { + "title": "zbook api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookFollow" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/create_follow": { + "post": { + "summary": "CreateFollow", + "description": "Use this api to create follow relation between two user", + "operationId": "ZBookFollow_CreateFollow", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateFollowResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateFollowRequest" + } + } + ], + "tags": [ + "ZBookFollow" + ] + } + }, + "/v1/delete_follow": { + "post": { + "summary": "delete follow", + "description": "Use this api to delete follow", + "operationId": "ZBookFollow_DeleteFollow", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeleteFollowResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbDeleteFollowRequest" + } + } + ], + "tags": [ + "ZBookFollow" + ] + } + }, + "/v1/get_follow_status": { + "post": { + "summary": "get details of user", + "description": "Use this api to get details of user", + "operationId": "ZBookFollow_GetFollowStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetFollowStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetFollowStatusRequest" + } + } + ], + "tags": [ + "ZBookFollow" + ] + } + }, + "/v1/get_follower_count": { + "post": { + "summary": "list follower of user", + "description": "Use this api to list follower of user", + "operationId": "ZBookFollow_GetFollowerCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetFollowerCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetFollowerCountRequest" + } + } + ], + "tags": [ + "ZBookFollow" + ] + } + }, + "/v1/get_following_count": { + "post": { + "summary": "list following of user", + "description": "Use this api to list follower of user", + "operationId": "ZBookFollow_GetFollowingCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetFollowingCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetFollowingCountRequest" + } + } + ], + "tags": [ + "ZBookFollow" + ] + } + }, + "/v1/list_follower": { + "post": { + "summary": "list follower of user", + "description": "Use this api to list follower of user", + "operationId": "ZBookFollow_ListFollower", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListFollowerResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListFollowerRequest" + } + } + ], + "tags": [ + "ZBookFollow" + ] + } + }, + "/v1/list_following": { + "post": { + "summary": "list following of user", + "description": "Use this api to list following of user", + "operationId": "ZBookFollow_ListFollowing", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListFollowingResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListFollowingRequest" + } + } + ], + "tags": [ + "ZBookFollow" + ] + } + } + }, + "definitions": { + "pbCreateFollowRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + } + }, + "title": "1.CreateFollow" + }, + "pbCreateFollowResponse": { + "type": "object", + "properties": { + "follow": { + "$ref": "#/definitions/pbFollow" + } + } + }, + "pbDeleteFollowRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + } + }, + "title": "3.DeleteFollow" + }, + "pbDeleteFollowResponse": { + "type": "object", + "properties": { + "follow": { + "$ref": "#/definitions/pbFollow" + } + } + }, + "pbFollow": { + "type": "object", + "properties": { + "followId": { + "type": "string", + "format": "int64" + }, + "followerId": { + "type": "string", + "format": "int64" + }, + "followingId": { + "type": "string", + "format": "int64" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, + "pbGetFollowStatusRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + } + }, + "title": "2.GetFollowStatus" + }, + "pbGetFollowStatusResponse": { + "type": "object", + "properties": { + "isFollowing": { + "type": "boolean" + } + } + }, + "pbGetFollowerCountRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "query": { + "type": "string" + } + }, + "title": "5.GetFollowerCount" + }, + "pbGetFollowerCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetFollowingCountRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "query": { + "type": "string" + } + }, + "title": "7.GetFollowingCount" + }, + "pbGetFollowingCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbListFollowInfo": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "isFollowing": { + "type": "boolean" + }, + "repoCount": { + "type": "integer", + "format": "int32" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, + "pbListFollowerRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "4.ListFollower" + }, + "pbListFollowerResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListFollowInfo" + } + } + } + }, + "pbListFollowingRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "6.ListFollowing" + }, + "pbListFollowingResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListFollowInfo" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_markdown.swagger.json b/zbook_backend/doc/swagger/service_zbook_markdown.swagger.json new file mode 100644 index 0000000..1e19ba6 --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_markdown.swagger.json @@ -0,0 +1,444 @@ +{ + "swagger": "2.0", + "info": { + "title": "image api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookMarkdown" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/get_markdown_content": { + "post": { + "summary": "get markdown", + "description": "Use this api to get markdown", + "operationId": "ZBookMarkdown_GetMarkdownContent", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetMarkdownContentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetMarkdownContentRequest" + } + } + ], + "tags": [ + "ZBookMarkdown" + ] + } + }, + "/v1/get_markdown_image": { + "post": { + "summary": "获取markdown image", + "description": "获取markdown image", + "operationId": "ZBookMarkdown_GetMarkdownImage", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetMarkdownImageResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetMarkdownImageRequest" + } + } + ], + "tags": [ + "ZBookMarkdown" + ] + } + }, + "/v1/query_markdown": { + "post": { + "summary": "query markdown", + "description": "Use this api to query markdown", + "operationId": "ZBookMarkdown_QueryMarkdown", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbQueryMarkdownResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbQueryMarkdownRequest" + } + } + ], + "tags": [ + "ZBookMarkdown" + ] + } + }, + "/v1/query_repo_markdown": { + "post": { + "summary": "query markdown repo", + "description": "Use this api to query markdown repo", + "operationId": "ZBookMarkdown_QueryRepoMarkdown", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbQueryRepoMarkdownResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbQueryRepoMarkdownRequest" + } + } + ], + "tags": [ + "ZBookMarkdown" + ] + } + }, + "/v1/query_user_markdown": { + "post": { + "summary": "query markdown user", + "description": "Use this api to query markdown user", + "operationId": "ZBookMarkdown_QueryUserMarkdown", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbQueryUserMarkdownResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbQueryUserMarkdownRequest" + } + } + ], + "tags": [ + "ZBookMarkdown" + ] + } + } + }, + "definitions": { + "pbFooterSocial": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "url": { + "type": "string" + } + } + }, + "pbGetMarkdownContentRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "relativePath": { + "type": "string" + } + }, + "title": "1.GetMarkdownContent" + }, + "pbGetMarkdownContentResponse": { + "type": "object", + "properties": { + "markdown": { + "$ref": "#/definitions/pbMarkdown" + }, + "prev": { + "type": "string" + }, + "next": { + "type": "string" + }, + "footers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbFooterSocial" + } + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "themeColor": { + "type": "string" + } + } + }, + "pbGetMarkdownImageRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "filePath": { + "type": "string" + } + }, + "title": "2.GetMarkdownImage" + }, + "pbGetMarkdownImageResponse": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "byte" + } + } + }, + "pbMarkdown": { + "type": "object", + "properties": { + "markdownId": { + "type": "string", + "format": "int64" + }, + "relativePath": { + "type": "string" + }, + "userId": { + "type": "string", + "format": "int64" + }, + "repoId": { + "type": "string", + "format": "int64" + }, + "mainContent": { + "type": "string" + }, + "tableContent": { + "type": "string" + }, + "md5": { + "type": "string" + }, + "versionKey": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + } + } + }, + "pbQueryMarkdownRequest": { + "type": "object", + "properties": { + "plainToTsquery": { + "type": "string" + }, + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + } + }, + "title": "4.QueryMarkdown" + }, + "pbQueryMarkdownResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbMarkdown" + } + } + } + }, + "pbQueryRepoMarkdownRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "plainToTsquery": { + "type": "string" + }, + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + } + }, + "title": "3.QueryRepoMarkdown" + }, + "pbQueryRepoMarkdownResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbMarkdown" + } + } + } + }, + "pbQueryUserMarkdownRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "plainToTsquery": { + "type": "string" + }, + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + } + }, + "title": "4.QueryUserMarkdown" + }, + "pbQueryUserMarkdownResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbMarkdown" + } + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_notification.swagger.json b/zbook_backend/doc/swagger/service_zbook_notification.swagger.json new file mode 100644 index 0000000..7f1ef4f --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_notification.swagger.json @@ -0,0 +1,864 @@ +{ + "swagger": "2.0", + "info": { + "title": "zbook api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookNotification" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/get_list_comment_notification_unreaded_count": { + "post": { + "summary": "分页列出指定用户的评论通知归属信息", + "description": "分页列出指定用户的评论通知归属信息", + "operationId": "ZBookNotification_GetListCommentNotificationUnreadedCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListCommentNotificationUnreadedCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListCommentNotificationUnreadedCountRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/get_list_follower_notification_unreaded_count": { + "post": { + "summary": "分页列出指定用户的关注者通知归属信息", + "description": "分页列出指定用户的关注者通知归属信息", + "operationId": "ZBookNotification_GetListFollowerNotificationUnreadedCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListFollowerNotificationUnreadedCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListFollowerNotificationUnreadedCountRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/get_list_repo_notification_unreaded_count": { + "post": { + "summary": "分页列出指定用户的帖子通知归属信息", + "description": "分页列出指定用户的帖子通知归属信息", + "operationId": "ZBookNotification_GetListRepoNotificationUnreadedCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListRepoNotificationUnreadedCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListRepoNotificationUnreadedCountRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/get_list_system_notification_unreaded_count": { + "post": { + "summary": "分页获取指定用户的系统通知", + "description": "分页获取指定用户的系统通知", + "operationId": "ZBookNotification_GetListSystemNotificationUnreadedCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListSystemNotificationUnreadedCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListSystemNotificationUnreadedCountRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/get_unread_count": { + "post": { + "summary": "get_unread_count", + "description": "Use this api to get_unread_count", + "operationId": "ZBookNotification_GetUnReadCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetUnReadCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetUnReadCountRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/list_comment_notification": { + "post": { + "summary": "分页列出指定用户的评论通知归属信息", + "description": "分页列出指定用户的评论通知归属信息", + "operationId": "ZBookNotification_ListCommentNotification", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListCommentNotificationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListCommentNotificationRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/list_follower_notification": { + "post": { + "summary": "分页列出指定用户的关注者通知归属信息", + "description": "分页列出指定用户的关注者通知归属信息", + "operationId": "ZBookNotification_ListFollowerNotification", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListFollowerNotificationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListFollowerNotificationRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/list_repo_notification": { + "post": { + "summary": "分页列出指定用户的帖子通知归属信息", + "description": "分页列出指定用户的帖子通知归属信息", + "operationId": "ZBookNotification_ListRepoNotification", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListRepoNotificationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListRepoNotificationRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/list_system_notification": { + "post": { + "summary": "分页获取指定用户的系统通知", + "description": "分页获取指定用户的系统通知", + "operationId": "ZBookNotification_ListSystemNotification", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListSystemNotificationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListSystemNotificationRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/mark_comment_notification_readed": { + "post": { + "summary": "set_comment_noti_read", + "description": "Use this api to set_comment_noti_read", + "operationId": "ZBookNotification_MarkCommentNotificationReaded", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbSetNotiReadResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbMarkCommentNotificationReadedRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/mark_follower_notification_readed": { + "post": { + "summary": "mark_follower_notification_readed", + "description": "Use this api to set_follower_noti_read", + "operationId": "ZBookNotification_MarkFollowerNotificationReaded", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbSetNotiReadResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbMarkFollowerNotificationReadedRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/mark_repo_notification_readed": { + "post": { + "summary": "set_image_noti_read", + "description": "Use this api to set_image_noti_read", + "operationId": "ZBookNotification_MarkRepoNotificationReaded", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbSetNotiReadResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbMarkRepoNotificationReadedRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/mark_system_notification_readed": { + "post": { + "summary": "set_system_noti_read", + "description": "Use this api to set_system_noti_read", + "operationId": "ZBookNotification_MarkSystemNotificationReaded", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbSetNotiReadResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbMarkSystemNotificationReadedRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + }, + "/v1/reset_unread_count": { + "post": { + "summary": "reset_unread_count", + "description": "Use this api to reset_unread_count", + "operationId": "ZBookNotification_ResetUnreadCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbResetUnreadCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbResetUnreadCountRequest" + } + } + ], + "tags": [ + "ZBookNotification" + ] + } + } + }, + "definitions": { + "pbGetListCommentNotificationUnreadedCountRequest": { + "type": "object", + "title": "13.GetListCommentNotificationUnreadedCount" + }, + "pbGetListCommentNotificationUnreadedCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetListFollowerNotificationUnreadedCountRequest": { + "type": "object", + "title": "11.GetListFollowerNotificationUnreadedCount" + }, + "pbGetListFollowerNotificationUnreadedCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetListRepoNotificationUnreadedCountRequest": { + "type": "object", + "title": "12.GetListRepoNotificationUnreadedCount" + }, + "pbGetListRepoNotificationUnreadedCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetListSystemNotificationUnreadedCountRequest": { + "type": "object", + "title": "14.GetListSystemNotificationUnreadedCount" + }, + "pbGetListSystemNotificationUnreadedCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetUnReadCountRequest": { + "type": "object", + "title": "9.GetUnReadCount" + }, + "pbGetUnReadCountResponse": { + "type": "object", + "properties": { + "unreadCount": { + "type": "integer", + "format": "int32" + } + } + }, + "pbListCommentNotificationInfo": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "readed": { + "type": "boolean" + }, + "notiId": { + "type": "string", + "format": "int64" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "commentContent": { + "type": "string" + }, + "repoId": { + "type": "string", + "format": "int64" + }, + "relativePath": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "repoUsername": { + "type": "string" + } + } + }, + "pbListCommentNotificationRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + } + }, + "title": "3.ListCommentNotification" + }, + "pbListCommentNotificationResponse": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListCommentNotificationInfo" + } + } + } + }, + "pbListFollowerNotificationInfo": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "readed": { + "type": "boolean" + }, + "notiId": { + "type": "string", + "format": "int64" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, + "pbListFollowerNotificationRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + } + }, + "title": "1.ListFollowerNotification" + }, + "pbListFollowerNotificationResponse": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListFollowerNotificationInfo" + } + } + } + }, + "pbListRepoNotificationInfo": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "readed": { + "type": "boolean" + }, + "notiId": { + "type": "string", + "format": "int64" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "repoId": { + "type": "string", + "format": "int64" + }, + "repoName": { + "type": "string" + } + } + }, + "pbListRepoNotificationRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + } + }, + "title": "2.ListRepoNotification" + }, + "pbListRepoNotificationResponse": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListRepoNotificationInfo" + } + } + } + }, + "pbListSystemNotificationInfo": { + "type": "object", + "properties": { + "readed": { + "type": "boolean" + }, + "notiId": { + "type": "string", + "format": "int64" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "title": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "redirectUrl": { + "type": "string" + } + } + }, + "pbListSystemNotificationRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + } + }, + "title": "4.ListSystemNotification" + }, + "pbListSystemNotificationResponse": { + "type": "object", + "properties": { + "notifications": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListSystemNotificationInfo" + } + } + } + }, + "pbMarkCommentNotificationReadedRequest": { + "type": "object", + "properties": { + "notiId": { + "type": "string", + "format": "int64" + } + }, + "title": "7.MarkCommentNotificationReaded" + }, + "pbMarkFollowerNotificationReadedRequest": { + "type": "object", + "properties": { + "notiId": { + "type": "string", + "format": "int64" + } + }, + "title": "5.MarkFollowerNotificationReaded" + }, + "pbMarkRepoNotificationReadedRequest": { + "type": "object", + "properties": { + "notiId": { + "type": "string", + "format": "int64" + } + }, + "title": "8.MarkRepoNotificationReaded" + }, + "pbMarkSystemNotificationReadedRequest": { + "type": "object", + "properties": { + "notiId": { + "type": "string", + "format": "int64" + } + }, + "title": "6.MarkSystemNotificationReaded" + }, + "pbResetUnreadCountRequest": { + "type": "object", + "title": "10.ResetUnreadCount" + }, + "pbResetUnreadCountResponse": { + "type": "object" + }, + "pbSetNotiReadResponse": { + "type": "object" + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_oauth.swagger.json b/zbook_backend/doc/swagger/service_zbook_oauth.swagger.json new file mode 100644 index 0000000..85855b4 --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_oauth.swagger.json @@ -0,0 +1,273 @@ +{ + "swagger": "2.0", + "info": { + "title": "zbook api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookOAuth" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/check_oauth_status": { + "post": { + "summary": "check oauth status", + "description": "Use this api to check oauth status", + "operationId": "ZBookOAuth_CheckOAuthStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCheckOAuthStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCheckOAuthStatusRequest" + } + } + ], + "tags": [ + "ZBookOAuth" + ] + } + }, + "/v1/create_oauth_link": { + "post": { + "summary": "create new oauth user", + "description": "Use this api to create new oauth user", + "operationId": "ZBookOAuth_CreateOAuthLink", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateOAuthLinkResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateOAuthLinkRequest" + } + } + ], + "tags": [ + "ZBookOAuth" + ] + } + }, + "/v1/delete_oauth_link": { + "post": { + "summary": "delete oauth user", + "description": "Use this api to delete oauth user", + "operationId": "ZBookOAuth_DeleteOAuthLink", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeleteOAuthLinkResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbDeleteOAuthLinkRequest" + } + } + ], + "tags": [ + "ZBookOAuth" + ] + } + }, + "/v1/login_by_oauth": { + "post": { + "summary": "login oauth user", + "description": "Use this api to login oauth user", + "operationId": "ZBookOAuth_LoginByOAuth", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbLoginByOAuthResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbLoginByOAuthRequest" + } + } + ], + "tags": [ + "ZBookOAuth" + ] + } + } + }, + "definitions": { + "pbCheckOAuthStatusRequest": { + "type": "object", + "title": "2.CheckOAuthStatus" + }, + "pbCheckOAuthStatusResponse": { + "type": "object", + "properties": { + "github": { + "type": "boolean" + }, + "google": { + "type": "boolean" + } + } + }, + "pbCreateOAuthLinkRequest": { + "type": "object", + "properties": { + "oauthType": { + "type": "string" + }, + "appId": { + "type": "string" + } + }, + "title": "1.CreateOAuthLink" + }, + "pbCreateOAuthLinkResponse": { + "type": "object" + }, + "pbDeleteOAuthLinkRequest": { + "type": "object", + "properties": { + "oauthType": { + "type": "string" + } + }, + "title": "3.DeleteOAuthLink" + }, + "pbDeleteOAuthLinkResponse": { + "type": "object" + }, + "pbLoginByOAuthRequest": { + "type": "object", + "properties": { + "oauthType": { + "type": "string" + }, + "appId": { + "type": "string" + }, + "accessToken": { + "type": "string" + } + }, + "title": "4.LoginByOAuth" + }, + "pbLoginByOAuthResponse": { + "type": "object", + "properties": { + "accessToken": { + "type": "string" + }, + "refreshToken": { + "type": "string" + }, + "username": { + "type": "string" + }, + "role": { + "type": "string" + }, + "accessTokenExpiresAt": { + "type": "string", + "format": "date-time" + }, + "refreshTokenExpiresAt": { + "type": "string", + "format": "date-time" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_repo.swagger.json b/zbook_backend/doc/swagger/service_zbook_repo.swagger.json new file mode 100644 index 0000000..dde1a22 --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_repo.swagger.json @@ -0,0 +1,884 @@ +{ + "swagger": "2.0", + "info": { + "title": "zbook api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookRepo" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/auto_sync_repo": { + "post": { + "summary": "自动远端同步仓库", + "description": "自动远端同步仓库", + "operationId": "ZBookRepo_AutoSyncRepo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbAutoSyncRepoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbAutoSyncRepoRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/create_repo": { + "post": { + "summary": "create repo", + "description": "Use this api to create repo", + "operationId": "ZBookRepo_CreateRepo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateRepoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateRepoRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/delete_repo": { + "post": { + "summary": "delete repo", + "description": "Use this api to delete repo", + "operationId": "ZBookRepo_DeleteRepo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeleteRepoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbDeleteRepoRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/get_list_repo_count": { + "post": { + "summary": "get_repo_count", + "description": "Use this api to list_repo_private", + "operationId": "ZBookRepo_GetListRepoCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListRepoCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListRepoCountRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/get_list_user_like_repo_count": { + "post": { + "summary": "列出用户创建帖子的归属信息", + "description": "分页列出指定用户创建帖子的归属信息", + "operationId": "ZBookRepo_GetListUserLikeRepoCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListUserLikeRepoCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListUserLikeRepoCountRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/get_list_user_own_repo_count": { + "post": { + "summary": "列出用户创建帖子的归属信息", + "description": "分页列出指定用户创建帖子的归属信息", + "operationId": "ZBookRepo_GetListUserOwnRepoCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListUserOwnRepoCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListUserOwnRepoCountRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/get_repo_basic_info": { + "post": { + "summary": "get repo info", + "description": "Use this api to get repo info", + "operationId": "ZBookRepo_GetRepoBasicInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetRepoBasicInfoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetRepoBasicInfoRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/get_repo_config": { + "post": { + "summary": "get repo config", + "description": "Use this api to get repo config", + "operationId": "ZBookRepo_GetRepoConfig", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetRepoConfigResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetRepoConfigRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/list_repo": { + "post": { + "summary": "list_repo", + "description": "Use this api to list_repo_private", + "operationId": "ZBookRepo_ListRepo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListRepoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListRepoRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/list_user_like_repo": { + "post": { + "summary": "列出用户可见喜欢帖子归属信息", + "description": "分页列出指定用户喜欢可见帖子的归属信息", + "operationId": "ZBookRepo_ListUserLikeRepo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListUserLikeRepoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListUserLikeRepoRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/list_user_own_repo": { + "post": { + "summary": "列出用户创建帖子的归属信息", + "description": "分页列出指定用户创建帖子的归属信息", + "operationId": "ZBookRepo_ListUserOwnRepo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListUserOwnRepoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListUserOwnRepoRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/manual_sync_repo": { + "post": { + "summary": "手动与远端同步仓库", + "description": "手动与远端同步仓库", + "operationId": "ZBookRepo_ManualSyncRepo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbManualSyncRepoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbManualSyncRepoRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + }, + "/v1/update_repo_info": { + "post": { + "summary": "update repo", + "description": "Use this api to update repo", + "operationId": "ZBookRepo_UpdateRepoInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUpdateRepoInfoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUpdateRepoInfoRequest" + } + } + ], + "tags": [ + "ZBookRepo" + ] + } + } + }, + "definitions": { + "pbAutoSyncRepoRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "syncToken": { + "type": "string" + } + }, + "title": "5.AutoSyncRepo" + }, + "pbAutoSyncRepoResponse": { + "type": "object" + }, + "pbCreateRepoRequest": { + "type": "object", + "properties": { + "repoName": { + "type": "string" + }, + "repoDescription": { + "type": "string" + }, + "gitAddr": { + "type": "string" + }, + "gitAccessToken": { + "type": "string" + }, + "syncToken": { + "type": "string" + }, + "visibilityLevel": { + "type": "string" + }, + "homePage": { + "type": "string" + }, + "themeSidebar": { + "type": "string" + }, + "themeColor": { + "type": "string" + } + }, + "title": "1.CreateRepo" + }, + "pbCreateRepoResponse": { + "type": "object" + }, + "pbDeleteRepoRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + } + }, + "title": "3.DeleteRepo" + }, + "pbDeleteRepoResponse": { + "type": "object" + }, + "pbGetListRepoCountRequest": { + "type": "object", + "properties": { + "query": { + "type": "string" + } + }, + "title": "14.GetListRepoCount" + }, + "pbGetListRepoCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetListUserLikeRepoCountRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "query": { + "type": "string" + } + }, + "title": "12.GetListUserLikeRepoCount" + }, + "pbGetListUserLikeRepoCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetListUserOwnRepoCountRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "query": { + "type": "string" + } + }, + "title": "10.GetListUserOwnRepoCount" + }, + "pbGetListUserOwnRepoCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetRepoBasicInfoRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + } + }, + "title": "7.GetRepoBasicInfo" + }, + "pbGetRepoBasicInfoResponse": { + "type": "object", + "properties": { + "repoName": { + "type": "string" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "avatar": { + "type": "string", + "format": "byte" + }, + "repoDescription": { + "type": "string" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "homePage": { + "type": "string" + } + } + }, + "pbGetRepoConfigRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + } + }, + "title": "2.GetRepoConfig" + }, + "pbGetRepoConfigResponse": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "config": { + "type": "string" + }, + "visibilityLevel": { + "type": "string" + }, + "themeSidebar": { + "type": "string" + }, + "themeColor": { + "type": "string" + } + } + }, + "pbListRepoInfo": { + "type": "object", + "properties": { + "repoId": { + "type": "string", + "format": "int64" + }, + "repoName": { + "type": "string" + }, + "repoDescription": { + "type": "string" + }, + "visibilityLevel": { + "type": "string" + }, + "gitHost": { + "type": "string" + }, + "likeCount": { + "type": "integer", + "format": "int32" + }, + "isLiked": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "username": { + "type": "string" + } + } + }, + "pbListRepoRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "13.ListRepo" + }, + "pbListRepoResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListRepoInfo" + } + } + } + }, + "pbListUserLikeRepoRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "11.ListUserLikeRepo" + }, + "pbListUserLikeRepoResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListRepoInfo" + } + } + } + }, + "pbListUserOwnRepoRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "9.ListUserOwnRepo" + }, + "pbListUserOwnRepoResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListRepoInfo" + } + } + } + }, + "pbManualSyncRepoRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + } + }, + "title": "4.ManualSyncRepo" + }, + "pbManualSyncRepoResponse": { + "type": "object" + }, + "pbUpdateRepoInfoRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "oldRepoName": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "gitAccessToken": { + "type": "string" + }, + "repoDescription": { + "type": "string" + }, + "visibilityLevel": { + "type": "string" + }, + "syncToken": { + "type": "string" + }, + "homePage": { + "type": "string" + }, + "themeSidebar": { + "type": "string" + }, + "themeColor": { + "type": "string" + } + }, + "title": "6.UpdateRepoInfo" + }, + "pbUpdateRepoInfoResponse": { + "type": "object" + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_repo_relation.swagger.json b/zbook_backend/doc/swagger/service_zbook_repo_relation.swagger.json new file mode 100644 index 0000000..3c8b56f --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_repo_relation.swagger.json @@ -0,0 +1,414 @@ +{ + "swagger": "2.0", + "info": { + "title": "image repo relation api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookRepoRelation" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/create_repo_relation": { + "post": { + "summary": "create like on repo", + "description": "Use this api to create like on repo", + "operationId": "ZBookRepoRelation_CreateRepoRelation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateRepoRelationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateRepoRelationRequest" + } + } + ], + "tags": [ + "ZBookRepoRelation" + ] + } + }, + "/v1/create_repo_visibility": { + "post": { + "summary": "列出用户创建帖子的归属信息", + "description": "分页列出指定用户创建帖子的归属信息", + "operationId": "ZBookRepoRelation_CreateRepoVisibility", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateRepoVisibilityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateRepoVisibilityRequest" + } + } + ], + "tags": [ + "ZBookRepoRelation" + ] + } + }, + "/v1/delete_repo_relation": { + "post": { + "summary": "delete like on repo", + "description": "Use this api to delete like on repo", + "operationId": "ZBookRepoRelation_DeleteRepoRelation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeleteRepoRelationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbDeleteRepoRelationRequest" + } + } + ], + "tags": [ + "ZBookRepoRelation" + ] + } + }, + "/v1/delete_repo_visibility": { + "post": { + "summary": "列出用户创建帖子的归属信息", + "description": "分页列出指定用户创建帖子的归属信息", + "operationId": "ZBookRepoRelation_DeleteRepoVisibility", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbDeleteRepoVisibilityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbDeleteRepoVisibilityRequest" + } + } + ], + "tags": [ + "ZBookRepoRelation" + ] + } + }, + "/v1/get_repo_visibility_count": { + "post": { + "summary": "列出用户创建帖子的归属信息", + "description": "分页列出指定用户创建帖子的归属信息", + "operationId": "ZBookRepoRelation_GetRepoVisibilityCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetRepoVisibilityCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetRepoVisibilityCountRequest" + } + } + ], + "tags": [ + "ZBookRepoRelation" + ] + } + }, + "/v1/list_repo_visibility": { + "post": { + "summary": "列出用户创建帖子的归属信息", + "description": "分页列出指定用户创建帖子的归属信息", + "operationId": "ZBookRepoRelation_ListRepoVisibility", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListRepoVisibilityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListRepoVisibilityRequest" + } + } + ], + "tags": [ + "ZBookRepoRelation" + ] + } + } + }, + "definitions": { + "pbCreateRepoRelationRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "relationType": { + "type": "string" + } + }, + "title": "1.CreateRepoRelation" + }, + "pbCreateRepoRelationResponse": { + "type": "object", + "properties": { + "likeId": { + "type": "string", + "format": "int64" + } + } + }, + "pbCreateRepoVisibilityRequest": { + "type": "object", + "properties": { + "repoUsername": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "title": "3.CreateRepoVisibility" + }, + "pbCreateRepoVisibilityResponse": { + "type": "object" + }, + "pbDeleteRepoRelationRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "relationType": { + "type": "string" + } + }, + "title": "2.DeleteRepoRelation" + }, + "pbDeleteRepoRelationResponse": { + "type": "object" + }, + "pbDeleteRepoVisibilityRequest": { + "type": "object", + "properties": { + "repoUsername": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "title": "4.DeleteRepoVisibility" + }, + "pbDeleteRepoVisibilityResponse": { + "type": "object" + }, + "pbGetRepoVisibilityCountRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + } + }, + "title": "6.GetRepoVisibilityCount" + }, + "pbGetRepoVisibilityCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbListRepoVisibilityRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "username": { + "type": "string" + }, + "repoName": { + "type": "string" + }, + "query": { + "type": "string" + } + }, + "title": "5.ListRepoVisibility" + }, + "pbListRepoVisibilityResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListUserRepoVisiblityInfo" + } + } + } + }, + "pbListUserRepoVisiblityInfo": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "isFollowing": { + "type": "boolean" + }, + "isRepoVisible": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_user.swagger.json b/zbook_backend/doc/swagger/service_zbook_user.swagger.json new file mode 100644 index 0000000..1cc977d --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_user.swagger.json @@ -0,0 +1,727 @@ +{ + "swagger": "2.0", + "info": { + "title": "zbook api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookUser" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/create_user": { + "post": { + "summary": "create new user", + "description": "Use this api to create new user", + "operationId": "ZBookUser_CreateUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbCreateUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbCreateUserRequest" + } + } + ], + "tags": [ + "ZBookUser" + ] + } + }, + "/v1/get_list_user_count": { + "post": { + "summary": "list all user", + "description": "Use this api to list all user", + "operationId": "ZBookUser_GetListUserCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetListUserCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetListUserCountRequest" + } + } + ], + "tags": [ + "ZBookUser" + ] + } + }, + "/v1/get_query_user_count": { + "post": { + "summary": "list all user", + "description": "Use this api to list all user", + "operationId": "ZBookUser_GetQueryUserCount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetQueryUserCountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetQueryUserCountRequest" + } + } + ], + "tags": [ + "ZBookUser" + ] + } + }, + "/v1/get_user_avatar": { + "get": { + "summary": "Verify email", + "description": "Use this API to verify user's email address", + "operationId": "ZBookUser_GetUserAvatar", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetUserAvatarResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "username", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "ZBookUser" + ] + } + }, + "/v1/get_user_info": { + "post": { + "summary": "get details of user", + "description": "Use this api to get details of user", + "operationId": "ZBookUser_GetUserInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbGetUserInfoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbGetUserInfoRequest" + } + } + ], + "tags": [ + "ZBookUser" + ] + } + }, + "/v1/list_user": { + "post": { + "summary": "list all user", + "description": "Use this api to list all user", + "operationId": "ZBookUser_ListUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbListUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbListUserRequest" + } + } + ], + "tags": [ + "ZBookUser" + ] + } + }, + "/v1/login_user": { + "post": { + "summary": "login user", + "description": "Use this api to login user", + "operationId": "ZBookUser_LoginUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbLoginUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbLoginUserRequest" + } + } + ], + "tags": [ + "ZBookUser" + ] + } + }, + "/v1/query_user": { + "post": { + "summary": "检索用户", + "description": "使用用户名关键词检索用户", + "operationId": "ZBookUser_QueryUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbQueryUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbQueryUserRequest" + } + } + ], + "tags": [ + "ZBookUser" + ] + } + }, + "/v1/update_user": { + "post": { + "summary": " update user", + "description": "Use this api to update user", + "operationId": "ZBookUser_UpdateUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUpdateUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUpdateUserRequest" + } + } + ], + "tags": [ + "ZBookUser" + ] + } + }, + "/v1/update_user_onboarding": { + "post": { + "summary": " update user", + "description": "Use this api to update user", + "operationId": "ZBookUser_UpdateUserOnBoarding", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbUpdateUserOnBoardingResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbUpdateUserOnBoardingRequest" + } + } + ], + "tags": [ + "ZBookUser" + ] + } + } + }, + "definitions": { + "pbCreateUserRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "email": { + "type": "string" + }, + "invitationUrl": { + "type": "string" + } + }, + "title": "1.CreateUser" + }, + "pbCreateUserResponse": { + "type": "object" + }, + "pbGetListUserCountRequest": { + "type": "object", + "properties": { + "query": { + "type": "string" + } + }, + "title": "9.GetListUserCount" + }, + "pbGetListUserCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetQueryUserCountRequest": { + "type": "object", + "properties": { + "query": { + "type": "string" + } + }, + "title": "10.GetQueryUserCount" + }, + "pbGetQueryUserCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + } + } + }, + "pbGetUserAvatarResponse": { + "type": "object", + "properties": { + "avatar": { + "type": "string", + "format": "byte" + } + } + }, + "pbGetUserInfoRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "userCount": { + "type": "boolean" + }, + "userBasic": { + "type": "boolean" + }, + "userImage": { + "type": "boolean" + } + }, + "title": "6.GetUserInfo" + }, + "pbGetUserInfoResponse": { + "type": "object", + "properties": { + "userCountInfo": { + "$ref": "#/definitions/pbUserCountInfo" + }, + "userBasicInfo": { + "$ref": "#/definitions/pbUserBasicInfo" + }, + "userImageInfo": { + "$ref": "#/definitions/pbUserImageInfo" + } + } + }, + "pbListUserInfo": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "blocked": { + "type": "boolean" + }, + "verified": { + "type": "boolean" + }, + "onboarding": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "createdAt": { + "type": "string", + "format": "date-time" + } + } + }, + "pbListUserRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "8.ListUser" + }, + "pbListUserResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListUserInfo" + } + } + } + }, + "pbLoginUserRequest": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "title": "2.LoginUser" + }, + "pbLoginUserResponse": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "role": { + "type": "string" + }, + "accessToken": { + "type": "string" + }, + "refreshToken": { + "type": "string" + }, + "accessTokenExpiresAt": { + "type": "string", + "format": "date-time" + }, + "refreshTokenExpiresAt": { + "type": "string", + "format": "date-time" + } + } + }, + "pbQueryUserRequest": { + "type": "object", + "properties": { + "pageId": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "query": { + "type": "string" + } + }, + "title": "5.QueryUser" + }, + "pbQueryUserResponse": { + "type": "object", + "properties": { + "elements": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pbListUserInfo" + } + } + } + }, + "pbUpdateUserOnBoardingRequest": { + "type": "object", + "properties": { + "onboarding": { + "type": "boolean" + } + }, + "title": "4.UpdateUserOnBoarding" + }, + "pbUpdateUserOnBoardingResponse": { + "type": "object", + "properties": { + "onboarding": { + "type": "boolean" + } + } + }, + "pbUpdateUserRequest": { + "type": "object", + "properties": { + "motto": { + "type": "string" + }, + "password": { + "type": "string" + }, + "avatar": { + "type": "string", + "format": "byte" + } + }, + "title": "3.UpdateUser" + }, + "pbUpdateUserResponse": { + "type": "object" + }, + "pbUserBasicInfo": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "format": "int64" + }, + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "motto": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "onboarding": { + "type": "boolean" + } + } + }, + "pbUserCountInfo": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "format": "int64" + }, + "countLikes": { + "type": "integer", + "format": "int32" + }, + "countFollowing": { + "type": "integer", + "format": "int32" + }, + "countFollower": { + "type": "integer", + "format": "int32" + }, + "countRepos": { + "type": "integer", + "format": "int32" + }, + "following": { + "type": "boolean" + } + } + }, + "pbUserImageInfo": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "format": "int64" + }, + "avatar": { + "type": "string", + "format": "byte" + }, + "updateImageInfoAt": { + "type": "string", + "format": "date-time" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/doc/swagger/service_zbook_verification.swagger.json b/zbook_backend/doc/swagger/service_zbook_verification.swagger.json new file mode 100644 index 0000000..cec326c --- /dev/null +++ b/zbook_backend/doc/swagger/service_zbook_verification.swagger.json @@ -0,0 +1,309 @@ +{ + "swagger": "2.0", + "info": { + "title": "zbook api", + "version": "0.1", + "contact": { + "name": "zizdlp.com", + "url": "https://github.com/zizdlp/zbook", + "email": "zizdlp@gmail.com" + } + }, + "tags": [ + { + "name": "ZBookVerification" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/v1/refresh_token": { + "post": { + "summary": "refresh token", + "description": "Use this api to refresh token", + "operationId": "ZBookVerification_RefreshToken", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbRefreshTokenResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbRefreshTokenRequest" + } + } + ], + "tags": [ + "ZBookVerification" + ] + } + }, + "/v1/reset_password": { + "post": { + "summary": "reset password", + "description": "Use this API to reset password", + "operationId": "ZBookVerification_ResetPassword", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbResetPasswordResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbResetPasswordRequest" + } + } + ], + "tags": [ + "ZBookVerification" + ] + } + }, + "/v1/send_email_to_reset_password": { + "post": { + "summary": "Use this api to send verify code to your email", + "description": "Use this api to send verify code to your email", + "operationId": "ZBookVerification_SendEmailToResetPassword", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbSendEmailToResetPasswordResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbSendEmailToResetPasswordRequest" + } + } + ], + "tags": [ + "ZBookVerification" + ] + } + }, + "/v1/send_email_to_verify_email": { + "post": { + "summary": "Use this api to send verify email to your email", + "description": "Use this api to send verify email to your email", + "operationId": "ZBookVerification_SendEmailToVerifyEmail", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbSendEmailToVerifyEmailResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbSendEmailToVerifyEmailRequest" + } + } + ], + "tags": [ + "ZBookVerification" + ] + } + }, + "/v1/verify_email": { + "get": { + "summary": "Verify email", + "description": "Use this API to verify user's email address", + "operationId": "ZBookVerification_VerifyEmail", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbVerifyEmailResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "verificationUrl", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "ZBookVerification" + ] + } + } + }, + "definitions": { + "pbRefreshTokenRequest": { + "type": "object", + "properties": { + "refreshToken": { + "type": "string" + } + }, + "title": "5.RefreshToken" + }, + "pbRefreshTokenResponse": { + "type": "object", + "properties": { + "accessToken": { + "type": "string" + }, + "accessTokenExpiresAt": { + "type": "string", + "format": "date-time" + } + } + }, + "pbResetPasswordRequest": { + "type": "object", + "properties": { + "verificationUrl": { + "type": "string" + }, + "password": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "title": "2.ResetPassword" + }, + "pbResetPasswordResponse": { + "type": "object", + "properties": { + "isReset": { + "type": "boolean" + } + } + }, + "pbSendEmailToResetPasswordRequest": { + "type": "object", + "properties": { + "email": { + "type": "string" + } + }, + "title": "3.SendEmailToResetPassword" + }, + "pbSendEmailToResetPasswordResponse": { + "type": "object", + "properties": { + "isSend": { + "type": "boolean" + } + } + }, + "pbSendEmailToVerifyEmailRequest": { + "type": "object", + "properties": { + "email": { + "type": "string" + } + }, + "title": "4.SendEmailToVerifyEmail" + }, + "pbSendEmailToVerifyEmailResponse": { + "type": "object", + "properties": { + "isSend": { + "type": "boolean" + } + } + }, + "pbVerifyEmailResponse": { + "type": "object", + "properties": { + "isVerified": { + "type": "boolean" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/zbook_backend/gapi/admin_create_system_notification.go b/zbook_backend/gapi/admin_create_system_notification.go new file mode 100644 index 0000000..60636e7 --- /dev/null +++ b/zbook_backend/gapi/admin_create_system_notification.go @@ -0,0 +1,64 @@ +package gapi + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CreateSystemNotification(ctx context.Context, req *rpcs.CreateSystemNotificationRequest) (*rpcs.CreateSystemNotificationResponse, error) { + violations := validateCreateSystemNotificationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + apiUserDailyLimit := 10000 + apiKey := "CreateSystemNotification" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get user: %s", err) + } + + CreateSystemNotificationParams := db.CreateSystemNotificationParams{ + UserID: user.UserID, + Title: req.GetTitle(), + Contents: req.GetContents(), + RedirectUrl: pgtype.Text{String: req.GetRedirectUrl(), Valid: req.GetRedirectUrl() != ""}, + } + err = server.store.CreateSystemNotificationTx(ctx, db.CreateSystemNotificationTxParams{CreateSystemNotificationParams: CreateSystemNotificationParams}) + if err != nil { + if db.ErrorCode(err) == db.UniqueViolation || db.ErrorCode(err) == db.ForeignKeyViolation { + return nil, status.Errorf(codes.AlreadyExists, "system notification already exist: %s", err) + } + return nil, status.Errorf(codes.Internal, "create system notification failed: %s", err) + } + rsp := &rpcs.CreateSystemNotificationResponse{} + return rsp, nil +} +func validateCreateSystemNotificationRequest(req *rpcs.CreateSystemNotificationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + + if err := val.ValidateString(req.GetContents(), 1, 512); err != nil { + violations = append(violations, fieldViolation("content", err)) + } + + if err := val.ValidateString(req.GetTitle(), 1, 512); err != nil { + violations = append(violations, fieldViolation("title", err)) + } + + return violations +} diff --git a/zbook_backend/gapi/admin_delete_user.go b/zbook_backend/gapi/admin_delete_user.go new file mode 100644 index 0000000..7eb0c96 --- /dev/null +++ b/zbook_backend/gapi/admin_delete_user.go @@ -0,0 +1,69 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeleteUser(ctx context.Context, req *rpcs.DeleteUserRequest) (*rpcs.DeleteUserResponse, error) { + violations := validateDeleteUserRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "DeleteUser" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + deletedUser, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get user: %s", err) + } + if deletedUser.UserRole != util.UserRole { + return nil, status.Errorf(codes.PermissionDenied, "admin account cant not be deleted") + } + + arg := db.DeleteUserTxParams{ + UserID: deletedUser.UserID, + Username: deletedUser.Username, + AfterDelte: func(userID int64, username string) error { + err := storage.DeleteAvatarByUsername(server.minioClient, context.Background(), username) + if err != nil { + return err + } + return storage.DeleteFilesByUserID(server.minioClient, context.Background(), userID, "git-files") + }, + } + + err = server.store.DeleteUserTx(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to delete user: %v", err) + } + + err = server.store.DeleteUser(ctx, req.GetUsername()) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "failed to delete user: %s", err) + } + + rsp := &rpcs.DeleteUserResponse{} + return rsp, nil +} +func validateDeleteUserRequest(req *rpcs.DeleteUserRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} diff --git a/zbook_backend/gapi/admin_get_configuration.go b/zbook_backend/gapi/admin_get_configuration.go new file mode 100644 index 0000000..f13f381 --- /dev/null +++ b/zbook_backend/gapi/admin_get_configuration.go @@ -0,0 +1,41 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetConfiguration(ctx context.Context, req *rpcs.GetConfigurationRequest) (*rpcs.GetConfigurationResponse, error) { + violations := validateGetConfigurationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "GetConfiguration" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + config, err := server.store.GetConfiguration(ctx, req.GetConfigName()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get configuration failed: %s", err) + } + + rsp := &rpcs.GetConfigurationResponse{ + ConfigValue: config.ConfigValue, + } + return rsp, nil +} + +func validateGetConfigurationRequest(req *rpcs.GetConfigurationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetConfigName(), 1, 32); err != nil { + violations = append(violations, fieldViolation("config_name", err)) + } + return violations +} diff --git a/zbook_backend/gapi/admin_get_daily_active_user_count.go b/zbook_backend/gapi/admin_get_daily_active_user_count.go new file mode 100644 index 0000000..e558ac5 --- /dev/null +++ b/zbook_backend/gapi/admin_get_daily_active_user_count.go @@ -0,0 +1,104 @@ +package gapi + +import ( + "context" + "sort" + "strconv" + "time" + + "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetDailyActiveUserCount(ctx context.Context, req *rpcs.GetDailyActiveUserCountRequest) (*rpcs.GetDailyActiveUserCountResponse, error) { + // 校验 timezone 参数 + violations := validateGetDailyActiveUserCountRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + apiUserDailyLimit := 10000 + apiKey := "GetDailyActiveUserCount" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + arg := db.GetDailyActiveUserCountParams{ + Timezone: req.GetTimeZone(), + IntervalDays: pgtype.Text{String: strconv.Itoa(int(req.GetNdays())), Valid: true}, + } + + counts, err := server.store.GetDailyActiveUserCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get daily active user count failed: %s", err) + } + + // 对结果进行排序,确保顺序从旧到新 + sort.Slice(counts, func(i, j int) bool { + return counts[i].RegistrationDate.Time.Before(counts[j].RegistrationDate.Time) + }) + + // 将日期和计数拆分成两个数组,并补全缺失日期 + dates, countsArray := fillMissingDatesAndCountsForActiveUser(counts, req.GetNdays(), req.GetTimeZone()) + rsp := &rpcs.GetDailyActiveUserCountResponse{ + Dates: dates, + Counts: countsArray, + } + return rsp, nil +} +func fillMissingDatesAndCountsForActiveUser(users []db.GetDailyActiveUserCountRow, ndays int32, timezone string) ([]string, []int32) { + var dates []string + var countsMap = make(map[string]int32) + + // Load the location + location, err := time.LoadLocation(timezone) + if err != nil { + // Handle the error according to your application's needs + return nil, nil + } + + // Get the end date in the specified timezone + endDate := time.Now().In(location) + endDate = time.Date(endDate.Year(), endDate.Month(), endDate.Day(), 0, 0, 0, 0, location) + + // Calculate the start date + startDate := endDate.AddDate(0, 0, -int(ndays)) + + // Generate date range + for date := startDate; !date.After(endDate); date = date.AddDate(0, 0, 1) { + formattedDate := date.Format("2006-01-02") + dates = append(dates, formattedDate) + countsMap[formattedDate] = 0 + } + + // Update counts map with actual data + for _, user := range users { + formattedDate := user.RegistrationDate.Time.Format("2006-01-02") + countsMap[formattedDate] = int32(user.ActiveUsersCount) + } + + // Fill counts array in the same order as dates + var counts []int32 + for _, date := range dates { + counts = append(counts, countsMap[date]) + } + + return dates, counts +} + +func validateGetDailyActiveUserCountRequest(req *rpcs.GetDailyActiveUserCountRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidTimeZone(req.GetTimeZone()); err != nil { + violations = append(violations, fieldViolation("time_zone", err)) + } + if err := val.ValidateInt32ID(req.GetNdays()); err != nil { + violations = append(violations, fieldViolation("ndays", err)) + } + return violations +} diff --git a/zbook_backend/gapi/admin_get_daily_create_user_count.go b/zbook_backend/gapi/admin_get_daily_create_user_count.go new file mode 100644 index 0000000..b7579ee --- /dev/null +++ b/zbook_backend/gapi/admin_get_daily_create_user_count.go @@ -0,0 +1,101 @@ +package gapi + +import ( + "context" + "sort" + "strconv" + "time" + + "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetDailyCreateUserCount(ctx context.Context, req *rpcs.GetDailyCreateUserCountRequest) (*rpcs.GetDailyCreateUserCountResponse, error) { + violations := validateGetDailyCreateUserCount(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + apiUserDailyLimit := 10000 + apiKey := "GetDailyCreateUserCount" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + arg := db.GetDailyCreateUserCountParams{ + Timezone: req.GetTimeZone(), + IntervalDays: pgtype.Text{String: strconv.Itoa(int(req.GetNdays())), Valid: true}, + } + + counts, err := server.store.GetDailyCreateUserCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get daily create user count: %s", err) + } + // 对结果进行排序,确保顺序从旧到新 + sort.Slice(counts, func(i, j int) bool { + return counts[i].RegistrationDate.Time.Before(counts[j].RegistrationDate.Time) + }) + + // 补全日期范围并填充数据 + dates, countsArray := fillMissingDatesAndCounts(counts, req.GetNdays(), req.GetTimeZone()) + + rsp := &rpcs.GetDailyCreateUserCountResponse{ + Dates: dates, + Counts: countsArray, + } + return rsp, nil +} +func fillMissingDatesAndCounts(users []db.GetDailyCreateUserCountRow, ndays int32, timezone string) ([]string, []int32) { + var dates []string + var countsMap = make(map[string]int32) + + // Load the location + location, err := time.LoadLocation(timezone) + if err != nil { + // Handle the error according to your application's needs + return nil, nil + } + + // Calculate start and end dates + endDate := time.Now().In(location) + endDate = time.Date(endDate.Year(), endDate.Month(), endDate.Day(), 0, 0, 0, 0, location) + startDate := endDate.AddDate(0, 0, -int(ndays)) + + // Generate date range + for date := startDate; !date.After(endDate); date = date.AddDate(0, 0, 1) { + formattedDate := date.Format("2006-01-02") + dates = append(dates, formattedDate) + countsMap[formattedDate] = 0 + } + + // Update counts map with actual data + for _, user := range users { + formattedDate := user.RegistrationDate.Time.Format("2006-01-02") + countsMap[formattedDate] = int32(user.NewUsersCount) + } + + // Fill counts array in the same order as dates + var counts []int32 + for _, date := range dates { + counts = append(counts, countsMap[date]) + } + + return dates, counts +} + +func validateGetDailyCreateUserCount(req *rpcs.GetDailyCreateUserCountRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidTimeZone(req.GetTimeZone()); err != nil { + violations = append(violations, fieldViolation("time_zone", err)) + } + if err := val.ValidateInt32ID(req.GetNdays()); err != nil { + violations = append(violations, fieldViolation("ndays", err)) + } + return violations +} diff --git a/zbook_backend/gapi/admin_get_daily_visitor_count.go b/zbook_backend/gapi/admin_get_daily_visitor_count.go new file mode 100644 index 0000000..d9ccb1f --- /dev/null +++ b/zbook_backend/gapi/admin_get_daily_visitor_count.go @@ -0,0 +1,50 @@ +package gapi + +import ( + "context" + "sort" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetDailyVisitorCount(ctx context.Context, req *rpcs.GetDailyVisitorCountRequest) (*rpcs.GetDailyVisitorCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetDailyVisitorCount" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + counts, err := server.GetUniqueKeysCountForLastNDays(req.GetNdays(), req.GetTimeZone()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get unique visitor count failed: %s", err) + } + + // 对结果进行排序,确保顺序从旧到新 + sort.Slice(counts, func(i, j int) bool { + return counts[i].Date.Before(counts[j].Date) + }) + + // 分离日期和计数 + dates, countsList := convertDailyVisitorCount(counts) + rsp := &rpcs.GetDailyVisitorCountResponse{ + Dates: dates, + Counts: countsList, + } + return rsp, nil +} + +func convertDailyVisitorCount(users []DailyUniqueKeysCount) ([]string, []int32) { + var dates []string + var counts []int32 + for i := 0; i < len(users); i++ { + // 只保留年月日 + formattedDate := users[i].Date.Format("2006-01-02") + dates = append(dates, formattedDate) + counts = append(counts, int32(users[i].Count)) + } + return dates, counts +} diff --git a/zbook_backend/gapi/admin_get_daily_visitors.go b/zbook_backend/gapi/admin_get_daily_visitors.go new file mode 100644 index 0000000..6d63c61 --- /dev/null +++ b/zbook_backend/gapi/admin_get_daily_visitors.go @@ -0,0 +1,80 @@ +package gapi + +import ( + "context" + "net/netip" + + "github.com/rs/zerolog/log" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetDailyVisitors(ctx context.Context, req *rpcs.GetDailyVisitorsRequest) (*rpcs.GetDailyVisitorsResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetDailyVisitors" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + visitors, err := server.GetDailyVisitorsForLastNDays(req.GetNdays()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get daily visitor failed: %s", err) + } + + rsp := &rpcs.GetDailyVisitorsResponse{ + Visitors: convertVisitors(server, visitors, req.GetLang()), + } + return rsp, nil +} + +func convertVisitors(server *Server, visitors []*VisitorData, lang string) []*rpcs.Visitor { + var ret_reports []*rpcs.Visitor + for i := 0; i < len(visitors); i++ { + ip, err := netip.ParseAddr(visitors[i].IP) + if err != nil { + log.Error().Err(err).Msgf("can not parse ip addr: %s", visitors[i].IP) + continue + } + record, err := server.store.GetGeoInfo(context.Background(), ip) + if err != nil { + // 如果解析出错,则将错误信息添加到响应中,继续处理下一个 IP + ret_reports = append(ret_reports, + &rpcs.Visitor{ + IP: visitors[i].IP, + Agent: visitors[i].Agent, + Count: int32(visitors[i].Count), + }, + ) + } else { + // 如果解析成功,则将城市、经度和纬度信息添加到响应中 + + city := "" + if lang == "en" { + if record.CityNameEn.Valid { + city = record.CityNameEn.String + } + } else if record.CityNameZhCn.Valid { + city = record.CityNameZhCn.String + } else { + if record.CityNameEn.Valid { + city = record.CityNameEn.String + } + } + + ret_reports = append(ret_reports, + &rpcs.Visitor{ + IP: visitors[i].IP, + Agent: visitors[i].Agent, + Count: int32(visitors[i].Count), + City: city, + Lat: record.Latitude.Float64, + Long: record.Longitude.Float64, + }, + ) + } + } + return ret_reports +} diff --git a/zbook_backend/gapi/admin_get_list_comment_count.go b/zbook_backend/gapi/admin_get_list_comment_count.go new file mode 100644 index 0000000..89fa144 --- /dev/null +++ b/zbook_backend/gapi/admin_get_list_comment_count.go @@ -0,0 +1,41 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListCommentCount(ctx context.Context, req *rpcs.GetListCommentCountRequest) (*rpcs.GetListCommentCountResponse, error) { + + apiUserDailyLimit := 10000 + apiKey := "GetListCommentCount" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + if req.GetQuery() != "" { + user_count, err := server.store.GetQueryCommentCount(ctx, req.GetQuery()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query comment count failed: %s", err) + } + + rsp := &rpcs.GetListCommentCountResponse{ + Count: user_count, + } + return rsp, nil + } else { + user_count, err := server.store.GetListCommentCount(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list comment count failed: %s", err) + } + rsp := &rpcs.GetListCommentCountResponse{ + Count: user_count, + } + return rsp, nil + } + +} diff --git a/zbook_backend/gapi/admin_get_list_comment_report_count.go b/zbook_backend/gapi/admin_get_list_comment_report_count.go new file mode 100644 index 0000000..0b7e7a5 --- /dev/null +++ b/zbook_backend/gapi/admin_get_list_comment_report_count.go @@ -0,0 +1,29 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListCommentReportCount(ctx context.Context, req *rpcs.GetListCommentReportCountRequest) (*rpcs.GetListCommentReportCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetListCommentReportCount" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + user_count, err := server.store.GetListCommentReportCount(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list comment report count failed: %s", err) + } + + rsp := &rpcs.GetListCommentReportCountResponse{ + Count: user_count, + } + return rsp, nil +} diff --git a/zbook_backend/gapi/admin_get_list_session_count.go b/zbook_backend/gapi/admin_get_list_session_count.go new file mode 100644 index 0000000..c2aba75 --- /dev/null +++ b/zbook_backend/gapi/admin_get_list_session_count.go @@ -0,0 +1,42 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListSessionCount(ctx context.Context, req *rpcs.GetListSessionCountRequest) (*rpcs.GetListSessionCountResponse, error) { + + apiUserDailyLimit := 10000 + apiKey := "GetListSessionCount" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + if req.GetQuery() != "" { + user_count, err := server.store.GetQuerySessionCount(ctx, req.GetQuery()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query active session count failed: %s", err) + } + + rsp := &rpcs.GetListSessionCountResponse{ + Count: user_count, + } + return rsp, nil + } else { + user_count, err := server.store.GetListSessionCount(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list active session count failed: %s", err) + } + + rsp := &rpcs.GetListSessionCountResponse{ + Count: user_count, + } + return rsp, nil + } + +} diff --git a/zbook_backend/gapi/admin_list_comment.go b/zbook_backend/gapi/admin_list_comment.go new file mode 100644 index 0000000..53d2d13 --- /dev/null +++ b/zbook_backend/gapi/admin_list_comment.go @@ -0,0 +1,100 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListComment(ctx context.Context, req *rpcs.ListCommentRequest) (*rpcs.ListCommentResponse, error) { + violations := validateListCommentRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "ListComment" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + if req.GetQuery() != "" { + arg := db.QueryCommentParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Query: req.GetQuery(), + } + + reports, err := server.store.QueryComment(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query comment failed: %s", err) + } + rsp := &rpcs.ListCommentResponse{ + Elements: convertListCommentByID(reports), + } + return rsp, nil + } + arg := db.ListCommentParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + } + + reports, err := server.store.ListComment(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list comment failed: %s", err) + } + + rsp := &rpcs.ListCommentResponse{ + Elements: convertListComment(reports), + } + return rsp, nil +} +func validateListCommentRequest(req *rpcs.ListCommentRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} + +func convertListComment(reports []db.ListCommentRow) []*models.ListAdminCommentInfo { + var ret_reports []*models.ListAdminCommentInfo + for i := 0; i < len(reports); i++ { + ret_reports = append(ret_reports, + &models.ListAdminCommentInfo{ + CommentId: reports[i].CommentID, + CommentContent: reports[i].CommentContent, + CreatedAt: timestamppb.New(reports[i].CreatedAt), + Username: reports[i].Username, + Email: reports[i].Email, + }, + ) + } + return ret_reports +} + +func convertListCommentByID(reports []db.QueryCommentRow) []*models.ListAdminCommentInfo { + var ret_reports []*models.ListAdminCommentInfo + for i := 0; i < len(reports); i++ { + ret_reports = append(ret_reports, + &models.ListAdminCommentInfo{ + CommentId: reports[i].CommentID, + CommentContent: reports[i].CommentContent, + CreatedAt: timestamppb.New(reports[i].CreatedAt), + Username: reports[i].Username, + Email: reports[i].Email, + }, + ) + } + return ret_reports +} diff --git a/zbook_backend/gapi/admin_list_comment_report.go b/zbook_backend/gapi/admin_list_comment_report.go new file mode 100644 index 0000000..66ed0b9 --- /dev/null +++ b/zbook_backend/gapi/admin_list_comment_report.go @@ -0,0 +1,111 @@ +package gapi + +import ( + "context" + "fmt" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListCommentReport(ctx context.Context, req *rpcs.ListCommentReportRequest) (*rpcs.ListCommentReportResponse, error) { + violations := validateListCommentReportRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "ListCommentReport" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + if req.GetQuery() != "" { + arg := db.QueryCommentReportParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Query: req.GetQuery(), + } + reports, err := server.store.QueryCommentReport(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query comment report failed: %s", err) + } + rsp := &rpcs.ListCommentReportResponse{ + Elements: convertQueryCommentReport(reports), + } + fmt.Println("---:", req.GetQuery(), reports) + return rsp, nil + } + arg := db.ListCommentReportParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + } + + reports, err := server.store.ListCommentReport(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list comment resport failed: %s", err) + } + + rsp := &rpcs.ListCommentReportResponse{ + Elements: convertListCommentReport(reports), + } + return rsp, nil +} +func validateListCommentReportRequest(req *rpcs.ListCommentReportRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} + +func convertListCommentReport(reports []db.ListCommentReportRow) []*models.ListCommentReportInfo { + var ret_reports []*models.ListCommentReportInfo + for i := 0; i < len(reports); i++ { + ret_reports = append(ret_reports, + &models.ListCommentReportInfo{ + ReportId: reports[i].ReportID, + CommentId: reports[i].CommentID, + RepoName: reports[i].RepoName, + RepoUsername: reports[i].RepoUsername, + RelativePath: reports[i].RelativePath, + ReportContent: reports[i].ReportContent, + CommentContent: reports[i].CommentContent, + Processed: reports[i].Processed, + CreatedAt: timestamppb.New(reports[i].CreatedAt), + Username: reports[i].Username, + }, + ) + } + return ret_reports +} + +func convertQueryCommentReport(reports []db.QueryCommentReportRow) []*models.ListCommentReportInfo { + var ret_reports []*models.ListCommentReportInfo + for i := 0; i < len(reports); i++ { + ret_reports = append(ret_reports, + &models.ListCommentReportInfo{ + ReportId: reports[i].ReportID, + CommentId: reports[i].CommentID, + RepoName: reports[i].RepoName, + RepoUsername: reports[i].RepoUsername, + RelativePath: reports[i].RelativePath, + ReportContent: reports[i].ReportContent, + CommentContent: reports[i].CommentContent, + Processed: reports[i].Processed, + CreatedAt: timestamppb.New(reports[i].CreatedAt), + Username: reports[i].Username, + }, + ) + } + return ret_reports +} diff --git a/zbook_backend/gapi/admin_list_session.go b/zbook_backend/gapi/admin_list_session.go new file mode 100644 index 0000000..a3f60fd --- /dev/null +++ b/zbook_backend/gapi/admin_list_session.go @@ -0,0 +1,100 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListSession(ctx context.Context, req *rpcs.ListSessionRequest) (*rpcs.ListSessionResponse, error) { + violations := validateListSessionRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "ListSession" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + if req.GetQuery() != "" { + arg := db.QuerySessionParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Query: req.GetQuery(), + } + sessions, err := server.store.QuerySession(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query active session failed: %s", err) + } + rsp := &rpcs.ListSessionResponse{ + Elements: convertListSessionQuery(sessions), + } + return rsp, nil + } + + arg := db.ListSessionParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + } + + sessions, err := server.store.ListSession(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list active session failed: %s", err) + } + rsp := &rpcs.ListSessionResponse{ + Elements: convertListSession(sessions), + } + return rsp, nil +} +func validateListSessionRequest(req *rpcs.ListSessionRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} + +func convertListSession(sessions []db.ListSessionRow) []*models.SessionInfo { + var ret_sessions []*models.SessionInfo + for i := 0; i < len(sessions); i++ { + ret_sessions = append(ret_sessions, + &models.SessionInfo{ + UserAgent: sessions[i].UserAgent, + Email: sessions[i].Email, + ClientIp: sessions[i].ClientIp, + Username: sessions[i].Username, + ExpiresAt: timestamppb.New(sessions[i].ExpiresAt), + CreatedAt: timestamppb.New(sessions[i].CreatedAt), + }, + ) + } + return ret_sessions +} + +func convertListSessionQuery(sessions []db.QuerySessionRow) []*models.SessionInfo { + var ret_sessions []*models.SessionInfo + for i := 0; i < len(sessions); i++ { + ret_sessions = append(ret_sessions, + &models.SessionInfo{ + Email: sessions[i].Email, + UserAgent: sessions[i].UserAgent, + ClientIp: sessions[i].ClientIp, + Username: sessions[i].Username, + ExpiresAt: timestamppb.New(sessions[i].ExpiresAt), + CreatedAt: timestamppb.New(sessions[i].CreatedAt), + }, + ) + } + return ret_sessions +} diff --git a/zbook_backend/gapi/admin_log_visitor.go b/zbook_backend/gapi/admin_log_visitor.go new file mode 100644 index 0000000..5a12a55 --- /dev/null +++ b/zbook_backend/gapi/admin_log_visitor.go @@ -0,0 +1,16 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" +) + +func (server *Server) LogVisitor(ctx context.Context, req *rpcs.LogVisitorRequest) (*rpcs.LogVisitorResponse, error) { + err := server.LogRedisVisitor(ctx) + if err != nil { + return nil, err + } + rsp := &rpcs.LogVisitorResponse{} + return rsp, nil +} diff --git a/zbook_backend/gapi/admin_send_invitation.go b/zbook_backend/gapi/admin_send_invitation.go new file mode 100644 index 0000000..b95f6c6 --- /dev/null +++ b/zbook_backend/gapi/admin_send_invitation.go @@ -0,0 +1,58 @@ +package gapi + +import ( + "context" + "fmt" + "time" + + "github.com/hibiken/asynq" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "github.com/zizdlp/zbook/worker" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) SendInvitation(ctx context.Context, req *rpcs.SendInvitationRequest) (*rpcs.SendInvitationResponse, error) { + violations := validateSendInvitationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + apiUserDailyLimit := 10000 + apiKey := "SendInvitation" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + user, err := server.store.GetUserByEmail(ctx, req.GetEmail()) + if err == nil { + return nil, fmt.Errorf("use already exist for this email: %s", user.Email) + } + taskPayload := &worker.PayloadInviteUser{ + Email: req.GetEmail(), + } + opts := []asynq.Option{ + asynq.MaxRetry(10), + asynq.ProcessIn(10 * time.Second), + asynq.Queue(worker.QueueCritical), + } + err = server.taskDistributor.DistributeTaskInviteUser(ctx, taskPayload, opts...) + if err != nil { + return nil, status.Errorf(codes.Internal, "distribute invite user task failed: %s", err) + } + rsp := &rpcs.SendInvitationResponse{ + IsSend: true, + } + return rsp, nil + +} + +func validateSendInvitationRequest(req *rpcs.SendInvitationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateEmail(req.GetEmail()); err != nil { + violations = append(violations, fieldViolation("email", err)) + } + return violations +} diff --git a/zbook_backend/gapi/admin_update_comment_report_status.go b/zbook_backend/gapi/admin_update_comment_report_status.go new file mode 100644 index 0000000..4fa5998 --- /dev/null +++ b/zbook_backend/gapi/admin_update_comment_report_status.go @@ -0,0 +1,49 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) UpdateCommentReportStatus(ctx context.Context, req *rpcs.UpdateCommentReportStatusRequest) (*rpcs.UpdateCommentReportStatusResponse, error) { + violations := validateUpdateCommentReportStatusRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "UpdateCommentReportStatus" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + arg := db.UpdateCommentReportStatusParams{ + ReportID: req.GetReportId(), + Processed: req.GetProcessed(), + } + + err = server.store.UpdateCommentReportStatus(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "comment report not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "failed to update comment report: %s", err) + } + + rsp := &rpcs.UpdateCommentReportStatusResponse{} + return rsp, nil +} +func validateUpdateCommentReportStatusRequest(req *rpcs.UpdateCommentReportStatusRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetReportId()); err != nil { + violations = append(violations, fieldViolation("report_id", err)) + } + return violations +} diff --git a/zbook_backend/gapi/admin_update_configuration.go b/zbook_backend/gapi/admin_update_configuration.go new file mode 100644 index 0000000..8b18fb1 --- /dev/null +++ b/zbook_backend/gapi/admin_update_configuration.go @@ -0,0 +1,44 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) UpdateConfiguration(ctx context.Context, req *rpcs.UpdateConfigurationRequest) (*rpcs.UpdateConfigurationResponse, error) { + violations := validateUpdateConfigurationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "UpdateConfiguration" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + arg := db.UpdateConfigurationParams{ + ConfigName: req.GetConfigName(), + ConfigValue: req.GetConfigValue(), + } + err = server.store.UpdateConfiguration(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "update configuration failed: %s", err) + } + + rsp := &rpcs.UpdateConfigurationResponse{} + return rsp, nil +} + +func validateUpdateConfigurationRequest(req *rpcs.UpdateConfigurationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetConfigName(), 1, 32); err != nil { + violations = append(violations, fieldViolation("config_name", err)) + } + return violations +} diff --git a/zbook_backend/gapi/admin_update_user_block.go b/zbook_backend/gapi/admin_update_user_block.go new file mode 100644 index 0000000..d12554f --- /dev/null +++ b/zbook_backend/gapi/admin_update_user_block.go @@ -0,0 +1,56 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) UpdateUserBlock(ctx context.Context, req *rpcs.UpdateUserBlockRequest) (*rpcs.UpdateUserBlockResponse, error) { + violations := validateUpdateUserBlockRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "UpdateUserBlock" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + user_set, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.NotFound, "user not exist: %s", err) + } + if user_set.UserRole == util.AdminRole { + return nil, status.Errorf(codes.PermissionDenied, "admin user can not be blocked") + } + arg := db.UpdateUserBasicInfoParams{ + Username: req.GetUsername(), + Blocked: pgtype.Bool{Bool: req.GetBlocked(), Valid: true}, + } + + user, err := server.store.UpdateUserBasicInfo(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "update user failed: %s", err) + } + + rsp := &rpcs.UpdateUserBlockResponse{Blocked: user.Blocked} + return rsp, nil +} +func validateUpdateUserBlockRequest(req *rpcs.UpdateUserBlockRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} diff --git a/zbook_backend/gapi/auth.go b/zbook_backend/gapi/auth.go new file mode 100644 index 0000000..945b126 --- /dev/null +++ b/zbook_backend/gapi/auth.go @@ -0,0 +1,395 @@ +package gapi + +import ( + "context" + "fmt" + "sort" + "strconv" + "strings" + "time" + + "github.com/go-redis/redis" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +const ( + authorizationHeader = "authorization" + authorizationBearer = "bearer" +) + +func (server *Server) checkUserStatus(ctx context.Context, Blocked bool, UserRole string, Verified bool) error { + + if Blocked { + return status.Errorf(codes.PermissionDenied, "user account has been blocked, please contact admin") + } + if server.config.REQUIRE_EMAIL_VERIFY && !Verified { + return status.Errorf(codes.PermissionDenied, "email not verified for this account") + } + + config, err := server.store.GetConfiguration(ctx, "allow_login") + if err != nil { + return status.Errorf(codes.Internal, "failed to get login configuration: %s", err) + } + if !config.ConfigValue && UserRole != util.AdminRole { + return status.Errorf(codes.PermissionDenied, "login is currently disabled") + } + return nil +} + +func (server *Server) CreateLoginPart(ctx context.Context, Username string, UserRole string, UserID int64, apiKey string) (*rpcs.LoginUserResponse, error) { + + accessToken, accessPayload, err := server.tokenMaker.CreateToken( + Username, + UserRole, + server.config.AccessTokenDuration, + ) + if err != nil { + return nil, status.Errorf(codes.Internal, "create access token token failed: %s", err) + } + + refreshToken, refreshPayload, err := server.tokenMaker.CreateToken( + Username, + UserRole, + server.config.RefreshTokenDuration, + ) + if err != nil { + return nil, status.Errorf(codes.Internal, "create refresh token failed: %s", err) + } + apiUserDailyLimit := 100 + err = server.checkUserLimit(UserID, apiKey, apiUserDailyLimit) + if err != nil { + return nil, err + } + mtdt := server.extractMetadata(ctx) + _, err = server.store.CreateSession(ctx, db.CreateSessionParams{ + SessionID: refreshPayload.ID, + UserID: UserID, + RefreshToken: refreshToken, + UserAgent: mtdt.UserAgent, + ClientIp: mtdt.ClientIP, + ExpiresAt: refreshPayload.ExpiredAt, + }) + if err != nil { + return nil, status.Errorf(codes.Internal, "create session failed: %s", err) + } + rsp := &rpcs.LoginUserResponse{ + AccessToken: accessToken, + RefreshToken: refreshToken, + Username: Username, + AccessTokenExpiresAt: timestamppb.New(accessPayload.ExpiredAt), + RefreshTokenExpiresAt: timestamppb.New(refreshPayload.ExpiredAt), + Role: UserRole, + } + return rsp, nil +} + +func (server *Server) authUser(ctx context.Context, accessibleRoles []string, apiUserDailyLimit int, apiKey string) (*db.User, error) { + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return nil, status.Errorf(codes.Unauthenticated, "missing metadata") + } + values := md.Get(authorizationHeader) + if len(values) == 0 { + return nil, status.Errorf(codes.Unauthenticated, "missing authorization header") + } + authHeader := values[0] + fields := strings.Fields(authHeader) + if len(fields) < 2 { + return nil, status.Errorf(codes.Unauthenticated, "invalid authorization header format") + } + authType := strings.ToLower(fields[0]) + if authType != authorizationBearer { + return nil, status.Errorf(codes.Unauthenticated, "unsupported authorization type: %s", authType) + } + accessToken := fields[1] + payload, err := server.tokenMaker.VerifyToken(accessToken) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, "invalid access token: %s", err) + } + user, err := server.store.GetUserByUsername(ctx, payload.Username) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get user: %s", err) + } + err = server.checkUserStatus(ctx, user.Blocked, user.UserRole, user.Verified) + if err != nil { + return nil, err + } + + if !hasPermission(payload.Role, accessibleRoles) { + return nil, status.Errorf(codes.PermissionDenied, "permission denied") + } + err = server.checkUserLimit(user.UserID, apiKey, apiUserDailyLimit) + if err != nil { + return nil, err + } + return &user, nil +} + +func hasPermission(userRole string, accessibleRoles []string) bool { + for _, role := range accessibleRoles { + if userRole == role { + return true + } + } + return false +} + +type DailyUniqueKeysCount struct { + Date time.Time + Count int32 +} + +type VisitorData struct { + IP string + Agent string + Count int +} + +// 定义排序函数,按照 Count 降序排序 +type ByCountDesc []*VisitorData + +func (a ByCountDesc) Len() int { + return len(a) +} +func (a ByCountDesc) Swap(i, j int) { + a[i], a[j] = a[j], a[i] +} +func (a ByCountDesc) Less(i, j int) bool { + return a[i].Count > a[j].Count // 降序排序 +} + +func (server *Server) GetDailyVisitorsForLastNDays(ndays int32) ([]*VisitorData, error) { + // 定义用于存储符合条件的访客数据的切片 + var visitors []*VisitorData + location, err := time.LoadLocation(server.config.TIMEZONE) + if err != nil { + return nil, fmt.Errorf("failed to load location:%v", err) + } + for i := 0; i < int(ndays); i++ { + // 计算当前日期(向前推 ndays 天) + currentDate := time.Now().In(location).AddDate(0, 0, -i) + today := currentDate.Format("2006-01-02") + + // 构建 Redis 键的模式,匹配过去一天的所有键 + pattern := fmt.Sprint("logvisitor:*:*:*", today) + // 获取符合模式的所有 Redis 键 + keys, err := server.redisClient.Keys(pattern).Result() + if err != nil { + return nil, status.Errorf(codes.Internal, "error fetching keys from Redis: %s", err) + } + + // 遍历符合模式的所有键 + for _, key := range keys { + // 获取键对应的值,即访问次数 + countStr, err := server.redisClient.Get(key).Result() + if err != nil { + return nil, status.Errorf(codes.Internal, "error fetching value from Redis: %s", err) + } + count, err := strconv.Atoi(countStr) + if err != nil { + return nil, status.Errorf(codes.Internal, "error fetching value from Redis: %s", err) + } + // 将键解析为 IP 和 UserAgent + parts := strings.Split(key, ":") + // 获取 IP 地址部分 + ipParts := strings.Split(parts[1], ",")[0] + // 构建 VisitorData 结构体并添加到切片中 + visitors = append(visitors, &VisitorData{ + IP: ipParts, + Agent: parts[len(parts)-2], + Count: count, + }) + } + } + sort.Sort(ByCountDesc(visitors)) + return visitors, nil +} + +func (server *Server) GetUniqueKeysCountForLastNDays(ndays int32, timezone string) ([]DailyUniqueKeysCount, error) { + var dailyCounts []DailyUniqueKeysCount + + // 加载时区 + location, err := time.LoadLocation(server.config.TIMEZONE) + if err != nil { + return nil, fmt.Errorf("failed to load location:%v", err) + } + // 遍历过去 ndays 天内的每一天 + for i := 0; i < int(ndays); i++ { + // 计算指定时区的当前日期(向前推 ndays 天) + + currentDate := time.Now().In(location).AddDate(0, 0, -i) + today := currentDate.Format("2006-01-02") + + // 构建 Redis 键的模式,用于匹配该天的所有键 + pattern := fmt.Sprintf("logvisitor:*:%s", today) + // 获取匹配的键列表 + keys, err := server.redisClient.Keys(pattern).Result() + if err != nil { + return nil, err + } + + // 计算集合的大小,即为该天的唯一键数量,并存储到数组中 + uniqueKeysCount := int32(len(keys)) + dailyCounts = append(dailyCounts, DailyUniqueKeysCount{Date: currentDate, Count: uniqueKeysCount}) + } + return dailyCounts, nil +} + +func (server *Server) insertRedisKey(redisKey string, dailyLimit int, duration time.Duration) error { + // 获取当前用户的插入次数 + countStr, err := server.redisClient.Get(redisKey).Result() + if err == redis.Nil { + // 如果 Redis 键不存在,则说明用户还没有插入过数据,插入次数初始化为 0 + countStr = "0" + } else if err != nil { + return status.Errorf(codes.Internal, "failed to retrieve count from Redis: %s", err) + } + + // 将插入次数字符串转换为整数 + count, err := strconv.Atoi(countStr) + if err != nil { + return status.Errorf(codes.Internal, "failed to convert count string '%s' to integer: %s", countStr, err) + } + + // 检查插入次数是否已经达到限制 + if count >= dailyLimit { + return status.Errorf(codes.ResourceExhausted, "user has exceeded the daily limit of %d inserts", dailyLimit) + } + + // 更新 Redis 中用户的插入次数 + count++ + err = server.redisClient.Set(redisKey, strconv.Itoa(count), duration*time.Hour).Err() + if err != nil { + return status.Errorf(codes.Internal, "failed to update count in Redis: %s", err) + } + return nil +} + +func (server *Server) LogRedisVisitor(ctx context.Context) (err error) { + mtdt := server.extractMetadata(ctx) + UserAgent := mtdt.UserAgent + ClientIp := mtdt.ClientIP + + if strings.HasPrefix(ClientIp, "::1") { + ClientIp = "127.0.0.1" + strings.TrimPrefix(ClientIp, "::1") + } + // 分隔ClientIp并取第一个部分 + if ClientIp == "" { + ClientIp = "unknown" + } else { + // 分隔ClientIp并取第一个部分 + ClientIpParts := strings.Split(ClientIp, ",") + ClientIp = ClientIpParts[0] + } + location, err := time.LoadLocation(server.config.TIMEZONE) + if err != nil { + return fmt.Errorf("failed to load location:%v", err) + } + today := time.Now().In(location).Format("2006-01-02") + redisKey := fmt.Sprintf("%s:%s:%s:%s", "logvisitor", ClientIp, UserAgent, today) + log.Info().Msgf("inser to redis: %s", redisKey) + return server.insertRedisKey(redisKey, 1000000, 24*31) //保留31天,设置较大使用限制 +} + +func (server *Server) checkUserLimit(userID int64, keytype string, dailyLimit int) error { + + // 获取当前日期字符串,用于构建 Redis 键和设置过期时间 + location, err := time.LoadLocation(server.config.TIMEZONE) + if err != nil { + return fmt.Errorf("failed to load location:%v", err) + } + today := time.Now().In(location).Format("2006-01-02") + userIDStr := strconv.FormatInt(userID, 10) + redisKey := fmt.Sprintf("userlimit:%s:%s:%s", keytype, userIDStr, today) + return server.insertRedisKey(redisKey, dailyLimit, 24) //保留24h +} + +// 1,表示等同于写的用户,2表示其他可见用户,0表示无权限 +func (server *Server) getUserPermessionlevel(ctx context.Context, authUsername string, username string) (int, error) { + if username == authUsername { + return 1, nil + } + checkUser, err := server.store.GetUserByUsername(ctx, authUsername) + if err != nil { + return 0, err + } + if checkUser.UserRole == util.AdminRole { + return 1, nil + } + datauser, err := server.store.GetUserByUsername(ctx, username) + if err != nil { + return 0, err + } + // TODO add verified + if !datauser.Blocked { + return 2, nil + } + return 0, status.Errorf(codes.PermissionDenied, "current account do not have enough permission") +} + +func (server *Server) isRepoVisibleToCurrentUser(ctx context.Context, RepoID int64) error { + repoInfo, err := server.store.GetRepoPermission(ctx, RepoID) + if err != nil { + return status.Errorf(codes.Internal, "get repo failed: %s", err) + } + + if repoInfo.VisibilityLevel == util.VisibilityPublic { + return nil + } + + apiUserDailyLimit := 100000 + apiKey := "isRepoVisibleToCurrentUser" + authUser, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return err + } + if repoInfo.VisibilityLevel == util.VisibilitySigned { + return nil + } + + if repoInfo.VisibilityLevel == util.VisibilityChosed { + + arg := db.GetRepoRelationParams{UserID: authUser.UserID, RepoID: RepoID, RelationType: util.RelationTypeVisi} + _, err := server.store.GetRepoRelation(ctx, arg) + if err != nil && !(authUser.UserRole == util.AdminRole || authUser.UserID == repoInfo.UserID) { + return status.Errorf(codes.PermissionDenied, "current account can not visit this repo") + } + return nil + } else { + if authUser.UserRole == util.AdminRole { + return nil + } else if authUser.UserID == repoInfo.UserID { + return nil + } else { + return status.Errorf(codes.PermissionDenied, "current account can not visit this repo") + } + } +} + +func (server *Server) isMarkdownVisibleToCurrentUser(ctx context.Context, MarkdownID int64) error { + + RepoID, err := server.store.GetMarkdownRepoID(ctx, MarkdownID) + if err != nil { + return status.Errorf(codes.Internal, "get repo failed: %s", err) + } + return server.isRepoVisibleToCurrentUser(ctx, RepoID) +} +func (server *Server) isCommentVisibleToCurrentUser(ctx context.Context, CommentID int64) error { + comment, err := server.store.GetCommentBasicInfo(ctx, CommentID) + if err != nil { + return status.Errorf(codes.Internal, "get comment failed: %s", err) + } + RepoID, err := server.store.GetMarkdownRepoID(ctx, comment.MarkdownID) + if err != nil { + return status.Errorf(codes.Internal, "get repo failed: %s", err) + } + return server.isRepoVisibleToCurrentUser(ctx, RepoID) +} diff --git a/zbook_backend/gapi/comment_create_comment.go b/zbook_backend/gapi/comment_create_comment.go new file mode 100644 index 0000000..ad36ce4 --- /dev/null +++ b/zbook_backend/gapi/comment_create_comment.go @@ -0,0 +1,80 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) CreateComment(ctx context.Context, req *rpcs.CreateCommentRequest) (*rpcs.CreateCommentResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "CreateComment" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateCreateCommentRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + err = server.isMarkdownVisibleToCurrentUser(ctx, req.GetMarkdownId()) + if err != nil { + return nil, err + } + var RootID int64 = 0 + if req.GetParentId() != 0 { + pcomment, err := server.store.GetCommentBasicInfo(ctx, req.GetParentId()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get comment failed: %s", err) + } + if pcomment.RootID.Valid { + RootID = pcomment.RootID.Int64 + } else { + RootID = pcomment.CommentID + } + } + + arg := db.CreateCommentTxParams{ + UserID: authPayload.UserID, + MarkdownID: req.GetMarkdownId(), + ParentID: req.GetParentId(), + RootID: RootID, + CommentContent: req.GetCommentContent(), + } + + comment, err := server.store.CreateCommentTx(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "create comment failed: %s", err) + } + + rsp := &rpcs.CreateCommentResponse{ + Comment: &models.CommentBasicInfo{ + CommentId: comment.Comment.CommentID, + UserId: comment.Comment.UserID, + ParentId: req.GetParentId(), + RootId: RootID, + MarkdownId: comment.Comment.MarkdownID, + CommentContent: comment.Comment.CommentContent, + CreatedAt: timestamppb.New(comment.Comment.CreatedAt), + }, + } + return rsp, nil +} +func validateCreateCommentRequest(req *rpcs.CreateCommentRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetMarkdownId()); err != nil { + violations = append(violations, fieldViolation("markdown_id", err)) + } + if err := val.ValidateString(req.GetCommentContent(), 1, 512); err != nil { + violations = append(violations, fieldViolation("comment_content", err)) + } + return violations +} diff --git a/zbook_backend/gapi/comment_delete_comment.go b/zbook_backend/gapi/comment_delete_comment.go new file mode 100644 index 0000000..a677e4e --- /dev/null +++ b/zbook_backend/gapi/comment_delete_comment.go @@ -0,0 +1,53 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeleteComment(ctx context.Context, req *rpcs.DeleteCommentRequest) (*rpcs.DeleteCommentResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "DeleteComment" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateDeleteCommentRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + comment, err := server.store.GetCommentBasicInfo(ctx, req.GetCommentId()) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "comment not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get comment failed: %s", err) + } + + if comment.UserID != authPayload.UserID && authPayload.UserRole != util.AdminRole { + return nil, status.Errorf(codes.PermissionDenied, "current account can not delete this comment") + } + + err = server.store.DeleteComment(ctx, req.GetCommentId()) + if err != nil { + return nil, status.Errorf(codes.Internal, "delete comment failed: %s", err) + } + + rsp := &rpcs.DeleteCommentResponse{} + return rsp, nil +} +func validateDeleteCommentRequest(req *rpcs.DeleteCommentRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetCommentId()); err != nil { + violations = append(violations, fieldViolation("comment_id", err)) + } + return violations +} diff --git a/zbook_backend/gapi/comment_get_comment_count_info.go b/zbook_backend/gapi/comment_get_comment_count_info.go new file mode 100644 index 0000000..6959a5e --- /dev/null +++ b/zbook_backend/gapi/comment_get_comment_count_info.go @@ -0,0 +1,60 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetCommentCountInfo(ctx context.Context, req *rpcs.GetCommentCountInfoRequest) (*rpcs.GetCommentCountInfoResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetCommentCountInfo" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateGetCommentCountInfoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.GetCommentDetailParams{ + UserID: authPayload.UserID, + CommentID: req.GetCommentId(), + } + comment, err := server.store.GetCommentDetail(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get comment failed: %s", err) + } + + comment_count_info := &models.CommentCountInfo{ + CommentId: comment.CommentID, + LikeCount: int32(comment.LikeCount), + ReplyCount: int32(comment.ReplyCount), + IsLiked: comment.IsLiked, + IsDisliked: comment.IsDisliked, + IsShared: comment.IsShared, + IsReported: comment.IsReported, + } + + rsp := &rpcs.GetCommentCountInfoResponse{ + CommentCountInfo: comment_count_info, + } + return rsp, nil +} +func validateGetCommentCountInfoRequest(req *rpcs.GetCommentCountInfoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + + if err := val.ValidateID(req.GetCommentId()); err != nil { + violations = append(violations, fieldViolation("comment_id", err)) + } + + return violations +} diff --git a/zbook_backend/gapi/comment_get_list_comment_level_one_count.go b/zbook_backend/gapi/comment_get_list_comment_level_one_count.go new file mode 100644 index 0000000..2e9072c --- /dev/null +++ b/zbook_backend/gapi/comment_get_list_comment_level_one_count.go @@ -0,0 +1,30 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListCommentLevelOneCount(ctx context.Context, req *rpcs.GetListCommentLevelOneCountRequest) (*rpcs.GetListCommentLevelCountResponse, error) { + + apiUserDailyLimit := 10000 + apiKey := "GetListCommentLevelOneCount" + _, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + user_count, err := server.store.GetListCommentLevelOneCount(ctx, req.GetMarkdownId()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list level one comment count failed: %s", err) + } + + rsp := &rpcs.GetListCommentLevelCountResponse{ + Count: user_count, + } + return rsp, nil +} diff --git a/zbook_backend/gapi/comment_get_list_comment_level_two_count.go b/zbook_backend/gapi/comment_get_list_comment_level_two_count.go new file mode 100644 index 0000000..e05a01b --- /dev/null +++ b/zbook_backend/gapi/comment_get_list_comment_level_two_count.go @@ -0,0 +1,31 @@ +package gapi + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListCommentLevelTwoCount(ctx context.Context, req *rpcs.GetListCommentLevelTwoCountRequest) (*rpcs.GetListCommentLevelCountResponse, error) { + + apiUserDailyLimit := 10000 + apiKey := "GetListCommentLevelTwoCount" + _, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + user_count, err := server.store.GetListCommentLevelTwoCount(ctx, pgtype.Int8{Int64: req.GetRootId(), Valid: true}) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list comment level two count failed: %s", err) + } + + rsp := &rpcs.GetListCommentLevelCountResponse{ + Count: user_count, + } + return rsp, nil +} diff --git a/zbook_backend/gapi/comment_list_comment_level_one.go b/zbook_backend/gapi/comment_list_comment_level_one.go new file mode 100644 index 0000000..164c5a7 --- /dev/null +++ b/zbook_backend/gapi/comment_list_comment_level_one.go @@ -0,0 +1,84 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListCommentLevelOne(ctx context.Context, req *rpcs.ListCommentLevelOneRequest) (*rpcs.ListCommentLevelResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListCommentLevelOne" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateListCommentLevelOneRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + err = server.isMarkdownVisibleToCurrentUser(ctx, req.GetMarkdownId()) + if err != nil { + return nil, err + } + arg := db.ListCommentLevelOneParams{ + MarkdownID: req.GetMarkdownId(), + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + UserID: authPayload.UserID, + } + + comments, err := server.store.ListCommentLevelOne(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get comment level one failed: %s", err) + } + + rsp := &rpcs.ListCommentLevelResponse{ + Comments: convertListCommentLevelOne(comments), + } + return rsp, nil +} + +func validateListCommentLevelOneRequest(req *rpcs.ListCommentLevelOneRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetMarkdownId()); err != nil { + violations = append(violations, fieldViolation("markdown_id", err)) + } + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} + +func convertListCommentLevelOne(comments []db.ListCommentLevelOneRow) []*models.ListCommentInfo { + var ret_comments []*models.ListCommentInfo + for i := 0; i < len(comments); i++ { + ret_comments = append(ret_comments, + &models.ListCommentInfo{ + MarkdownId: comments[i].MarkdownID, + ParentId: int64(0), + Username: comments[i].Username, + CommentContent: comments[i].CommentContent, + CreatedAt: timestamppb.New(comments[i].CreatedAt), + LikeCount: comments[i].LikeCount, + ReplyCount: comments[i].ReplyCount, + IsLiked: comments[i].IsLiked, + IsDisliked: comments[i].IsDisliked, + IsShared: comments[i].IsShared, + IsReported: comments[i].IsReported, + CommentId: comments[i].CommentID, + }, + ) + } + return ret_comments +} diff --git a/zbook_backend/gapi/comment_list_comment_level_two.go b/zbook_backend/gapi/comment_list_comment_level_two.go new file mode 100644 index 0000000..226c4c0 --- /dev/null +++ b/zbook_backend/gapi/comment_list_comment_level_two.go @@ -0,0 +1,87 @@ +package gapi + +import ( + "context" + + "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListCommentLevelTwo(ctx context.Context, req *rpcs.ListCommentLevelTwoRequest) (*rpcs.ListCommentLevelResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListCommentLevelTwo" + authUser, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateListCommentLevelTwoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + err = server.isCommentVisibleToCurrentUser(ctx, req.GetRootId()) + if err != nil { + return nil, err + } + + arg := db.ListCommentLevelTwoParams{ + RootID: pgtype.Int8{Int64: req.GetRootId(), Valid: true}, + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + UserID: authUser.UserID, + } + + comments, err := server.store.ListCommentLevelTwo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list comment level two failed: %s", err) + } + + rsp := &rpcs.ListCommentLevelResponse{ + Comments: convertListCommentLevelTwo(comments), + } + return rsp, nil +} + +func validateListCommentLevelTwoRequest(req *rpcs.ListCommentLevelTwoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetRootId()); err != nil { + violations = append(violations, fieldViolation("root_id", err)) + } + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} + +func convertListCommentLevelTwo(comments []db.ListCommentLevelTwoRow) []*models.ListCommentInfo { + var ret_comments []*models.ListCommentInfo + for i := 0; i < len(comments); i++ { + ret_comments = append(ret_comments, + &models.ListCommentInfo{ + MarkdownId: comments[i].MarkdownID, + ParentId: comments[i].ParentID.Int64, + Username: comments[i].Username, + Pusername: comments[i].Pusername.String, + CommentContent: comments[i].CommentContent, + CreatedAt: timestamppb.New(comments[i].CreatedAt), + LikeCount: comments[i].LikeCount, + ReplyCount: comments[i].ReplyCount, + IsLiked: comments[i].IsLiked, + IsDisliked: comments[i].IsDisliked, + IsShared: comments[i].IsShared, + IsReported: comments[i].IsReported, + CommentId: comments[i].CommentID, + }, + ) + } + return ret_comments +} diff --git a/zbook_backend/gapi/commentrelation_create_comment_relation.go b/zbook_backend/gapi/commentrelation_create_comment_relation.go new file mode 100644 index 0000000..87f8022 --- /dev/null +++ b/zbook_backend/gapi/commentrelation_create_comment_relation.go @@ -0,0 +1,70 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CreateCommentRelation(ctx context.Context, req *rpcs.CreateCommentRelationRequest) (*rpcs.CreateCommentRelationResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "CreateCommentRelation" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateCreateCommentRelationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + err = server.isCommentVisibleToCurrentUser(ctx, req.GetCommentId()) + if err != nil { + return nil, err + } + relationType := util.RelationTypeShare + if req.GetRelationType() == util.RelationTypeDislike { + relationType = util.RelationTypeDislike + } else if req.GetRelationType() == util.RelationTypeLike { + relationType = util.RelationTypeLike + } else if req.GetRelationType() == util.RelationTypeShare { + relationType = util.RelationTypeShare + } else { + return nil, status.Errorf(codes.InvalidArgument, "Unknown RelationType: %s", relationType) + } + arg := db.CreateCommentRelationParams{ + CommentID: req.GetCommentId(), + UserID: authPayload.UserID, + RelationType: relationType, + } + + err = server.store.CreateCommentRelation(ctx, arg) + + if err != nil { + if db.ErrorCode(err) == db.UniqueViolation || db.ErrorCode(err) == db.ForeignKeyViolation { + return nil, status.Errorf(codes.AlreadyExists, "comment relation already exist: %s", err) + } + return nil, status.Errorf(codes.Internal, "failed to create comment relation: %s", err) + } + + rsp := &rpcs.CreateCommentRelationResponse{} + return rsp, nil +} +func validateCreateCommentRelationRequest(req *rpcs.CreateCommentRelationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetCommentId()); err != nil { + violations = append(violations, fieldViolation("comment_id", err)) + } + if req.GetRelationType() != util.RelationTypeDislike && + req.GetRelationType() != util.RelationTypeLike && + req.GetRelationType() != util.RelationTypeShare { + violations = append(violations, fieldViolation("relation_type", errors.New("invalid relation_type"))) + } + return violations +} diff --git a/zbook_backend/gapi/commentrelation_create_comment_report.go b/zbook_backend/gapi/commentrelation_create_comment_report.go new file mode 100644 index 0000000..c2c5f31 --- /dev/null +++ b/zbook_backend/gapi/commentrelation_create_comment_report.go @@ -0,0 +1,53 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CreateCommentReport(ctx context.Context, req *rpcs.CreateCommentReportRequest) (*rpcs.CreateCommentReportResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "CreateCommentReport" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateCreateCommentReportRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.CreateCommentReportParams{ + ReportContent: req.GetReportContent(), + CommentID: req.GetCommentId(), + UserID: authPayload.UserID, + } + + err = server.store.CreateCommentReport(ctx, arg) + + if err != nil { + if db.ErrorCode(err) == db.UniqueViolation || db.ErrorCode(err) == db.ForeignKeyViolation { + return nil, status.Errorf(codes.AlreadyExists, "comment report already exist: %s", err) + } + return nil, status.Errorf(codes.Internal, "failed to create comment report: %s", err) + } + + rsp := &rpcs.CreateCommentReportResponse{} + return rsp, nil +} +func validateCreateCommentReportRequest(req *rpcs.CreateCommentReportRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetCommentId()); err != nil { + violations = append(violations, fieldViolation("comment_id", err)) + } + if err := val.ValidateString(req.GetReportContent(), 1, 512); err != nil { + violations = append(violations, fieldViolation("report_content", err)) + } + return violations +} diff --git a/zbook_backend/gapi/commentrelation_delete_comment_relation.go b/zbook_backend/gapi/commentrelation_delete_comment_relation.go new file mode 100644 index 0000000..4059992 --- /dev/null +++ b/zbook_backend/gapi/commentrelation_delete_comment_relation.go @@ -0,0 +1,64 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeleteCommentRelation(ctx context.Context, req *rpcs.DeleteCommentRelationRequest) (*rpcs.DeleteCommentRelationResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "DeleteCommentRelation" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateDeleteCommentRelationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + relationType := util.RelationTypeShare + if req.GetRelationType() == util.RelationTypeDislike { + relationType = util.RelationTypeDislike + } else if req.GetRelationType() == util.RelationTypeLike { + relationType = util.RelationTypeLike + } else if req.GetRelationType() == util.RelationTypeShare { + relationType = util.RelationTypeShare + } else { + return nil, status.Errorf(codes.InvalidArgument, "Unknown RelationType %s", relationType) + } + arg := db.DeleteCommentRelationParams{ + CommentID: req.GetCommentId(), + UserID: authPayload.UserID, + RelationType: relationType, + } + err = server.store.DeleteCommentRelation(ctx, arg) + + if err != nil { + if db.ErrorCode(err) == db.UniqueViolation || db.ErrorCode(err) == db.ForeignKeyViolation { + return nil, status.Errorf(codes.AlreadyExists, "comment relation not exist: %s", err) + } + return nil, status.Errorf(codes.Internal, "failed to delete comment relation: %s", err) + } + + rsp := &rpcs.DeleteCommentRelationResponse{} + return rsp, nil +} +func validateDeleteCommentRelationRequest(req *rpcs.DeleteCommentRelationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetCommentId()); err != nil { + violations = append(violations, fieldViolation("comment_id", err)) + } + if req.GetRelationType() != util.RelationTypeDislike && + req.GetRelationType() != util.RelationTypeLike && + req.GetRelationType() != util.RelationTypeShare { + violations = append(violations, fieldViolation("relation_type", errors.New("invalid relation_type"))) + } + return violations +} diff --git a/zbook_backend/gapi/error.go b/zbook_backend/gapi/error.go new file mode 100644 index 0000000..4027f37 --- /dev/null +++ b/zbook_backend/gapi/error.go @@ -0,0 +1,27 @@ +package gapi + +import ( + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func fieldViolation(field string, err error) *errdetails.BadRequest_FieldViolation { + return &errdetails.BadRequest_FieldViolation{ + Field: field, + Description: err.Error(), + } +} + +func invalidArgumentError(violations []*errdetails.BadRequest_FieldViolation) error { + + badRequest := &errdetails.BadRequest{ + FieldViolations: violations, + } + statusInvalid := status.New(codes.InvalidArgument, "invalid parameters") + statusDetails, err := statusInvalid.WithDetails(badRequest) + if err != nil { + return statusInvalid.Err() + } + return statusDetails.Err() +} diff --git a/zbook_backend/gapi/follow_create_follow.go b/zbook_backend/gapi/follow_create_follow.go new file mode 100644 index 0000000..f0114c4 --- /dev/null +++ b/zbook_backend/gapi/follow_create_follow.go @@ -0,0 +1,69 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) CreateFollow(ctx context.Context, req *rpcs.CreateFollowRequest) (*rpcs.CreateFollowResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "CreateFollow" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateCreateFollowRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + + arg := db.CreateFollowTxParams{ + CreateFollowParams: db.CreateFollowParams{ + FollowerID: authPayload.UserID, + FollowingID: user.UserID, + }, + } + + txResult, err := server.store.CreateFollowTx(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "create follow failed: %s", err) + } + + rsp := &rpcs.CreateFollowResponse{ + Follow: convertCreateFollow(txResult.Follow), + } + return rsp, nil +} +func validateCreateFollowRequest(req *rpcs.CreateFollowRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} + +func convertCreateFollow(follow db.Follow) *models.Follow { + return &models.Follow{ + FollowId: follow.FollowID, + FollowerId: follow.FollowerID, + FollowingId: follow.FollowingID, + CreatedAt: timestamppb.New(follow.CreatedAt), + } +} diff --git a/zbook_backend/gapi/follow_delete_follow.go b/zbook_backend/gapi/follow_delete_follow.go new file mode 100644 index 0000000..e44113d --- /dev/null +++ b/zbook_backend/gapi/follow_delete_follow.go @@ -0,0 +1,68 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) DeleteFollow(ctx context.Context, req *rpcs.DeleteFollowRequest) (*rpcs.DeleteFollowResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "DeleteFollow" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateDeleteFollowRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + + arg := db.DeleteFollowTxParams{ + DeleteFollowParams: db.DeleteFollowParams{ + FollowerID: authPayload.UserID, + FollowingID: user.UserID, + }, + } + txResult, err := server.store.DeleteFollowTx(ctx, arg) + if err != nil { + return nil, err + } + + rsp := &rpcs.DeleteFollowResponse{ + Follow: convertDeleteFollowResponse(txResult.Follow), + } + return rsp, nil +} +func validateDeleteFollowRequest(req *rpcs.DeleteFollowRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} + +func convertDeleteFollowResponse(follow db.Follow) *models.Follow { + return &models.Follow{ + FollowId: follow.FollowID, + FollowerId: follow.FollowerID, + FollowingId: follow.FollowingID, + CreatedAt: timestamppb.New(follow.CreatedAt), + } +} diff --git a/zbook_backend/gapi/follow_get_follow_status.go b/zbook_backend/gapi/follow_get_follow_status.go new file mode 100644 index 0000000..80ea821 --- /dev/null +++ b/zbook_backend/gapi/follow_get_follow_status.go @@ -0,0 +1,53 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetFollowStatus(ctx context.Context, req *rpcs.GetFollowStatusRequest) (*rpcs.GetFollowStatusResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetFollowStatus" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateGetFollowStatusRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + + arg := db.IsFollowingParams{ + FollowingID: user.UserID, + FollowerID: authPayload.UserID, + } + IsFollowing, err := server.store.IsFollowing(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get isfollowing status failed: %s", err) + } + + rsp := &rpcs.GetFollowStatusResponse{ + IsFollowing: IsFollowing, + } + return rsp, nil +} +func validateGetFollowStatusRequest(req *rpcs.GetFollowStatusRequest) (violations []*errdetails.BadRequest_FieldViolation) { + + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + + return violations +} diff --git a/zbook_backend/gapi/follow_get_follower_count.go b/zbook_backend/gapi/follow_get_follower_count.go new file mode 100644 index 0000000..ad7947b --- /dev/null +++ b/zbook_backend/gapi/follow_get_follower_count.go @@ -0,0 +1,69 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetFollowerCount(ctx context.Context, req *rpcs.GetFollowerCountRequest) (*rpcs.GetFollowerCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetFollowerCount" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateGetFollowerCountRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + if req.GetQuery() != "" { + arg := db.GetQueryFollowerCountParams{ + CurUserID: authPayload.UserID, + UserID: user.UserID, + Query: req.GetQuery(), + } + count, err := server.store.GetQueryFollowerCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query follower count failed: %s", err) + } + rsp := &rpcs.GetFollowerCountResponse{ + Count: count, + } + return rsp, nil + } else { + arg := db.GetListFollowerCountParams{ + CurUserID: authPayload.UserID, + UserID: user.UserID, + } + + count, err := server.store.GetListFollowerCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list follower count failed : %s", err) + } + + rsp := &rpcs.GetFollowerCountResponse{ + Count: count, + } + return rsp, nil + } + +} +func validateGetFollowerCountRequest(req *rpcs.GetFollowerCountRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} diff --git a/zbook_backend/gapi/follow_get_following_count.go b/zbook_backend/gapi/follow_get_following_count.go new file mode 100644 index 0000000..9be3854 --- /dev/null +++ b/zbook_backend/gapi/follow_get_following_count.go @@ -0,0 +1,68 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetFollowingCount(ctx context.Context, req *rpcs.GetFollowingCountRequest) (*rpcs.GetFollowingCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetFollowingCount" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateGetFollowingCountRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + + if req.GetQuery() != "" { + arg := db.GetQueryFollowingCountParams{ + CurUserID: authPayload.UserID, + UserID: user.UserID, + Query: req.GetQuery(), + } + count, err := server.store.GetQueryFollowingCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query following count failed: %s", err) + } + rsp := &rpcs.GetFollowingCountResponse{ + Count: count, + } + return rsp, nil + } else { + arg := db.GetListFollowingCountParams{ + CurUserID: authPayload.UserID, + UserID: user.UserID, + } + count, err := server.store.GetListFollowingCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list following count failed: %s", err) + } + rsp := &rpcs.GetFollowingCountResponse{ + Count: count, + } + return rsp, nil + } + +} +func validateGetFollowingCountRequest(req *rpcs.GetFollowingCountRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} diff --git a/zbook_backend/gapi/follow_list_follower.go b/zbook_backend/gapi/follow_list_follower.go new file mode 100644 index 0000000..20c8c58 --- /dev/null +++ b/zbook_backend/gapi/follow_list_follower.go @@ -0,0 +1,120 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListFollower(ctx context.Context, req *rpcs.ListFollowerRequest) (*rpcs.ListFollowerResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListFollower" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateListFollowerRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + _, err = server.getUserPermessionlevel(ctx, authPayload.Username, req.GetUsername()) + if err != nil { + return nil, err + } + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + if req.GetQuery() != "" { + arg := db.QueryFollowerParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + UserID: user.UserID, + CurUserID: authPayload.UserID, + Query: req.GetQuery(), + Role: authPayload.UserRole, + } + + follows, err := server.store.QueryFollower(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query follower failed: %s", err) + } + + rsp := &rpcs.ListFollowerResponse{ + Elements: convertQueryFollower(follows), + } + return rsp, nil + } + arg := db.ListFollowerParams{ + UserID: user.UserID, + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + CurUserID: authPayload.UserID, + Role: authPayload.UserRole, + } + + follows, err := server.store.ListFollower(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list follower failed: %s", err) + } + + rsp := &rpcs.ListFollowerResponse{ + Elements: convertListFollower(follows), + } + return rsp, nil +} +func validateListFollowerRequest(req *rpcs.ListFollowerRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} + +func convertListFollower(users []db.ListFollowerRow) []*models.ListFollowInfo { + var ret_users []*models.ListFollowInfo + for i := 0; i < len(users); i++ { + ret_users = append(ret_users, + &models.ListFollowInfo{ + Username: users[i].Username, + Email: users[i].Email, + IsFollowing: users[i].IsFollowing, + UpdatedAt: timestamppb.New(users[i].UpdatedAt), + CreatedAt: timestamppb.New(users[i].CreatedAt), + RepoCount: int32(users[i].RepoCount), + }, + ) + } + return ret_users +} + +func convertQueryFollower(users []db.QueryFollowerRow) []*models.ListFollowInfo { + var ret_users []*models.ListFollowInfo + for i := 0; i < len(users); i++ { + ret_users = append(ret_users, + &models.ListFollowInfo{ + Username: users[i].Username, + Email: users[i].Email, + IsFollowing: users[i].IsFollowing, + UpdatedAt: timestamppb.New(users[i].UpdatedAt), + CreatedAt: timestamppb.New(users[i].CreatedAt), + RepoCount: int32(users[i].RepoCount), + }, + ) + } + return ret_users +} diff --git a/zbook_backend/gapi/follow_list_following.go b/zbook_backend/gapi/follow_list_following.go new file mode 100644 index 0000000..46a4d49 --- /dev/null +++ b/zbook_backend/gapi/follow_list_following.go @@ -0,0 +1,120 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListFollowing(ctx context.Context, req *rpcs.ListFollowingRequest) (*rpcs.ListFollowingResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListFollowing" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateListFollowingRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + _, err = server.getUserPermessionlevel(ctx, authPayload.Username, req.GetUsername()) + if err != nil { + return nil, err + } + if req.GetQuery() != "" { + arg := db.QueryFollowingParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + UserID: user.UserID, + CurUserID: authPayload.UserID, + Query: req.GetQuery(), + Role: authPayload.UserRole, + } + + follows, err := server.store.QueryFollowing(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query following failed: %s", err) + } + + rsp := &rpcs.ListFollowingResponse{ + Elements: convertQueryFollowing(follows), + } + return rsp, nil + } + arg := db.ListFollowingParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + UserID: user.UserID, + CurUserID: authPayload.UserID, + Role: authPayload.UserRole, + } + + follows, err := server.store.ListFollowing(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list following failed: %s", err) + } + + rsp := &rpcs.ListFollowingResponse{ + Elements: convertListFollowing(follows), + } + return rsp, nil +} +func validateListFollowingRequest(req *rpcs.ListFollowingRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} + +func convertListFollowing(users []db.ListFollowingRow) []*models.ListFollowInfo { + var ret_users []*models.ListFollowInfo + for i := 0; i < len(users); i++ { + ret_users = append(ret_users, + &models.ListFollowInfo{ + Username: users[i].Username, + Email: users[i].Email, + IsFollowing: users[i].IsFollowing, + UpdatedAt: timestamppb.New(users[i].UpdatedAt), + CreatedAt: timestamppb.New(users[i].CreatedAt), + RepoCount: int32(users[i].RepoCount), + }, + ) + } + return ret_users +} + +func convertQueryFollowing(users []db.QueryFollowingRow) []*models.ListFollowInfo { + var ret_users []*models.ListFollowInfo + for i := 0; i < len(users); i++ { + ret_users = append(ret_users, + &models.ListFollowInfo{ + Username: users[i].Username, + Email: users[i].Email, + IsFollowing: users[i].IsFollowing, + UpdatedAt: timestamppb.New(users[i].UpdatedAt), + CreatedAt: timestamppb.New(users[i].CreatedAt), + RepoCount: int32(users[i].RepoCount), + }, + ) + } + return ret_users +} diff --git a/zbook_backend/gapi/logger.go b/zbook_backend/gapi/logger.go new file mode 100644 index 0000000..9f54c7c --- /dev/null +++ b/zbook_backend/gapi/logger.go @@ -0,0 +1,84 @@ +package gapi + +import ( + "context" + "net/http" + "time" + + "github.com/rs/zerolog/log" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func GrpcLogger( + ctx context.Context, + req interface{}, + info *grpc.UnaryServerInfo, + handler grpc.UnaryHandler, +) (resp interface{}, err error) { + startTime := time.Now() + result, err := handler(ctx, req) + duration := time.Since(startTime) + + statusCode := codes.Unknown + if st, ok := status.FromError(err); ok { + statusCode = st.Code() + } + + logger := log.Info() + if err != nil { + logger = log.Error().Err(err) + } + + logger.Str("protocol", "grpc"). + Str("method", info.FullMethod). + Int("status_code", int(statusCode)). + Str("status_text", statusCode.String()). + Dur("duration", duration). + Msg("received a gRPC request") + + return result, err +} + +type ResponseRecorder struct { + http.ResponseWriter + StatusCode int + Body []byte +} + +func (rec *ResponseRecorder) WriteHeader(statusCode int) { + rec.StatusCode = statusCode + rec.ResponseWriter.WriteHeader(statusCode) +} + +func (rec *ResponseRecorder) Write(body []byte) (int, error) { + rec.Body = body + return rec.ResponseWriter.Write(body) +} + +func HttpLogger(handler http.Handler) http.Handler { + return http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + startTime := time.Now() + rec := &ResponseRecorder{ + ResponseWriter: res, + StatusCode: http.StatusOK, + } + handler.ServeHTTP(rec, req) + duration := time.Since(startTime) + + logger := log.Info() + if rec.StatusCode != http.StatusOK { + logger = log.Error().Bytes("body", rec.Body) + } + clientIP := req.Header.Get("X-Forwarded-For") + logger.Str("protocol", "http"). + Str("clientIP", clientIP). + Str("method", req.Method). + Str("path", req.RequestURI). + Int("status_code", rec.StatusCode). + Str("status_text", http.StatusText(rec.StatusCode)). + Dur("duration", duration). + Msg("received a HTTP request") + }) +} diff --git a/zbook_backend/gapi/main_test.go b/zbook_backend/gapi/main_test.go new file mode 100644 index 0000000..d4c2b09 --- /dev/null +++ b/zbook_backend/gapi/main_test.go @@ -0,0 +1,25 @@ +package gapi + +import ( + "testing" + "time" + + "github.com/go-redis/redis" + "github.com/minio/minio-go/v7" + "github.com/stretchr/testify/require" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/worker" +) + +func newTestServer(t *testing.T, store db.Store, taskDistrubutor worker.TaskDistributor, redisClient *redis.Client, minioClient *minio.Client) *Server { + config := util.Config{ + TokenSymmetricKey: util.RandomString(32), + AccessTokenDuration: time.Minute, + } + + server, err := NewServer(config, store, taskDistrubutor, redisClient, minioClient) + require.NoError(t, err) + + return server +} diff --git a/zbook_backend/gapi/markdown_get_markdown_content.go b/zbook_backend/gapi/markdown_get_markdown_content.go new file mode 100644 index 0000000..03a8116 --- /dev/null +++ b/zbook_backend/gapi/markdown_get_markdown_content.go @@ -0,0 +1,118 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) GetMarkdownContent(ctx context.Context, req *rpcs.GetMarkdownContentRequest) (*rpcs.GetMarkdownContentResponse, error) { + violations := validateGetMarkdownContentRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + arg_get := db.GetRepoBasicInfoParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo, err := server.store.GetRepoBasicInfo(ctx, arg_get) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo basic info failed: %s", err) + } + err = server.isRepoVisibleToCurrentUser(ctx, repo.RepoID) + if err != nil { + return nil, err + } + arg := db.GetMarkdownContentParams{ + RelativePath: req.GetRelativePath(), + RepoID: repo.RepoID, + } + markdown, err := server.store.GetMarkdownContent(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "GetMarkdownContent not found error: %s", err) + } + return nil, status.Errorf(codes.Internal, "GetMarkdownContent error : %s", err) + } + + arg_config := db.GetRepoConfigParams{Username: req.GetUsername(), RepoName: req.GetRepoName()} + repo_config, err := server.store.GetRepoConfig(ctx, arg_config) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "get repo config not found error: %s", err) + } + return nil, status.Errorf(codes.Internal, "GetRepoConfig error : %s", err) + } + config, err := util.ParseRepoConfigFromString(repo_config.Config) + if err != nil { + return nil, status.Errorf(codes.Internal, "ParseRepoConfigFromString error : %s", err) + } + prev, next, err := config.FindAdjacentPaths(req.GetRelativePath()) + if err != nil { + return nil, status.Errorf(codes.Internal, "FindAdjacentPaths error : %s", err) + } + + rsp := &rpcs.GetMarkdownContentResponse{ + Markdown: convertMarkdown(markdown), + Prev: prev, + Next: next, + Footers: convertFooters(config.FooterSocials), + UpdatedAt: timestamppb.New(markdown.UpdatedAt), + ThemeColor: repo.ThemeColor, + } + return rsp, nil +} +func validateGetMarkdownContentRequest(req *rpcs.GetMarkdownContentRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + err = val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + if err := val.ValidateString(req.GetRelativePath(), 1, 512); err != nil { + violations = append(violations, fieldViolation("relative_path", err)) + } + return violations +} +func convertMarkdown(markdown db.Markdown) *models.Markdown { + return &models.Markdown{ + MarkdownId: markdown.MarkdownID, + RelativePath: markdown.RelativePath, + UserId: markdown.UserID, + RepoId: markdown.RepoID, + MainContent: markdown.MainContent, + TableContent: markdown.TableContent, + + CreatedAt: timestamppb.New(markdown.CreatedAt), + } +} + +func convertFooters(footers []util.FooterSocial) []*models.FooterSocial { + + var ret_footers []*models.FooterSocial + for i := 0; i < len(footers); i++ { + ret_footers = append(ret_footers, + &models.FooterSocial{ + Name: footers[i].Name, + Icon: footers[i].Icon, + Url: footers[i].URL, + }, + ) + } + return ret_footers + +} diff --git a/zbook_backend/gapi/markdown_get_markdown_image.go b/zbook_backend/gapi/markdown_get_markdown_image.go new file mode 100644 index 0000000..f3462b6 --- /dev/null +++ b/zbook_backend/gapi/markdown_get_markdown_image.go @@ -0,0 +1,62 @@ +package gapi + +import ( + "context" + "errors" + "strconv" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetMarkdownImage(ctx context.Context, req *rpcs.GetMarkdownImageRequest) (*rpcs.GetMarkdownImageResponse, error) { + violations := validateGetMarkdownImageRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.GetRepoBasicInfoParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo, err := server.store.GetRepoBasicInfo(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo basic info failed: %s", err) + } + err = server.isRepoVisibleToCurrentUser(ctx, repo.RepoID) + if err != nil { + return nil, err + } + + path := strconv.FormatInt(repo.UserID, 10) + "/" + strconv.FormatInt(repo.RepoID, 10) + "/" + req.GetFilePath() + path = util.NormalizePath(path) + avatarData, err := storage.DownloadFileFromStorage(server.minioClient, ctx, path, "git-files") + if err != nil { + return nil, status.Errorf(codes.Internal, "GetMarkdownFile failed: %s", err) + } + // Create the response with the (potentially compressed) image data + rsp := &rpcs.GetMarkdownImageResponse{ + File: avatarData, + } + return rsp, nil +} +func validateGetMarkdownImageRequest(req *rpcs.GetMarkdownImageRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + err = val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + return violations +} diff --git a/zbook_backend/gapi/markdown_query_markdown.go b/zbook_backend/gapi/markdown_query_markdown.go new file mode 100644 index 0000000..550b4f8 --- /dev/null +++ b/zbook_backend/gapi/markdown_query_markdown.go @@ -0,0 +1,80 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) QueryMarkdown(ctx context.Context, req *rpcs.QueryMarkdownRequest) (*rpcs.QueryMarkdownResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "QueryMarkdown" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateQueryMarkdownRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.QueryMarkdownParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + PlaintoTsquery: req.GetPlainToTsquery(), + Role: authPayload.UserRole, + Signed: true, + CurUserID: authPayload.UserID, + } + markdowns, err := server.store.QueryMarkdown(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "markdown not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "query markdown failed: %s", err) + } + rsp := &rpcs.QueryMarkdownResponse{ + Elements: convertQueryMarkdown(markdowns), + } + return rsp, nil + +} +func validateQueryMarkdownRequest(req *rpcs.QueryMarkdownRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetPlainToTsquery(), 1, 512); err != nil { + violations = append(violations, fieldViolation("plain_to_tsquery", err)) + } + return violations +} + +func convertQueryMarkdown(markdowns []db.QueryMarkdownRow) []*models.Markdown { + var ret_markdowns []*models.Markdown + for i := 0; i < len(markdowns); i++ { + str, ok := markdowns[i].Coalesce.(string) + if !ok { + if !ok { + log.Error().Msg("cannot convert coalesce to string") + } + } + ret_markdowns = append(ret_markdowns, + &models.Markdown{ + MarkdownId: markdowns[i].MarkdownID, + RelativePath: markdowns[i].RelativePath, + UserId: markdowns[i].UserID, + RepoId: markdowns[i].RepoID, + MainContent: str, + Username: markdowns[i].Username, + RepoName: markdowns[i].RepoName, + }, + ) + } + return ret_markdowns +} diff --git a/zbook_backend/gapi/markdown_query_repo_markdown.go b/zbook_backend/gapi/markdown_query_repo_markdown.go new file mode 100644 index 0000000..8ca49c5 --- /dev/null +++ b/zbook_backend/gapi/markdown_query_repo_markdown.go @@ -0,0 +1,91 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) QueryRepoMarkdown(ctx context.Context, req *rpcs.QueryRepoMarkdownRequest) (*rpcs.QueryRepoMarkdownResponse, error) { + violations := validateQueryRepoMarkdownRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg_get := db.GetRepoByRepoNameParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo, err := server.store.GetRepoByRepoName(ctx, arg_get) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo failed : %s", err) + } + err = server.isRepoVisibleToCurrentUser(ctx, repo.RepoID) + if err != nil { + return nil, err + } + + arg := db.QueryRepoMarkdownParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + PlaintoTsquery: req.GetPlainToTsquery(), + RepoID: repo.RepoID, + UserID: repo.UserID, + } + markdowns, err := server.store.QueryRepoMarkdown(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "markdown not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "query repo markdown failed: %s", err) + } + + rsp := &rpcs.QueryRepoMarkdownResponse{ + Elements: convertQueryRepoMarkdown(markdowns), + } + return rsp, nil +} +func validateQueryRepoMarkdownRequest(req *rpcs.QueryRepoMarkdownRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetPlainToTsquery(), 1, 512); err != nil { + violations = append(violations, fieldViolation("plain_to_tsquery", err)) + } + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + if err := val.ValidateRepoName(req.GetRepoName()); err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + return violations +} +func convertQueryRepoMarkdown(markdowns []db.QueryRepoMarkdownRow) []*models.Markdown { + var ret_markdowns []*models.Markdown + for i := 0; i < len(markdowns); i++ { + str, ok := markdowns[i].Coalesce.(string) + if !ok { + log.Error().Msg("cannot convert coalesce to string") + } + ret_markdowns = append(ret_markdowns, + &models.Markdown{ + MarkdownId: markdowns[i].MarkdownID, + RelativePath: markdowns[i].RelativePath, + UserId: markdowns[i].UserID, + RepoId: markdowns[i].RepoID, + MainContent: str, + Username: markdowns[i].Username, + RepoName: markdowns[i].RepoName, + }, + ) + } + return ret_markdowns +} diff --git a/zbook_backend/gapi/markdown_query_user_markdown.go b/zbook_backend/gapi/markdown_query_user_markdown.go new file mode 100644 index 0000000..623da5c --- /dev/null +++ b/zbook_backend/gapi/markdown_query_user_markdown.go @@ -0,0 +1,92 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) QueryUserMarkdown(ctx context.Context, req *rpcs.QueryUserMarkdownRequest) (*rpcs.QueryUserMarkdownResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "QueryUserMarkdown" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateQueryUserMarkdownRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + _, err = server.getUserPermessionlevel(ctx, authPayload.Username, req.GetUsername()) + if err != nil { + return nil, err + } + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + + arg := db.QueryUserMarkdownParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + PlaintoTsquery: req.GetPlainToTsquery(), + UserID: user.UserID, + Role: authPayload.UserRole, + Signed: true, + CurUserID: authPayload.UserID, + } + markdowns, err := server.store.QueryUserMarkdown(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "markdown not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "query user markdown failed: %s", err) + } + rsp := &rpcs.QueryUserMarkdownResponse{ + Elements: convertQueryUserMarkdown(markdowns), + } + return rsp, nil + +} +func validateQueryUserMarkdownRequest(req *rpcs.QueryUserMarkdownRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetPlainToTsquery(), 1, 512); err != nil { + violations = append(violations, fieldViolation("plain_to_tsquery", err)) + } + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} + +func convertQueryUserMarkdown(markdowns []db.QueryUserMarkdownRow) []*models.Markdown { + var ret_markdowns []*models.Markdown + for i := 0; i < len(markdowns); i++ { + str, ok := markdowns[i].Coalesce.(string) + if !ok { + if !ok { + log.Error().Msg("cannot convert coalesce to string") + } + } + ret_markdowns = append(ret_markdowns, + &models.Markdown{ + MarkdownId: markdowns[i].MarkdownID, + RelativePath: markdowns[i].RelativePath, + UserId: markdowns[i].UserID, + RepoId: markdowns[i].RepoID, + MainContent: str, + Username: markdowns[i].Username, + RepoName: markdowns[i].RepoName, + }, + ) + } + return ret_markdowns +} diff --git a/zbook_backend/gapi/metadata.go b/zbook_backend/gapi/metadata.go new file mode 100644 index 0000000..1dae9bd --- /dev/null +++ b/zbook_backend/gapi/metadata.go @@ -0,0 +1,38 @@ +package gapi + +import ( + "context" + + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" +) + +const ( + grpcGatewayUserAgentHeader = "grpcgateway-user-agent" + xForwardedForHeader = "x-forwarded-for" + userAgentHeader = "user-agent" +) + +type Metadata struct { + UserAgent string + ClientIP string +} + +func (server *Server) extractMetadata(ctx context.Context) *Metadata { + mtdt := &Metadata{} + if md, ok := metadata.FromIncomingContext(ctx); ok { + if userAgents := md.Get(grpcGatewayUserAgentHeader); len(userAgents) > 0 { + mtdt.UserAgent = userAgents[0] + } + if userAgents := md.Get(userAgentHeader); len(userAgents) > 0 { + mtdt.UserAgent = userAgents[0] + } + if ClientIPs := md.Get(xForwardedForHeader); len(ClientIPs) > 0 { + mtdt.ClientIP = ClientIPs[0] + } + } + if p, ok := peer.FromContext(ctx); ok { + mtdt.ClientIP = p.Addr.String() + } + return mtdt +} diff --git a/zbook_backend/gapi/notification_get_list_comment_notification_unreaded_count.go b/zbook_backend/gapi/notification_get_list_comment_notification_unreaded_count.go new file mode 100644 index 0000000..25bcb44 --- /dev/null +++ b/zbook_backend/gapi/notification_get_list_comment_notification_unreaded_count.go @@ -0,0 +1,29 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListCommentNotificationUnreadedCount(ctx context.Context, req *rpcs.GetListCommentNotificationUnreadedCountRequest) (*rpcs.GetListCommentNotificationUnreadedCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetListCommentNotificationUnreadedCount" + authUser, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + user_count, err := server.store.GetListCommentNotificationUnreadedCount(ctx, authUser.UserID) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list comment notification unreaded count failed: %s", err) + } + + rsp := &rpcs.GetListCommentNotificationUnreadedCountResponse{ + Count: user_count, + } + return rsp, nil +} diff --git a/zbook_backend/gapi/notification_get_list_follower_notification_unreaded_count.go b/zbook_backend/gapi/notification_get_list_follower_notification_unreaded_count.go new file mode 100644 index 0000000..fa9fe5c --- /dev/null +++ b/zbook_backend/gapi/notification_get_list_follower_notification_unreaded_count.go @@ -0,0 +1,29 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListFollowerNotificationUnreadedCount(ctx context.Context, req *rpcs.GetListFollowerNotificationUnreadedCountRequest) (*rpcs.GetListFollowerNotificationUnreadedCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetListFollowerNotificationUnreadedCount" + authUser, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + user_count, err := server.store.GetListFollowerNotificationUnreadedCount(ctx, authUser.UserID) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list follower notification unreaded count failed: %s", err) + } + + rsp := &rpcs.GetListFollowerNotificationUnreadedCountResponse{ + Count: user_count, + } + return rsp, nil +} diff --git a/zbook_backend/gapi/notification_get_list_repo_notification_unreaded_count.go b/zbook_backend/gapi/notification_get_list_repo_notification_unreaded_count.go new file mode 100644 index 0000000..24cb779 --- /dev/null +++ b/zbook_backend/gapi/notification_get_list_repo_notification_unreaded_count.go @@ -0,0 +1,29 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListRepoNotificationUnreadedCount(ctx context.Context, req *rpcs.GetListRepoNotificationUnreadedCountRequest) (*rpcs.GetListRepoNotificationUnreadedCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetListRepoNotificationUnreadedCount" + authUser, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + user_count, err := server.store.GetListRepoNotificationUnreadedCount(ctx, authUser.UserID) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list repo notification unreaded count failed: %s", err) + } + + rsp := &rpcs.GetListRepoNotificationUnreadedCountResponse{ + Count: user_count, + } + return rsp, nil +} diff --git a/zbook_backend/gapi/notification_get_list_system_notification_unreaded_count.go b/zbook_backend/gapi/notification_get_list_system_notification_unreaded_count.go new file mode 100644 index 0000000..8ce5dee --- /dev/null +++ b/zbook_backend/gapi/notification_get_list_system_notification_unreaded_count.go @@ -0,0 +1,29 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListSystemNotificationUnreadedCount(ctx context.Context, req *rpcs.GetListSystemNotificationUnreadedCountRequest) (*rpcs.GetListSystemNotificationUnreadedCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetListSystemNotificationUnreadedCount" + authUser, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + user_count, err := server.store.GetListSystemNotificationUnReadedCount(ctx, authUser.UserID) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list system notification unreaded count failed: %s", err) + } + + rsp := &rpcs.GetListSystemNotificationUnreadedCountResponse{ + Count: user_count, + } + return rsp, nil +} diff --git a/zbook_backend/gapi/notification_get_unread_count.go b/zbook_backend/gapi/notification_get_unread_count.go new file mode 100644 index 0000000..46037a6 --- /dev/null +++ b/zbook_backend/gapi/notification_get_unread_count.go @@ -0,0 +1,34 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetUnReadCount(ctx context.Context, req *rpcs.GetUnReadCountRequest) (*rpcs.GetUnReadCountResponse, error) { + apiUserDailyLimit := 100000 + apiKey := "GetUnReadCount" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + unreadCount, err := server.store.GetUnReadCount(ctx, authPayload.Username) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "unread count not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get unread count failed: %s", err) + } + + rsp := &rpcs.GetUnReadCountResponse{ + UnreadCount: unreadCount, + } + return rsp, nil +} diff --git a/zbook_backend/gapi/notification_list_comment_notification.go b/zbook_backend/gapi/notification_list_comment_notification.go new file mode 100644 index 0000000..4aaf451 --- /dev/null +++ b/zbook_backend/gapi/notification_list_comment_notification.go @@ -0,0 +1,76 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListCommentNotification(ctx context.Context, req *rpcs.ListCommentNotificationRequest) (*rpcs.ListCommentNotificationResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListCommentNotification" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateListCommentNotificationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + post_arg := db.ListCommentNotificationParams{ + UserID: authPayload.UserID, + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + } + + notifications, err := server.store.ListCommentNotification(ctx, post_arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list comment notification failed: %s", err) + } + + rsp := &rpcs.ListCommentNotificationResponse{ + Notifications: convertListCommentNotification(notifications), + } + return rsp, nil + +} +func validateListCommentNotificationRequest(req *rpcs.ListCommentNotificationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} +func convertListCommentNotification(notifications []db.ListCommentNotificationRow) []*models.ListCommentNotificationInfo { + var ret_notifications []*models.ListCommentNotificationInfo + for i := 0; i < len(notifications); i++ { + + ret_notifications = append(ret_notifications, + &models.ListCommentNotificationInfo{ + Username: notifications[i].Username, // 需要commenter的username + Email: notifications[i].Email, + Readed: notifications[i].Readed, + NotiId: notifications[i].NotiID, + CreatedAt: timestamppb.New(notifications[i].CreatedAt), // 需要评论created_at + CommentContent: notifications[i].CommentContent, // 需要评论内容 + RepoId: notifications[i].RepoID, // 需要repid+ href 用于跳转 + RelativePath: notifications[i].RelativePath, // 需要repid+ href 用于跳转 + RepoName: notifications[i].RepoName, + RepoUsername: notifications[i].RepoUsername, + }, + ) + } + return ret_notifications +} diff --git a/zbook_backend/gapi/notification_list_follower_notification.go b/zbook_backend/gapi/notification_list_follower_notification.go new file mode 100644 index 0000000..10be508 --- /dev/null +++ b/zbook_backend/gapi/notification_list_follower_notification.go @@ -0,0 +1,72 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListFollowerNotification(ctx context.Context, req *rpcs.ListFollowerNotificationRequest) (*rpcs.ListFollowerNotificationResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListFollowerNotification" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateListFollowerNotificationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.ListFollowerNotificationParams{ + UserID: authPayload.UserID, + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + } + + notifications, err := server.store.ListFollowerNotification(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list follower notification failed: %s", err) + } + + rsp := &rpcs.ListFollowerNotificationResponse{ + Notifications: convertListFollowerNotification(notifications), + } + return rsp, nil + +} +func validateListFollowerNotificationRequest(req *rpcs.ListFollowerNotificationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} + +func convertListFollowerNotification(notifications []db.ListFollowerNotificationRow) []*models.ListFollowerNotificationInfo { + var ret_notifications []*models.ListFollowerNotificationInfo + for i := 0; i < len(notifications); i++ { + + ret_notifications = append(ret_notifications, + &models.ListFollowerNotificationInfo{ + Username: notifications[i].Username, // 需要commenter的username + Email: notifications[i].Email, + Readed: notifications[i].Readed, + NotiId: notifications[i].NotiID, + CreatedAt: timestamppb.New(notifications[i].CreatedAt), // 需要评论created_at + }, + ) + } + return ret_notifications +} diff --git a/zbook_backend/gapi/notification_list_repo_notification.go b/zbook_backend/gapi/notification_list_repo_notification.go new file mode 100644 index 0000000..eeacbd6 --- /dev/null +++ b/zbook_backend/gapi/notification_list_repo_notification.go @@ -0,0 +1,72 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListRepoNotification(ctx context.Context, req *rpcs.ListRepoNotificationRequest) (*rpcs.ListRepoNotificationResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListRepoNotification" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateListRepoNotificationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.ListRepoNotificationParams{ + UserID: authPayload.UserID, + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + } + + notifications, err := server.store.ListRepoNotification(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list repo notification failed: %s", err) + } + + rsp := &rpcs.ListRepoNotificationResponse{ + Notifications: convertListRepoNotification(notifications), + } + return rsp, nil +} +func validateListRepoNotificationRequest(req *rpcs.ListRepoNotificationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} +func convertListRepoNotification(notifications []db.ListRepoNotificationRow) []*models.ListRepoNotificationInfo { + var ret_notifications []*models.ListRepoNotificationInfo + for i := 0; i < len(notifications); i++ { + + ret_notifications = append(ret_notifications, + &models.ListRepoNotificationInfo{ + Username: notifications[i].Username, // 需要commenter的username + Email: notifications[i].Email, + Readed: notifications[i].Readed, + NotiId: notifications[i].NotiID, + CreatedAt: timestamppb.New(notifications[i].CreatedAt), // 需要评论created_at + RepoId: notifications[i].RepoID, // 需要repid+ href 用于跳转 + RepoName: notifications[i].RepoName, + }, + ) + } + return ret_notifications +} diff --git a/zbook_backend/gapi/notification_list_system_notification.go b/zbook_backend/gapi/notification_list_system_notification.go new file mode 100644 index 0000000..b96585e --- /dev/null +++ b/zbook_backend/gapi/notification_list_system_notification.go @@ -0,0 +1,70 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListSystemNotification(ctx context.Context, req *rpcs.ListSystemNotificationRequest) (*rpcs.ListSystemNotificationResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListSystemNotification" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateListSystemNotificationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + post_arg := db.ListSystemNotificationParams{ + UserID: authPayload.UserID, + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + } + + notifications, err := server.store.ListSystemNotification(ctx, post_arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list system notification failed: %s", err) + } + + rsp := &rpcs.ListSystemNotificationResponse{ + Notifications: convertListSystemNotification(notifications), + } + return rsp, nil + +} +func validateListSystemNotificationRequest(req *rpcs.ListSystemNotificationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} +func convertListSystemNotification(notifications []db.ListSystemNotificationRow) []*models.ListSystemNotificationInfo { + var ret_notifications []*models.ListSystemNotificationInfo + for i := 0; i < len(notifications); i++ { + ret_notifications = append(ret_notifications, + &models.ListSystemNotificationInfo{ + Title: notifications[i].Title, + Contents: notifications[i].Contents, + CreatedAt: timestamppb.New(notifications[i].CreatedAt), + Readed: notifications[i].Readed, + NotiId: notifications[i].NotiID, + RedirectUrl: notifications[i].RedirectUrl.String, + }, + ) + } + return ret_notifications +} diff --git a/zbook_backend/gapi/notification_mark_comment_notification_readed.go b/zbook_backend/gapi/notification_mark_comment_notification_readed.go new file mode 100644 index 0000000..4101b31 --- /dev/null +++ b/zbook_backend/gapi/notification_mark_comment_notification_readed.go @@ -0,0 +1,46 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) MarkCommentNotificationReaded(ctx context.Context, req *rpcs.MarkCommentNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "MarkCommentNotificationReaded" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateMarkCommentNotificationReadedRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + arg := db.MarkCommentNotificationReadedParams{ + NotiID: req.GetNotiId(), + UserID: authPayload.UserID, + } + _, err = server.store.MarkCommentNotificationReaded(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "comment notification not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "mark comment notification readed failed: %s", err) + } + rsp := &rpcs.SetNotiReadResponse{} + return rsp, nil +} +func validateMarkCommentNotificationReadedRequest(req *rpcs.MarkCommentNotificationReadedRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetNotiId()); err != nil { + violations = append(violations, fieldViolation("noti_id", err)) + } + return violations +} diff --git a/zbook_backend/gapi/notification_mark_follower_notification_readed.go b/zbook_backend/gapi/notification_mark_follower_notification_readed.go new file mode 100644 index 0000000..ece02b1 --- /dev/null +++ b/zbook_backend/gapi/notification_mark_follower_notification_readed.go @@ -0,0 +1,48 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) MarkFollowerNotificationReaded(ctx context.Context, req *rpcs.MarkFollowerNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "MarkFollowerNotificationReaded" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateMarkFollowerNotificationReadedRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.MarkFollowerNotificationReadedParams{ + NotiID: req.GetNotiId(), + UserID: authPayload.UserID, + } + _, err = server.store.MarkFollowerNotificationReaded(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "follower notification not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "mark follower notification readed failed: %s", err) + } + + rsp := &rpcs.SetNotiReadResponse{} + return rsp, nil +} +func validateMarkFollowerNotificationReadedRequest(req *rpcs.MarkFollowerNotificationReadedRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetNotiId()); err != nil { + violations = append(violations, fieldViolation("noti_id", err)) + } + return violations +} diff --git a/zbook_backend/gapi/notification_mark_repo_notification_readed.go b/zbook_backend/gapi/notification_mark_repo_notification_readed.go new file mode 100644 index 0000000..e61b4e3 --- /dev/null +++ b/zbook_backend/gapi/notification_mark_repo_notification_readed.go @@ -0,0 +1,47 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) MarkRepoNotificationReaded(ctx context.Context, req *rpcs.MarkRepoNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "MarkRepoNotificationReaded" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateMarkRepoNotificationReadedRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.MarkRepoNotificationReadedParams{ + NotiID: req.GetNotiId(), + UserID: authPayload.UserID, + } + _, err = server.store.MarkRepoNotificationReaded(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo notification not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "mark repo notification readed failed: %s", err) + } + rsp := &rpcs.SetNotiReadResponse{} + return rsp, nil +} +func validateMarkRepoNotificationReadedRequest(req *rpcs.MarkRepoNotificationReadedRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetNotiId()); err != nil { + violations = append(violations, fieldViolation("noti_id", err)) + } + return violations +} diff --git a/zbook_backend/gapi/notification_mark_system_notification_readed.go b/zbook_backend/gapi/notification_mark_system_notification_readed.go new file mode 100644 index 0000000..0814c82 --- /dev/null +++ b/zbook_backend/gapi/notification_mark_system_notification_readed.go @@ -0,0 +1,46 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) MarkSystemNotificationReaded(ctx context.Context, req *rpcs.MarkSystemNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "MarkSystemNotificationReaded" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateMarkSystemNotificationReadedRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + arg := db.MarkSystemNotificationReadedParams{ + NotiID: req.GetNotiId(), + UserID: authPayload.UserID, + } + _, err = server.store.MarkSystemNotificationReaded(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "system notification not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "mark system notification readed failed: %s", err) + } + rsp := &rpcs.SetNotiReadResponse{} + return rsp, nil +} +func validateMarkSystemNotificationReadedRequest(req *rpcs.MarkSystemNotificationReadedRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateID(req.GetNotiId()); err != nil { + violations = append(violations, fieldViolation("noti_id", err)) + } + return violations +} diff --git a/zbook_backend/gapi/notification_reset_unread_count.go b/zbook_backend/gapi/notification_reset_unread_count.go new file mode 100644 index 0000000..d01a6fa --- /dev/null +++ b/zbook_backend/gapi/notification_reset_unread_count.go @@ -0,0 +1,32 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) ResetUnreadCount(ctx context.Context, req *rpcs.ResetUnreadCountRequest) (*rpcs.ResetUnreadCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ResetUnreadCount" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + err = server.store.ResetUnreadCount(ctx, authPayload.Username) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "unreaded count not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "reset unreaded count failed: %s", err) + } + + rsp := &rpcs.ResetUnreadCountResponse{} + return rsp, nil +} diff --git a/zbook_backend/gapi/oauth_check_oauth_status.go b/zbook_backend/gapi/oauth_check_oauth_status.go new file mode 100644 index 0000000..5dbfc6e --- /dev/null +++ b/zbook_backend/gapi/oauth_check_oauth_status.go @@ -0,0 +1,30 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CheckOAuthStatus(ctx context.Context, req *rpcs.CheckOAuthStatusRequest) (*rpcs.CheckOAuthStatusResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "CheckOAuthStatus" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + third_status, err := server.store.CheckOAuthStatus(ctx, authPayload.UserID) + if err != nil { + return nil, status.Errorf(codes.Internal, "check third status failed: %s", err) + } + + rsp := &rpcs.CheckOAuthStatusResponse{ + Github: third_status.GithubStatus, + Google: third_status.GoogleStatus, + } + return rsp, nil +} diff --git a/zbook_backend/gapi/oauth_create_oauth_link.go b/zbook_backend/gapi/oauth_create_oauth_link.go new file mode 100644 index 0000000..2f43361 --- /dev/null +++ b/zbook_backend/gapi/oauth_create_oauth_link.go @@ -0,0 +1,56 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CreateOAuthLink(ctx context.Context, req *rpcs.CreateOAuthLinkRequest) (*rpcs.CreateOAuthLinkResponse, error) { + apiUserDailyLimit := 100 + apiKey := "CreateOAuthLink" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateCreateOAuthLinkRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + oauthType := util.OAuthTypeGoogle + if req.GetOauthType() == util.OAuthTypeGithub { + oauthType = util.OAuthTypeGithub + } + arg_oauth := db.CreateOAuthParams{ + UserID: authPayload.UserID, + OauthType: oauthType, + AppID: req.GetAppId(), + } + _, err = server.store.CreateOAuth(ctx, arg_oauth) + if err != nil { + return nil, status.Errorf(codes.Internal, "check oauth failed: %s", err) + } + + rsp := &rpcs.CreateOAuthLinkResponse{} + return rsp, nil +} +func validateCreateOAuthLinkRequest(req *rpcs.CreateOAuthLinkRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetAppId(), 1, 256); err != nil { + violations = append(violations, fieldViolation("app_id", err)) + } + if req.GetOauthType() != util.OAuthTypeGithub && + req.GetOauthType() != util.OAuthTypeGoogle { + violations = append(violations, fieldViolation("oauth_type", errors.New("invalid oauth_type"))) + } + + return violations +} diff --git a/zbook_backend/gapi/oauth_delete_oauth_link.go b/zbook_backend/gapi/oauth_delete_oauth_link.go new file mode 100644 index 0000000..b967db2 --- /dev/null +++ b/zbook_backend/gapi/oauth_delete_oauth_link.go @@ -0,0 +1,50 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeleteOAuthLink(ctx context.Context, req *rpcs.DeleteOAuthLinkRequest) (*rpcs.DeleteOAuthLinkResponse, error) { + apiUserDailyLimit := 100 + apiKey := "DeleteOAuthLink" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateDeleteOAuthLinkRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + oauthType := util.OAuthTypeGoogle + if req.GetOauthType() == util.OAuthTypeGithub { + oauthType = util.OAuthTypeGithub + } + arg_oauth := db.DeleteOAuthParams{ + UserID: authPayload.UserID, + OauthType: oauthType, + } + _, err = server.store.DeleteOAuth(ctx, arg_oauth) + if err != nil { + return nil, status.Errorf(codes.Internal, "delete oauth failed: %s", err) + } + + rsp := &rpcs.DeleteOAuthLinkResponse{} + return rsp, nil +} +func validateDeleteOAuthLinkRequest(req *rpcs.DeleteOAuthLinkRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if req.GetOauthType() != util.OAuthTypeGithub && + req.GetOauthType() != util.OAuthTypeGoogle { + violations = append(violations, fieldViolation("oauth_type", errors.New("invalid oauth_type"))) + } + return violations +} diff --git a/zbook_backend/gapi/oauth_login_by_oauth.go b/zbook_backend/gapi/oauth_login_by_oauth.go new file mode 100644 index 0000000..41a5594 --- /dev/null +++ b/zbook_backend/gapi/oauth_login_by_oauth.go @@ -0,0 +1,105 @@ +package gapi + +import ( + "context" + "encoding/json" + "errors" + "io" + "strconv" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type GithubUser struct { + ID int `json:"id"` +} + +func (server *Server) LoginByOAuth(ctx context.Context, req *rpcs.LoginByOAuthRequest) (*rpcs.LoginByOAuthResponse, error) { + violations := validateLoginByOAuthRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + // Determine oauth party type + oauthType := req.GetOauthType() + if oauthType != util.OAuthTypeGoogle && oauthType != util.OAuthTypeGithub { + return nil, status.Errorf(codes.InvalidArgument, "unsupported oauth party type") + } + + if oauthType == util.OAuthTypeGithub { + // check github account + + resp, err := util.FetchGithub(req.GetAccessToken()) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, "github account is invalid: %s", err) + } + defer resp.Body.Close() + + // 读取响应 + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, status.Errorf(codes.Internal, "read github response failed: %s", err) + } + + // 解析 JSON 响应 + var user GithubUser + err = json.Unmarshal(body, &user) + if err != nil { + return nil, status.Errorf(codes.Internal, "parse github response failed: %s", err) + } + // 将 int 转换为 string 进行比较 + userIDStr := strconv.Itoa(user.ID) + if userIDStr != req.GetAppId() { + return nil, status.Errorf(codes.PermissionDenied, "github account does not match: %s", userIDStr) + } + log.Info().Msg("github account is matched") + } + + arg := db.GetOAuthUserParams{ + OauthType: oauthType, + AppID: req.GetAppId(), + } + user, err := server.store.GetOAuthUser(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not exist,please link an account first") + } + return nil, status.Errorf(codes.Internal, "login in failed: %s", err) + } + + err = server.checkUserStatus(ctx, user.Blocked, user.UserRole, user.Verified) + if err != nil { + return nil, err + } + response, err := server.CreateLoginPart(ctx, user.Username, user.UserRole, user.UserID, "LoginByOAuth") + if err != nil { + return nil, err + } + return &rpcs.LoginByOAuthResponse{ + Role: response.Role, + AccessToken: response.AccessToken, + RefreshToken: response.RefreshToken, + Username: response.Username, + AccessTokenExpiresAt: response.AccessTokenExpiresAt, + RefreshTokenExpiresAt: response.RefreshTokenExpiresAt, + }, nil +} +func validateLoginByOAuthRequest(req *rpcs.LoginByOAuthRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetAppId(), 1, 256); err != nil { + violations = append(violations, fieldViolation("app_id", err)) + } + if req.GetOauthType() != util.OAuthTypeGithub && + req.GetOauthType() != util.OAuthTypeGoogle { + violations = append(violations, fieldViolation("oauth_type", errors.New("invalid oauth_type"))) + } + if err := val.ValidateString(req.GetAccessToken(), 1, 256); err != nil { + violations = append(violations, fieldViolation("access_token", err)) + } + return violations +} diff --git a/zbook_backend/gapi/repo_auto_sync_repo.go b/zbook_backend/gapi/repo_auto_sync_repo.go new file mode 100644 index 0000000..5193179 --- /dev/null +++ b/zbook_backend/gapi/repo_auto_sync_repo.go @@ -0,0 +1,63 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) AutoSyncRepo(ctx context.Context, req *rpcs.AutoSyncRepoRequest) (*rpcs.AutoSyncRepoResponse, error) { + violations := validateAutoSyncRepoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg_repo := db.GetRepoByRepoNameParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo, err := server.store.GetRepoByRepoName(ctx, arg_repo) + if err != nil { + return nil, err + } + if !repo.SyncToken.Valid { + return nil, status.Errorf(codes.PermissionDenied, "this repo not set auto sync token") + } + if repo.SyncToken.String != req.GetSyncToken() { + return nil, status.Errorf(codes.InvalidArgument, "invalied sync token") + } + + arg := db.ManualSyncRepoTxParams{ + RepoID: repo.RepoID, + AfterCreate: func(cloneDir string, repoID int64, userID int64, addedFiles []string, modifiedFiles []string, deletedFiles []string) error { + return storage.ConvertFile2Storage(server.minioClient, cloneDir, repoID, userID, addedFiles, modifiedFiles, deletedFiles) + }, + } + + err = server.store.ManualSyncRepoTx(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "manual sync repo failed: %s", err) + } + + rsp := &rpcs.AutoSyncRepoResponse{} + return rsp, nil +} +func validateAutoSyncRepoRequest(req *rpcs.AutoSyncRepoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + if err := val.ValidateString(req.GetSyncToken(), 6, 32); err != nil { + violations = append(violations, fieldViolation("sync_token", err)) + } + return violations +} diff --git a/zbook_backend/gapi/repo_create_repo.go b/zbook_backend/gapi/repo_create_repo.go new file mode 100644 index 0000000..f7406cd --- /dev/null +++ b/zbook_backend/gapi/repo_create_repo.go @@ -0,0 +1,90 @@ +package gapi + +import ( + "context" + "strings" + + "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + storage "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CreateRepo(ctx context.Context, req *rpcs.CreateRepoRequest) (*rpcs.CreateRepoResponse, error) { + apiUserDailyLimit := 100 + apiKey := "CreateRepo" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateCreateRepoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + GitProtocol, GitHost, GitUsername, GitRepo, err := util.ParseGitURL(req.GetGitAddr()) + if err != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.CreateRepoTxParams{ + CreateRepoParams: db.CreateRepoParams{ + UserID: authPayload.UserID, + GitProtocol: GitProtocol, + GitHost: GitHost, + GitUsername: GitUsername, + GitRepo: GitRepo, + GitAccessToken: pgtype.Text{String: req.GetGitAccessToken(), Valid: req.GetGitAccessToken() != ""}, + RepoName: req.GetRepoName(), + RepoDescription: req.GetRepoDescription(), + SyncToken: pgtype.Text{String: req.GetSyncToken(), Valid: req.GetSyncToken() != ""}, + VisibilityLevel: req.GetVisibilityLevel(), + HomePage: strings.ToLower(req.GetHomePage()), + ThemeSidebar: req.GetThemeSidebar(), + ThemeColor: req.GetThemeColor(), + }, + Username: authPayload.Username, + AfterCreate: func(cloneDir string, repoID int64, userID int64, addedFiles []string, modifiedFiles []string, deletedFiles []string) error { + return storage.ConvertFile2Storage(server.minioClient, cloneDir, repoID, userID, addedFiles, modifiedFiles, deletedFiles) + }, + } + + _, err = server.store.CreateRepoTx(ctx, arg) + if err != nil { + if db.ErrorCode(err) == db.UniqueViolation || db.ErrorCode(err) == db.ForeignKeyViolation { + return nil, status.Errorf(codes.AlreadyExists, "repo already exist: %s", err) + } + return nil, status.Errorf(codes.Internal, "create repo failed: %s", err) + } + + rsp := &rpcs.CreateRepoResponse{} + return rsp, nil +} +func validateCreateRepoRequest(req *rpcs.CreateRepoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateRepoName(req.GetRepoName()); err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + if err := val.ValidateString(req.GetRepoDescription(), 1, 512); err != nil { + violations = append(violations, fieldViolation("repo_description", err)) + } + _, _, _, _, err := util.ParseGitURL(req.GetGitAddr()) + if err != nil { + violations = append(violations, fieldViolation("git_addr", err)) + } + if err := val.ValidateRepoVisibility(req.GetVisibilityLevel()); err != nil { + violations = append(violations, fieldViolation("visibility_level", err)) + } + + if err := val.ValidateRepoSideBarTheme(req.GetThemeSidebar()); err != nil { + violations = append(violations, fieldViolation("theme_sidebar", err)) + } + if err := val.ValidateRepoThemeColor(req.GetThemeColor()); err != nil { + violations = append(violations, fieldViolation("theme_color", err)) + } + + return violations +} diff --git a/zbook_backend/gapi/repo_delete_repo.go b/zbook_backend/gapi/repo_delete_repo.go new file mode 100644 index 0000000..7cbcc10 --- /dev/null +++ b/zbook_backend/gapi/repo_delete_repo.go @@ -0,0 +1,69 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeleteRepo(ctx context.Context, req *rpcs.DeleteRepoRequest) (*rpcs.DeleteRepoResponse, error) { + violations := validateDeleteRepoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "DeleteRepo" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + arg_get := db.GetRepoBasicInfoParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo, err := server.store.GetRepoBasicInfo(ctx, arg_get) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo failed: %s", err) + } + + if repo.UserID != authPayload.UserID && authPayload.UserRole != util.AdminRole { + return nil, status.Errorf(codes.PermissionDenied, "current account do not have enough permission") + } + arg := db.DeleteRepoTxParams{ + RepoID: repo.RepoID, + UserID: repo.UserID, + AfterDelte: func(repoID int64, userID int64) error { + return storage.DeleteFilesByUserIDAndRepoID(server.minioClient, context.Background(), userID, repoID, "git-files") + }, + } + + err = server.store.DeleteRepoTx(ctx, arg) + if err != nil { + return nil, err + } + + rsp := &rpcs.DeleteRepoResponse{} + return rsp, nil +} +func validateDeleteRepoRequest(req *rpcs.DeleteRepoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + err = val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} diff --git a/zbook_backend/gapi/repo_get_list_repo_count.go b/zbook_backend/gapi/repo_get_list_repo_count.go new file mode 100644 index 0000000..6b1340b --- /dev/null +++ b/zbook_backend/gapi/repo_get_list_repo_count.go @@ -0,0 +1,86 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListRepoCount(ctx context.Context, req *rpcs.GetListRepoCountRequest) (*rpcs.GetListRepoCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetListRepoCount" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + // is unsigned + + if req.GetQuery() != "" { + arg := db.GetQueryRepoCountParams{ + Query: req.GetQuery(), + Role: util.UserRole, + Signed: false, + CurUserID: 0, + } + count, err := server.store.GetQueryRepoCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query repo count failed: %s", err) + } + rsp := &rpcs.GetListRepoCountResponse{ + Count: count, + } + return rsp, nil + } else { + arg := db.GetListRepoCountParams{ + Signed: false, + CurUserID: 0, + Role: util.UserRole, + } + user_count, err := server.store.GetListRepoCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list repo count failed: %s", err) + } + rsp := &rpcs.GetListRepoCountResponse{ + Count: user_count, + } + return rsp, nil + } + + } else { + if req.GetQuery() != "" { + arg := db.GetQueryRepoCountParams{ + Query: req.GetQuery(), + Role: authPayload.UserRole, + Signed: true, + CurUserID: authPayload.UserID, + } + count, err := server.store.GetQueryRepoCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query repo count failed: %s", err) + } + rsp := &rpcs.GetListRepoCountResponse{ + Count: count, + } + return rsp, nil + } else { + arg := db.GetListRepoCountParams{ + Signed: true, + CurUserID: authPayload.UserID, + Role: authPayload.UserRole, + } + user_count, err := server.store.GetListRepoCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list repo count failed: %s", err) + } + + rsp := &rpcs.GetListRepoCountResponse{ + Count: user_count, + } + return rsp, nil + } + + } + +} diff --git a/zbook_backend/gapi/repo_get_list_user_like_repo_count.go b/zbook_backend/gapi/repo_get_list_user_like_repo_count.go new file mode 100644 index 0000000..58df913 --- /dev/null +++ b/zbook_backend/gapi/repo_get_list_user_like_repo_count.go @@ -0,0 +1,73 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListUserLikeRepoCount(ctx context.Context, req *rpcs.GetListUserLikeRepoCountRequest) (*rpcs.GetListUserLikeRepoCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetListUserLikeRepoCount" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateGetListUserLikeRepoCountRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user failed: %s", err) + } + if req.GetQuery() != "" { + arg := db.GetQueryUserLikeRepoCountParams{ + UserID: user.UserID, + Signed: true, + CurUserID: authPayload.UserID, + Role: authPayload.UserRole, + Query: req.GetQuery(), + } + count, err := server.store.GetQueryUserLikeRepoCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query user like repo count failed: %s", err) + } + + rsp := &rpcs.GetListUserLikeRepoCountResponse{ + Count: count, + } + return rsp, nil + } else { + arg := db.GetListUserLikeRepoCountParams{ + UserID: user.UserID, + Signed: true, + CurUserID: authPayload.UserID, + Role: authPayload.UserRole, + } + count, err := server.store.GetListUserLikeRepoCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list user like repo count failed: %s", err) + } + + rsp := &rpcs.GetListUserLikeRepoCountResponse{ + Count: count, + } + return rsp, nil + } + +} +func validateGetListUserLikeRepoCountRequest(req *rpcs.GetListUserLikeRepoCountRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} diff --git a/zbook_backend/gapi/repo_get_list_user_own_repo_count.go b/zbook_backend/gapi/repo_get_list_user_own_repo_count.go new file mode 100644 index 0000000..6a58d30 --- /dev/null +++ b/zbook_backend/gapi/repo_get_list_user_own_repo_count.go @@ -0,0 +1,71 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListUserOwnRepoCount(ctx context.Context, req *rpcs.GetListUserOwnRepoCountRequest) (*rpcs.GetListUserOwnRepoCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetListUserOwnRepoCount" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateGetListUserOwnRepoCountRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + if req.GetQuery() != "" { + arg := db.GetQueryUserOwnRepoCountParams{ + UserID: user.UserID, + Signed: true, + CurUserID: authPayload.UserID, + Role: authPayload.UserRole, + Query: req.GetQuery(), + } + count, err := server.store.GetQueryUserOwnRepoCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query user own repo count failed: %s", err) + } + rsp := &rpcs.GetListUserOwnRepoCountResponse{ + Count: count, + } + return rsp, nil + } else { + arg := db.GetListUserOwnRepoCountParams{ + UserID: user.UserID, + Signed: true, + CurUserID: authPayload.UserID, + Role: authPayload.UserRole, + } + count, err := server.store.GetListUserOwnRepoCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list user own repo count failed: %s", err) + } + rsp := &rpcs.GetListUserOwnRepoCountResponse{ + Count: count, + } + return rsp, nil + } + +} +func validateGetListUserOwnRepoCountRequest(req *rpcs.GetListUserOwnRepoCountRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} diff --git a/zbook_backend/gapi/repo_get_repo_basic_info.go b/zbook_backend/gapi/repo_get_repo_basic_info.go new file mode 100644 index 0000000..9d95ef3 --- /dev/null +++ b/zbook_backend/gapi/repo_get_repo_basic_info.go @@ -0,0 +1,64 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) GetRepoBasicInfo(ctx context.Context, req *rpcs.GetRepoBasicInfoRequest) (*rpcs.GetRepoBasicInfoResponse, error) { + violations := validateGetRepoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.GetRepoBasicInfoParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo, err := server.store.GetRepoBasicInfo(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo basic info failed: %s", err) + } + err = server.isRepoVisibleToCurrentUser(ctx, repo.RepoID) + if err != nil { + return nil, err + } + avatarData, err := storage.DownloadFileFromStorage(server.minioClient, context.Background(), repo.Username, "avatar") + if err != nil { + log.Info().Msgf("download avatar for %s failed: %s", repo.Username, err) + } + rsp := &rpcs.GetRepoBasicInfoResponse{ + Username: repo.Username, + Email: repo.Email, + UpdatedAt: timestamppb.New(repo.UpdatedAt), + Avatar: avatarData, + RepoName: repo.RepoName, + RepoDescription: repo.RepoDescription, + HomePage: repo.HomePage, + } + return rsp, nil +} +func validateGetRepoRequest(req *rpcs.GetRepoBasicInfoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + err = val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + return violations +} diff --git a/zbook_backend/gapi/repo_get_repo_config.go b/zbook_backend/gapi/repo_get_repo_config.go new file mode 100644 index 0000000..2a3a612 --- /dev/null +++ b/zbook_backend/gapi/repo_get_repo_config.go @@ -0,0 +1,71 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetRepoConfig(ctx context.Context, req *rpcs.GetRepoConfigRequest) (*rpcs.GetRepoConfigResponse, error) { + violations := validateGetRepoConfigRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + arg_repo := db.GetRepoIDParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo_id, err := server.store.GetRepoID(ctx, arg_repo) + if err != nil { + log.Info().Msgf("get repo config get repo id failed:%s,%s", req.GetUsername(), req.GetRepoName()) + return nil, status.Errorf(codes.Internal, "get repo id failed: %s", err) + } + + err = server.isRepoVisibleToCurrentUser(ctx, repo_id) + if err != nil { + return nil, err + } + + arg := db.GetRepoConfigParams{Username: req.GetUsername(), RepoName: req.GetRepoName()} + repo, err := server.store.GetRepoConfig(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo config not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo config failed: %s", err) + } + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get user by id failed: %s", err) + } + + rsp := &rpcs.GetRepoConfigResponse{ + Config: repo.Config, + Username: user.Username, + VisibilityLevel: repo.VisibilityLevel, + ThemeSidebar: repo.ThemeSidebar, + ThemeColor: repo.ThemeColor, + } + return rsp, nil +} +func validateGetRepoConfigRequest(req *rpcs.GetRepoConfigRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + err = val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + return violations +} diff --git a/zbook_backend/gapi/repo_list_repo.go b/zbook_backend/gapi/repo_list_repo.go new file mode 100644 index 0000000..0734df9 --- /dev/null +++ b/zbook_backend/gapi/repo_list_repo.go @@ -0,0 +1,151 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListRepo(ctx context.Context, req *rpcs.ListRepoRequest) (*rpcs.ListRepoResponse, error) { + violations := validateListRepoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "ListRepo" + authUser, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + // not signed + if req.GetQuery() != "" { + + arg := db.QueryRepoParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Query: req.GetQuery(), + Role: util.UserRole, + Signed: false, + CurUserID: 0, + } + reports, err := server.store.QueryRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query repo failed: %s", err) + } + rsp := &rpcs.ListRepoResponse{ + Elements: convertQueryRepo(reports), + } + return rsp, nil + } + arg := db.ListRepoParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Signed: false, + CurUserID: 0, + Role: util.UserRole, + } + + reports, err := server.store.ListRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list repo failed: %s", err) + } + + rsp := &rpcs.ListRepoResponse{ + Elements: convertListRepos(reports), + } + return rsp, nil + } + + if req.GetQuery() != "" { + + arg := db.QueryRepoParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Query: req.GetQuery(), + Role: authUser.UserRole, + Signed: true, + CurUserID: authUser.UserID, + } + reports, err := server.store.QueryRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query repo failed: %s", err) + } + rsp := &rpcs.ListRepoResponse{ + Elements: convertQueryRepo(reports), + } + return rsp, nil + } + arg := db.ListRepoParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Signed: true, + CurUserID: authUser.UserID, + Role: util.AdminRole, + } + + reports, err := server.store.ListRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list repo failed: %s", err) + } + rsp := &rpcs.ListRepoResponse{ + Elements: convertListRepos(reports), + } + return rsp, nil +} +func validateListRepoRequest(req *rpcs.ListRepoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} + +func convertListRepos(reports []db.ListRepoRow) []*models.ListRepoInfo { + var ret_reports []*models.ListRepoInfo + for i := 0; i < len(reports); i++ { + + ret_reports = append(ret_reports, + &models.ListRepoInfo{ + RepoId: reports[i].RepoID, + RepoName: reports[i].RepoName, + Username: reports[i].Username, + RepoDescription: reports[i].RepoDescription, + VisibilityLevel: reports[i].VisibilityLevel, + GitHost: reports[i].GitHost, + LikeCount: int32(reports[i].LikeCount), + IsLiked: reports[i].IsLiked, + UpdatedAt: timestamppb.New(reports[i].UpdatedAt), + CreatedAt: timestamppb.New(reports[i].CreatedAt), + }, + ) + } + return ret_reports +} + +func convertQueryRepo(reports []db.QueryRepoRow) []*models.ListRepoInfo { + var ret_reports []*models.ListRepoInfo + for i := 0; i < len(reports); i++ { + ret_reports = append(ret_reports, + &models.ListRepoInfo{ + RepoId: reports[i].RepoID, + Username: reports[i].Username, + RepoName: reports[i].RepoName, + RepoDescription: reports[i].RepoDescription, + VisibilityLevel: reports[i].VisibilityLevel, + GitHost: reports[i].GitHost, + // LikeCount: int32(reports[i].LikeCount), + UpdatedAt: timestamppb.New(reports[i].UpdatedAt), + CreatedAt: timestamppb.New(reports[i].CreatedAt), + }, + ) + } + return ret_reports +} diff --git a/zbook_backend/gapi/repo_list_user_like_repo.go b/zbook_backend/gapi/repo_list_user_like_repo.go new file mode 100644 index 0000000..d9960cb --- /dev/null +++ b/zbook_backend/gapi/repo_list_user_like_repo.go @@ -0,0 +1,128 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListUserLikeRepo(ctx context.Context, req *rpcs.ListUserLikeRepoRequest) (*rpcs.ListUserLikeRepoResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListUserLikeRepo" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateListUserLikeRepoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + _, err = server.getUserPermessionlevel(ctx, authPayload.Username, req.GetUsername()) + if err != nil { + return nil, err + } + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + if req.GetQuery() != "" { + arg := db.QueryUserLikeRepoParams{ + UserID: user.UserID, + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Signed: true, + Role: authPayload.UserRole, + CurUserID: authPayload.UserID, + Query: req.GetQuery(), + } + + repos, err := server.store.QueryUserLikeRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query user like repo failed: %s", err) + } + + rsp := &rpcs.ListUserLikeRepoResponse{ + Elements: convertQueryUserLikeRepo(repos), + } + return rsp, nil + } else { + arg := db.ListUserLikeRepoParams{ + UserID: user.UserID, + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Signed: true, + Role: authPayload.UserRole, + CurUserID: authPayload.UserID, + } + + repos, err := server.store.ListUserLikeRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list user like repo failed: %s", err) + } + + rsp := &rpcs.ListUserLikeRepoResponse{ + Elements: convertListUserLikeRepo(repos), + } + return rsp, nil + } + +} +func validateListUserLikeRepoRequest(req *rpcs.ListUserLikeRepoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidateInt32ID(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} + +func convertListUserLikeRepo(repos []db.ListUserLikeRepoRow) []*models.ListRepoInfo { + var ret_repos []*models.ListRepoInfo + for i := 0; i < len(repos); i++ { + ret_repos = append(ret_repos, + &models.ListRepoInfo{ + RepoId: repos[i].RepoID, + Username: repos[i].Username, + RepoName: repos[i].RepoName, + RepoDescription: repos[i].RepoDescription, + VisibilityLevel: repos[i].VisibilityLevel, + GitHost: repos[i].GitHost, + LikeCount: int32(repos[i].LikeCount), + IsLiked: repos[i].IsLiked, + UpdatedAt: timestamppb.New(repos[i].UpdatedAt), + CreatedAt: timestamppb.New(repos[i].CreatedAt), + }, + ) + } + return ret_repos +} +func convertQueryUserLikeRepo(repos []db.QueryUserLikeRepoRow) []*models.ListRepoInfo { + var ret_repos []*models.ListRepoInfo + for i := 0; i < len(repos); i++ { + ret_repos = append(ret_repos, + &models.ListRepoInfo{ + RepoId: repos[i].RepoID, + RepoName: repos[i].RepoName, + Username: repos[i].Username, + RepoDescription: repos[i].RepoDescription, + VisibilityLevel: repos[i].VisibilityLevel, + GitHost: repos[i].GitHost, + LikeCount: int32(repos[i].LikeCount), + IsLiked: repos[i].IsLiked, + UpdatedAt: timestamppb.New(repos[i].UpdatedAt), + CreatedAt: timestamppb.New(repos[i].CreatedAt), + }, + ) + } + return ret_repos +} diff --git a/zbook_backend/gapi/repo_list_user_own_repo.go b/zbook_backend/gapi/repo_list_user_own_repo.go new file mode 100644 index 0000000..e465b72 --- /dev/null +++ b/zbook_backend/gapi/repo_list_user_own_repo.go @@ -0,0 +1,126 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListUserOwnRepo(ctx context.Context, req *rpcs.ListUserOwnRepoRequest) (*rpcs.ListUserOwnRepoResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "ListUserOwnRepo" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateListUserOwnRepoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + if req.GetQuery() != "" { + arg := db.QueryUserOwnRepoParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Signed: true, + CurUserID: authPayload.UserID, + UserID: user.UserID, + Role: authPayload.UserRole, + Query: req.GetQuery(), + } + + repos, err := server.store.QueryUserOwnRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query user own repo failed: %s", err) + } + + rsp := &rpcs.ListUserOwnRepoResponse{ + Elements: convertQueryUserOwnRepo(repos, req.GetUsername()), + } + return rsp, nil + } else { + arg := db.ListUserOwnRepoParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Signed: true, + CurUserID: authPayload.UserID, + UserID: user.UserID, + Role: authPayload.UserRole, + } + + repos, err := server.store.ListUserOwnRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list user own repo failed: %s", err) + } + + rsp := &rpcs.ListUserOwnRepoResponse{ + Elements: convertListUserOwnRepo(repos, req.GetUsername()), + } + return rsp, nil + } + +} +func validateListUserOwnRepoRequest(req *rpcs.ListUserOwnRepoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidateInt32ID(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} + +func convertListUserOwnRepo(repos []db.ListUserOwnRepoRow, username string) []*models.ListRepoInfo { + var ret_repos []*models.ListRepoInfo + for i := 0; i < len(repos); i++ { + ret_repos = append(ret_repos, + &models.ListRepoInfo{ + RepoId: repos[i].RepoID, + RepoName: repos[i].RepoName, + Username: username, + RepoDescription: repos[i].RepoDescription, + VisibilityLevel: repos[i].VisibilityLevel, + GitHost: repos[i].GitHost, + LikeCount: int32(repos[i].LikeCount), + IsLiked: repos[i].IsLiked, + UpdatedAt: timestamppb.New(repos[i].UpdatedAt), + CreatedAt: timestamppb.New(repos[i].CreatedAt), + }, + ) + } + return ret_repos +} + +func convertQueryUserOwnRepo(repos []db.QueryUserOwnRepoRow, username string) []*models.ListRepoInfo { + var ret_repos []*models.ListRepoInfo + for i := 0; i < len(repos); i++ { + ret_repos = append(ret_repos, + &models.ListRepoInfo{ + RepoId: repos[i].RepoID, + RepoName: repos[i].RepoName, + Username: username, + RepoDescription: repos[i].RepoDescription, + VisibilityLevel: repos[i].VisibilityLevel, + GitHost: repos[i].GitHost, + IsLiked: repos[i].IsLiked, + LikeCount: int32(repos[i].LikeCount), + UpdatedAt: timestamppb.New(repos[i].UpdatedAt), + CreatedAt: timestamppb.New(repos[i].CreatedAt), + }, + ) + } + return ret_repos +} diff --git a/zbook_backend/gapi/repo_manual_sync_repo.go b/zbook_backend/gapi/repo_manual_sync_repo.go new file mode 100644 index 0000000..e6e24b0 --- /dev/null +++ b/zbook_backend/gapi/repo_manual_sync_repo.go @@ -0,0 +1,57 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" +) + +func (server *Server) ManualSyncRepo(ctx context.Context, req *rpcs.ManualSyncRepoRequest) (*rpcs.ManualSyncRepoResponse, error) { + violations := validateManualSyncRepoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + arg_get := db.GetRepoBasicInfoParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo, err := server.store.GetRepoBasicInfo(ctx, arg_get) + if err != nil { + return nil, err + } + err = server.isRepoVisibleToCurrentUser(ctx, repo.RepoID) + if err != nil { + return nil, err + } + + arg := db.ManualSyncRepoTxParams{ + RepoID: repo.RepoID, + AfterCreate: func(cloneDir string, repoID int64, userID int64, addedFiles []string, modifiedFiles []string, deletedFiles []string) error { + return storage.ConvertFile2Storage(server.minioClient, cloneDir, repoID, userID, addedFiles, modifiedFiles, deletedFiles) + }, + } + + err = server.store.ManualSyncRepoTx(ctx, arg) + if err != nil { + return nil, err + } + + rsp := &rpcs.ManualSyncRepoResponse{} + + return rsp, nil +} +func validateManualSyncRepoRequest(req *rpcs.ManualSyncRepoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + err = val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} diff --git a/zbook_backend/gapi/repo_update_repo.go b/zbook_backend/gapi/repo_update_repo.go new file mode 100644 index 0000000..50c2ec7 --- /dev/null +++ b/zbook_backend/gapi/repo_update_repo.go @@ -0,0 +1,116 @@ +package gapi + +import ( + "context" + "errors" + "strings" + + "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) UpdateRepoInfo(ctx context.Context, req *rpcs.UpdateRepoInfoRequest) (*rpcs.UpdateRepoInfoResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "UpdateRepoInfo" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateUpdateRepoInfoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + arg_get := db.GetRepoBasicInfoParams{ + Username: req.GetUsername(), + RepoName: req.GetOldRepoName(), + } + repo_get, err := server.store.GetRepoBasicInfo(ctx, arg_get) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo failed: %s", err) + } + if authPayload.UserID != repo_get.UserID { + return nil, status.Error(codes.PermissionDenied, "cannot update other user's repo") + } + + arg := db.UpdateRepoInfoParams{ + RepoID: repo_get.RepoID, + RepoName: pgtype.Text{ + String: req.GetRepoName(), + Valid: len(req.GetRepoName()) != 0, + }, + RepoDescription: pgtype.Text{String: req.GetRepoDescription(), Valid: req.GetRepoDescription() != ""}, + + GitAccessToken: pgtype.Text{ + String: req.GetGitAccessToken(), + Valid: len(req.GetGitAccessToken()) != 0, + }, + + VisibilityLevel: pgtype.Text{ + String: req.GetVisibilityLevel(), + Valid: len(req.GetVisibilityLevel()) != 0, + }, + ThemeSidebar: pgtype.Text{String: req.GetThemeSidebar(), Valid: len(req.GetThemeSidebar()) != 0}, + ThemeColor: pgtype.Text{String: req.GetThemeColor(), Valid: len(req.GetThemeColor()) != 0}, + SyncToken: pgtype.Text{String: req.GetSyncToken(), Valid: len(req.GetSyncToken()) != 0}, + HomePage: pgtype.Text{String: strings.ToLower(req.GetHomePage()), Valid: len(req.GetHomePage()) != 0}, + } + + _, err = server.store.UpdateRepoInfo(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "UpdateRepoInfo not found error: %s", err) + } + return nil, status.Errorf(codes.Internal, "UpdateRepoInfo error: %s", err) + } + + rsp := &rpcs.UpdateRepoInfoResponse{} + return rsp, nil +} +func validateUpdateRepoInfoRequest(req *rpcs.UpdateRepoInfoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + err = val.ValidateRepoName(req.GetOldRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + + if req.GetRepoName() != "" { + if err = val.ValidateRepoName(req.GetRepoName()); err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + } + if req.GetRepoDescription() != "" { + if err = val.ValidateString(req.GetRepoDescription(), 1, 512); err != nil { + violations = append(violations, fieldViolation("repo_description", err)) + } + } + if req.GetVisibilityLevel() != "" { + if err := val.ValidateRepoVisibility(req.GetVisibilityLevel()); err != nil { + violations = append(violations, fieldViolation("visibility_level", err)) + } + } + if req.GetThemeSidebar() != "" { + if err := val.ValidateRepoSideBarTheme(req.GetThemeSidebar()); err != nil { + violations = append(violations, fieldViolation("theme_sidebar", err)) + } + } + if req.GetThemeColor() != "" { + if err := val.ValidateRepoThemeColor(req.GetThemeColor()); err != nil { + violations = append(violations, fieldViolation("theme_color", err)) + } + } + + return violations +} diff --git a/zbook_backend/gapi/reporelation_create_repo_relation.go b/zbook_backend/gapi/reporelation_create_repo_relation.go new file mode 100644 index 0000000..f2c3aa4 --- /dev/null +++ b/zbook_backend/gapi/reporelation_create_repo_relation.go @@ -0,0 +1,86 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CreateRepoRelation(ctx context.Context, req *rpcs.CreateRepoRelationRequest) (*rpcs.CreateRepoRelationResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "CreateRepoRelation" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateCreateRepoRelationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + arg_get := db.GetRepoBasicInfoParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo, err := server.store.GetRepoBasicInfo(ctx, arg_get) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo basic info failed: %s", err) + } + + err = server.isRepoVisibleToCurrentUser(ctx, repo.RepoID) + if err != nil { + return nil, err + } + relationType := util.RelationTypeShare + if req.GetRelationType() == util.RelationTypeDislike { + relationType = util.RelationTypeDislike + } else if req.GetRelationType() == util.RelationTypeLike { + relationType = util.RelationTypeLike + } else if req.GetRelationType() == util.RelationTypeShare { + relationType = util.RelationTypeShare + } else { + return nil, status.Errorf(codes.InvalidArgument, "Unknown RelationType") + } + arg := db.CreateRepoRelationParams{ + RepoID: repo.RepoID, + UserID: authPayload.UserID, + RelationType: relationType, + } + + err = server.store.CreateRepoRelation(ctx, arg) + + if err != nil { + if db.ErrorCode(err) == db.UniqueViolation || db.ErrorCode(err) == db.ForeignKeyViolation { + return nil, status.Errorf(codes.AlreadyExists, "repo relation already exists: %s", err) + } + return nil, status.Errorf(codes.Internal, "create repo relation failed: %s", err) + } + + rsp := &rpcs.CreateRepoRelationResponse{} + return rsp, nil +} +func validateCreateRepoRelationRequest(req *rpcs.CreateRepoRelationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + err = val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + if req.GetRelationType() != util.RelationTypeDislike && + req.GetRelationType() != util.RelationTypeLike && + req.GetRelationType() != util.RelationTypeShare { + violations = append(violations, fieldViolation("relation_type", errors.New("invalid relation_type"))) + } + return violations +} diff --git a/zbook_backend/gapi/reporelation_create_repo_visibility.go b/zbook_backend/gapi/reporelation_create_repo_visibility.go new file mode 100644 index 0000000..d58ef09 --- /dev/null +++ b/zbook_backend/gapi/reporelation_create_repo_visibility.go @@ -0,0 +1,78 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CreateRepoVisibility(ctx context.Context, req *rpcs.CreateRepoVisibilityRequest) (*rpcs.CreateRepoVisibilityResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "CreateRepoVisibility" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateCreateRepoVisibilityRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.NotFound, "get user by username failed: %s", err) + } + arg_repo := db.GetRepoIDParams{ + Username: req.GetRepoUsername(), + RepoName: req.GetRepoName(), + } + repo_id, err := server.store.GetRepoID(ctx, arg_repo) + if err != nil { + log.Info().Msgf("get repo layout get repo id failed:%s,%s", req.GetUsername(), req.GetRepoName()) + return nil, status.Errorf(codes.Internal, "get repo id failed: %s", err) + } + repo, err := server.store.GetRepo(ctx, repo_id) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo failed: %s", err) + } + if authPayload.UserID != repo.UserID { + return nil, status.Error(codes.PermissionDenied, "cannot update other user's repo") + } + + arg := db.CreateRepoRelationParams{ + RepoID: repo.RepoID, + UserID: user.UserID, + RelationType: util.RelationTypeVisi, + } + server.store.CreateRepoRelation(ctx, arg) + + rsp := &rpcs.CreateRepoVisibilityResponse{} + return rsp, nil +} +func validateCreateRepoVisibilityRequest(req *rpcs.CreateRepoVisibilityRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + err = val.ValidateUsername(req.GetRepoUsername()) + if err != nil { + violations = append(violations, fieldViolation("repo_username", err)) + } + err = val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + return violations +} diff --git a/zbook_backend/gapi/reporelation_delete_repo_relation.go b/zbook_backend/gapi/reporelation_delete_repo_relation.go new file mode 100644 index 0000000..8e8d1eb --- /dev/null +++ b/zbook_backend/gapi/reporelation_delete_repo_relation.go @@ -0,0 +1,85 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeleteRepoRelation(ctx context.Context, req *rpcs.DeleteRepoRelationRequest) (*rpcs.DeleteRepoRelationResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "DeleteRepoRelation" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateDeleteRepoRelationRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + relationType := util.RelationTypeShare + if req.GetRelationType() == util.RelationTypeDislike { + relationType = util.RelationTypeDislike + } else if req.GetRelationType() == util.RelationTypeLike { + relationType = util.RelationTypeLike + } else if req.GetRelationType() == util.RelationTypeShare { + relationType = util.RelationTypeShare + } else { + return nil, status.Errorf(codes.InvalidArgument, "Unknown RelationType") + } + + arg_get := db.GetRepoBasicInfoParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo, err := server.store.GetRepoBasicInfo(ctx, arg_get) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo basic info failed: %s", err) + } + err = server.isRepoVisibleToCurrentUser(ctx, repo.RepoID) + if err != nil { + return nil, err + } + arg := db.DeleteRepoRelationParams{ + RepoID: repo.RepoID, + UserID: authPayload.UserID, + RelationType: relationType, + } + err = server.store.DeleteRepoRelation(ctx, arg) + + if err != nil { + if db.ErrorCode(err) == db.UniqueViolation || db.ErrorCode(err) == db.ForeignKeyViolation { + return nil, status.Errorf(codes.AlreadyExists, "repo relation already exists: %s", err) + } + return nil, status.Errorf(codes.Internal, "delete repo relation failed: %s", err) + } + + rsp := &rpcs.DeleteRepoRelationResponse{} + return rsp, nil +} +func validateDeleteRepoRelationRequest(req *rpcs.DeleteRepoRelationRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + err = val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + if req.GetRelationType() != util.RelationTypeDislike && + req.GetRelationType() != util.RelationTypeLike && + req.GetRelationType() != util.RelationTypeShare { + violations = append(violations, fieldViolation("relation_type", errors.New("invalid relation_type"))) + } + return violations +} diff --git a/zbook_backend/gapi/reporelation_delete_repo_visibility.go b/zbook_backend/gapi/reporelation_delete_repo_visibility.go new file mode 100644 index 0000000..3879d7d --- /dev/null +++ b/zbook_backend/gapi/reporelation_delete_repo_visibility.go @@ -0,0 +1,79 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) DeleteRepoVisibility(ctx context.Context, req *rpcs.DeleteRepoVisibilityRequest) (*rpcs.DeleteRepoVisibilityResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "DeleteRepoVisibility" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + violations := validateDeleteRepoVisibilityRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + + arg_repo := db.GetRepoIDParams{ + Username: req.GetRepoUsername(), + RepoName: req.GetRepoName(), + } + repo_id, err := server.store.GetRepoID(ctx, arg_repo) + if err != nil { + log.Info().Msgf("get repo layout get repo id failed:%s,%s", req.GetUsername(), req.GetRepoName()) + return nil, status.Errorf(codes.Internal, "get repo id failed: %s", err) + } + repo, err := server.store.GetRepo(ctx, repo_id) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "repo not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get repo failed: %s", err) + } + if authPayload.UserID != repo.UserID { + return nil, status.Error(codes.PermissionDenied, "cannot update other user's repo") + } + + arg := db.DeleteRepoRelationParams{ + RepoID: repo.RepoID, + UserID: user.UserID, + RelationType: util.RelationTypeVisi, + } + server.store.DeleteRepoRelation(ctx, arg) + + rsp := &rpcs.DeleteRepoVisibilityResponse{} + return rsp, nil +} +func validateDeleteRepoVisibilityRequest(req *rpcs.DeleteRepoVisibilityRequest) (violations []*errdetails.BadRequest_FieldViolation) { + err := val.ValidateUsername(req.GetUsername()) + if err != nil { + violations = append(violations, fieldViolation("username", err)) + } + err = val.ValidateUsername(req.GetRepoUsername()) + if err != nil { + violations = append(violations, fieldViolation("repo_username", err)) + } + err = val.ValidateRepoName(req.GetRepoName()) + if err != nil { + violations = append(violations, fieldViolation("repo_name", err)) + } + return violations +} diff --git a/zbook_backend/gapi/reporelation_get_repo_visibility_count.go b/zbook_backend/gapi/reporelation_get_repo_visibility_count.go new file mode 100644 index 0000000..2d87290 --- /dev/null +++ b/zbook_backend/gapi/reporelation_get_repo_visibility_count.go @@ -0,0 +1,39 @@ +package gapi + +import ( + "context" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetRepoVisibilityCount(ctx context.Context, req *rpcs.GetRepoVisibilityCountRequest) (*rpcs.GetRepoVisibilityCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetRepoVisibilityCount" + _, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + arg_repo := db.GetRepoIDParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo_id, err := server.store.GetRepoID(ctx, arg_repo) + if err != nil { + log.Info().Msgf("get repo layout get repo id failed:%s,%s", req.GetUsername(), req.GetRepoName()) + return nil, status.Errorf(codes.Internal, "get repo id failed: %s", err) + } + userCount, err := server.store.GetRepoVisibilityByRepoCount(ctx, repo_id) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get repository visibility count: %s", err) + } + rsp := &rpcs.GetRepoVisibilityCountResponse{ + Count: userCount, + } + return rsp, nil + +} diff --git a/zbook_backend/gapi/reporelation_list_repo_visibility.go b/zbook_backend/gapi/reporelation_list_repo_visibility.go new file mode 100644 index 0000000..113ccf5 --- /dev/null +++ b/zbook_backend/gapi/reporelation_list_repo_visibility.go @@ -0,0 +1,109 @@ +package gapi + +import ( + "context" + + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListRepoVisibility(ctx context.Context, req *rpcs.ListRepoVisibilityRequest) (*rpcs.ListRepoVisibilityResponse, error) { + violations := validateListRepoVisibilityRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "ListRepoVisibility" + _, err := server.authUser(ctx, []string{util.AdminRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + arg_repo := db.GetRepoIDParams{ + Username: req.GetUsername(), + RepoName: req.GetRepoName(), + } + repo_id, err := server.store.GetRepoID(ctx, arg_repo) + if err != nil { + log.Info().Msgf("get repo layout get repo id failed:%s,%s", req.GetUsername(), req.GetRepoName()) + return nil, status.Errorf(codes.Internal, "get repo id failed: %s", err) + } + if req.GetQuery() != "" { + arg := db.QueryRepoVisibilityByRepoParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Username: req.GetQuery(), + RepoID: repo_id, + } + + users, err := server.store.QueryRepoVisibilityByRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query repo visisiblity by repo failed: %s", err) + } + rsp := &rpcs.ListRepoVisibilityResponse{ + Elements: convertQueryRepoVisibility(users), + } + return rsp, nil + } else { + arg := db.ListRepoVisibilityByRepoParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + RepoID: repo_id, + } + + users, err := server.store.ListRepoVisibilityByRepo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list repo visibilisty by repo failed: %s", err) + } + + rsp := &rpcs.ListRepoVisibilityResponse{ + Elements: convertListRepoVisibility(users), + } + return rsp, nil + } + +} +func validateListRepoVisibilityRequest(req *rpcs.ListRepoVisibilityRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} +func convertListRepoVisibility(users []db.User) []*models.ListUserRepoVisiblityInfo { + var ret_users []*models.ListUserRepoVisiblityInfo + for i := 0; i < len(users); i++ { + ret_users = append(ret_users, + &models.ListUserRepoVisiblityInfo{ + Username: users[i].Username, + Email: users[i].Email, + UpdatedAt: timestamppb.New(users[i].UpdatedAt), + IsRepoVisible: true, + }, + ) + } + return ret_users +} +func convertQueryRepoVisibility(users []db.QueryRepoVisibilityByRepoRow) []*models.ListUserRepoVisiblityInfo { + var ret_users []*models.ListUserRepoVisiblityInfo + for i := 0; i < len(users); i++ { + ret_users = append(ret_users, + &models.ListUserRepoVisiblityInfo{ + Username: users[i].Username, + Email: users[i].Email, + UpdatedAt: timestamppb.New(users[i].UpdatedAt), + IsRepoVisible: users[i].IsVisible, + }, + ) + } + return ret_users +} diff --git a/zbook_backend/gapi/server.go b/zbook_backend/gapi/server.go new file mode 100644 index 0000000..05eed87 --- /dev/null +++ b/zbook_backend/gapi/server.go @@ -0,0 +1,50 @@ +package gapi + +import ( + "fmt" + + "github.com/go-redis/redis" + "github.com/minio/minio-go/v7" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb" + "github.com/zizdlp/zbook/token" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/worker" +) + +type Server struct { + pb.UnimplementedZBookVerificationServer + pb.UnimplementedZBookRepoRelationServer + pb.UnimplementedZBookCommentRelationServer + pb.UnimplementedZBookNotificationServer + pb.UnimplementedZBookAdminServer + pb.UnimplementedZBookCommentServer + pb.UnimplementedZBookMarkdownServer + pb.UnimplementedZBookRepoServer + pb.UnimplementedZBookUserServer + pb.UnimplementedZBookOAuthServer + pb.UnimplementedZBookFollowServer + config util.Config + store db.Store + tokenMaker token.Maker + taskDistributor worker.TaskDistributor + redisClient *redis.Client + minioClient *minio.Client +} + +func NewServer(config util.Config, store db.Store, taskDistributor worker.TaskDistributor, redisClient *redis.Client, minioClient *minio.Client) (*Server, error) { + tokenMaker, err := token.NewPasetoMaker(config.TokenSymmetricKey) + if err != nil { + return nil, fmt.Errorf("cannot create token maker: %w", err) + } + server := &Server{ + config: config, + store: store, + tokenMaker: tokenMaker, + taskDistributor: taskDistributor, + redisClient: redisClient, + minioClient: minioClient, + } + + return server, nil +} diff --git a/zbook_backend/gapi/user_create_user.go b/zbook_backend/gapi/user_create_user.go new file mode 100644 index 0000000..66d3dbf --- /dev/null +++ b/zbook_backend/gapi/user_create_user.go @@ -0,0 +1,124 @@ +package gapi + +import ( + "context" + "fmt" + "time" + + "github.com/hibiken/asynq" + "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/storage" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "github.com/zizdlp/zbook/worker" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) CreateUser(ctx context.Context, req *rpcs.CreateUserRequest) (*rpcs.CreateUserResponse, error) { + + violations := validateCreateUserRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + config, err := server.store.GetConfiguration(ctx, "allow_registration") + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get configuration: %v", err) + } + if !config.ConfigValue { + config_invitation, err := server.store.GetConfiguration(ctx, "allow_invitation") + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get configuration: %v", err) + } + if !config_invitation.ConfigValue { + return nil, status.Errorf(codes.PermissionDenied, "registration is currently not enabled") + } else { + arg_invitation := db.GetInvitationParams{ + Email: req.GetEmail(), + InvitationUrl: req.GetInvitationUrl(), + } + invitation, err := server.store.GetInvitation(ctx, arg_invitation) + if err != nil { + return nil, status.Errorf(codes.PermissionDenied, "registration is currently not enabled") + } + if invitation.IsUsed || invitation.ExpiredAt.Before(time.Now()) { + return nil, status.Errorf(codes.PermissionDenied, "invitation is invalid or has expired") + } + } + } + + hashedPassword, err := util.HashPassword(req.GetPassword()) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to hash password: %v", err) + } + path := fmt.Sprintf("icons/v%d.png", util.RandomInt32(0, 9)) + avatar, err := util.ReadImageBytes(path) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to read image bytes: %v", err) + } + err = storage.UploadFileToStorage(server.minioClient, ctx, req.GetUsername(), "avatar", avatar) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to upload avatar: %v", err) + } + arg := db.CreateUserTxParams{ + CreateUserParams: db.CreateUserParams{ + Username: req.GetUsername(), + HashedPassword: hashedPassword, + Email: req.GetEmail(), + }, + AfterCreate: func(user db.User) error { + if server.config.REQUIRE_EMAIL_VERIFY { + taskPayload := &worker.PayloadVerifyEmail{ + Email: user.Email, + } + opts := []asynq.Option{ + asynq.MaxRetry(10), + asynq.ProcessIn(10 * time.Second), + asynq.Queue(worker.QueueCritical), + } + return server.taskDistributor.DistributeTaskVerifyEmail(ctx, taskPayload, opts...) + } else { + return nil + } + }, + } + + result, err := server.store.CreateUserTx(ctx, arg) + if err != nil { + if db.ErrorCode(err) == db.UniqueViolation { + return nil, status.Errorf(codes.AlreadyExists, "username or email already exists: %v", err) + } + return nil, status.Errorf(codes.Internal, "failed to create user: %v", err) + } + + CreateSystemNotificationParams := db.CreateSystemNotificationParams{ + UserID: result.User.UserID, + Title: "Welcome to ZBook", + Contents: "Welcome to ZBook, please click to view the introduction guide.", + RedirectUrl: pgtype.Text{String: "https://github.com/zizdlp/zbook-user-guide", Valid: true}, + } + err = server.store.CreateSystemNotificationTx(ctx, db.CreateSystemNotificationTxParams{CreateSystemNotificationParams: CreateSystemNotificationParams}) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to create system notification: %v", err) + } + + rsp := &rpcs.CreateUserResponse{} + return rsp, nil +} + +func validateCreateUserRequest(req *rpcs.CreateUserRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + if err := val.ValidatePassword(req.GetPassword()); err != nil { + violations = append(violations, fieldViolation("password", err)) + } + if err := val.ValidateEmail(req.GetEmail()); err != nil { + violations = append(violations, fieldViolation("email", err)) + } + return violations +} diff --git a/zbook_backend/gapi/user_create_user_test.go b/zbook_backend/gapi/user_create_user_test.go new file mode 100644 index 0000000..b8fc959 --- /dev/null +++ b/zbook_backend/gapi/user_create_user_test.go @@ -0,0 +1,193 @@ +package gapi + +import ( + "context" + "database/sql" + "fmt" + + "reflect" + "testing" + + "github.com/go-redis/redis" + "github.com/golang/mock/gomock" + "github.com/stretchr/testify/require" + mockdb "github.com/zizdlp/zbook/db/mock" + "github.com/zizdlp/zbook/storage" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + mockwk "github.com/zizdlp/zbook/worker/mock" +) + +type eqCreateUserTxParamsMatcher struct { + arg db.CreateUserTxParams + password string +} + +func (expected eqCreateUserTxParamsMatcher) Matches(x interface{}) bool { + actualArg, ok := x.(db.CreateUserTxParams) // 这个是真的外部传入的值。 expected是期待的值 + if !ok { + return false + } + + err := util.CheckPassword(expected.password, actualArg.HashedPassword) + if err != nil { + return false + } + + expected.arg.HashedPassword = actualArg.HashedPassword + return reflect.DeepEqual(expected.arg.CreateUserParams, actualArg.CreateUserParams) +} + +func (e eqCreateUserTxParamsMatcher) String() string { + return fmt.Sprintf("matches arg %v and password %v", e.arg, e.password) +} + +func EqCreateUserTxParams(arg db.CreateUserTxParams, password string) gomock.Matcher { + return eqCreateUserTxParamsMatcher{arg, password} +} + +func TestCreateUserAPI(t *testing.T) { + user, password := createRandomUser(t) + + testCases := []struct { + name string + req *rpcs.CreateUserRequest + buildStubs func(store *mockdb.MockStore) + checkResponse func(t *testing.T, res *rpcs.CreateUserResponse, err error) + }{ + { + name: "InternalError", + req: &rpcs.CreateUserRequest{ + Username: user.Username, + Password: password, + Email: user.Email, + }, + buildStubs: func(store *mockdb.MockStore) { + store.EXPECT(). + CreateUserTx(gomock.Any(), gomock.Any()). + Times(1). + Return(db.CreateUserTxResult{}, sql.ErrConnDone) + }, + checkResponse: func(t *testing.T, res *rpcs.CreateUserResponse, err error) { + require.Error(t, err) + st, ok := status.FromError(err) + require.True(t, ok) + require.Equal(t, codes.Internal, st.Code()) + }, + }, + { + name: "OK", + req: &rpcs.CreateUserRequest{ + Username: user.Username, + Password: password, + Email: user.Email, + }, + buildStubs: func(store *mockdb.MockStore) { + arg := db.CreateUserTxParams{ + CreateUserParams: db.CreateUserParams{ + Username: user.Username, + Email: user.Email, + }, + } + store.EXPECT(). + CreateUserTx(gomock.Any(), EqCreateUserTxParams(arg, password)). + Times(1). + Return(db.CreateUserTxResult{User: user}, nil) + }, + checkResponse: func(t *testing.T, res *rpcs.CreateUserResponse, err error) { + require.NoError(t, err) + require.NotNil(t, res) + + }, + }, + { + name: "DuplicateUsername", + req: &rpcs.CreateUserRequest{ + Username: user.Username, + Password: password, + Email: user.Email, + }, + buildStubs: func(store *mockdb.MockStore) { + store.EXPECT(). + CreateUserTx(gomock.Any(), gomock.Any()). + Times(1). + Return(db.CreateUserTxResult{}, db.ErrUniqueViolation) + + }, + checkResponse: func(t *testing.T, res *rpcs.CreateUserResponse, err error) { + require.Error(t, err) + st, ok := status.FromError(err) + require.True(t, ok) + require.Equal(t, codes.AlreadyExists, st.Code()) + }, + }, + { + name: "InvalidEmail", + req: &rpcs.CreateUserRequest{ + Username: user.Username, + Password: password, + Email: "invalid-email", + }, + buildStubs: func(store *mockdb.MockStore) { + store.EXPECT(). + CreateUserTx(gomock.Any(), gomock.Any()). + Times(0) + + }, + checkResponse: func(t *testing.T, res *rpcs.CreateUserResponse, err error) { + require.Error(t, err) + st, ok := status.FromError(err) + require.True(t, ok) + require.Equal(t, codes.InvalidArgument, st.Code()) + }, + }, + } + + for i := range testCases { + tc := testCases[i] + + t.Run(tc.name, func(t *testing.T) { + storeCtrl := gomock.NewController(t) + defer storeCtrl.Finish() + store := mockdb.NewMockStore(storeCtrl) + + taskCtrl := gomock.NewController(t) + defer taskCtrl.Finish() + taskDistributor := mockwk.NewMockTaskDistributor(taskCtrl) + + config, err := util.LoadConfig(".") + if err != nil { + return + } + redisClient := redis.NewClient(&redis.Options{ + Addr: config.RedisAddress, // Redis 服务器地址和端口 + }) + minioClient, err := storage.GetMinioClient() + if err != nil { + return + } + tc.buildStubs(store) + server := newTestServer(t, store, taskDistributor, redisClient, minioClient) + + res, err := server.CreateUser(context.Background(), tc.req) + tc.checkResponse(t, res, err) + }) + } +} + +func createRandomUser(t *testing.T) (user db.User, password string) { + password = util.RandomString(6) + hashedPassword, err := util.HashPassword(password) + require.NoError(t, err) + + user = db.User{ + Username: util.RandomUsername(), + HashedPassword: hashedPassword, + Email: util.RandomEmail(), + } + return +} diff --git a/zbook_backend/gapi/user_get_list_user_count.go b/zbook_backend/gapi/user_get_list_user_count.go new file mode 100644 index 0000000..beb9cf6 --- /dev/null +++ b/zbook_backend/gapi/user_get_list_user_count.go @@ -0,0 +1,45 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetListUserCount(ctx context.Context, req *rpcs.GetListUserCountRequest) (*rpcs.GetListUserCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetListUserCount" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + if req.GetQuery() != "" { + arg := db.GetQueryUserCountParams{ + Role: authPayload.UserRole, + Query: req.GetQuery(), + } + user_count, err := server.store.GetQueryUserCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query user count failed: %s", err) + } + rsp := &rpcs.GetListUserCountResponse{ + Count: user_count, + } + return rsp, nil + } else { + user_count, err := server.store.GetListUserCount(ctx, authPayload.UserRole) + if err != nil { + return nil, status.Errorf(codes.Internal, "get list user count failed: %s", err) + } + + rsp := &rpcs.GetListUserCountResponse{ + Count: user_count, + } + return rsp, nil + } + +} diff --git a/zbook_backend/gapi/user_get_query_user_count.go b/zbook_backend/gapi/user_get_query_user_count.go new file mode 100644 index 0000000..d88b235 --- /dev/null +++ b/zbook_backend/gapi/user_get_query_user_count.go @@ -0,0 +1,34 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetQueryUserCount(ctx context.Context, req *rpcs.GetQueryUserCountRequest) (*rpcs.GetQueryUserCountResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetQueryUserCount" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + arg := db.GetQueryUserCountParams{ + Role: authPayload.UserRole, + Query: req.GetQuery(), + } + user_count, err := server.store.GetQueryUserCount(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get query user count failed: %s", err) + } + + rsp := &rpcs.GetQueryUserCountResponse{ + Count: user_count, + } + return rsp, nil + +} diff --git a/zbook_backend/gapi/user_get_user_avatar.go b/zbook_backend/gapi/user_get_user_avatar.go new file mode 100644 index 0000000..4b74aac --- /dev/null +++ b/zbook_backend/gapi/user_get_user_avatar.go @@ -0,0 +1,36 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) GetUserAvatar(ctx context.Context, req *rpcs.GetUserAvatarRequest) (*rpcs.GetUserAvatarResponse, error) { + violations := validateGetUserAvatarRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + avatarData, err := storage.DownloadFileFromStorage(server.minioClient, ctx, req.GetUsername(), "avatar") + if err != nil { + return nil, status.Errorf(codes.Internal, "download avatar failed: %s", err) + } + + rsp := &rpcs.GetUserAvatarResponse{ + Avatar: avatarData, + } + return rsp, nil +} + +func validateGetUserAvatarRequest(req *rpcs.GetUserAvatarRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + return violations +} diff --git a/zbook_backend/gapi/user_get_user_info.go b/zbook_backend/gapi/user_get_user_info.go new file mode 100644 index 0000000..12236c1 --- /dev/null +++ b/zbook_backend/gapi/user_get_user_info.go @@ -0,0 +1,101 @@ +package gapi + +import ( + "context" + + "github.com/rs/zerolog/log" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) GetUserInfo(ctx context.Context, req *rpcs.GetUserInfoRequest) (*rpcs.GetUserInfoResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "GetUserInfo" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateGetUserInfoRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + var user_basic_info *models.UserBasicInfo + var user_image_info *models.UserImageInfo + var user_count_info *models.UserCountInfo + user, err := server.store.GetUserByUsername(ctx, req.GetUsername()) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + arg := db.GetUserInfoParams{ + CurUserID: authPayload.UserID, + UserID: user.UserID, + Signed: true, + Role: authPayload.UserRole, + } + user_row, err := server.store.GetUserInfo(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user info failed: %s", err) + } + if req.GetUserBasic() { + user_basic_info = &models.UserBasicInfo{ + UserId: user.UserID, + Username: user.Username, + Email: user.Email, + Motto: user.Motto, + CreatedAt: timestamppb.New(user.CreatedAt), + } + } + if req.GetUserImage() { + avatarData, err := storage.DownloadFileFromStorage(server.minioClient, ctx, user.Username, "avatar") + if err != nil { + log.Error().Msgf("download avatar for %s failed: %s", user.Username, err) + user_image_info = &models.UserImageInfo{ + UserId: user.UserID, + } + } else { + user_image_info = &models.UserImageInfo{ + UserId: user.UserID, + Avatar: avatarData, + } + } + + } + + if req.GetUserCount() { + + user_count_info = &models.UserCountInfo{ + UserId: user.UserID, + CountLikes: int32(user_row.LikeCount), + CountRepos: int32(user_row.RepoCount), + CountFollowing: int32(user_row.FollowingCount), + CountFollower: int32(user_row.FollowerCount), + Following: user_row.IsFollowing, + } + + } + + rsp := &rpcs.GetUserInfoResponse{ + UserBasicInfo: user_basic_info, + UserImageInfo: user_image_info, + UserCountInfo: user_count_info, + } + return rsp, nil +} +func validateGetUserInfoRequest(req *rpcs.GetUserInfoRequest) (violations []*errdetails.BadRequest_FieldViolation) { + + if err := val.ValidateUsername(req.GetUsername()); err != nil { + violations = append(violations, fieldViolation("username", err)) + } + + return violations +} diff --git a/zbook_backend/gapi/user_list_user.go b/zbook_backend/gapi/user_list_user.go new file mode 100644 index 0000000..c4b8a67 --- /dev/null +++ b/zbook_backend/gapi/user_list_user.go @@ -0,0 +1,106 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/models" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) ListUser(ctx context.Context, req *rpcs.ListUserRequest) (*rpcs.ListUserResponse, error) { + violations := validateListUserRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + apiUserDailyLimit := 10000 + apiKey := "ListUser" + authUser, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + if req.GetQuery() != "" { + arg := db.QueryUserParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Query: req.GetQuery(), + Role: authUser.UserRole, + } + users, err := server.store.QueryUser(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "query user failed: %s", err) + } + rsp := &rpcs.ListUserResponse{ + Elements: convertQueryUser(users), + } + return rsp, nil + } else { + arg := db.ListUserParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Role: authUser.UserRole, + } + + users, err := server.store.ListUser(ctx, arg) + if err != nil { + return nil, status.Errorf(codes.Internal, "list user failed: %s", err) + } + + rsp := &rpcs.ListUserResponse{ + Elements: convertListUser(users), + } + return rsp, nil + } + +} +func validateListUserRequest(req *rpcs.ListUserRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + return violations +} +func convertListUser(users []db.User) []*models.ListUserInfo { + var ret_users []*models.ListUserInfo + for i := 0; i < len(users); i++ { + ret_users = append(ret_users, + &models.ListUserInfo{ + Username: users[i].Username, + Email: users[i].Email, + Blocked: users[i].Blocked, + Verified: users[i].Verified, + Onboarding: users[i].Onboarding, + UpdatedAt: timestamppb.New(users[i].UpdatedAt), + CreatedAt: timestamppb.New(users[i].CreatedAt), + Role: users[i].UserRole, + }, + ) + } + return ret_users +} +func convertQueryUser(users []db.QueryUserRow) []*models.ListUserInfo { + var ret_users []*models.ListUserInfo + for i := 0; i < len(users); i++ { + ret_users = append(ret_users, + &models.ListUserInfo{ + Username: users[i].Username, + Email: users[i].Email, + Blocked: users[i].Blocked, + Verified: users[i].Verified, + Onboarding: users[i].Onboarding, + Role: users[i].UserRole, + UpdatedAt: timestamppb.New(users[i].UpdatedAt), + CreatedAt: timestamppb.New(users[i].CreatedAt), + }, + ) + } + return ret_users +} diff --git a/zbook_backend/gapi/user_login_user.go b/zbook_backend/gapi/user_login_user.go new file mode 100644 index 0000000..5eeb127 --- /dev/null +++ b/zbook_backend/gapi/user_login_user.go @@ -0,0 +1,52 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) LoginUser(ctx context.Context, req *rpcs.LoginUserRequest) (*rpcs.LoginUserResponse, error) { + violations := validateLoginuserRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + user, err := server.store.GetUserByEmail(ctx, req.GetEmail()) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not exist: %s", err) + } + return nil, status.Errorf(codes.Internal, "get user by email failed: %s", err) + } + + err = util.CheckPassword(req.Password, user.HashedPassword) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, "password is wrong") + } + + err = server.checkUserStatus(ctx, user.Blocked, user.UserRole, user.Verified) + if err != nil { + return nil, err + } + response, err := server.CreateLoginPart(ctx, user.Username, user.UserRole, user.UserID, "LoginUser") + if err != nil { + return nil, err + } + return response, nil +} +func validateLoginuserRequest(req *rpcs.LoginUserRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateEmail(req.GetEmail()); err != nil { + violations = append(violations, fieldViolation("email", err)) + } + if err := val.ValidatePassword(req.GetPassword()); err != nil { + violations = append(violations, fieldViolation("password", err)) + } + return violations +} diff --git a/zbook_backend/gapi/user_query_user.go b/zbook_backend/gapi/user_query_user.go new file mode 100644 index 0000000..29fa450 --- /dev/null +++ b/zbook_backend/gapi/user_query_user.go @@ -0,0 +1,60 @@ +package gapi + +import ( + "context" + "errors" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) QueryUser(ctx context.Context, req *rpcs.QueryUserRequest) (*rpcs.QueryUserResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "QueryUser" + _, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + violations := validateQueryUserRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + arg := db.QueryUserParams{ + Limit: req.GetPageSize(), + Offset: (req.GetPageId() - 1) * req.GetPageSize(), + Query: req.GetQuery(), + } + + users, err := server.store.QueryUser(ctx, arg) + + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "query user failed: %s", err) + } + + rsp := &rpcs.QueryUserResponse{ + Elements: convertQueryUser(users), + } + return rsp, nil + +} +func validateQueryUserRequest(req *rpcs.QueryUserRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateInt32ID(req.GetPageId()); err != nil { + violations = append(violations, fieldViolation("page_id", err)) + } + if err := val.ValidatePageSize(req.GetPageSize()); err != nil { + violations = append(violations, fieldViolation("page_size", err)) + } + if err := val.ValidateString(req.GetQuery(), 1, 64); err != nil { + violations = append(violations, fieldViolation("query", err)) + } + return violations +} diff --git a/zbook_backend/gapi/user_update_user.go b/zbook_backend/gapi/user_update_user.go new file mode 100644 index 0000000..673acbb --- /dev/null +++ b/zbook_backend/gapi/user_update_user.go @@ -0,0 +1,67 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/jackc/pgx/v5/pgtype" + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/storage" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) UpdateUser(ctx context.Context, req *rpcs.UpdateUserRequest) (*rpcs.UpdateUserResponse, error) { + apiUserDailyLimit := 1000 + apiKey := "UpdateUser" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + hashedPassword := "" + if len(req.GetPassword()) != 0 { + hashedPassword, err = util.HashPassword(req.GetPassword()) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to hash password: %s", err) + } + } + + arg := db.UpdateUserBasicInfoParams{ + Username: authPayload.Username, + Motto: pgtype.Text{ + String: req.GetMotto(), + Valid: len(req.GetMotto()) != 0, + }, + HashedPassword: pgtype.Text{ + String: hashedPassword, + Valid: len(req.GetPassword()) != 0, + }, + } + + if len(req.GetAvatar()) != 0 { + avatar, err := util.CompressImage(req.GetAvatar()) + if err != nil { + log.Info().Msgf("compress image for %s failed: %s", authPayload.Username, err) + } + + err = storage.UploadFileToStorage(server.minioClient, context.Background(), authPayload.Username, "avatar", avatar) + if err != nil { + return nil, status.Errorf(codes.NotFound, "upload avatar failed: %s", err) + } + } + + _, err = server.store.UpdateUserBasicInfo(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "fail to Update user: %s", err) + } + + rsp := &rpcs.UpdateUserResponse{} + return rsp, nil +} diff --git a/zbook_backend/gapi/user_update_user_onboarding.go b/zbook_backend/gapi/user_update_user_onboarding.go new file mode 100644 index 0000000..1f3aebc --- /dev/null +++ b/zbook_backend/gapi/user_update_user_onboarding.go @@ -0,0 +1,37 @@ +package gapi + +import ( + "context" + "errors" + + "github.com/jackc/pgx/v5/pgtype" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/util" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) UpdateUserOnBoarding(ctx context.Context, req *rpcs.UpdateUserOnBoardingRequest) (*rpcs.UpdateUserOnBoardingResponse, error) { + apiUserDailyLimit := 10000 + apiKey := "UpdateUserOnBoarding" + authPayload, err := server.authUser(ctx, []string{util.AdminRole, util.UserRole}, apiUserDailyLimit, apiKey) + if err != nil { + return nil, err + } + + arg := db.UpdateUserBasicInfoParams{ + Username: authPayload.Username, + Onboarding: pgtype.Bool{Bool: req.GetOnboarding(), Valid: false}, + } + user, err := server.store.UpdateUserBasicInfo(ctx, arg) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "update user failed: %s", err) + } + + rsp := &rpcs.UpdateUserOnBoardingResponse{Onboarding: user.Onboarding} + return rsp, nil +} diff --git a/zbook_backend/gapi/verification_refresh_token.go b/zbook_backend/gapi/verification_refresh_token.go new file mode 100644 index 0000000..8508442 --- /dev/null +++ b/zbook_backend/gapi/verification_refresh_token.go @@ -0,0 +1,78 @@ +package gapi + +import ( + "context" + "errors" + "time" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" +) + +func (server *Server) RefreshToken(ctx context.Context, req *rpcs.RefreshTokenRequest) (*rpcs.RefreshTokenResponse, error) { + violations := validateRefreshTokenRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + refreshPayload, err := server.tokenMaker.VerifyToken(req.GetRefreshToken()) + if err != nil { + return nil, status.Errorf(codes.Internal, "verifiy token failed: %s", err) + } + + user, err := server.store.GetUserByUsername(ctx, refreshPayload.Username) + if err != nil { + return nil, status.Errorf(codes.Internal, "get user by username failed: %s", err) + } + + err = server.checkUserStatus(ctx, user.Blocked, user.UserRole, user.Verified) + if err != nil { + return nil, err + } + + session, err := server.store.GetSession(ctx, refreshPayload.ID) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "session not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get session failed: %s", err) + } + + if session.UserID != user.UserID { + return nil, status.Errorf(codes.Unauthenticated, "incorrect session user") + } + + if session.RefreshToken != req.RefreshToken { + return nil, status.Errorf(codes.Unauthenticated, "incorrect session") + } + + if time.Now().After(session.ExpiresAt) { + return nil, status.Errorf(codes.Unauthenticated, "expired session") + } + + accessToken, accessPayload, err := server.tokenMaker.CreateToken( + refreshPayload.Username, + refreshPayload.Role, + server.config.AccessTokenDuration, + ) + if err != nil { + return nil, status.Errorf(codes.Internal, "create refresh token failed: %s", err) + } + + rsp := &rpcs.RefreshTokenResponse{ + AccessToken: accessToken, + AccessTokenExpiresAt: timestamppb.New(accessPayload.ExpiredAt), + } + return rsp, nil +} +func validateRefreshTokenRequest(req *rpcs.RefreshTokenRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetRefreshToken(), 1, 512); err != nil { + violations = append(violations, fieldViolation("refresh_token", err)) + } + return violations +} diff --git a/zbook_backend/gapi/verification_reset_password.go b/zbook_backend/gapi/verification_reset_password.go new file mode 100644 index 0000000..81cdf2e --- /dev/null +++ b/zbook_backend/gapi/verification_reset_password.go @@ -0,0 +1,44 @@ +package gapi + +import ( + "context" + + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" +) + +func (server *Server) ResetPassword(ctx context.Context, req *rpcs.ResetPasswordRequest) (*rpcs.ResetPasswordResponse, error) { + + violations := validateResetPasswordRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + arg := db.ResetPasswordTxParams{ + VerificationUrl: req.GetVerificationUrl(), + Email: req.GetEmail(), + Password: req.GetPassword(), + } + err := server.store.ResetPasswordTx(ctx, arg) + if err != nil { + return nil, err + } + rsp := &rpcs.ResetPasswordResponse{ + IsReset: true, + } + return rsp, nil +} +func validateResetPasswordRequest(req *rpcs.ResetPasswordRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetVerificationUrl(), 16, 64); err != nil { + violations = append(violations, fieldViolation("verification_url", err)) + } + if err := val.ValidateEmail(req.GetEmail()); err != nil { + violations = append(violations, fieldViolation("email", err)) + } + if err := val.ValidatePassword(req.GetPassword()); err != nil { + violations = append(violations, fieldViolation("password", err)) + } + + return violations +} diff --git a/zbook_backend/gapi/verification_send_email_to_reset_password.go b/zbook_backend/gapi/verification_send_email_to_reset_password.go new file mode 100644 index 0000000..fa7b583 --- /dev/null +++ b/zbook_backend/gapi/verification_send_email_to_reset_password.go @@ -0,0 +1,61 @@ +package gapi + +import ( + "context" + "errors" + "time" + + "github.com/hibiken/asynq" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/val" + "github.com/zizdlp/zbook/worker" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) SendEmailToResetPassword(ctx context.Context, req *rpcs.SendEmailToResetPasswordRequest) (*rpcs.SendEmailToResetPasswordResponse, error) { + violations := validateSendEmailToResetPasswordRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + user, err := server.store.GetUserByEmail(ctx, req.GetEmail()) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get user by email failed: %s", err) + } + + apiKey := "SendEmailToResetPassword" + apiUserDailyLimit := 100 + err = server.checkUserLimit(user.UserID, apiKey, apiUserDailyLimit) + if err != nil { + return nil, err + } + + taskPayload := &worker.PayloadResetPassword{ + Email: req.GetEmail(), + } + opts := []asynq.Option{ + asynq.MaxRetry(10), + asynq.ProcessIn(10 * time.Second), + asynq.Queue(worker.QueueCritical), + } + err = server.taskDistributor.DistributeTaskResetPassword(ctx, taskPayload, opts...) + if err != nil { + return nil, status.Errorf(codes.Internal, "distribute restpassword task failed: %s", err) + } + rsp := &rpcs.SendEmailToResetPasswordResponse{ + IsSend: true, + } + return rsp, nil +} + +func validateSendEmailToResetPasswordRequest(req *rpcs.SendEmailToResetPasswordRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateEmail(req.GetEmail()); err != nil { + violations = append(violations, fieldViolation("email", err)) + } + return violations +} diff --git a/zbook_backend/gapi/verification_send_email_to_verify_email.go b/zbook_backend/gapi/verification_send_email_to_verify_email.go new file mode 100644 index 0000000..73c2bf4 --- /dev/null +++ b/zbook_backend/gapi/verification_send_email_to_verify_email.go @@ -0,0 +1,64 @@ +package gapi + +import ( + "context" + "errors" + "time" + + "github.com/hibiken/asynq" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/val" + "github.com/zizdlp/zbook/worker" + "google.golang.org/genproto/googleapis/rpc/errdetails" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (server *Server) SendEmailToVerifyEmail(ctx context.Context, req *rpcs.SendEmailToVerifyEmailRequest) (*rpcs.SendEmailToVerifyEmailResponse, error) { + violations := validateSendEmailToVerifyEmailRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.GetUserByEmail(ctx, req.GetEmail()) + if err != nil { + if errors.Is(err, db.ErrRecordNotFound) { + return nil, status.Errorf(codes.NotFound, "user not found: %s", err) + } + return nil, status.Errorf(codes.Internal, "get user by email failed: %s", err) + } + if user.Verified { + return nil, status.Errorf(codes.Internal, "email is already verified") + } + apiKey := "SendEmailToVerifyEmail" + apiUserDailyLimit := 100 + err = server.checkUserLimit(user.UserID, apiKey, apiUserDailyLimit) + if err != nil { + return nil, err + } + + taskPayload := &worker.PayloadVerifyEmail{ + Email: req.GetEmail(), + } + opts := []asynq.Option{ + asynq.MaxRetry(10), + asynq.ProcessIn(10 * time.Second), + asynq.Queue(worker.QueueCritical), + } + err = server.taskDistributor.DistributeTaskVerifyEmail(ctx, taskPayload, opts...) + if err != nil { + return nil, status.Errorf(codes.Internal, "distribute verify email task failed: %s", err) + } + rsp := &rpcs.SendEmailToVerifyEmailResponse{ + IsSend: true, + } + return rsp, nil +} + +func validateSendEmailToVerifyEmailRequest(req *rpcs.SendEmailToVerifyEmailRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateEmail(req.GetEmail()); err != nil { + violations = append(violations, fieldViolation("email", err)) + } + return violations +} diff --git a/zbook_backend/gapi/verification_verify_email.go b/zbook_backend/gapi/verification_verify_email.go new file mode 100644 index 0000000..f8d0ad3 --- /dev/null +++ b/zbook_backend/gapi/verification_verify_email.go @@ -0,0 +1,33 @@ +package gapi + +import ( + "context" + + "github.com/zizdlp/zbook/pb/rpcs" + "github.com/zizdlp/zbook/val" + "google.golang.org/genproto/googleapis/rpc/errdetails" +) + +func (server *Server) VerifyEmail(ctx context.Context, req *rpcs.VerifyEmailRequest) (*rpcs.VerifyEmailResponse, error) { + violations := validateVerifyEmailRequest(req) + if violations != nil { + return nil, invalidArgumentError(violations) + } + + user, err := server.store.VerifyEmailTx(ctx, req.GetVerificationUrl()) + if err != nil { + return nil, err + } + + rsp := &rpcs.VerifyEmailResponse{ + IsVerified: user.Verified, + } + return rsp, nil +} + +func validateVerifyEmailRequest(req *rpcs.VerifyEmailRequest) (violations []*errdetails.BadRequest_FieldViolation) { + if err := val.ValidateString(req.GetVerificationUrl(), 16, 64); err != nil { + violations = append(violations, fieldViolation("verification_url", err)) + } + return violations +} diff --git a/zbook_backend/go.mod b/zbook_backend/go.mod new file mode 100644 index 0000000..bf62026 --- /dev/null +++ b/zbook_backend/go.mod @@ -0,0 +1,93 @@ +module github.com/zizdlp/zbook + +go 1.21 + +toolchain go1.21.6 + +require ( + github.com/aead/chacha20poly1305 v0.0.0-20201124145622-1a5aba2a8b29 + github.com/dietsche/rfsnotify v0.0.0-20200716145600-b37be6e4177f + github.com/go-redis/redis/v8 v8.11.5 + github.com/golang-migrate/migrate/v4 v4.17.0 + github.com/golang/mock v1.6.0 + github.com/google/uuid v1.6.0 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 + github.com/hibiken/asynq v0.24.1 + github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible + github.com/minio/minio-go/v7 v7.0.69 + github.com/rakyll/statik v0.1.7 + github.com/rs/zerolog v1.32.0 + github.com/spf13/viper v1.18.2 + github.com/stretchr/testify v1.9.0 + go.abhg.dev/goldmark/toc v0.10.0 + golang.org/x/crypto v0.23.0 + golang.org/x/sync v0.7.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 + google.golang.org/grpc v1.62.1 +) + +require ( + github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect + github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect + github.com/jackc/puddle/v2 v2.2.1 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/lib/pq v1.10.9 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/md5-simd v1.1.2 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/onsi/gomega v1.27.10 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/redis/go-redis/v9 v9.5.1 // indirect + github.com/robfig/cron/v3 v3.0.1 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rs/xid v1.5.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/time v0.5.0 // indirect + gopkg.in/fsnotify.v1 v1.4.7 // indirect +) + +require ( + github.com/bluele/gcache v0.0.2 + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-redis/redis v6.15.9+incompatible + github.com/golang/protobuf v1.5.4 // indirect + github.com/gorilla/websocket v1.5.1 + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jackc/pgx/v5 v5.5.5 + github.com/magiconair/properties v1.8.7 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/o1egl/paseto v1.0.0 + github.com/pelletier/go-toml/v2 v2.2.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/yuin/goldmark v1.7.0 + golang.org/x/image v0.18.0 + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.16.0 // indirect + google.golang.org/protobuf v1.33.0 + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/zbook_backend/go.sum b/zbook_backend/go.sum new file mode 100644 index 0000000..61760e2 --- /dev/null +++ b/zbook_backend/go.sum @@ -0,0 +1,287 @@ +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= +github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= +github.com/aead/chacha20poly1305 v0.0.0-20170617001512-233f39982aeb/go.mod h1:UzH9IX1MMqOcwhoNOIjmTQeAxrFgzs50j4golQtXXxU= +github.com/aead/chacha20poly1305 v0.0.0-20201124145622-1a5aba2a8b29 h1:1DcvRPZOdbQRg5nAHt2jrc5QbV0AGuhDdfQI6gXjiFE= +github.com/aead/chacha20poly1305 v0.0.0-20201124145622-1a5aba2a8b29/go.mod h1:UzH9IX1MMqOcwhoNOIjmTQeAxrFgzs50j4golQtXXxU= +github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw= +github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us= +github.com/bluele/gcache v0.0.2 h1:WcbfdXICg7G/DGBh1PFfcirkWOQV+v077yF1pSy3DGw= +github.com/bluele/gcache v0.0.2/go.mod h1:m15KV+ECjptwSPxKhOhQoAFQVtUFjTVkc3H8o0t/fp0= +github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.26.0/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/dhui/dktest v0.4.0 h1:z05UmuXZHO/bgj/ds2bGMBu8FI4WA+Ag/m3ghL+om7M= +github.com/dhui/dktest v0.4.0/go.mod h1:v/Dbz1LgCBOi2Uki2nUqLBGa83hWBGFMu5MrgMDCc78= +github.com/dietsche/rfsnotify v0.0.0-20200716145600-b37be6e4177f h1:b3QvpXLSx1U13VM79rSkA+6Xv4lmT/urEMzA36Yma0U= +github.com/dietsche/rfsnotify v0.0.0-20200716145600-b37be6e4177f/go.mod h1:ztitxkMUaBsHRey1tS5xFCd4gm/zAQwA9yfCP5y4cAA= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= +github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= +github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-migrate/migrate/v4 v4.17.0 h1:rd40H3QXU0AA4IoLllFcEAEo9dYKRHYND2gB4p7xcaU= +github.com/golang-migrate/migrate/v4 v4.17.0/go.mod h1:+Cp2mtLP4/aXDTKb9wmXYitdrNx2HGs45rbWAo6OsKM= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= +github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hibiken/asynq v0.24.1 h1:+5iIEAyA9K/lcSPvx3qoPtsKJeKI5u9aOIvUmSsazEw= +github.com/hibiken/asynq v0.24.1/go.mod h1:u5qVeSbrnfT+vtG5Mq8ZPzQu/BmCKMHvTGb91uy9Tts= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= +github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= +github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= +github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA= +github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= +github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= +github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= +github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= +github.com/minio/minio-go/v7 v7.0.69 h1:l8AnsQFyY1xiwa/DaQskY4NXSLA2yrGsW5iD9nRPVS0= +github.com/minio/minio-go/v7 v7.0.69/go.mod h1:XAvOPJQ5Xlzk5o3o/ArO2NMbhSGkimC+bpW/ngRKDmQ= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/o1egl/paseto v1.0.0 h1:bwpvPu2au176w4IBlhbyUv/S5VPptERIA99Oap5qUd0= +github.com/o1egl/paseto v1.0.0/go.mod h1:5HxsZPmw/3RI2pAwGo1HhOOwSdvBpcuVzO7uDkm+CLU= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= +github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= +github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= +github.com/redis/go-redis/v9 v9.0.3/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= +github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= +github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.7.0 h1:EfOIvIMZIzHdB/R/zVrikYLPPwJlfMcNczJFMs1m6sA= +github.com/yuin/goldmark v1.7.0/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +go.abhg.dev/goldmark/toc v0.10.0 h1:de3LrIimwtGhBMKh7aEl1c6n4XWwOdukIO5wOAMYZzg= +go.abhg.dev/goldmark/toc v0.10.0/go.mod h1:OpH0qqRP9v/eosCV28ZeqGI78jZ8rri3C7Jh8fzEo2M= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= +golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ= +golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= diff --git a/zbook_backend/icons/logo.png b/zbook_backend/icons/logo.png new file mode 100644 index 0000000..f4376c4 Binary files /dev/null and b/zbook_backend/icons/logo.png differ diff --git a/zbook_backend/icons/v0.png b/zbook_backend/icons/v0.png new file mode 100644 index 0000000..b418336 Binary files /dev/null and b/zbook_backend/icons/v0.png differ diff --git a/zbook_backend/icons/v1.png b/zbook_backend/icons/v1.png new file mode 100644 index 0000000..8ff7c4b Binary files /dev/null and b/zbook_backend/icons/v1.png differ diff --git a/zbook_backend/icons/v2.png b/zbook_backend/icons/v2.png new file mode 100644 index 0000000..11a6c15 Binary files /dev/null and b/zbook_backend/icons/v2.png differ diff --git a/zbook_backend/icons/v3.png b/zbook_backend/icons/v3.png new file mode 100644 index 0000000..029f653 Binary files /dev/null and b/zbook_backend/icons/v3.png differ diff --git a/zbook_backend/icons/v4.png b/zbook_backend/icons/v4.png new file mode 100644 index 0000000..e9cee6f Binary files /dev/null and b/zbook_backend/icons/v4.png differ diff --git a/zbook_backend/icons/v5.png b/zbook_backend/icons/v5.png new file mode 100644 index 0000000..a3c4d3c Binary files /dev/null and b/zbook_backend/icons/v5.png differ diff --git a/zbook_backend/icons/v6.png b/zbook_backend/icons/v6.png new file mode 100644 index 0000000..735351a Binary files /dev/null and b/zbook_backend/icons/v6.png differ diff --git a/zbook_backend/icons/v7.png b/zbook_backend/icons/v7.png new file mode 100644 index 0000000..afacf2c Binary files /dev/null and b/zbook_backend/icons/v7.png differ diff --git a/zbook_backend/icons/v8.png b/zbook_backend/icons/v8.png new file mode 100644 index 0000000..cd83065 Binary files /dev/null and b/zbook_backend/icons/v8.png differ diff --git a/zbook_backend/icons/v9.png b/zbook_backend/icons/v9.png new file mode 100644 index 0000000..293b416 Binary files /dev/null and b/zbook_backend/icons/v9.png differ diff --git a/zbook_backend/mail/sender.go b/zbook_backend/mail/sender.go new file mode 100644 index 0000000..d1dac24 --- /dev/null +++ b/zbook_backend/mail/sender.go @@ -0,0 +1,64 @@ +package mail + +import ( + "fmt" + "net/smtp" + + "github.com/jordan-wright/email" +) + +type EmailSender interface { + SendEmail( + subject string, + content string, + to []string, + cc []string, + bcc []string, + attachFiles []string, + smtpAuthAddress string, + smtpServerAddress string, + ) error +} + +type GmailSender struct { + name string + fromEmailAddress string + fromEmailPassword string +} + +func NewGmailSender(name string, fromEmailAddress string, fromEmailPassword string) EmailSender { + return &GmailSender{ + name: name, + fromEmailAddress: fromEmailAddress, + fromEmailPassword: fromEmailPassword, + } +} + +func (sender *GmailSender) SendEmail( + subject string, + content string, + to []string, + cc []string, + bcc []string, + attachFiles []string, + smtpAuthAddress string, + smtpServerAddress string, +) error { + e := email.NewEmail() + e.From = fmt.Sprintf("%s <%s>", sender.name, sender.fromEmailAddress) + e.Subject = subject + e.HTML = []byte(content) + e.To = to + e.Cc = cc + e.Bcc = bcc + + for _, f := range attachFiles { + _, err := e.AttachFile(f) + if err != nil { + return fmt.Errorf("failed to attach file %s: %w", f, err) + } + } + + smtpAuth := smtp.PlainAuth("", sender.fromEmailAddress, sender.fromEmailPassword, smtpAuthAddress) + return e.Send(smtpServerAddress, smtpAuth) +} diff --git a/zbook_backend/mail/sender_test.go b/zbook_backend/mail/sender_test.go new file mode 100644 index 0000000..07c40ea --- /dev/null +++ b/zbook_backend/mail/sender_test.go @@ -0,0 +1,44 @@ +package mail + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func TestSendEmailWithGmail(t *testing.T) { + if testing.Short() { + fmt.Println("***** TestSendEmailWithGmail is ignored *****") + t.Skip() + } + + config, err := util.LoadConfig("..") + require.NoError(t, err) + + sender := NewGmailSender(config.EmailSenderName, config.EmailSenderAddress, config.EmailSenderPassword) + + subject := "A test email from @zizdlp.com" + // 模拟用户数据 + user := struct { + Username string + }{ + Username: "admin", + } + verifyUrl := "http://localhost:3000/verify_email?verification_id=66ca2c9313264f449648a6e2aa6f8cf0" + + Title := "Verify Your Email Address" + emailSubject := "Thank you for registering with us! Please verify your email address by clicking the button below:" + buttonText := "Verify Email" + additionalText := "If you did not register for an account, please ignore this email or contact support if you have any questions." + base64Image, err := util.ReadImageBytesToBase64("../icons/logo.png") + require.NoError(t, err) + + emailBody := fmt.Sprintf(util.EmailTemplate, Title, user.Username, emailSubject, verifyUrl, buttonText, additionalText, base64Image) + + to := []string{"zizdlp@gmail.com"} + + err = sender.SendEmail(subject, emailBody, to, nil, nil, nil, config.SmtpAuthAddress, config.SmtpServerAddress) + require.NoError(t, err) +} diff --git a/zbook_backend/markdown/admonition/ast.go b/zbook_backend/markdown/admonition/ast.go new file mode 100644 index 0000000..5e5446d --- /dev/null +++ b/zbook_backend/markdown/admonition/ast.go @@ -0,0 +1,32 @@ +package admonitions + +import ( + "github.com/yuin/goldmark/ast" +) + +// A Admonition struct represents a fenced code block of Markdown text. +type Admonition struct { + ast.BaseBlock + AdmonitionClass []byte + Title []byte +} + +// Dump implements Node.Dump . +func (n *Admonition) Dump(source []byte, level int) { + ast.DumpHelper(n, source, level, nil, nil) +} + +// KindAdmonition is a NodeKind of the Admonition node. +var KindAdmonition = ast.NewNodeKind("Admonition") + +// Kind implements Node.Kind. +func (n *Admonition) Kind() ast.NodeKind { + return KindAdmonition +} + +// NewAdmonition return a new Admonition node. +func NewAdmonition() *Admonition { + return &Admonition{ + BaseBlock: ast.BaseBlock{}, + } +} diff --git a/zbook_backend/markdown/admonition/extend.go b/zbook_backend/markdown/admonition/extend.go new file mode 100644 index 0000000..8fce607 --- /dev/null +++ b/zbook_backend/markdown/admonition/extend.go @@ -0,0 +1,49 @@ +package admonitions + +import ( + "github.com/yuin/goldmark" + "github.com/yuin/goldmark/parser" + "github.com/yuin/goldmark/renderer" + "github.com/yuin/goldmark/util" +) + +// This extender allows you to use admonitions in markdown +// +// Admonitions are a markdown extension that allows you to style markdown as +// nice boxes with a title. This is done by way of wrapping other elements in +// divs with classes starting with "adm-" +// +// !!!note This is the title {.some-additional-class} +// This is the admonition +// +// ## with a header +// +// !!!danger Nesting is possible! +// ```R +// X <- as.data.table(iris) +// X[Species != "virginica", mean(Sepal.Length), Species] +// ``` +// !!! +// !!! +type Extender struct { + priority int // optional int != 0. the priority value for parser and renderer. Defaults to 100. +} + +// This implements the Extend method for goldmark-admonitions.Extender +func (e *Extender) Extend(md goldmark.Markdown) { + priority := 100 + + if e.priority != 0 { + priority = e.priority + } + md.Parser().AddOptions( + parser.WithBlockParsers( + util.Prioritized(&admonitionParser{}, priority), + ), + ) + md.Renderer().AddOptions( + renderer.WithNodeRenderers( + util.Prioritized(&Renderer{}, priority), + ), + ) +} diff --git a/zbook_backend/markdown/admonition/gen_random_string.go b/zbook_backend/markdown/admonition/gen_random_string.go new file mode 100644 index 0000000..084e9e7 --- /dev/null +++ b/zbook_backend/markdown/admonition/gen_random_string.go @@ -0,0 +1,13 @@ +package admonitions + +import "math/rand" + +const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + +func genRandomString(n int) string { + bytes := make([]byte, n) + for i := range bytes { + bytes[i] = letters[rand.Intn(len(letters))] + } + return string(bytes) +} diff --git a/zbook_backend/markdown/admonition/parser.go b/zbook_backend/markdown/admonition/parser.go new file mode 100644 index 0000000..dd69eac --- /dev/null +++ b/zbook_backend/markdown/admonition/parser.go @@ -0,0 +1,301 @@ +package admonitions + +import ( + "bytes" + "fmt" + + "github.com/yuin/goldmark/ast" + "github.com/yuin/goldmark/parser" + "github.com/yuin/goldmark/text" + "github.com/yuin/goldmark/util" +) + +type admonitionParser struct { +} + +var defaultAdmonitionParser = &admonitionParser{} + +// NewAdmonitionParser returns a new BlockParser that +// parses admonition blocks. +func NewAdmonitionParser() parser.BlockParser { + return defaultAdmonitionParser +} + +type admonitionData struct { + ID string // The ID of the admonition. This enables nested admonitions with indentation + char byte // Currently, this is always "!" + indent int // The indentation of the opening (and closing) tags (!!!{}) + length int // The length of the admonition, e.g. is it !!! or !!!!? + node ast.Node // The node of the admonition + contentIndent int // The indentation of the content relative to the previous admonition block. The first line of the content is taken as its indentation. If you want an admonition with just a code block you need to use backticks + contentHasStarted bool // Only used as an indicator if contentIndent has been set already +} + +var admonitionInfoKey = parser.NewContextKey() + +func (b *admonitionParser) Trigger() []byte { + return []byte{'!'} +} + +func (b *admonitionParser) Open(parent ast.Node, reader text.Reader, pc parser.Context) (ast.Node, parser.State) { + line, _ := reader.PeekLine() + pos := pc.BlockOffset() + if pos < 0 || line[pos] != '!' { + return nil, parser.NoChildren + } + findent := pos + + // currently useless + admonitionChar := line[pos] + i := pos + for ; i < len(line) && line[i] == admonitionChar; i++ { + } + oAdmonitionLength := i - pos + if oAdmonitionLength < 3 { + return nil, parser.NoChildren + } + + // ========================================================================== // + // Without attributes we return + + if i >= len(line)-1 { + // If there are no attributes we can't create a div because we won't know + // if a "!!!" ends the last admonition or opens a new one + return nil, parser.NoChildren + } + + rest := line[i:] + left := i + util.TrimLeftSpaceLength(rest) + right := len(line) - 1 - util.TrimRightSpaceLength(rest) + + if left >= right { + // As above: + // If there are no attributes we can't create a div because we won't know + // if a "!!!" ends the last admonition or opens a new one + return nil, parser.NoChildren + } + + // ========================================================================== // + // With attributes we construct the node + node := parseOpeningLine(reader, left) + admonitionID := genRandomString(24) + node.SetAttributeString("data-admonition", []byte(admonitionID)) + + fdata := &admonitionData{ + ID: admonitionID, + char: admonitionChar, + indent: findent, + length: oAdmonitionLength, + node: node, + contentIndent: 0, + contentHasStarted: false, + } + var fdataMap []*admonitionData + + if oldData := pc.Get(admonitionInfoKey); oldData != nil { + fdataMap = oldData.([]*admonitionData) + fdataMap = append(fdataMap, fdata) + } else { + fdataMap = []*admonitionData{fdata} + } + pc.Set(admonitionInfoKey, fdataMap) + + // ========================================================================== // + // check if it's an empty block + + line, _ = reader.PeekLine() + w, pos := util.IndentWidth(line, reader.LineOffset()) + if close, _ := hasClosingTag(line, w, pos, fdata); w < fdata.indent || close { + return node, parser.NoChildren + } + return node, parser.HasChildren +} + +// Parse the opening line for +// * admonition class +// * admonition title +// * attributes +func parseOpeningLine(reader text.Reader, left int) *Admonition { + node := NewAdmonition() + reader.Advance(left) + + remainingLine, _ := reader.PeekLine() + remainingLength := len(remainingLine) - 1 + + // ========================================================================== // + // find class + endClass := 0 + for ; endClass < remainingLength && remainingLine[endClass] != ' ' && remainingLine[endClass] != '{'; endClass++ { + } + if endClass > 0 { + node.AdmonitionClass = remainingLine[0:endClass] + } + + // ========================================================================== // + // find title + startTitle := endClass + util.TrimLeftSpaceLength(remainingLine[endClass:]) + endTitle := startTitle + for ; endTitle < remainingLength && remainingLine[endTitle] != '{'; endTitle++ { + } + if endTitle > startTitle { + endTitle = endTitle - util.TrimRightSpaceLength(remainingLine[startTitle:endTitle]) + if endTitle > startTitle { + node.Title = remainingLine[startTitle:endTitle] + } + } + + if endTitle < remainingLength { + reader.Advance(endTitle) + } else { + reader.Advance(remainingLength) + } + + // ========================================================================== // + // find attributes + hasClass := false + admClass := bytes.Join([][]byte{[]byte("admonition adm-"), node.AdmonitionClass}, []byte("")) + + attrs, ok := parser.ParseAttributes(reader) + + if ok { + for _, attr := range attrs { + oldVal := attr.Value.([]byte) + var val []byte + + if bytes.Equal(attr.Name, []byte("class")) { + hasClass = true + val = bytes.Join([][]byte{admClass, oldVal}, []byte(" ")) + } else { + val = oldVal + } + + node.SetAttribute(attr.Name, val) + } + } + + if !hasClass { + node.SetAttribute([]byte("class"), admClass) + } + + return node +} + +func (b *admonitionParser) Continue(node ast.Node, reader text.Reader, pc parser.Context) parser.State { + // ========================================================================== // + // Get admonitionID from node + + rawAdmonitionID, ok := node.AttributeString("data-admonition") + if !ok { + fmt.Println("Admonition ID is missing") + } + admonitionID := string(rawAdmonitionID.([]byte)) + + // ========================================================================== // + // Get admonition for current admonition + rawdata := pc.Get(admonitionInfoKey) + fdataMap := rawdata.([]*admonitionData) + + // This should not happen + if len(fdataMap) == 0 { + fmt.Printf("we're in an admonition block but have no state data. This should not happen") + return parser.Close + } + + var fdata *admonitionData + var flevel int + for flevel = 0; flevel < len(fdataMap); flevel++ { + fdata = fdataMap[flevel] + if fdata.ID == admonitionID { + break + } + } + + // ========================================================================== // + // Set indentation level if it hasn't been set yet + + line, segment := reader.PeekLine() + w, pos := util.IndentWidth(line, reader.LineOffset()) + + if !fdata.contentHasStarted && !util.IsBlank(line[pos:]) { + fdata.contentHasStarted = true + fdata.contentIndent = w + + fdataMap[flevel] = fdata + pc.Set(admonitionInfoKey, fdataMap) + } + + // ========================================================================== // + // Are we closing the node? + // * Either the indentation is below the indentation of the opening tags + // * or it is at the level of the opening tags but the content was indented + // * or there is a closing tag and we're in the deepest admonition block + close, newline := hasClosingTag(line, w, pos, fdata) + if close && flevel == len(fdataMap)-1 { + reader.Advance(segment.Stop - segment.Start - newline + segment.Padding) + + node.SetAttributeString("data-admonition", []byte(fmt.Sprint(flevel))) + + fdataMap = fdataMap[:flevel] + pc.Set(admonitionInfoKey, fdataMap) + + return parser.Close + } + //// w: 是新起一行文本的最左边位置 + //// fdata.contentIndent:是admonition 应该的最左位置:! + + indentClose := + !util.IsBlank(line) && + (w < fdata.indent || (w == fdata.indent && w <= fdata.contentIndent)) // mydebug:warning,这里w < fdata.contentIndent 修改添加= + if indentClose { + node.SetAttributeString("data-admonition", []byte(fmt.Sprint(flevel))) + + fdataMap = fdataMap[:flevel] + pc.Set(admonitionInfoKey, fdataMap) + + return parser.Close + } + + if fdata.contentIndent > 0 { + dontJumpLineEnd := segment.Stop - segment.Start - 1 + if fdata.contentIndent < dontJumpLineEnd { + dontJumpLineEnd = fdata.contentIndent + } + + reader.Advance(dontJumpLineEnd) + } + + return parser.Continue | parser.HasChildren +} + +func (b *admonitionParser) Close(node ast.Node, reader text.Reader, pc parser.Context) { +} + +func (b *admonitionParser) CanInterruptParagraph() bool { + return true +} + +func (b *admonitionParser) CanAcceptIndentedLine() bool { + return false +} + +func hasClosingTag(line []byte, w int, pos int, fdata *admonitionData) (bool, int) { + // else, check for the correct number of closing chars and provide the info + // necessary to advance the reader + if w == fdata.indent { + i := pos + for ; i < len(line) && line[i] == fdata.char; i++ { + } + length := i - pos + + if length >= fdata.length && util.IsBlank(line[i:]) { + newline := 1 + if line[len(line)-1] != '\n' { + newline = 0 + } + + return true, newline + } + } + + return false, 0 +} diff --git a/zbook_backend/markdown/admonition/renderer.go b/zbook_backend/markdown/admonition/renderer.go new file mode 100644 index 0000000..4f06c78 --- /dev/null +++ b/zbook_backend/markdown/admonition/renderer.go @@ -0,0 +1,47 @@ +package admonitions + +import ( + "github.com/yuin/goldmark/ast" + "github.com/yuin/goldmark/renderer" + "github.com/yuin/goldmark/renderer/html" + "github.com/yuin/goldmark/util" +) + +// A Config struct has configurations for the HTML based renderers. +type Config struct { + Writer html.Writer + HardWraps bool + XHTML bool + Unsafe bool +} + +// HeadingAttributeFilter defines attribute names which heading elements can have +var AdmonitionAttributeFilter = html.GlobalAttributeFilter + +// A Renderer struct is an implementation of renderer.NodeRenderer that renders +// nodes as (X)HTML. +type Renderer struct { + Config +} + +// RegisterFuncs implements NodeRenderer.RegisterFuncs . +func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { + reg.Register(KindAdmonition, r.renderAdmonition) +} + +func (r *Renderer) renderAdmonition(w util.BufWriter, source []byte, node ast.Node, entering bool) (ast.WalkStatus, error) { + n := node.(*Admonition) + if entering { + if n.Attributes() != nil { + _, _ = w.WriteString("\n") + } else { + _, _ = w.WriteString("
\n") + } + _, _ = w.WriteString(`
` + string(util.EscapeHTML(n.Title)) + "
\n
\n") + } else { + _, _ = w.WriteString("
\n
\n") + } + return ast.WalkContinue, nil +} diff --git a/zbook_backend/markdown/convert/convert.go b/zbook_backend/markdown/convert/convert.go new file mode 100644 index 0000000..c8ef639 --- /dev/null +++ b/zbook_backend/markdown/convert/convert.go @@ -0,0 +1,201 @@ +package convert + +import ( + "bytes" + "encoding/json" + "io" + "os" + "path/filepath" + "strings" + "time" + + "github.com/rs/zerolog/log" + "github.com/yuin/goldmark" + "github.com/yuin/goldmark/text" + md "github.com/zizdlp/zbook/markdown/render" +) + +func ConvertMarkdownBuffer(data []byte, markdown goldmark.Markdown) (bytes.Buffer, bytes.Buffer, error) { + + doc := markdown.Parser().Parse(text.NewReader(data)) + var tableBuffer bytes.Buffer + if doc.HasChildren() && doc.FirstChild().Kind().String() == "Heading" { // 有heading就意味有 content table + //remove 1. heading,2 lists + err := markdown.Renderer().Render(&tableBuffer, data, doc.FirstChild().NextSibling()) // 1.渲染目录 + if err != nil { + return bytes.Buffer{}, bytes.Buffer{}, err + } + content := doc.FirstChild() + doc.RemoveChild(doc, content) + content = doc.FirstChild() // 目录 + doc.RemoveChild(doc, content) + } + + var mainBuffer bytes.Buffer + err := markdown.Renderer().Render(&mainBuffer, data, doc) // 2.渲染正式内容 + if err != nil { + return bytes.Buffer{}, bytes.Buffer{}, err + } + return tableBuffer, mainBuffer, nil + +} +func ConvertMd2Html(src_path string, des_path string) { + markdown := md.GetMarkdownConfig() + data, err := os.ReadFile(src_path) + if err != nil { + log.Error().Err(err).Msgf("failed to open file: %s", src_path) + return + } + _, main, err := ConvertMarkdownBuffer(data, markdown) + if err != nil { + log.Error().Err(err).Msg("failed to convert markdown") + return + } + // 写入 JSON 字符串到文件 + err = os.WriteFile(des_path, main.Bytes(), 0644) + if err != nil { + log.Error().Err(err).Msgf("failed to write file: %s", des_path) + return + } +} +func ConvertMdTable2Html(src_path string, des_path string) { + markdown := md.GetMarkdownConfig() + data, err := os.ReadFile(src_path) + if err != nil { + log.Error().Err(err).Msgf("failed to open file: %s", src_path) + return + } + table, main, err := ConvertMarkdownBuffer(data, markdown) + if err != nil { + log.Error().Err(err).Msg("failed to convert markdown") + return + } + // 写入 JSON 字符串到文件 + err = os.WriteFile(des_path, main.Bytes(), 0644) + if err != nil { + log.Error().Err(err).Msgf("failed to write main file: %s", des_path) + return + } + + // 写入 JSON 字符串到文件 + err = os.WriteFile(des_path, table.Bytes(), 0644) + if err != nil { + log.Error().Err(err).Msgf("failed to write table file: %s", des_path) + return + } +} + +func ConvertMd2Json(src_path string, des_path string) { + markdown := md.GetMarkdownConfig() + data, err := os.ReadFile(src_path) + if err != nil { + log.Error().Err(err).Msgf("failed to open file: %s", src_path) + return + } + table, main, err := ConvertMarkdownBuffer(data, markdown) + if err != nil { + log.Error().Err(err).Msg("failed to convert markdown") + return + } + + // 构建包含 HTML 表格和内容的 JSON 对象 + jsonObject := map[string]string{ + "table": table.String(), + "content": main.String(), + } + // 将 JSON 对象序列化为 JSON 字符串 + jsonString, err := json.Marshal(jsonObject) + if err != nil { + log.Error().Err(err).Msg("failed to parse json") + return + } + + // 写入 JSON 字符串到文件 + err = os.WriteFile(des_path, jsonString, 0644) + if err != nil { + log.Error().Err(err).Msgf("failed to write html file: %s", des_path) + return + } +} + +// copyFile 复制文件 +func copyFile(src, dest string) error { + srcFile, err := os.Open(src) + if err != nil { + return err + } + defer srcFile.Close() + + // 确保目标目录及其上级目录存在 + err = os.MkdirAll(filepath.Dir(dest), os.ModePerm) + if err != nil { + return err + } + + destFile, err := os.Create(dest) + if err != nil { + return err + } + defer destFile.Close() + + _, err = io.Copy(destFile, srcFile) + if err != nil { + return err + } + + return nil +} +func ConvertFolder(srcDir string, destDir string) { + // 记录开始时间 + startTime := time.Now() + // 遍历源目录 + err := filepath.Walk(srcDir, func(srcPath string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + // 检查是否为文件 + if !info.IsDir() { + // 构建相对路径 + relPath, err := filepath.Rel(srcDir, srcPath) + if err != nil { + return err + } + + // 构建目标路径 + destPath := filepath.Join(destDir, relPath) + + // 如果是以".md"结尾的文件,修改目标路径后缀为".json" + if strings.HasSuffix(info.Name(), ".md") { + destPath = filepath.Join(destDir, relPath[:len(relPath)-len(".md")]+".html") + // 确保目标目录及其上级目录存在 + err = os.MkdirAll(filepath.Dir(destPath), os.ModePerm) + if err != nil { + return err + } + ConvertMd2Html(srcPath, destPath) + } else { + // 复制文件 + err = copyFile(srcPath, destPath) + if err != nil { + log.Error().Err(err).Msgf("failed to copy %s to %s", srcPath, destPath) + panic(err) + } + } + } + return nil + }) + + if err != nil { + log.Error().Err(err).Msg("failed to iterate folder") + panic(err) + } + + // 记录结束时间 + endTime := time.Now() + + // 计算耗时并输出 + elapsedTime := endTime.Sub(startTime) + log.Info().Msgf("convert folder time consume:%s", elapsedTime) + // RenderLayout(srcDir, destDir) +} diff --git a/zbook_backend/markdown/convert/convert_test.go b/zbook_backend/markdown/convert/convert_test.go new file mode 100644 index 0000000..2c3ab81 --- /dev/null +++ b/zbook_backend/markdown/convert/convert_test.go @@ -0,0 +1,29 @@ +package convert + +import ( + "fmt" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" + md "github.com/zizdlp/zbook/markdown/render" +) + +func TestConvertMarkdownBuffer(t *testing.T) { + // 记录开始时间 + srcPath := "./test_files" + files, err := os.ReadDir(srcPath) + markdown := md.GetMarkdownConfig() + require.NoError(t, err) + for _, file := range files { + if filepath.Ext(file.Name()) == ".md" { + fmt.Println("test markdown render:", file.Name()) + filePath := filepath.Join(srcPath, file.Name()) + data, err := os.ReadFile(filePath) + require.NoError(t, err) + _, _, err = ConvertMarkdownBuffer(data, markdown) + require.NoError(t, err) + } + } +} diff --git a/zbook_backend/markdown/convert/layout.go b/zbook_backend/markdown/convert/layout.go new file mode 100644 index 0000000..9cb9142 --- /dev/null +++ b/zbook_backend/markdown/convert/layout.go @@ -0,0 +1,118 @@ +package convert + +import ( + "encoding/json" + "fmt" + "os" + "strings" +) + +// 创建结构体 +type Layout struct { + Title string `json:"title"` + Href string `json:"href"` + Isdir bool `json:"isdir"` + Sublayouts []Layout `json:"sublayouts"` +} + +// 查看本目录下面是否有md文件,有的话true +func hasMdUnder(Layout *Layout) bool { + if !Layout.Isdir { + return true + } + for _, sublayout := range Layout.Sublayouts { + if hasMdUnder(&sublayout) { + return true + } + } + return false +} + +// 生成一个 layout json 文档 +func GenLayout(prefix int, path string, layout *Layout) error { + files, err := os.ReadDir(path) + if err != nil { + return fmt.Errorf("read path :%s failed: %v", path, err) + } + left_path := "" + if prefix < len(path) { + left_path = path[prefix:] + "/" + } + + for _, f := range files { + if f.Type().IsRegular() && strings.HasSuffix(f.Name(), ".md") { + current_layout := Layout{ + Title: f.Name(), + Isdir: false, + Href: left_path + strings.TrimSuffix(f.Name(), ".md"), + } + layout.Sublayouts = append(layout.Sublayouts, current_layout) + } + if f.IsDir() { + current_layout := Layout{ + Title: f.Name(), + Isdir: true, + } + err := GenLayout(prefix, path+"/"+f.Name(), ¤t_layout) + if err != nil { + return err + } + if hasMdUnder(¤t_layout) { + layout.Sublayouts = append(layout.Sublayouts, current_layout) + lens := len(layout.Sublayouts) + if current_layout.Isdir { //[l,r] + left := 0 + right := len(layout.Sublayouts) - 1 + + for left < right { + mid := (left + right) / 2 + mid_v := layout.Sublayouts[mid].Isdir + if mid_v { + left = mid + 1 + } else { + right = mid + } + } + if left < lens-1 { + layout.Sublayouts[left], layout.Sublayouts[lens-1] = layout.Sublayouts[lens-1], layout.Sublayouts[left] + } + } + } + } + } + return nil +} + +// 生成仓库对应的layout json, +// 出错则返回:"",err +func LayoutToString(path string) (string, error) { + layout := Layout{ + Title: "wiki", + Isdir: true, + } + + prefix := len(path) + 1 + err := GenLayout(prefix, path, &layout) + if err != nil { + return "", err + } + json_layout, err := json.Marshal(layout) + if err != nil { + return "", err + } + return string(json_layout), err +} + +// RenderLayout 将 LayoutToString 返回的字符串写入文件 +func RenderLayout(path string, outputPath string) error { + stringLayout, err := LayoutToString(path) + if err != nil { + return err + } + err = os.WriteFile(outputPath+"/layout.layout", []byte(stringLayout), 0644) + if err != nil { + return err + } + + return nil +} diff --git a/zbook_backend/markdown/convert/monitor.go b/zbook_backend/markdown/convert/monitor.go new file mode 100644 index 0000000..01149fc --- /dev/null +++ b/zbook_backend/markdown/convert/monitor.go @@ -0,0 +1,73 @@ +package convert + +import ( + "os" + "path/filepath" + "sync" + + "github.com/dietsche/rfsnotify" + "github.com/rs/zerolog/log" +) + +func StartWatcher(sourceDir, destDir string) error { + // watcher, err := rfsnotify.NewWatcher() + watcher, err := rfsnotify.NewWatcher() + if err != nil { + return err + } + defer watcher.Close() + watcher.AddRecursive(sourceDir) + // 使用 WaitGroup 以确保所有子 goroutine 完成后再退出程序 + var wg sync.WaitGroup + wg.Add(1) + // 启动 goroutine 监听事件 + go func() { + defer wg.Done() + for { + select { + case event := <-watcher.Events: + if filepath.Ext(event.Name) == ".md" { + // .md 文件被写入,进行同步操作 + relPath, err := filepath.Rel(sourceDir, event.Name) + if err != nil { + continue + } + destPath := filepath.Join(destDir, relPath[:len(relPath)-len(".md")]+".wiki") + // 确保目标目录及其上级目录存在 + err = os.MkdirAll(filepath.Dir(destPath), os.ModePerm) + if err != nil { + continue + } + ConvertMd2Json(event.Name, destPath) + RenderLayout(sourceDir, destDir) + } + + case err := <-watcher.Errors: + log.Error().Err(err).Msg("moniter watch error") + + } + } + }() + + // 添加监听源目录及其子目录 + err = filepath.Walk(sourceDir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if info.IsDir() { + wg.Add(1) + go func() { + defer wg.Done() + watcher.Add(path) + }() + } + return nil + }) + if err != nil { + return err + } + log.Info().Msg("Watcher started. Press Ctrl+C to stop.") + // 等待所有子 goroutine 完成 + wg.Wait() + return nil +} diff --git a/zbook_backend/markdown/convert/test_files/admonition.md b/zbook_backend/markdown/convert/test_files/admonition.md new file mode 100644 index 0000000..8c58751 --- /dev/null +++ b/zbook_backend/markdown/convert/test_files/admonition.md @@ -0,0 +1,14 @@ +# admonition + +!!! note mermaid +hello + +!!! + +!!! + +!!! + +!!! tip googd + dasdf +!!! diff --git a/zbook_backend/markdown/katex/ast.go b/zbook_backend/markdown/katex/ast.go new file mode 100644 index 0000000..7d38780 --- /dev/null +++ b/zbook_backend/markdown/katex/ast.go @@ -0,0 +1,60 @@ +package katex + +import ( + "github.com/yuin/goldmark/ast" + "github.com/yuin/goldmark/util" +) + +type Inline struct { + ast.BaseInline + + Equation []byte +} + +func (n *Inline) Inline() {} + +func (n *Inline) IsBlank(source []byte) bool { + for c := n.FirstChild(); c != nil; c = c.NextSibling() { + text := c.(*ast.Text).Segment + if !util.IsBlank(text.Value(source)) { + return false + } + } + return true +} + +func (n *Inline) Dump(source []byte, level int) { + ast.DumpHelper(n, source, level, nil, nil) +} + +var KindInline = ast.NewNodeKind("Inline") + +func (n *Inline) Kind() ast.NodeKind { + return KindInline +} + +type Block struct { + ast.BaseInline + + Equation []byte +} + +func (n *Block) IsBlank(source []byte) bool { + for c := n.FirstChild(); c != nil; c = c.NextSibling() { + text := c.(*ast.Text).Segment + if !util.IsBlank(text.Value(source)) { + return false + } + } + return true +} + +func (n *Block) Dump(source []byte, level int) { + ast.DumpHelper(n, source, level, nil, nil) +} + +var KindBlock = ast.NewNodeKind("Block") + +func (n *Block) Kind() ast.NodeKind { + return KindBlock +} diff --git a/zbook_backend/markdown/katex/extender.go b/zbook_backend/markdown/katex/extender.go new file mode 100644 index 0000000..a451173 --- /dev/null +++ b/zbook_backend/markdown/katex/extender.go @@ -0,0 +1,24 @@ +package katex + +import ( + "github.com/bluele/gcache" + "github.com/yuin/goldmark" + "github.com/yuin/goldmark/parser" + "github.com/yuin/goldmark/renderer" + "github.com/yuin/goldmark/util" +) + +type Extender struct { +} + +func (e *Extender) Extend(m goldmark.Markdown) { + m.Parser().AddOptions(parser.WithInlineParsers( + util.Prioritized(&Parser{}, 0), + )) + m.Renderer().AddOptions(renderer.WithNodeRenderers( + util.Prioritized(&HTMLRenderer{ + cacheInline: gcache.New(5000).ARC().Build(), + cacheDisplay: gcache.New(5000).ARC().Build(), + }, 0), + )) +} diff --git a/zbook_backend/markdown/katex/katex.go b/zbook_backend/markdown/katex/katex.go new file mode 100644 index 0000000..58fa025 --- /dev/null +++ b/zbook_backend/markdown/katex/katex.go @@ -0,0 +1,16 @@ +package katex + +import ( + _ "embed" + "io" +) + +func Render(w io.Writer, src []byte, display bool) error { + if display { + _, err := io.WriteString(w, "$$"+string(src)+"$$") + return err + } else { + _, err := io.WriteString(w, "$"+string(src)+"$") + return err + } +} diff --git a/zbook_backend/markdown/katex/parser.go b/zbook_backend/markdown/katex/parser.go new file mode 100644 index 0000000..bb59575 --- /dev/null +++ b/zbook_backend/markdown/katex/parser.go @@ -0,0 +1,101 @@ +package katex + +import ( + "github.com/yuin/goldmark/ast" + "github.com/yuin/goldmark/parser" + "github.com/yuin/goldmark/text" +) + +type Parser struct { +} + +func (s *Parser) Trigger() []byte { + return []byte{'$'} +} + +func (s *Parser) Parse(parent ast.Node, block text.Reader, pc parser.Context) ast.Node { + buf := block.Source() + ln, pos := block.Position() + + lstart := pos.Start + lend := pos.Stop + line := buf[lstart:lend] + + var start, end, advance int + + trigger := line[0] + + display := len(line) > 1 && line[1] == trigger + + if display { // Display + start = lstart + 2 + + offset := 2 + + L: + for x := 0; x < 20; x++ { + for j := offset; j < len(line); j++ { + if len(line) > j+1 && line[j] == trigger && line[j+1] == trigger { + end = lstart + j + advance = 2 + break L + } + } + if lend == len(buf) { + break + } + if end == 0 { + rest := buf[lend:] + j := 1 + for j < len(rest) && rest[j] != '\n' { + j++ + } + lstart = lend + lend += j + line = buf[lstart:lend] + ln++ + offset = 0 + } + } + + } else { // Inline + start = lstart + 1 + + for i := 1; i < len(line); i++ { + c := line[i] + if c == '\\' { + i++ + continue + } + if c == trigger { + end = lstart + i + advance = 1 + break + } + } + if end >= len(buf) || buf[end] != trigger { + return nil + } + } + + if start >= end { + return nil + } + + newpos := end + advance + if newpos < lend { + block.SetPosition(ln, text.NewSegment(newpos, lend)) + } else { + block.Advance(newpos) + } + + if display { + return &Block{ + Equation: buf[start:end], + } + } else { + return &Inline{ + Equation: buf[start:end], + } + } +} diff --git a/zbook_backend/markdown/katex/renderer.go b/zbook_backend/markdown/katex/renderer.go new file mode 100644 index 0000000..44a52be --- /dev/null +++ b/zbook_backend/markdown/katex/renderer.go @@ -0,0 +1,81 @@ +package katex + +import ( + "bytes" + + "github.com/bluele/gcache" + "github.com/yuin/goldmark/ast" + "github.com/yuin/goldmark/renderer" + "github.com/yuin/goldmark/renderer/html" + "github.com/yuin/goldmark/util" +) + +type HTMLRenderer struct { + html.Config + + cacheInline gcache.Cache + cacheDisplay gcache.Cache +} + +func (r *HTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { + reg.Register(KindInline, r.renderInline) + reg.Register(KindBlock, r.renderBlock) +} + +func (r *HTMLRenderer) renderInline(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) { + if entering { + node := n.(*Inline) + + html, err := r.cacheInline.Get(string(node.Equation)) + + if err == nil { + w.Write(html.([]byte)) + return ast.WalkContinue, nil + } + + if err == gcache.KeyNotFoundError { + b := bytes.Buffer{} + err = Render(&b, node.Equation, false) + if err != nil { + return ast.WalkStop, err + } + html := b.Bytes() + w.Write(html) + r.cacheInline.Set(string(node.Equation), html) + return ast.WalkContinue, nil + } + + return ast.WalkStop, err + } + + return ast.WalkContinue, nil +} + +func (r *HTMLRenderer) renderBlock(w util.BufWriter, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) { + if entering { + node := n.(*Block) + + html, err := r.cacheDisplay.Get(string(node.Equation)) + + if err == nil { + w.Write(html.([]byte)) + return ast.WalkContinue, nil + } + + if err == gcache.KeyNotFoundError { + b := bytes.Buffer{} + err = Render(&b, node.Equation, true) + if err != nil { + return ast.WalkStop, err + } + html := b.Bytes() + w.Write(html) + r.cacheDisplay.Set(string(node.Equation), html) + return ast.WalkContinue, nil + } + + return ast.WalkStop, err + } + + return ast.WalkContinue, nil +} diff --git a/zbook_backend/markdown/render/config.go b/zbook_backend/markdown/render/config.go new file mode 100644 index 0000000..419d6e7 --- /dev/null +++ b/zbook_backend/markdown/render/config.go @@ -0,0 +1,35 @@ +package render + +import ( + // admonitions "github.com/stefanfritsch/goldmark-admonitions" + "github.com/yuin/goldmark" + "github.com/yuin/goldmark/extension" + "github.com/yuin/goldmark/parser" + admonitions "github.com/zizdlp/zbook/markdown/admonition" + "github.com/zizdlp/zbook/markdown/katex" + "go.abhg.dev/goldmark/toc" +) + +func GetMarkdownConfig() goldmark.Markdown { + markdown := goldmark.New( + goldmark.WithParserOptions(parser.WithAutoHeadingID()), + goldmark.WithExtensions( + &toc.Extender{ + Title: "content_table", + ListID: "content_title", + }, + ), + goldmark.WithExtensions(extension.GFM), + goldmark.WithExtensions( + &admonitions.Extender{}, + ), + goldmark.WithExtensions(extension.NewCJK(extension.WithEastAsianLineBreaks(), extension.WithEscapedSpace())), + goldmark.WithExtensions( + extension.NewFootnote( + extension.WithFootnoteIDPrefix([]byte("footnote-")), + extension.WithFootnoteBacklinkHTML([]byte("^"))), + ), + goldmark.WithExtensions(&katex.Extender{}), + ) + return markdown +} diff --git a/zbook_backend/operations/clone.go b/zbook_backend/operations/clone.go new file mode 100644 index 0000000..5bed438 --- /dev/null +++ b/zbook_backend/operations/clone.go @@ -0,0 +1,81 @@ +package operations + +import ( + "fmt" + "os/exec" + "strings" + + "github.com/zizdlp/zbook/util" +) + +// Clone clones a git repository from the specified URL into the specified directory. +func Clone(gitURL string, dir string) error { + // Create the git clone command with the directory parameter + cmd := exec.Command("git", "clone", gitURL, dir) + + // Run the command and capture its output + output, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf(util.ParserGitCloneError(string(output))) + } + return nil +} + +// CloneWithPassword clones a git repository from the specified URL into the specified directory. +// It supports cloning private repositories using either a personal access token (token) +// or basic authentication (username and password). +func CloneWithPassword(gitURL, dir, username, password string) error { + // Construct the clone URL with username and password embedded + urlWithCredentials := embedCredentialsInURL(gitURL, username, password) + // Create the git clone command with the directory parameter + cmd := exec.Command("git", "clone", urlWithCredentials, dir) + + // Run the command and capture its output + output, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf(util.ParserGitCloneError(string(output))) + } + + return nil +} + +// CloneWithToken clones a git repository from the specified URL into the specified directory. +// It supports cloning private repositories using a personal access token. +func CloneWithToken(gitURL, dir, token string) error { + // Construct the clone URL with the token embedded + urlWithToken := embedTokenInURL(gitURL, token) + // Create the git clone command with the directory parameter + cmd := exec.Command("git", "clone", urlWithToken, dir) + + // Run the command and capture its output + output, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf(util.ParserGitCloneError(string(output))) + } + + return nil +} + +// embedCredentialsInURL embeds the username and password into the git URL for basic authentication. +func embedCredentialsInURL(gitURL, username, password string) string { + // Split the URL at "//" to insert username and password + parts := strings.Split(gitURL, "//") + if len(parts) < 2 { + return gitURL // Invalid URL format, return as is + } + + // Insert username and password after "//" + return fmt.Sprintf("%s//%s:%s@%s", parts[0], username, password, parts[1]) +} + +// embedTokenInURL embeds the personal access token into the git URL for token authentication. +func embedTokenInURL(gitURL, token string) string { + // Split the URL at "//" to insert the token + parts := strings.Split(gitURL, "//") + if len(parts) < 2 { + return gitURL // Invalid URL format, return as is + } + + // Insert token after "//" using the format "token@" + return fmt.Sprintf("%s//%s@%s", parts[0], token, parts[1]) +} diff --git a/zbook_backend/operations/clone_test.go b/zbook_backend/operations/clone_test.go new file mode 100644 index 0000000..73cad70 --- /dev/null +++ b/zbook_backend/operations/clone_test.go @@ -0,0 +1,86 @@ +package operations + +import ( + "fmt" + "os" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func TestClone(t *testing.T) { + // 使用一个公开的 Git 仓库 URL 进行测试 + gitURL := "https://github.com/zizdlp/zbook-user-guide.git" + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(10) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + + // 调用 Clone 函数 + err := Clone(gitURL, cloneDir) + + // 验证没有返回错误 + require.NoError(t, err) + + // 验证目标目录已创建 + _, err = os.Stat(cloneDir) + require.NoError(t, err) +} + +func TestCloneWithPassword(t *testing.T) { + if testing.Short() { + fmt.Println("***** TestCloneWithPassword is ignored *****") + t.Skip() + } + gitURL := "https://gitee.com/zizdlp/docs.git" + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(10) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + password := os.Getenv("ZBOOK_TEST_PASSWORD") + username := "zizdlp" + // 调用 CloneWithPassword 函数 + err := CloneWithPassword(gitURL, cloneDir, username, password) + + // 验证没有返回错误 + require.NoError(t, err) + + // 验证目标目录已创建 + _, err = os.Stat(cloneDir) + require.NoError(t, err) +} + +func TestCloneWithToken(t *testing.T) { + if testing.Short() { + fmt.Println("***** TestCloneWithTokenShouldOK is ignored *****") + t.Skip() + } + gitURL := "https://github.com/zizdlp/full-stack-guide.git" + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(10) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + token := os.Getenv("ZBOOK_TEST_TOKEN") + // 调用 CloneWithToken 函数 + err := CloneWithToken(gitURL, cloneDir, token) + + // 验证没有返回错误 + require.NoError(t, err) + + // 验证目标目录已创建 + _, err = os.Stat(cloneDir) + require.NoError(t, err) +} diff --git a/zbook_backend/operations/get_diff_files.go b/zbook_backend/operations/get_diff_files.go new file mode 100644 index 0000000..d9af2ca --- /dev/null +++ b/zbook_backend/operations/get_diff_files.go @@ -0,0 +1,110 @@ +package operations + +import ( + "fmt" + "os/exec" + "path/filepath" + "strings" +) + +// GetDiffFiles returns three slices containing added, deleted, and modified file names between two commits. +func GetDiffFiles(oldCommitID, newCommitID, repoDir string) ([]string, []string, []string, []string, error) { + var cmd *exec.Cmd + if oldCommitID == "" { + // If oldCommitID is empty, list all files in the repository + cmd = exec.Command("sh", "-c", "git ls-files -z") + cmd.Dir = repoDir // Set the working directory to the specified repository directory + + // Run the command and capture its output + output, err := cmd.Output() + if err != nil { + return nil, nil, nil, nil, fmt.Errorf("failed to run git command: %v", err) + } + // Split output into fields by null character + fields := strings.Split(string(output), "\x00") + if len(fields) > 0 && fields[len(fields)-1] == "" { + fields = fields[:len(fields)-1] // Remove the last empty element if it exists + } + // Initialize slices for added, deleted, and modified files + var addedFiles []string + var modifiedFiles []string + var deletedFiles []string + var renameFiles []string + i := 0 + for { + if i >= len(fields) { + break + } + addedFiles = append(addedFiles, fields[i]) + i += 1 + } + return addedFiles, modifiedFiles, deletedFiles, renameFiles, nil + } + // Construct the git diff command + cmd = exec.Command("sh", "-c", fmt.Sprintf("git diff --name-status -z %s %s", oldCommitID, newCommitID)) + + cmd.Dir = repoDir // Set the working directory to the specified repository directory + + // Run the command and capture its output + output, err := cmd.Output() + if err != nil { + return nil, nil, nil, nil, fmt.Errorf("failed to run git command: %v", err) + } + + // Split output into fields by null character + fields := strings.Split(string(output), "\x00") + if len(fields) > 0 && fields[len(fields)-1] == "" { + fields = fields[:len(fields)-1] // Remove the last empty element if it exists + } + // Initialize slices for added, deleted, and modified files + var addedFiles []string + var modifiedFiles []string + var deletedFiles []string + var renameFiles []string + + i := 0 + for { + if i >= len(fields) { + break + } + status := fields[i][0] + switch status { + case 'A': + fileName := fields[i+1] + addedFiles = append(addedFiles, fileName) + i += 2 + case 'M': + fileName := fields[i+1] + modifiedFiles = append(modifiedFiles, fileName) + i += 2 + case 'D': + fileName := fields[i+1] + deletedFiles = append(deletedFiles, fileName) + i += 2 + case 'R': + // Renamed status, next two fields are old and new filenames + oldName := fields[i+1] + newName := fields[i+2] + if filepath.Ext(oldName) == ".md" && filepath.Ext(newName) == ".md" { + renameFiles = append(renameFiles, oldName) + renameFiles = append(renameFiles, newName) + } else { + deletedFiles = append(deletedFiles, oldName) + addedFiles = append(addedFiles, newName) + } + i += 3 // Skip the next two fields since they are part of the rename + case 'C': + // Copied status, next two fields are old and new filenames + _ = fields[i+1] + newName := fields[i+2] + addedFiles = append(addedFiles, newName) + i += 3 // Skip the next two fields since they are part of the copy + default: + // Unsupported status or unhandled status + i = len(fields) + fmt.Printf("Unhandled status: %c\n", status) + } + } + + return addedFiles, modifiedFiles, deletedFiles, renameFiles, nil +} diff --git a/zbook_backend/operations/get_diff_files_test.go b/zbook_backend/operations/get_diff_files_test.go new file mode 100644 index 0000000..f8e415a --- /dev/null +++ b/zbook_backend/operations/get_diff_files_test.go @@ -0,0 +1,155 @@ +package operations + +import ( + "fmt" + "os" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func TestGetDiffFilesShouldOK(t *testing.T) { + // 使用一个公开的 Git 仓库 URL 进行测试 + gitURL := "https://github.com/zizdlp/zbook-docs.git" + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(10) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + + // 调用 Clone 函数 + err := Clone(gitURL, cloneDir) + + // 验证没有返回错误 + require.NoError(t, err) + + // 调用 GetLatestCommit 函数 + lastCommit, err := GetLatestCommit(cloneDir) + // 验证没有返回错误 + require.NoError(t, err) + + // 验证 commitHash 不为空 + require.NotEmpty(t, lastCommit) + + oldCommit := "6eec29b0b8188d4877cac57a90b17fd5fa8f165c" + + // 调用 GetDiffFiles 函数 + addedFiles, deletedFiles, modifiedFiles, renameFiles, err := GetDiffFiles(oldCommit, lastCommit, cloneDir) + require.NoError(t, err) + + // 输出差异文件列表,便于观察测试结果 + t.Logf("Added files between commit %s and commit %s:", oldCommit, lastCommit) + for _, file := range addedFiles { + t.Logf("A - %s", file) + } + + t.Logf("Deleted files between commit %s and commit %s:", oldCommit, lastCommit) + for _, file := range deletedFiles { + t.Logf("D - %s", file) + } + + t.Logf("Modified files between commit %s and commit %s:", oldCommit, lastCommit) + for _, file := range modifiedFiles { + t.Logf("M - %s", file) + } + + t.Logf("Rename files between commit %s and commit %s:", oldCommit, lastCommit) + for i := 0; i < len(renameFiles); i += 2 { + t.Logf("R - %s - %s", renameFiles[i], renameFiles[i+1]) + } +} + +func TestGetAllFilesShouldOK(t *testing.T) { + // 使用一个公开的 Git 仓库 URL 进行测试 + gitURL := "https://github.com/zizdlp/zbook-docs.git" + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(10) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + + // 调用 Clone 函数 + err := Clone(gitURL, cloneDir) + + // 验证没有返回错误 + require.NoError(t, err) + + // 调用 GetLatestCommit 函数 + lastCommit, err := GetLatestCommit(cloneDir) + // 验证没有返回错误 + require.NoError(t, err) + + // 验证 commitHash 不为空 + require.NotEmpty(t, lastCommit) + + oldCommit := "" + + // 调用 GetDiffFiles 函数 + addedFiles, deletedFiles, modifiedFiles, renameFiles, err := GetDiffFiles(oldCommit, lastCommit, cloneDir) + require.NoError(t, err) + + // 输出差异文件列表,便于观察测试结果 + t.Logf("Added files in the repository:") + for _, file := range addedFiles { + t.Logf("A - %s", file) + } + + t.Logf("Deleted files in the repository:") + for _, file := range deletedFiles { + t.Logf("D - %s", file) + } + + t.Logf("Modified files in the repository:") + for _, file := range modifiedFiles { + t.Logf("M - %s", file) + } + + t.Logf("Rename files between commit %s and commit %s:", oldCommit, lastCommit) + for i := 0; i < len(renameFiles); i += 2 { + t.Logf("R - %s,%s", renameFiles[i], renameFiles[i+1]) + } +} + +func TestGetDiffFilesRename(t *testing.T) { + if testing.Short() { + fmt.Println("***** TestCloneWithPassword is ignored *****") + t.Skip() + } + // 创建一个临时Git仓库并执行一些命令来设置测试环境 + // 请确保在执行测试之前,创建一个临时的Git仓库,模拟提交和文件修改 + + gitURL := "https://github.com/zizdlp/frpc.git" + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(10) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + + // 调用 Clone 函数 + err := Clone(gitURL, cloneDir) + + // 验证没有返回错误 + require.NoError(t, err) + + oldCommitID := "cb924727b336e70cab13ebe46d2daee7381f4b17" + newCommitID := "ef68cac5c79c3e683e90efa4dcca2db25d13375a" + + addedFiles, modifiedFiles, deletedFiles, renameFiles, err := GetDiffFiles(oldCommitID, newCommitID, cloneDir) + require.NoError(t, err) + + // 检查返回的文件列表是否符合预期 + require.Equal(t, []string{"getting-started/quick-start.mdx"}, addedFiles) + require.Empty(t, modifiedFiles) + require.Equal(t, []string{"getting-started/quick-start.md"}, deletedFiles) + require.Empty(t, renameFiles) +} diff --git a/zbook_backend/operations/get_lastest_commit.go b/zbook_backend/operations/get_lastest_commit.go new file mode 100644 index 0000000..5bda619 --- /dev/null +++ b/zbook_backend/operations/get_lastest_commit.go @@ -0,0 +1,22 @@ +package operations + +import ( + "fmt" + "os/exec" + "strings" +) + +// GetLatestCommit retrieves the latest commit hash from the specified repository directory. +func GetLatestCommit(dir string) (string, error) { + // Change the working directory to the specified directory + cmd := exec.Command("git", "-C", dir, "rev-parse", "HEAD") + + // Run the command and capture its output + output, err := cmd.Output() + if err != nil { + return "", fmt.Errorf("failed to get latest commit: %v", err) + } + + // Return the latest commit hash + return strings.TrimSpace(string(output)), nil +} diff --git a/zbook_backend/operations/get_latest_commit_test.go b/zbook_backend/operations/get_latest_commit_test.go new file mode 100644 index 0000000..2d8dd75 --- /dev/null +++ b/zbook_backend/operations/get_latest_commit_test.go @@ -0,0 +1,37 @@ +package operations + +import ( + "os" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func TestGetLatestCommitShouldOK(t *testing.T) { + // 使用一个公开的 Git 仓库 URL 进行测试 + gitURL := "https://github.com/zizdlp/zbook-user-guide.git" + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(10) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + + // 调用 Clone 函数 + err := Clone(gitURL, cloneDir) + + // 验证没有返回错误 + require.NoError(t, err) + + // 调用 GetLatestCommit 函数 + commitHash, err := GetLatestCommit(cloneDir) + // 验证没有返回错误 + require.NoError(t, err) + + // 验证 commitHash 不为空 + require.NotEmpty(t, commitHash) + +} diff --git a/zbook_backend/operations/list_markdowns.go b/zbook_backend/operations/list_markdowns.go new file mode 100644 index 0000000..84d6eb6 --- /dev/null +++ b/zbook_backend/operations/list_markdowns.go @@ -0,0 +1,31 @@ +package operations + +import ( + "fmt" + "os/exec" + "strings" +) + +// ListMarkdownFiles lists all .md files in the git repository located at the specified directory. +func ListMarkdownFiles(repoDir string) ([]string, error) { + // Construct the git ls-files command + // cmd := exec.Command("git", "-C", repoDir, "ls-files") + cmd := exec.Command("sh", "-c", "git ls-files -z | xargs -0 -n1 echo") + cmd.Dir = repoDir // Set the working directory to the specified repository directory + // Run the command and capture its output + output, err := cmd.Output() + if err != nil { + return nil, fmt.Errorf("failed to list files: %v", err) + } + + // Split output into lines and filter for .md files + allFiles := strings.Split(strings.TrimSpace(string(output)), "\n") + mdFiles := []string{} + for _, file := range allFiles { + if strings.HasSuffix(file, ".md") { + mdFiles = append(mdFiles, file) + } + } + + return mdFiles, nil +} diff --git a/zbook_backend/operations/list_markdowns_test.go b/zbook_backend/operations/list_markdowns_test.go new file mode 100644 index 0000000..dba8d46 --- /dev/null +++ b/zbook_backend/operations/list_markdowns_test.go @@ -0,0 +1,45 @@ +package operations + +import ( + "os" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func TestListMarkdownFilesShouldOK(t *testing.T) { + // 使用一个公开的 Git 仓库 URL 进行测试 + gitURL := "https://github.com/zizdlp/zbook-user-guide.git" + + rsg := util.NewRandomStringGenerator() + randomString := rsg.RandomString(10) + cloneDir := "/tmp/zbook_repo/" + randomString + // 删除目标目录以确保每次测试都是从头开始 + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + + // 调用 Clone 函数 + err := Clone(gitURL, cloneDir) + // 验证没有返回错误 + require.NoError(t, err) + + // 验证目标目录已创建 + _, err = os.Stat(cloneDir) + require.NoError(t, err) + + // 调用 ListMarkdownFiles 函数 + mdFiles, err := ListMarkdownFiles(cloneDir) + // 验证没有返回错误 + require.NoError(t, err) + + // 验证 mdFiles 不为空 + require.NotEmpty(t, mdFiles) + + // 输出 Markdown 文件列表,便于观察测试结果 + t.Logf("Markdown files in repository:") + for _, file := range mdFiles { + t.Logf("- %s", file) + } +} diff --git a/zbook_backend/pb/models/comment.pb.go b/zbook_backend/pb/models/comment.pb.go new file mode 100644 index 0000000..605407f --- /dev/null +++ b/zbook_backend/pb/models/comment.pb.go @@ -0,0 +1,625 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: models/comment.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CommentBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentId int64 `protobuf:"varint,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` + MarkdownId int64 `protobuf:"varint,2,opt,name=markdown_id,json=markdownId,proto3" json:"markdown_id,omitempty"` + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + ParentId int64 `protobuf:"varint,4,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` + RootId int64 `protobuf:"varint,5,opt,name=root_id,json=rootId,proto3" json:"root_id,omitempty"` + CommentContent string `protobuf:"bytes,6,opt,name=comment_content,json=commentContent,proto3" json:"comment_content,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *CommentBasicInfo) Reset() { + *x = CommentBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_comment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommentBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommentBasicInfo) ProtoMessage() {} + +func (x *CommentBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_comment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommentBasicInfo.ProtoReflect.Descriptor instead. +func (*CommentBasicInfo) Descriptor() ([]byte, []int) { + return file_models_comment_proto_rawDescGZIP(), []int{0} +} + +func (x *CommentBasicInfo) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +func (x *CommentBasicInfo) GetMarkdownId() int64 { + if x != nil { + return x.MarkdownId + } + return 0 +} + +func (x *CommentBasicInfo) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *CommentBasicInfo) GetParentId() int64 { + if x != nil { + return x.ParentId + } + return 0 +} + +func (x *CommentBasicInfo) GetRootId() int64 { + if x != nil { + return x.RootId + } + return 0 +} + +func (x *CommentBasicInfo) GetCommentContent() string { + if x != nil { + return x.CommentContent + } + return "" +} + +func (x *CommentBasicInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type CommentCountInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentId int64 `protobuf:"varint,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` + LikeCount int32 `protobuf:"varint,2,opt,name=like_count,json=likeCount,proto3" json:"like_count,omitempty"` + ReplyCount int32 `protobuf:"varint,3,opt,name=reply_count,json=replyCount,proto3" json:"reply_count,omitempty"` + IsLiked bool `protobuf:"varint,4,opt,name=is_liked,json=isLiked,proto3" json:"is_liked,omitempty"` + IsDisliked bool `protobuf:"varint,5,opt,name=is_disliked,json=isDisliked,proto3" json:"is_disliked,omitempty"` + IsShared bool `protobuf:"varint,6,opt,name=is_shared,json=isShared,proto3" json:"is_shared,omitempty"` + IsReported bool `protobuf:"varint,7,opt,name=is_reported,json=isReported,proto3" json:"is_reported,omitempty"` +} + +func (x *CommentCountInfo) Reset() { + *x = CommentCountInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_comment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommentCountInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommentCountInfo) ProtoMessage() {} + +func (x *CommentCountInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_comment_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommentCountInfo.ProtoReflect.Descriptor instead. +func (*CommentCountInfo) Descriptor() ([]byte, []int) { + return file_models_comment_proto_rawDescGZIP(), []int{1} +} + +func (x *CommentCountInfo) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +func (x *CommentCountInfo) GetLikeCount() int32 { + if x != nil { + return x.LikeCount + } + return 0 +} + +func (x *CommentCountInfo) GetReplyCount() int32 { + if x != nil { + return x.ReplyCount + } + return 0 +} + +func (x *CommentCountInfo) GetIsLiked() bool { + if x != nil { + return x.IsLiked + } + return false +} + +func (x *CommentCountInfo) GetIsDisliked() bool { + if x != nil { + return x.IsDisliked + } + return false +} + +func (x *CommentCountInfo) GetIsShared() bool { + if x != nil { + return x.IsShared + } + return false +} + +func (x *CommentCountInfo) GetIsReported() bool { + if x != nil { + return x.IsReported + } + return false +} + +type ListCommentInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MarkdownId int64 `protobuf:"varint,1,opt,name=markdown_id,json=markdownId,proto3" json:"markdown_id,omitempty"` + ParentId int64 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` + Pusername string `protobuf:"bytes,4,opt,name=pusername,proto3" json:"pusername,omitempty"` + CommentContent string `protobuf:"bytes,5,opt,name=comment_content,json=commentContent,proto3" json:"comment_content,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + LikeCount int64 `protobuf:"varint,7,opt,name=like_count,json=likeCount,proto3" json:"like_count,omitempty"` + ReplyCount int64 `protobuf:"varint,8,opt,name=reply_count,json=replyCount,proto3" json:"reply_count,omitempty"` + IsLiked bool `protobuf:"varint,9,opt,name=is_liked,json=isLiked,proto3" json:"is_liked,omitempty"` + IsDisliked bool `protobuf:"varint,10,opt,name=is_disliked,json=isDisliked,proto3" json:"is_disliked,omitempty"` + IsShared bool `protobuf:"varint,11,opt,name=is_shared,json=isShared,proto3" json:"is_shared,omitempty"` + IsReported bool `protobuf:"varint,12,opt,name=is_reported,json=isReported,proto3" json:"is_reported,omitempty"` + CommentId int64 `protobuf:"varint,13,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` +} + +func (x *ListCommentInfo) Reset() { + *x = ListCommentInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_comment_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentInfo) ProtoMessage() {} + +func (x *ListCommentInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_comment_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentInfo.ProtoReflect.Descriptor instead. +func (*ListCommentInfo) Descriptor() ([]byte, []int) { + return file_models_comment_proto_rawDescGZIP(), []int{2} +} + +func (x *ListCommentInfo) GetMarkdownId() int64 { + if x != nil { + return x.MarkdownId + } + return 0 +} + +func (x *ListCommentInfo) GetParentId() int64 { + if x != nil { + return x.ParentId + } + return 0 +} + +func (x *ListCommentInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListCommentInfo) GetPusername() string { + if x != nil { + return x.Pusername + } + return "" +} + +func (x *ListCommentInfo) GetCommentContent() string { + if x != nil { + return x.CommentContent + } + return "" +} + +func (x *ListCommentInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *ListCommentInfo) GetLikeCount() int64 { + if x != nil { + return x.LikeCount + } + return 0 +} + +func (x *ListCommentInfo) GetReplyCount() int64 { + if x != nil { + return x.ReplyCount + } + return 0 +} + +func (x *ListCommentInfo) GetIsLiked() bool { + if x != nil { + return x.IsLiked + } + return false +} + +func (x *ListCommentInfo) GetIsDisliked() bool { + if x != nil { + return x.IsDisliked + } + return false +} + +func (x *ListCommentInfo) GetIsShared() bool { + if x != nil { + return x.IsShared + } + return false +} + +func (x *ListCommentInfo) GetIsReported() bool { + if x != nil { + return x.IsReported + } + return false +} + +func (x *ListCommentInfo) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +type ListAdminCommentInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentId int64 `protobuf:"varint,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` + CommentContent string `protobuf:"bytes,2,opt,name=comment_content,json=commentContent,proto3" json:"comment_content,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *ListAdminCommentInfo) Reset() { + *x = ListAdminCommentInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_comment_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAdminCommentInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAdminCommentInfo) ProtoMessage() {} + +func (x *ListAdminCommentInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_comment_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListAdminCommentInfo.ProtoReflect.Descriptor instead. +func (*ListAdminCommentInfo) Descriptor() ([]byte, []int) { + return file_models_comment_proto_rawDescGZIP(), []int{3} +} + +func (x *ListAdminCommentInfo) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +func (x *ListAdminCommentInfo) GetCommentContent() string { + if x != nil { + return x.CommentContent + } + return "" +} + +func (x *ListAdminCommentInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListAdminCommentInfo) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ListAdminCommentInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +var File_models_comment_proto protoreflect.FileDescriptor + +var file_models_comment_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x02, 0x0a, 0x10, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, + 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x64, + 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x74, 0x49, 0x64, 0x12, + 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x22, 0xeb, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x69, 0x6b, 0x65, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6c, 0x69, 0x6b, + 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x70, + 0x6c, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x6c, 0x69, + 0x6b, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x4c, 0x69, 0x6b, + 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x6c, 0x69, 0x6b, 0x65, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x44, 0x69, 0x73, 0x6c, 0x69, + 0x6b, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, + 0x64, 0x22, 0xc6, 0x03, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, + 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x61, 0x72, 0x6b, + 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, + 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x69, 0x6b, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x69, 0x6b, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x6b, 0x65, 0x64, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x4c, 0x69, 0x6b, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x69, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x6c, 0x69, 0x6b, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x69, 0x73, 0x44, 0x69, 0x73, 0x6c, 0x69, 0x6b, 0x65, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x69, 0x73, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x69, 0x73, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, + 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x69, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0xcb, 0x01, 0x0a, 0x14, 0x4c, + 0x69, 0x73, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x39, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, + 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_comment_proto_rawDescOnce sync.Once + file_models_comment_proto_rawDescData = file_models_comment_proto_rawDesc +) + +func file_models_comment_proto_rawDescGZIP() []byte { + file_models_comment_proto_rawDescOnce.Do(func() { + file_models_comment_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_comment_proto_rawDescData) + }) + return file_models_comment_proto_rawDescData +} + +var file_models_comment_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_models_comment_proto_goTypes = []interface{}{ + (*CommentBasicInfo)(nil), // 0: pb.CommentBasicInfo + (*CommentCountInfo)(nil), // 1: pb.CommentCountInfo + (*ListCommentInfo)(nil), // 2: pb.ListCommentInfo + (*ListAdminCommentInfo)(nil), // 3: pb.ListAdminCommentInfo + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp +} +var file_models_comment_proto_depIdxs = []int32{ + 4, // 0: pb.CommentBasicInfo.created_at:type_name -> google.protobuf.Timestamp + 4, // 1: pb.ListCommentInfo.created_at:type_name -> google.protobuf.Timestamp + 4, // 2: pb.ListAdminCommentInfo.created_at:type_name -> google.protobuf.Timestamp + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_models_comment_proto_init() } +func file_models_comment_proto_init() { + if File_models_comment_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_comment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommentBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_comment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommentCountInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_comment_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_comment_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAdminCommentInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_comment_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_comment_proto_goTypes, + DependencyIndexes: file_models_comment_proto_depIdxs, + MessageInfos: file_models_comment_proto_msgTypes, + }.Build() + File_models_comment_proto = out.File + file_models_comment_proto_rawDesc = nil + file_models_comment_proto_goTypes = nil + file_models_comment_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/models/comment_relation.pb.go b/zbook_backend/pb/models/comment_relation.pb.go new file mode 100644 index 0000000..90e0dfe --- /dev/null +++ b/zbook_backend/pb/models/comment_relation.pb.go @@ -0,0 +1,243 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: models/comment_relation.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ListCommentReportInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReportId int64 `protobuf:"varint,1,opt,name=report_id,json=reportId,proto3" json:"report_id,omitempty"` + CommentId int64 `protobuf:"varint,2,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` + RepoName string `protobuf:"bytes,3,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + RepoUsername string `protobuf:"bytes,4,opt,name=repo_username,json=repoUsername,proto3" json:"repo_username,omitempty"` + RelativePath string `protobuf:"bytes,5,opt,name=relative_path,json=relativePath,proto3" json:"relative_path,omitempty"` + ReportContent string `protobuf:"bytes,6,opt,name=report_content,json=reportContent,proto3" json:"report_content,omitempty"` + CommentContent string `protobuf:"bytes,7,opt,name=comment_content,json=commentContent,proto3" json:"comment_content,omitempty"` + Processed bool `protobuf:"varint,8,opt,name=processed,proto3" json:"processed,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Username string `protobuf:"bytes,10,opt,name=username,proto3" json:"username,omitempty"` +} + +func (x *ListCommentReportInfo) Reset() { + *x = ListCommentReportInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_comment_relation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentReportInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentReportInfo) ProtoMessage() {} + +func (x *ListCommentReportInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_comment_relation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentReportInfo.ProtoReflect.Descriptor instead. +func (*ListCommentReportInfo) Descriptor() ([]byte, []int) { + return file_models_comment_relation_proto_rawDescGZIP(), []int{0} +} + +func (x *ListCommentReportInfo) GetReportId() int64 { + if x != nil { + return x.ReportId + } + return 0 +} + +func (x *ListCommentReportInfo) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +func (x *ListCommentReportInfo) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *ListCommentReportInfo) GetRepoUsername() string { + if x != nil { + return x.RepoUsername + } + return "" +} + +func (x *ListCommentReportInfo) GetRelativePath() string { + if x != nil { + return x.RelativePath + } + return "" +} + +func (x *ListCommentReportInfo) GetReportContent() string { + if x != nil { + return x.ReportContent + } + return "" +} + +func (x *ListCommentReportInfo) GetCommentContent() string { + if x != nil { + return x.CommentContent + } + return "" +} + +func (x *ListCommentReportInfo) GetProcessed() bool { + if x != nil { + return x.Processed + } + return false +} + +func (x *ListCommentReportInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *ListCommentReportInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +var File_models_comment_relation_proto protoreflect.FileDescriptor + +var file_models_comment_relation_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xff, 0x02, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, + 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, + 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, + 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x72, 0x65, 0x70, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x61, 0x74, + 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, + 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_models_comment_relation_proto_rawDescOnce sync.Once + file_models_comment_relation_proto_rawDescData = file_models_comment_relation_proto_rawDesc +) + +func file_models_comment_relation_proto_rawDescGZIP() []byte { + file_models_comment_relation_proto_rawDescOnce.Do(func() { + file_models_comment_relation_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_comment_relation_proto_rawDescData) + }) + return file_models_comment_relation_proto_rawDescData +} + +var file_models_comment_relation_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_models_comment_relation_proto_goTypes = []interface{}{ + (*ListCommentReportInfo)(nil), // 0: pb.ListCommentReportInfo + (*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp +} +var file_models_comment_relation_proto_depIdxs = []int32{ + 1, // 0: pb.ListCommentReportInfo.created_at:type_name -> google.protobuf.Timestamp + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_models_comment_relation_proto_init() } +func file_models_comment_relation_proto_init() { + if File_models_comment_relation_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_comment_relation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentReportInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_comment_relation_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_comment_relation_proto_goTypes, + DependencyIndexes: file_models_comment_relation_proto_depIdxs, + MessageInfos: file_models_comment_relation_proto_msgTypes, + }.Build() + File_models_comment_relation_proto = out.File + file_models_comment_relation_proto_rawDesc = nil + file_models_comment_relation_proto_goTypes = nil + file_models_comment_relation_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/models/follow.pb.go b/zbook_backend/pb/models/follow.pb.go new file mode 100644 index 0000000..20fba8f --- /dev/null +++ b/zbook_backend/pb/models/follow.pb.go @@ -0,0 +1,298 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: models/follow.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Follow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FollowId int64 `protobuf:"varint,1,opt,name=follow_id,json=followId,proto3" json:"follow_id,omitempty"` + FollowerId int64 `protobuf:"varint,2,opt,name=follower_id,json=followerId,proto3" json:"follower_id,omitempty"` + FollowingId int64 `protobuf:"varint,3,opt,name=following_id,json=followingId,proto3" json:"following_id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *Follow) Reset() { + *x = Follow{} + if protoimpl.UnsafeEnabled { + mi := &file_models_follow_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Follow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Follow) ProtoMessage() {} + +func (x *Follow) ProtoReflect() protoreflect.Message { + mi := &file_models_follow_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Follow.ProtoReflect.Descriptor instead. +func (*Follow) Descriptor() ([]byte, []int) { + return file_models_follow_proto_rawDescGZIP(), []int{0} +} + +func (x *Follow) GetFollowId() int64 { + if x != nil { + return x.FollowId + } + return 0 +} + +func (x *Follow) GetFollowerId() int64 { + if x != nil { + return x.FollowerId + } + return 0 +} + +func (x *Follow) GetFollowingId() int64 { + if x != nil { + return x.FollowingId + } + return 0 +} + +func (x *Follow) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type ListFollowInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + IsFollowing bool `protobuf:"varint,3,opt,name=is_following,json=isFollowing,proto3" json:"is_following,omitempty"` + RepoCount int32 `protobuf:"varint,4,opt,name=repo_count,json=repoCount,proto3" json:"repo_count,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *ListFollowInfo) Reset() { + *x = ListFollowInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_follow_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListFollowInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowInfo) ProtoMessage() {} + +func (x *ListFollowInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_follow_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowInfo.ProtoReflect.Descriptor instead. +func (*ListFollowInfo) Descriptor() ([]byte, []int) { + return file_models_follow_proto_rawDescGZIP(), []int{1} +} + +func (x *ListFollowInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListFollowInfo) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ListFollowInfo) GetIsFollowing() bool { + if x != nil { + return x.IsFollowing + } + return false +} + +func (x *ListFollowInfo) GetRepoCount() int32 { + if x != nil { + return x.RepoCount + } + return 0 +} + +func (x *ListFollowInfo) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *ListFollowInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +var File_models_follow_proto protoreflect.FileDescriptor + +var file_models_follow_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4, 0x01, 0x0a, 0x06, 0x46, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x22, 0xfa, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x66, 0x6f, 0x6c, + 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x70, + 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, + 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x23, + 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, + 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_follow_proto_rawDescOnce sync.Once + file_models_follow_proto_rawDescData = file_models_follow_proto_rawDesc +) + +func file_models_follow_proto_rawDescGZIP() []byte { + file_models_follow_proto_rawDescOnce.Do(func() { + file_models_follow_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_follow_proto_rawDescData) + }) + return file_models_follow_proto_rawDescData +} + +var file_models_follow_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_models_follow_proto_goTypes = []interface{}{ + (*Follow)(nil), // 0: pb.Follow + (*ListFollowInfo)(nil), // 1: pb.ListFollowInfo + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_models_follow_proto_depIdxs = []int32{ + 2, // 0: pb.Follow.created_at:type_name -> google.protobuf.Timestamp + 2, // 1: pb.ListFollowInfo.updated_at:type_name -> google.protobuf.Timestamp + 2, // 2: pb.ListFollowInfo.created_at:type_name -> google.protobuf.Timestamp + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_models_follow_proto_init() } +func file_models_follow_proto_init() { + if File_models_follow_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_follow_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Follow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_follow_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFollowInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_follow_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_follow_proto_goTypes, + DependencyIndexes: file_models_follow_proto_depIdxs, + MessageInfos: file_models_follow_proto_msgTypes, + }.Build() + File_models_follow_proto = out.File + file_models_follow_proto_rawDesc = nil + file_models_follow_proto_goTypes = nil + file_models_follow_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/models/markdown.pb.go b/zbook_backend/pb/models/markdown.pb.go new file mode 100644 index 0000000..7ff3d75 --- /dev/null +++ b/zbook_backend/pb/models/markdown.pb.go @@ -0,0 +1,330 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: models/markdown.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Markdown struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MarkdownId int64 `protobuf:"varint,1,opt,name=markdown_id,json=markdownId,proto3" json:"markdown_id,omitempty"` + RelativePath string `protobuf:"bytes,2,opt,name=relative_path,json=relativePath,proto3" json:"relative_path,omitempty"` + UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + RepoId int64 `protobuf:"varint,4,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` + MainContent string `protobuf:"bytes,5,opt,name=main_content,json=mainContent,proto3" json:"main_content,omitempty"` + TableContent string `protobuf:"bytes,6,opt,name=table_content,json=tableContent,proto3" json:"table_content,omitempty"` + Md5 string `protobuf:"bytes,7,opt,name=md5,proto3" json:"md5,omitempty"` + VersionKey string `protobuf:"bytes,8,opt,name=version_key,json=versionKey,proto3" json:"version_key,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Username string `protobuf:"bytes,10,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,11,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` +} + +func (x *Markdown) Reset() { + *x = Markdown{} + if protoimpl.UnsafeEnabled { + mi := &file_models_markdown_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Markdown) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Markdown) ProtoMessage() {} + +func (x *Markdown) ProtoReflect() protoreflect.Message { + mi := &file_models_markdown_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Markdown.ProtoReflect.Descriptor instead. +func (*Markdown) Descriptor() ([]byte, []int) { + return file_models_markdown_proto_rawDescGZIP(), []int{0} +} + +func (x *Markdown) GetMarkdownId() int64 { + if x != nil { + return x.MarkdownId + } + return 0 +} + +func (x *Markdown) GetRelativePath() string { + if x != nil { + return x.RelativePath + } + return "" +} + +func (x *Markdown) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *Markdown) GetRepoId() int64 { + if x != nil { + return x.RepoId + } + return 0 +} + +func (x *Markdown) GetMainContent() string { + if x != nil { + return x.MainContent + } + return "" +} + +func (x *Markdown) GetTableContent() string { + if x != nil { + return x.TableContent + } + return "" +} + +func (x *Markdown) GetMd5() string { + if x != nil { + return x.Md5 + } + return "" +} + +func (x *Markdown) GetVersionKey() string { + if x != nil { + return x.VersionKey + } + return "" +} + +func (x *Markdown) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *Markdown) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *Markdown) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +type FooterSocial struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` +} + +func (x *FooterSocial) Reset() { + *x = FooterSocial{} + if protoimpl.UnsafeEnabled { + mi := &file_models_markdown_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FooterSocial) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FooterSocial) ProtoMessage() {} + +func (x *FooterSocial) ProtoReflect() protoreflect.Message { + mi := &file_models_markdown_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FooterSocial.ProtoReflect.Descriptor instead. +func (*FooterSocial) Descriptor() ([]byte, []int) { + return file_models_markdown_proto_rawDescGZIP(), []int{1} +} + +func (x *FooterSocial) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FooterSocial) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *FooterSocial) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +var File_models_markdown_proto protoreflect.FileDescriptor + +var file_models_markdown_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf1, 0x02, 0x0a, + 0x08, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x72, + 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, + 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x49, + 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x64, 0x35, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x64, 0x35, 0x12, 0x1f, 0x0a, 0x0b, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x39, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, + 0x22, 0x48, 0x0a, 0x0c, 0x46, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x6c, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, + 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_markdown_proto_rawDescOnce sync.Once + file_models_markdown_proto_rawDescData = file_models_markdown_proto_rawDesc +) + +func file_models_markdown_proto_rawDescGZIP() []byte { + file_models_markdown_proto_rawDescOnce.Do(func() { + file_models_markdown_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_markdown_proto_rawDescData) + }) + return file_models_markdown_proto_rawDescData +} + +var file_models_markdown_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_models_markdown_proto_goTypes = []interface{}{ + (*Markdown)(nil), // 0: pb.Markdown + (*FooterSocial)(nil), // 1: pb.FooterSocial + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_models_markdown_proto_depIdxs = []int32{ + 2, // 0: pb.Markdown.created_at:type_name -> google.protobuf.Timestamp + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_models_markdown_proto_init() } +func file_models_markdown_proto_init() { + if File_models_markdown_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_markdown_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Markdown); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_markdown_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FooterSocial); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_markdown_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_markdown_proto_goTypes, + DependencyIndexes: file_models_markdown_proto_depIdxs, + MessageInfos: file_models_markdown_proto_msgTypes, + }.Build() + File_models_markdown_proto = out.File + file_models_markdown_proto_rawDesc = nil + file_models_markdown_proto_goTypes = nil + file_models_markdown_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/models/notification.pb.go b/zbook_backend/pb/models/notification.pb.go new file mode 100644 index 0000000..614f1a0 --- /dev/null +++ b/zbook_backend/pb/models/notification.pb.go @@ -0,0 +1,585 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: models/notification.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ListFollowerNotificationInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + Readed bool `protobuf:"varint,3,opt,name=readed,proto3" json:"readed,omitempty"` + NotiId int64 `protobuf:"varint,4,opt,name=noti_id,json=notiId,proto3" json:"noti_id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *ListFollowerNotificationInfo) Reset() { + *x = ListFollowerNotificationInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_notification_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListFollowerNotificationInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowerNotificationInfo) ProtoMessage() {} + +func (x *ListFollowerNotificationInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_notification_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowerNotificationInfo.ProtoReflect.Descriptor instead. +func (*ListFollowerNotificationInfo) Descriptor() ([]byte, []int) { + return file_models_notification_proto_rawDescGZIP(), []int{0} +} + +func (x *ListFollowerNotificationInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListFollowerNotificationInfo) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ListFollowerNotificationInfo) GetReaded() bool { + if x != nil { + return x.Readed + } + return false +} + +func (x *ListFollowerNotificationInfo) GetNotiId() int64 { + if x != nil { + return x.NotiId + } + return 0 +} + +func (x *ListFollowerNotificationInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type ListRepoNotificationInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + Readed bool `protobuf:"varint,3,opt,name=readed,proto3" json:"readed,omitempty"` + NotiId int64 `protobuf:"varint,4,opt,name=noti_id,json=notiId,proto3" json:"noti_id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + RepoId int64 `protobuf:"varint,6,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` + RepoName string `protobuf:"bytes,7,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` +} + +func (x *ListRepoNotificationInfo) Reset() { + *x = ListRepoNotificationInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_notification_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRepoNotificationInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRepoNotificationInfo) ProtoMessage() {} + +func (x *ListRepoNotificationInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_notification_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRepoNotificationInfo.ProtoReflect.Descriptor instead. +func (*ListRepoNotificationInfo) Descriptor() ([]byte, []int) { + return file_models_notification_proto_rawDescGZIP(), []int{1} +} + +func (x *ListRepoNotificationInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListRepoNotificationInfo) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ListRepoNotificationInfo) GetReaded() bool { + if x != nil { + return x.Readed + } + return false +} + +func (x *ListRepoNotificationInfo) GetNotiId() int64 { + if x != nil { + return x.NotiId + } + return 0 +} + +func (x *ListRepoNotificationInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *ListRepoNotificationInfo) GetRepoId() int64 { + if x != nil { + return x.RepoId + } + return 0 +} + +func (x *ListRepoNotificationInfo) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +type ListCommentNotificationInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + Readed bool `protobuf:"varint,3,opt,name=readed,proto3" json:"readed,omitempty"` + NotiId int64 `protobuf:"varint,4,opt,name=noti_id,json=notiId,proto3" json:"noti_id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + CommentContent string `protobuf:"bytes,6,opt,name=comment_content,json=commentContent,proto3" json:"comment_content,omitempty"` + RepoId int64 `protobuf:"varint,7,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` + RelativePath string `protobuf:"bytes,8,opt,name=relative_path,json=relativePath,proto3" json:"relative_path,omitempty"` + RepoName string `protobuf:"bytes,9,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + RepoUsername string `protobuf:"bytes,10,opt,name=repo_username,json=repoUsername,proto3" json:"repo_username,omitempty"` +} + +func (x *ListCommentNotificationInfo) Reset() { + *x = ListCommentNotificationInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_notification_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentNotificationInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentNotificationInfo) ProtoMessage() {} + +func (x *ListCommentNotificationInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_notification_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentNotificationInfo.ProtoReflect.Descriptor instead. +func (*ListCommentNotificationInfo) Descriptor() ([]byte, []int) { + return file_models_notification_proto_rawDescGZIP(), []int{2} +} + +func (x *ListCommentNotificationInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListCommentNotificationInfo) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ListCommentNotificationInfo) GetReaded() bool { + if x != nil { + return x.Readed + } + return false +} + +func (x *ListCommentNotificationInfo) GetNotiId() int64 { + if x != nil { + return x.NotiId + } + return 0 +} + +func (x *ListCommentNotificationInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *ListCommentNotificationInfo) GetCommentContent() string { + if x != nil { + return x.CommentContent + } + return "" +} + +func (x *ListCommentNotificationInfo) GetRepoId() int64 { + if x != nil { + return x.RepoId + } + return 0 +} + +func (x *ListCommentNotificationInfo) GetRelativePath() string { + if x != nil { + return x.RelativePath + } + return "" +} + +func (x *ListCommentNotificationInfo) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *ListCommentNotificationInfo) GetRepoUsername() string { + if x != nil { + return x.RepoUsername + } + return "" +} + +type ListSystemNotificationInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Readed bool `protobuf:"varint,1,opt,name=readed,proto3" json:"readed,omitempty"` + NotiId int64 `protobuf:"varint,2,opt,name=noti_id,json=notiId,proto3" json:"noti_id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + Contents string `protobuf:"bytes,5,opt,name=contents,proto3" json:"contents,omitempty"` + RedirectUrl string `protobuf:"bytes,6,opt,name=redirect_url,json=redirectUrl,proto3" json:"redirect_url,omitempty"` +} + +func (x *ListSystemNotificationInfo) Reset() { + *x = ListSystemNotificationInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_notification_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSystemNotificationInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSystemNotificationInfo) ProtoMessage() {} + +func (x *ListSystemNotificationInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_notification_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSystemNotificationInfo.ProtoReflect.Descriptor instead. +func (*ListSystemNotificationInfo) Descriptor() ([]byte, []int) { + return file_models_notification_proto_rawDescGZIP(), []int{3} +} + +func (x *ListSystemNotificationInfo) GetReaded() bool { + if x != nil { + return x.Readed + } + return false +} + +func (x *ListSystemNotificationInfo) GetNotiId() int64 { + if x != nil { + return x.NotiId + } + return 0 +} + +func (x *ListSystemNotificationInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *ListSystemNotificationInfo) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *ListSystemNotificationInfo) GetContents() string { + if x != nil { + return x.Contents + } + return "" +} + +func (x *ListSystemNotificationInfo) GetRedirectUrl() string { + if x != nil { + return x.RedirectUrl + } + return "" +} + +var File_models_notification_proto protoreflect.FileDescriptor + +var file_models_notification_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xbc, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6e, + 0x6f, 0x74, 0x69, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, + 0x74, 0x69, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, + 0xee, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x16, + 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x49, 0x64, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, + 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x70, + 0x6f, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, + 0x22, 0xe4, 0x02, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, + 0x74, 0x69, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x74, + 0x69, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x27, + 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, + 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, + 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x55, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xdd, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x64, 0x69, + 0x72, 0x65, 0x63, 0x74, 0x55, 0x72, 0x6c, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, + 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_notification_proto_rawDescOnce sync.Once + file_models_notification_proto_rawDescData = file_models_notification_proto_rawDesc +) + +func file_models_notification_proto_rawDescGZIP() []byte { + file_models_notification_proto_rawDescOnce.Do(func() { + file_models_notification_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_notification_proto_rawDescData) + }) + return file_models_notification_proto_rawDescData +} + +var file_models_notification_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_models_notification_proto_goTypes = []interface{}{ + (*ListFollowerNotificationInfo)(nil), // 0: pb.ListFollowerNotificationInfo + (*ListRepoNotificationInfo)(nil), // 1: pb.ListRepoNotificationInfo + (*ListCommentNotificationInfo)(nil), // 2: pb.ListCommentNotificationInfo + (*ListSystemNotificationInfo)(nil), // 3: pb.ListSystemNotificationInfo + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp +} +var file_models_notification_proto_depIdxs = []int32{ + 4, // 0: pb.ListFollowerNotificationInfo.created_at:type_name -> google.protobuf.Timestamp + 4, // 1: pb.ListRepoNotificationInfo.created_at:type_name -> google.protobuf.Timestamp + 4, // 2: pb.ListCommentNotificationInfo.created_at:type_name -> google.protobuf.Timestamp + 4, // 3: pb.ListSystemNotificationInfo.created_at:type_name -> google.protobuf.Timestamp + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_models_notification_proto_init() } +func file_models_notification_proto_init() { + if File_models_notification_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_notification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFollowerNotificationInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_notification_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRepoNotificationInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_notification_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentNotificationInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_notification_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSystemNotificationInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_notification_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_notification_proto_goTypes, + DependencyIndexes: file_models_notification_proto_depIdxs, + MessageInfos: file_models_notification_proto_msgTypes, + }.Build() + File_models_notification_proto = out.File + file_models_notification_proto_rawDesc = nil + file_models_notification_proto_goTypes = nil + file_models_notification_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/models/repo.pb.go b/zbook_backend/pb/models/repo.pb.go new file mode 100644 index 0000000..8d88ce6 --- /dev/null +++ b/zbook_backend/pb/models/repo.pb.go @@ -0,0 +1,505 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: models/repo.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RepoBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RepoId int64 `protobuf:"varint,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + RepoDescription string `protobuf:"bytes,3,opt,name=repo_description,json=repoDescription,proto3" json:"repo_description,omitempty"` + VisibilityLevel string `protobuf:"bytes,4,opt,name=visibility_level,json=visibilityLevel,proto3" json:"visibility_level,omitempty"` + SyncToken string `protobuf:"bytes,5,opt,name=sync_token,json=syncToken,proto3" json:"sync_token,omitempty"` + GitHost string `protobuf:"bytes,7,opt,name=git_host,json=gitHost,proto3" json:"git_host,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *RepoBasicInfo) Reset() { + *x = RepoBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_repo_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RepoBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepoBasicInfo) ProtoMessage() {} + +func (x *RepoBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_repo_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RepoBasicInfo.ProtoReflect.Descriptor instead. +func (*RepoBasicInfo) Descriptor() ([]byte, []int) { + return file_models_repo_proto_rawDescGZIP(), []int{0} +} + +func (x *RepoBasicInfo) GetRepoId() int64 { + if x != nil { + return x.RepoId + } + return 0 +} + +func (x *RepoBasicInfo) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *RepoBasicInfo) GetRepoDescription() string { + if x != nil { + return x.RepoDescription + } + return "" +} + +func (x *RepoBasicInfo) GetVisibilityLevel() string { + if x != nil { + return x.VisibilityLevel + } + return "" +} + +func (x *RepoBasicInfo) GetSyncToken() string { + if x != nil { + return x.SyncToken + } + return "" +} + +func (x *RepoBasicInfo) GetGitHost() string { + if x != nil { + return x.GitHost + } + return "" +} + +func (x *RepoBasicInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *RepoBasicInfo) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +type ListRepoInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RepoId int64 `protobuf:"varint,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + RepoDescription string `protobuf:"bytes,3,opt,name=repo_description,json=repoDescription,proto3" json:"repo_description,omitempty"` + VisibilityLevel string `protobuf:"bytes,4,opt,name=visibility_level,json=visibilityLevel,proto3" json:"visibility_level,omitempty"` + GitHost string `protobuf:"bytes,6,opt,name=git_host,json=gitHost,proto3" json:"git_host,omitempty"` + LikeCount int32 `protobuf:"varint,7,opt,name=like_count,json=likeCount,proto3" json:"like_count,omitempty"` + IsLiked bool `protobuf:"varint,8,opt,name=is_liked,json=isLiked,proto3" json:"is_liked,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Username string `protobuf:"bytes,11,opt,name=username,proto3" json:"username,omitempty"` +} + +func (x *ListRepoInfo) Reset() { + *x = ListRepoInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_repo_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRepoInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRepoInfo) ProtoMessage() {} + +func (x *ListRepoInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_repo_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRepoInfo.ProtoReflect.Descriptor instead. +func (*ListRepoInfo) Descriptor() ([]byte, []int) { + return file_models_repo_proto_rawDescGZIP(), []int{1} +} + +func (x *ListRepoInfo) GetRepoId() int64 { + if x != nil { + return x.RepoId + } + return 0 +} + +func (x *ListRepoInfo) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *ListRepoInfo) GetRepoDescription() string { + if x != nil { + return x.RepoDescription + } + return "" +} + +func (x *ListRepoInfo) GetVisibilityLevel() string { + if x != nil { + return x.VisibilityLevel + } + return "" +} + +func (x *ListRepoInfo) GetGitHost() string { + if x != nil { + return x.GitHost + } + return "" +} + +func (x *ListRepoInfo) GetLikeCount() int32 { + if x != nil { + return x.LikeCount + } + return 0 +} + +func (x *ListRepoInfo) GetIsLiked() bool { + if x != nil { + return x.IsLiked + } + return false +} + +func (x *ListRepoInfo) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *ListRepoInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *ListRepoInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type RepoCountInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RepoId int64 `protobuf:"varint,1,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` + LikeCount int32 `protobuf:"varint,2,opt,name=like_count,json=likeCount,proto3" json:"like_count,omitempty"` + DislikeCount int32 `protobuf:"varint,3,opt,name=dislike_count,json=dislikeCount,proto3" json:"dislike_count,omitempty"` + SharedCount int32 `protobuf:"varint,4,opt,name=shared_count,json=sharedCount,proto3" json:"shared_count,omitempty"` + IsLiked bool `protobuf:"varint,5,opt,name=is_liked,json=isLiked,proto3" json:"is_liked,omitempty"` + IsDisliked bool `protobuf:"varint,6,opt,name=is_disliked,json=isDisliked,proto3" json:"is_disliked,omitempty"` + IsShared bool `protobuf:"varint,7,opt,name=is_shared,json=isShared,proto3" json:"is_shared,omitempty"` +} + +func (x *RepoCountInfo) Reset() { + *x = RepoCountInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_repo_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RepoCountInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepoCountInfo) ProtoMessage() {} + +func (x *RepoCountInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_repo_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RepoCountInfo.ProtoReflect.Descriptor instead. +func (*RepoCountInfo) Descriptor() ([]byte, []int) { + return file_models_repo_proto_rawDescGZIP(), []int{2} +} + +func (x *RepoCountInfo) GetRepoId() int64 { + if x != nil { + return x.RepoId + } + return 0 +} + +func (x *RepoCountInfo) GetLikeCount() int32 { + if x != nil { + return x.LikeCount + } + return 0 +} + +func (x *RepoCountInfo) GetDislikeCount() int32 { + if x != nil { + return x.DislikeCount + } + return 0 +} + +func (x *RepoCountInfo) GetSharedCount() int32 { + if x != nil { + return x.SharedCount + } + return 0 +} + +func (x *RepoCountInfo) GetIsLiked() bool { + if x != nil { + return x.IsLiked + } + return false +} + +func (x *RepoCountInfo) GetIsDisliked() bool { + if x != nil { + return x.IsDisliked + } + return false +} + +func (x *RepoCountInfo) GetIsShared() bool { + if x != nil { + return x.IsShared + } + return false +} + +var File_models_repo_proto protoreflect.FileDescriptor + +var file_models_repo_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x70, + 0x6f, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, + 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x70, + 0x6f, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x76, + 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x69, 0x74, 0x5f, 0x68, 0x6f, 0x73, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x69, 0x74, 0x48, 0x6f, 0x73, 0x74, + 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x81, 0x03, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x70, 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, + 0x10, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x69, 0x73, 0x69, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x69, 0x74, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x69, 0x74, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x6c, 0x69, 0x6b, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x6c, 0x69, 0x6b, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x6b, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x69, 0x73, 0x4c, 0x69, 0x6b, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, + 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xe8, 0x01, 0x0a, 0x0d, 0x52, + 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, + 0x65, 0x70, 0x6f, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x69, 0x6b, 0x65, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6c, 0x69, 0x6b, 0x65, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x6c, 0x69, 0x6b, 0x65, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x69, 0x73, + 0x6c, 0x69, 0x6b, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0b, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x6b, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x69, 0x73, 0x4c, 0x69, 0x6b, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x64, 0x69, + 0x73, 0x6c, 0x69, 0x6b, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, + 0x44, 0x69, 0x73, 0x6c, 0x69, 0x6b, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, + 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_models_repo_proto_rawDescOnce sync.Once + file_models_repo_proto_rawDescData = file_models_repo_proto_rawDesc +) + +func file_models_repo_proto_rawDescGZIP() []byte { + file_models_repo_proto_rawDescOnce.Do(func() { + file_models_repo_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_repo_proto_rawDescData) + }) + return file_models_repo_proto_rawDescData +} + +var file_models_repo_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_models_repo_proto_goTypes = []interface{}{ + (*RepoBasicInfo)(nil), // 0: pb.RepoBasicInfo + (*ListRepoInfo)(nil), // 1: pb.ListRepoInfo + (*RepoCountInfo)(nil), // 2: pb.RepoCountInfo + (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp +} +var file_models_repo_proto_depIdxs = []int32{ + 3, // 0: pb.RepoBasicInfo.created_at:type_name -> google.protobuf.Timestamp + 3, // 1: pb.RepoBasicInfo.updated_at:type_name -> google.protobuf.Timestamp + 3, // 2: pb.ListRepoInfo.updated_at:type_name -> google.protobuf.Timestamp + 3, // 3: pb.ListRepoInfo.created_at:type_name -> google.protobuf.Timestamp + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_models_repo_proto_init() } +func file_models_repo_proto_init() { + if File_models_repo_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_repo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RepoBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_repo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRepoInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_repo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RepoCountInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_repo_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_repo_proto_goTypes, + DependencyIndexes: file_models_repo_proto_depIdxs, + MessageInfos: file_models_repo_proto_msgTypes, + }.Build() + File_models_repo_proto = out.File + file_models_repo_proto_rawDesc = nil + file_models_repo_proto_goTypes = nil + file_models_repo_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/models/repo_relation.pb.go b/zbook_backend/pb/models/repo_relation.pb.go new file mode 100644 index 0000000..82f555b --- /dev/null +++ b/zbook_backend/pb/models/repo_relation.pb.go @@ -0,0 +1,307 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: models/repo_relation.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ListRepoReportInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReportId int64 `protobuf:"varint,1,opt,name=report_id,json=reportId,proto3" json:"report_id,omitempty"` + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + RepoId int64 `protobuf:"varint,3,opt,name=repo_id,json=repoId,proto3" json:"repo_id,omitempty"` + ReportContent string `protobuf:"bytes,4,opt,name=report_content,json=reportContent,proto3" json:"report_content,omitempty"` + Processed bool `protobuf:"varint,5,opt,name=processed,proto3" json:"processed,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *ListRepoReportInfo) Reset() { + *x = ListRepoReportInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_repo_relation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRepoReportInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRepoReportInfo) ProtoMessage() {} + +func (x *ListRepoReportInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_repo_relation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRepoReportInfo.ProtoReflect.Descriptor instead. +func (*ListRepoReportInfo) Descriptor() ([]byte, []int) { + return file_models_repo_relation_proto_rawDescGZIP(), []int{0} +} + +func (x *ListRepoReportInfo) GetReportId() int64 { + if x != nil { + return x.ReportId + } + return 0 +} + +func (x *ListRepoReportInfo) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ListRepoReportInfo) GetRepoId() int64 { + if x != nil { + return x.RepoId + } + return 0 +} + +func (x *ListRepoReportInfo) GetReportContent() string { + if x != nil { + return x.ReportContent + } + return "" +} + +func (x *ListRepoReportInfo) GetProcessed() bool { + if x != nil { + return x.Processed + } + return false +} + +func (x *ListRepoReportInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type ListUserRepoVisiblityInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + IsFollowing bool `protobuf:"varint,3,opt,name=is_following,json=isFollowing,proto3" json:"is_following,omitempty"` + IsRepoVisible bool `protobuf:"varint,4,opt,name=is_repo_visible,json=isRepoVisible,proto3" json:"is_repo_visible,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *ListUserRepoVisiblityInfo) Reset() { + *x = ListUserRepoVisiblityInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_repo_relation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserRepoVisiblityInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserRepoVisiblityInfo) ProtoMessage() {} + +func (x *ListUserRepoVisiblityInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_repo_relation_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserRepoVisiblityInfo.ProtoReflect.Descriptor instead. +func (*ListUserRepoVisiblityInfo) Descriptor() ([]byte, []int) { + return file_models_repo_relation_proto_rawDescGZIP(), []int{1} +} + +func (x *ListUserRepoVisiblityInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListUserRepoVisiblityInfo) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ListUserRepoVisiblityInfo) GetIsFollowing() bool { + if x != nil { + return x.IsFollowing + } + return false +} + +func (x *ListUserRepoVisiblityInfo) GetIsRepoVisible() bool { + if x != nil { + return x.IsRepoVisible + } + return false +} + +func (x *ListUserRepoVisiblityInfo) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +var File_models_repo_relation_proto protoreflect.FileDescriptor + +var file_models_repo_relation_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xe3, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, + 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x72, 0x65, 0x70, 0x6f, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xd3, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x74, + 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x66, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, + 0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x73, + 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, + 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x23, 0x5a, + 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, + 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_repo_relation_proto_rawDescOnce sync.Once + file_models_repo_relation_proto_rawDescData = file_models_repo_relation_proto_rawDesc +) + +func file_models_repo_relation_proto_rawDescGZIP() []byte { + file_models_repo_relation_proto_rawDescOnce.Do(func() { + file_models_repo_relation_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_repo_relation_proto_rawDescData) + }) + return file_models_repo_relation_proto_rawDescData +} + +var file_models_repo_relation_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_models_repo_relation_proto_goTypes = []interface{}{ + (*ListRepoReportInfo)(nil), // 0: pb.ListRepoReportInfo + (*ListUserRepoVisiblityInfo)(nil), // 1: pb.ListUserRepoVisiblityInfo + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_models_repo_relation_proto_depIdxs = []int32{ + 2, // 0: pb.ListRepoReportInfo.created_at:type_name -> google.protobuf.Timestamp + 2, // 1: pb.ListUserRepoVisiblityInfo.updated_at:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_models_repo_relation_proto_init() } +func file_models_repo_relation_proto_init() { + if File_models_repo_relation_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_repo_relation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRepoReportInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_repo_relation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserRepoVisiblityInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_repo_relation_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_repo_relation_proto_goTypes, + DependencyIndexes: file_models_repo_relation_proto_depIdxs, + MessageInfos: file_models_repo_relation_proto_msgTypes, + }.Build() + File_models_repo_relation_proto = out.File + file_models_repo_relation_proto_rawDesc = nil + file_models_repo_relation_proto_goTypes = nil + file_models_repo_relation_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/models/session.pb.go b/zbook_backend/pb/models/session.pb.go new file mode 100644 index 0000000..6670da8 --- /dev/null +++ b/zbook_backend/pb/models/session.pb.go @@ -0,0 +1,340 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: models/session.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Session struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + RefreshToken string `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + UserAgent string `protobuf:"bytes,4,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` + ClientIp string `protobuf:"bytes,5,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"` + Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *Session) Reset() { + *x = Session{} + if protoimpl.UnsafeEnabled { + mi := &file_models_session_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Session) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Session) ProtoMessage() {} + +func (x *Session) ProtoReflect() protoreflect.Message { + mi := &file_models_session_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Session.ProtoReflect.Descriptor instead. +func (*Session) Descriptor() ([]byte, []int) { + return file_models_session_proto_rawDescGZIP(), []int{0} +} + +func (x *Session) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *Session) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *Session) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *Session) GetUserAgent() string { + if x != nil { + return x.UserAgent + } + return "" +} + +func (x *Session) GetClientIp() string { + if x != nil { + return x.ClientIp + } + return "" +} + +func (x *Session) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *Session) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +func (x *Session) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type SessionInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + UserAgent string `protobuf:"bytes,2,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` + ClientIp string `protobuf:"bytes,3,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *SessionInfo) Reset() { + *x = SessionInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_session_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SessionInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SessionInfo) ProtoMessage() {} + +func (x *SessionInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_session_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SessionInfo.ProtoReflect.Descriptor instead. +func (*SessionInfo) Descriptor() ([]byte, []int) { + return file_models_session_proto_rawDescGZIP(), []int{1} +} + +func (x *SessionInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *SessionInfo) GetUserAgent() string { + if x != nil { + return x.UserAgent + } + return "" +} + +func (x *SessionInfo) GetClientIp() string { + if x != nil { + return x.ClientIp + } + return "" +} + +func (x *SessionInfo) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *SessionInfo) GetExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.ExpiresAt + } + return nil +} + +func (x *SessionInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +var File_models_session_proto protoreflect.FileDescriptor + +var file_models_session_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x02, 0x0a, 0x07, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, 0x65, + 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x70, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x70, + 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x22, 0xf1, 0x01, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, + 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, + 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_models_session_proto_rawDescOnce sync.Once + file_models_session_proto_rawDescData = file_models_session_proto_rawDesc +) + +func file_models_session_proto_rawDescGZIP() []byte { + file_models_session_proto_rawDescOnce.Do(func() { + file_models_session_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_session_proto_rawDescData) + }) + return file_models_session_proto_rawDescData +} + +var file_models_session_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_models_session_proto_goTypes = []interface{}{ + (*Session)(nil), // 0: pb.Session + (*SessionInfo)(nil), // 1: pb.SessionInfo + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_models_session_proto_depIdxs = []int32{ + 2, // 0: pb.Session.expires_at:type_name -> google.protobuf.Timestamp + 2, // 1: pb.Session.created_at:type_name -> google.protobuf.Timestamp + 2, // 2: pb.SessionInfo.expires_at:type_name -> google.protobuf.Timestamp + 2, // 3: pb.SessionInfo.created_at:type_name -> google.protobuf.Timestamp + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_models_session_proto_init() } +func file_models_session_proto_init() { + if File_models_session_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_session_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Session); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_session_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SessionInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_session_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_session_proto_goTypes, + DependencyIndexes: file_models_session_proto_depIdxs, + MessageInfos: file_models_session_proto_msgTypes, + }.Build() + File_models_session_proto = out.File + file_models_session_proto_rawDesc = nil + file_models_session_proto_goTypes = nil + file_models_session_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/models/user.pb.go b/zbook_backend/pb/models/user.pb.go new file mode 100644 index 0000000..23349db --- /dev/null +++ b/zbook_backend/pb/models/user.pb.go @@ -0,0 +1,691 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: models/user.proto + +package models + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UserBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + Motto string `protobuf:"bytes,4,opt,name=motto,proto3" json:"motto,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + Onboarding bool `protobuf:"varint,8,opt,name=onboarding,proto3" json:"onboarding,omitempty"` +} + +func (x *UserBasicInfo) Reset() { + *x = UserBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserBasicInfo) ProtoMessage() {} + +func (x *UserBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserBasicInfo.ProtoReflect.Descriptor instead. +func (*UserBasicInfo) Descriptor() ([]byte, []int) { + return file_models_user_proto_rawDescGZIP(), []int{0} +} + +func (x *UserBasicInfo) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UserBasicInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *UserBasicInfo) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *UserBasicInfo) GetMotto() string { + if x != nil { + return x.Motto + } + return "" +} + +func (x *UserBasicInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +func (x *UserBasicInfo) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *UserBasicInfo) GetOnboarding() bool { + if x != nil { + return x.Onboarding + } + return false +} + +type UserImageInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Avatar []byte `protobuf:"bytes,2,opt,name=avatar,proto3" json:"avatar,omitempty"` + UpdateImageInfoAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=update_image_info_at,json=updateImageInfoAt,proto3" json:"update_image_info_at,omitempty"` +} + +func (x *UserImageInfo) Reset() { + *x = UserImageInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserImageInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserImageInfo) ProtoMessage() {} + +func (x *UserImageInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserImageInfo.ProtoReflect.Descriptor instead. +func (*UserImageInfo) Descriptor() ([]byte, []int) { + return file_models_user_proto_rawDescGZIP(), []int{1} +} + +func (x *UserImageInfo) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UserImageInfo) GetAvatar() []byte { + if x != nil { + return x.Avatar + } + return nil +} + +func (x *UserImageInfo) GetUpdateImageInfoAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdateImageInfoAt + } + return nil +} + +type DailyCount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Date string `protobuf:"bytes,2,opt,name=date,proto3" json:"date,omitempty"` +} + +func (x *DailyCount) Reset() { + *x = DailyCount{} + if protoimpl.UnsafeEnabled { + mi := &file_models_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DailyCount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DailyCount) ProtoMessage() {} + +func (x *DailyCount) ProtoReflect() protoreflect.Message { + mi := &file_models_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DailyCount.ProtoReflect.Descriptor instead. +func (*DailyCount) Descriptor() ([]byte, []int) { + return file_models_user_proto_rawDescGZIP(), []int{2} +} + +func (x *DailyCount) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *DailyCount) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +type UserCount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *UserCount) Reset() { + *x = UserCount{} + if protoimpl.UnsafeEnabled { + mi := &file_models_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserCount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserCount) ProtoMessage() {} + +func (x *UserCount) ProtoReflect() protoreflect.Message { + mi := &file_models_user_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserCount.ProtoReflect.Descriptor instead. +func (*UserCount) Descriptor() ([]byte, []int) { + return file_models_user_proto_rawDescGZIP(), []int{3} +} + +func (x *UserCount) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *UserCount) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +type UserCountInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + CountLikes int32 `protobuf:"varint,2,opt,name=count_likes,json=countLikes,proto3" json:"count_likes,omitempty"` + CountFollowing int32 `protobuf:"varint,3,opt,name=count_following,json=countFollowing,proto3" json:"count_following,omitempty"` + CountFollower int32 `protobuf:"varint,4,opt,name=count_follower,json=countFollower,proto3" json:"count_follower,omitempty"` + CountRepos int32 `protobuf:"varint,5,opt,name=count_repos,json=countRepos,proto3" json:"count_repos,omitempty"` + Following bool `protobuf:"varint,6,opt,name=following,proto3" json:"following,omitempty"` +} + +func (x *UserCountInfo) Reset() { + *x = UserCountInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserCountInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserCountInfo) ProtoMessage() {} + +func (x *UserCountInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_user_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserCountInfo.ProtoReflect.Descriptor instead. +func (*UserCountInfo) Descriptor() ([]byte, []int) { + return file_models_user_proto_rawDescGZIP(), []int{4} +} + +func (x *UserCountInfo) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UserCountInfo) GetCountLikes() int32 { + if x != nil { + return x.CountLikes + } + return 0 +} + +func (x *UserCountInfo) GetCountFollowing() int32 { + if x != nil { + return x.CountFollowing + } + return 0 +} + +func (x *UserCountInfo) GetCountFollower() int32 { + if x != nil { + return x.CountFollower + } + return 0 +} + +func (x *UserCountInfo) GetCountRepos() int32 { + if x != nil { + return x.CountRepos + } + return 0 +} + +func (x *UserCountInfo) GetFollowing() bool { + if x != nil { + return x.Following + } + return false +} + +type ListUserInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` + Blocked bool `protobuf:"varint,3,opt,name=blocked,proto3" json:"blocked,omitempty"` + Verified bool `protobuf:"varint,4,opt,name=verified,proto3" json:"verified,omitempty"` + Onboarding bool `protobuf:"varint,6,opt,name=onboarding,proto3" json:"onboarding,omitempty"` + Role string `protobuf:"bytes,7,opt,name=role,proto3" json:"role,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *ListUserInfo) Reset() { + *x = ListUserInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_models_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserInfo) ProtoMessage() {} + +func (x *ListUserInfo) ProtoReflect() protoreflect.Message { + mi := &file_models_user_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserInfo.ProtoReflect.Descriptor instead. +func (*ListUserInfo) Descriptor() ([]byte, []int) { + return file_models_user_proto_rawDescGZIP(), []int{5} +} + +func (x *ListUserInfo) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListUserInfo) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ListUserInfo) GetBlocked() bool { + if x != nil { + return x.Blocked + } + return false +} + +func (x *ListUserInfo) GetVerified() bool { + if x != nil { + return x.Verified + } + return false +} + +func (x *ListUserInfo) GetOnboarding() bool { + if x != nil { + return x.Onboarding + } + return false +} + +func (x *ListUserInfo) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *ListUserInfo) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *ListUserInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +var File_models_user_proto protoreflect.FileDescriptor + +var file_models_user_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x02, 0x0a, 0x0d, 0x55, 0x73, 0x65, + 0x72, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x74, 0x74, 0x6f, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x74, 0x74, 0x6f, 0x12, 0x39, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x22, 0x8d, 0x01, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x61, 0x76, + 0x61, 0x74, 0x61, 0x72, 0x12, 0x4b, 0x0a, 0x14, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x41, + 0x74, 0x22, 0x36, 0x0a, 0x0a, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3d, 0x0a, 0x09, 0x55, 0x73, 0x65, + 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xd8, 0x01, 0x0a, 0x0d, 0x55, 0x73, 0x65, + 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6c, 0x69, 0x6b, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4c, + 0x69, 0x6b, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x0a, + 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x46, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x72, 0x65, + 0x70, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x70, 0x6f, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, + 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x69, 0x6e, 0x67, 0x22, 0xa0, 0x02, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, + 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0a, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, + 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_models_user_proto_rawDescOnce sync.Once + file_models_user_proto_rawDescData = file_models_user_proto_rawDesc +) + +func file_models_user_proto_rawDescGZIP() []byte { + file_models_user_proto_rawDescOnce.Do(func() { + file_models_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_user_proto_rawDescData) + }) + return file_models_user_proto_rawDescData +} + +var file_models_user_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_models_user_proto_goTypes = []interface{}{ + (*UserBasicInfo)(nil), // 0: pb.UserBasicInfo + (*UserImageInfo)(nil), // 1: pb.UserImageInfo + (*DailyCount)(nil), // 2: pb.DailyCount + (*UserCount)(nil), // 3: pb.UserCount + (*UserCountInfo)(nil), // 4: pb.UserCountInfo + (*ListUserInfo)(nil), // 5: pb.ListUserInfo + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp +} +var file_models_user_proto_depIdxs = []int32{ + 6, // 0: pb.UserBasicInfo.created_at:type_name -> google.protobuf.Timestamp + 6, // 1: pb.UserBasicInfo.updated_at:type_name -> google.protobuf.Timestamp + 6, // 2: pb.UserImageInfo.update_image_info_at:type_name -> google.protobuf.Timestamp + 6, // 3: pb.ListUserInfo.updated_at:type_name -> google.protobuf.Timestamp + 6, // 4: pb.ListUserInfo.created_at:type_name -> google.protobuf.Timestamp + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_models_user_proto_init() } +func file_models_user_proto_init() { + if File_models_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserImageInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DailyCount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserCount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserCountInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_models_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_models_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_user_proto_goTypes, + DependencyIndexes: file_models_user_proto_depIdxs, + MessageInfos: file_models_user_proto_msgTypes, + }.Build() + File_models_user_proto = out.File + file_models_user_proto_rawDesc = nil + file_models_user_proto_goTypes = nil + file_models_user_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_admin.pb.go b/zbook_backend/pb/rpcs/rpc_admin.pb.go new file mode 100644 index 0000000..ffb0965 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_admin.pb.go @@ -0,0 +1,2698 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_admin.proto + +package rpcs + +import ( + models "github.com/zizdlp/zbook/pb/models" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.UpdateUserBlock +type UpdateUserBlockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Blocked bool `protobuf:"varint,2,opt,name=blocked,proto3" json:"blocked,omitempty"` +} + +func (x *UpdateUserBlockRequest) Reset() { + *x = UpdateUserBlockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserBlockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserBlockRequest) ProtoMessage() {} + +func (x *UpdateUserBlockRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserBlockRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserBlockRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{0} +} + +func (x *UpdateUserBlockRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *UpdateUserBlockRequest) GetBlocked() bool { + if x != nil { + return x.Blocked + } + return false +} + +type UpdateUserBlockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blocked bool `protobuf:"varint,1,opt,name=blocked,proto3" json:"blocked,omitempty"` +} + +func (x *UpdateUserBlockResponse) Reset() { + *x = UpdateUserBlockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserBlockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserBlockResponse) ProtoMessage() {} + +func (x *UpdateUserBlockResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserBlockResponse.ProtoReflect.Descriptor instead. +func (*UpdateUserBlockResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{1} +} + +func (x *UpdateUserBlockResponse) GetBlocked() bool { + if x != nil { + return x.Blocked + } + return false +} + +// 2.DeleteUser +type DeleteUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` +} + +func (x *DeleteUserRequest) Reset() { + *x = DeleteUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserRequest) ProtoMessage() {} + +func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. +func (*DeleteUserRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{2} +} + +func (x *DeleteUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type DeleteUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteUserResponse) Reset() { + *x = DeleteUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserResponse) ProtoMessage() {} + +func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead. +func (*DeleteUserResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{3} +} + +// 3.CreateSystemNotification +type CreateSystemNotificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Contents string `protobuf:"bytes,3,opt,name=contents,proto3" json:"contents,omitempty"` + RedirectUrl string `protobuf:"bytes,4,opt,name=redirect_url,json=redirectUrl,proto3" json:"redirect_url,omitempty"` +} + +func (x *CreateSystemNotificationRequest) Reset() { + *x = CreateSystemNotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateSystemNotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSystemNotificationRequest) ProtoMessage() {} + +func (x *CreateSystemNotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSystemNotificationRequest.ProtoReflect.Descriptor instead. +func (*CreateSystemNotificationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateSystemNotificationRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *CreateSystemNotificationRequest) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *CreateSystemNotificationRequest) GetContents() string { + if x != nil { + return x.Contents + } + return "" +} + +func (x *CreateSystemNotificationRequest) GetRedirectUrl() string { + if x != nil { + return x.RedirectUrl + } + return "" +} + +type CreateSystemNotificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateSystemNotificationResponse) Reset() { + *x = CreateSystemNotificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateSystemNotificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateSystemNotificationResponse) ProtoMessage() {} + +func (x *CreateSystemNotificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateSystemNotificationResponse.ProtoReflect.Descriptor instead. +func (*CreateSystemNotificationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{5} +} + +// 4.UpdateCommentReportStatus +type UpdateCommentReportStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReportId int64 `protobuf:"varint,1,opt,name=report_id,json=reportId,proto3" json:"report_id,omitempty"` + Processed bool `protobuf:"varint,2,opt,name=processed,proto3" json:"processed,omitempty"` +} + +func (x *UpdateCommentReportStatusRequest) Reset() { + *x = UpdateCommentReportStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateCommentReportStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCommentReportStatusRequest) ProtoMessage() {} + +func (x *UpdateCommentReportStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateCommentReportStatusRequest.ProtoReflect.Descriptor instead. +func (*UpdateCommentReportStatusRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateCommentReportStatusRequest) GetReportId() int64 { + if x != nil { + return x.ReportId + } + return 0 +} + +func (x *UpdateCommentReportStatusRequest) GetProcessed() bool { + if x != nil { + return x.Processed + } + return false +} + +type UpdateCommentReportStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateCommentReportStatusResponse) Reset() { + *x = UpdateCommentReportStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateCommentReportStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCommentReportStatusResponse) ProtoMessage() {} + +func (x *UpdateCommentReportStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateCommentReportStatusResponse.ProtoReflect.Descriptor instead. +func (*UpdateCommentReportStatusResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{7} +} + +// 5.ListSession +type ListSessionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListSessionRequest) Reset() { + *x = ListSessionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSessionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSessionRequest) ProtoMessage() {} + +func (x *ListSessionRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSessionRequest.ProtoReflect.Descriptor instead. +func (*ListSessionRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{8} +} + +func (x *ListSessionRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListSessionRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListSessionRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListSessionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.SessionInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListSessionResponse) Reset() { + *x = ListSessionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSessionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSessionResponse) ProtoMessage() {} + +func (x *ListSessionResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSessionResponse.ProtoReflect.Descriptor instead. +func (*ListSessionResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{9} +} + +func (x *ListSessionResponse) GetElements() []*models.SessionInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 6.GetListSessionCount +type GetListSessionCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *GetListSessionCountRequest) Reset() { + *x = GetListSessionCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListSessionCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListSessionCountRequest) ProtoMessage() {} + +func (x *GetListSessionCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListSessionCountRequest.ProtoReflect.Descriptor instead. +func (*GetListSessionCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{10} +} + +func (x *GetListSessionCountRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type GetListSessionCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListSessionCountResponse) Reset() { + *x = GetListSessionCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListSessionCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListSessionCountResponse) ProtoMessage() {} + +func (x *GetListSessionCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListSessionCountResponse.ProtoReflect.Descriptor instead. +func (*GetListSessionCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{11} +} + +func (x *GetListSessionCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 7.ListComment +type ListCommentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListCommentRequest) Reset() { + *x = ListCommentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentRequest) ProtoMessage() {} + +func (x *ListCommentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentRequest.ProtoReflect.Descriptor instead. +func (*ListCommentRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{12} +} + +func (x *ListCommentRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListCommentRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListCommentRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListCommentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListAdminCommentInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListCommentResponse) Reset() { + *x = ListCommentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentResponse) ProtoMessage() {} + +func (x *ListCommentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentResponse.ProtoReflect.Descriptor instead. +func (*ListCommentResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{13} +} + +func (x *ListCommentResponse) GetElements() []*models.ListAdminCommentInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 8.GetListCommentCount +type GetListCommentCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *GetListCommentCountRequest) Reset() { + *x = GetListCommentCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListCommentCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListCommentCountRequest) ProtoMessage() {} + +func (x *GetListCommentCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListCommentCountRequest.ProtoReflect.Descriptor instead. +func (*GetListCommentCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{14} +} + +func (x *GetListCommentCountRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type GetListCommentCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListCommentCountResponse) Reset() { + *x = GetListCommentCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListCommentCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListCommentCountResponse) ProtoMessage() {} + +func (x *GetListCommentCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListCommentCountResponse.ProtoReflect.Descriptor instead. +func (*GetListCommentCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{15} +} + +func (x *GetListCommentCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 9.ListCommentReport +type ListCommentReportRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListCommentReportRequest) Reset() { + *x = ListCommentReportRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentReportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentReportRequest) ProtoMessage() {} + +func (x *ListCommentReportRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentReportRequest.ProtoReflect.Descriptor instead. +func (*ListCommentReportRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{16} +} + +func (x *ListCommentReportRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListCommentReportRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListCommentReportRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListCommentReportResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListCommentReportInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListCommentReportResponse) Reset() { + *x = ListCommentReportResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentReportResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentReportResponse) ProtoMessage() {} + +func (x *ListCommentReportResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentReportResponse.ProtoReflect.Descriptor instead. +func (*ListCommentReportResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{17} +} + +func (x *ListCommentReportResponse) GetElements() []*models.ListCommentReportInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 10.GetListCommentReportCount +type GetListCommentReportCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetListCommentReportCountRequest) Reset() { + *x = GetListCommentReportCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListCommentReportCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListCommentReportCountRequest) ProtoMessage() {} + +func (x *GetListCommentReportCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListCommentReportCountRequest.ProtoReflect.Descriptor instead. +func (*GetListCommentReportCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{18} +} + +type GetListCommentReportCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListCommentReportCountResponse) Reset() { + *x = GetListCommentReportCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListCommentReportCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListCommentReportCountResponse) ProtoMessage() {} + +func (x *GetListCommentReportCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListCommentReportCountResponse.ProtoReflect.Descriptor instead. +func (*GetListCommentReportCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{19} +} + +func (x *GetListCommentReportCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 11.GetDailyVisitorCount +type GetDailyVisitorCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TimeZone string `protobuf:"bytes,1,opt,name=time_zone,json=timeZone,proto3" json:"time_zone,omitempty"` + Ndays int32 `protobuf:"varint,2,opt,name=ndays,proto3" json:"ndays,omitempty"` +} + +func (x *GetDailyVisitorCountRequest) Reset() { + *x = GetDailyVisitorCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDailyVisitorCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDailyVisitorCountRequest) ProtoMessage() {} + +func (x *GetDailyVisitorCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDailyVisitorCountRequest.ProtoReflect.Descriptor instead. +func (*GetDailyVisitorCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{20} +} + +func (x *GetDailyVisitorCountRequest) GetTimeZone() string { + if x != nil { + return x.TimeZone + } + return "" +} + +func (x *GetDailyVisitorCountRequest) GetNdays() int32 { + if x != nil { + return x.Ndays + } + return 0 +} + +type GetDailyVisitorCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dates []string `protobuf:"bytes,1,rep,name=dates,proto3" json:"dates,omitempty"` + Counts []int32 `protobuf:"varint,2,rep,packed,name=counts,proto3" json:"counts,omitempty"` +} + +func (x *GetDailyVisitorCountResponse) Reset() { + *x = GetDailyVisitorCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDailyVisitorCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDailyVisitorCountResponse) ProtoMessage() {} + +func (x *GetDailyVisitorCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDailyVisitorCountResponse.ProtoReflect.Descriptor instead. +func (*GetDailyVisitorCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{21} +} + +func (x *GetDailyVisitorCountResponse) GetDates() []string { + if x != nil { + return x.Dates + } + return nil +} + +func (x *GetDailyVisitorCountResponse) GetCounts() []int32 { + if x != nil { + return x.Counts + } + return nil +} + +// 12.GetDailyActiveUserCount +type GetDailyActiveUserCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TimeZone string `protobuf:"bytes,1,opt,name=time_zone,json=timeZone,proto3" json:"time_zone,omitempty"` + Ndays int32 `protobuf:"varint,2,opt,name=ndays,proto3" json:"ndays,omitempty"` +} + +func (x *GetDailyActiveUserCountRequest) Reset() { + *x = GetDailyActiveUserCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDailyActiveUserCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDailyActiveUserCountRequest) ProtoMessage() {} + +func (x *GetDailyActiveUserCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDailyActiveUserCountRequest.ProtoReflect.Descriptor instead. +func (*GetDailyActiveUserCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{22} +} + +func (x *GetDailyActiveUserCountRequest) GetTimeZone() string { + if x != nil { + return x.TimeZone + } + return "" +} + +func (x *GetDailyActiveUserCountRequest) GetNdays() int32 { + if x != nil { + return x.Ndays + } + return 0 +} + +type GetDailyActiveUserCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dates []string `protobuf:"bytes,1,rep,name=dates,proto3" json:"dates,omitempty"` + Counts []int32 `protobuf:"varint,2,rep,packed,name=counts,proto3" json:"counts,omitempty"` +} + +func (x *GetDailyActiveUserCountResponse) Reset() { + *x = GetDailyActiveUserCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDailyActiveUserCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDailyActiveUserCountResponse) ProtoMessage() {} + +func (x *GetDailyActiveUserCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDailyActiveUserCountResponse.ProtoReflect.Descriptor instead. +func (*GetDailyActiveUserCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{23} +} + +func (x *GetDailyActiveUserCountResponse) GetDates() []string { + if x != nil { + return x.Dates + } + return nil +} + +func (x *GetDailyActiveUserCountResponse) GetCounts() []int32 { + if x != nil { + return x.Counts + } + return nil +} + +// 13.GetDailyCreateUserCount +type GetDailyCreateUserCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TimeZone string `protobuf:"bytes,1,opt,name=time_zone,json=timeZone,proto3" json:"time_zone,omitempty"` + Ndays int32 `protobuf:"varint,2,opt,name=ndays,proto3" json:"ndays,omitempty"` +} + +func (x *GetDailyCreateUserCountRequest) Reset() { + *x = GetDailyCreateUserCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDailyCreateUserCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDailyCreateUserCountRequest) ProtoMessage() {} + +func (x *GetDailyCreateUserCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDailyCreateUserCountRequest.ProtoReflect.Descriptor instead. +func (*GetDailyCreateUserCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{24} +} + +func (x *GetDailyCreateUserCountRequest) GetTimeZone() string { + if x != nil { + return x.TimeZone + } + return "" +} + +func (x *GetDailyCreateUserCountRequest) GetNdays() int32 { + if x != nil { + return x.Ndays + } + return 0 +} + +type GetDailyCreateUserCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dates []string `protobuf:"bytes,1,rep,name=dates,proto3" json:"dates,omitempty"` + Counts []int32 `protobuf:"varint,2,rep,packed,name=counts,proto3" json:"counts,omitempty"` +} + +func (x *GetDailyCreateUserCountResponse) Reset() { + *x = GetDailyCreateUserCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDailyCreateUserCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDailyCreateUserCountResponse) ProtoMessage() {} + +func (x *GetDailyCreateUserCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetDailyCreateUserCountResponse.ProtoReflect.Descriptor instead. +func (*GetDailyCreateUserCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{25} +} + +func (x *GetDailyCreateUserCountResponse) GetDates() []string { + if x != nil { + return x.Dates + } + return nil +} + +func (x *GetDailyCreateUserCountResponse) GetCounts() []int32 { + if x != nil { + return x.Counts + } + return nil +} + +// 14.LogVisitor +type LogVisitorRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LogVisitorRequest) Reset() { + *x = LogVisitorRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogVisitorRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogVisitorRequest) ProtoMessage() {} + +func (x *LogVisitorRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[26] + 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 LogVisitorRequest.ProtoReflect.Descriptor instead. +func (*LogVisitorRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{26} +} + +type LogVisitorResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LogVisitorResponse) Reset() { + *x = LogVisitorResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogVisitorResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogVisitorResponse) ProtoMessage() {} + +func (x *LogVisitorResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[27] + 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 LogVisitorResponse.ProtoReflect.Descriptor instead. +func (*LogVisitorResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{27} +} + +type ParsedIPData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + City string `protobuf:"bytes,1,opt,name=city,proto3" json:"city,omitempty"` + Lat float64 `protobuf:"fixed64,2,opt,name=lat,proto3" json:"lat,omitempty"` + Long float64 `protobuf:"fixed64,3,opt,name=long,proto3" json:"long,omitempty"` +} + +func (x *ParsedIPData) Reset() { + *x = ParsedIPData{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ParsedIPData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ParsedIPData) ProtoMessage() {} + +func (x *ParsedIPData) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[28] + 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 ParsedIPData.ProtoReflect.Descriptor instead. +func (*ParsedIPData) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{28} +} + +func (x *ParsedIPData) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *ParsedIPData) GetLat() float64 { + if x != nil { + return x.Lat + } + return 0 +} + +func (x *ParsedIPData) GetLong() float64 { + if x != nil { + return x.Long + } + return 0 +} + +type Visitor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IP string `protobuf:"bytes,1,opt,name=IP,proto3" json:"IP,omitempty"` + Agent string `protobuf:"bytes,2,opt,name=Agent,proto3" json:"Agent,omitempty"` + Count int32 `protobuf:"varint,3,opt,name=Count,proto3" json:"Count,omitempty"` + City string `protobuf:"bytes,4,opt,name=city,proto3" json:"city,omitempty"` + Lat float64 `protobuf:"fixed64,5,opt,name=lat,proto3" json:"lat,omitempty"` + Long float64 `protobuf:"fixed64,6,opt,name=long,proto3" json:"long,omitempty"` +} + +func (x *Visitor) Reset() { + *x = Visitor{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Visitor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Visitor) ProtoMessage() {} + +func (x *Visitor) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[29] + 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 Visitor.ProtoReflect.Descriptor instead. +func (*Visitor) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{29} +} + +func (x *Visitor) GetIP() string { + if x != nil { + return x.IP + } + return "" +} + +func (x *Visitor) GetAgent() string { + if x != nil { + return x.Agent + } + return "" +} + +func (x *Visitor) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *Visitor) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *Visitor) GetLat() float64 { + if x != nil { + return x.Lat + } + return 0 +} + +func (x *Visitor) GetLong() float64 { + if x != nil { + return x.Long + } + return 0 +} + +// 16.GetDailyVisitors +type GetDailyVisitorsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ndays int32 `protobuf:"varint,1,opt,name=ndays,proto3" json:"ndays,omitempty"` + Lang string `protobuf:"bytes,2,opt,name=lang,proto3" json:"lang,omitempty"` +} + +func (x *GetDailyVisitorsRequest) Reset() { + *x = GetDailyVisitorsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDailyVisitorsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDailyVisitorsRequest) ProtoMessage() {} + +func (x *GetDailyVisitorsRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[30] + 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 GetDailyVisitorsRequest.ProtoReflect.Descriptor instead. +func (*GetDailyVisitorsRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{30} +} + +func (x *GetDailyVisitorsRequest) GetNdays() int32 { + if x != nil { + return x.Ndays + } + return 0 +} + +func (x *GetDailyVisitorsRequest) GetLang() string { + if x != nil { + return x.Lang + } + return "" +} + +type GetDailyVisitorsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Visitors []*Visitor `protobuf:"bytes,1,rep,name=visitors,proto3" json:"visitors,omitempty"` +} + +func (x *GetDailyVisitorsResponse) Reset() { + *x = GetDailyVisitorsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetDailyVisitorsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetDailyVisitorsResponse) ProtoMessage() {} + +func (x *GetDailyVisitorsResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[31] + 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 GetDailyVisitorsResponse.ProtoReflect.Descriptor instead. +func (*GetDailyVisitorsResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{31} +} + +func (x *GetDailyVisitorsResponse) GetVisitors() []*Visitor { + if x != nil { + return x.Visitors + } + return nil +} + +// 17.GetConfiguration +type GetConfigurationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConfigName string `protobuf:"bytes,1,opt,name=config_name,json=configName,proto3" json:"config_name,omitempty"` +} + +func (x *GetConfigurationRequest) Reset() { + *x = GetConfigurationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConfigurationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConfigurationRequest) ProtoMessage() {} + +func (x *GetConfigurationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[32] + 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 GetConfigurationRequest.ProtoReflect.Descriptor instead. +func (*GetConfigurationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{32} +} + +func (x *GetConfigurationRequest) GetConfigName() string { + if x != nil { + return x.ConfigName + } + return "" +} + +type GetConfigurationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConfigValue bool `protobuf:"varint,1,opt,name=config_value,json=configValue,proto3" json:"config_value,omitempty"` +} + +func (x *GetConfigurationResponse) Reset() { + *x = GetConfigurationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetConfigurationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetConfigurationResponse) ProtoMessage() {} + +func (x *GetConfigurationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[33] + 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 GetConfigurationResponse.ProtoReflect.Descriptor instead. +func (*GetConfigurationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{33} +} + +func (x *GetConfigurationResponse) GetConfigValue() bool { + if x != nil { + return x.ConfigValue + } + return false +} + +// 18.UpdateConfiguration +type UpdateConfigurationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConfigName string `protobuf:"bytes,1,opt,name=config_name,json=configName,proto3" json:"config_name,omitempty"` + ConfigValue bool `protobuf:"varint,2,opt,name=config_value,json=configValue,proto3" json:"config_value,omitempty"` +} + +func (x *UpdateConfigurationRequest) Reset() { + *x = UpdateConfigurationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateConfigurationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateConfigurationRequest) ProtoMessage() {} + +func (x *UpdateConfigurationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[34] + 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 UpdateConfigurationRequest.ProtoReflect.Descriptor instead. +func (*UpdateConfigurationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{34} +} + +func (x *UpdateConfigurationRequest) GetConfigName() string { + if x != nil { + return x.ConfigName + } + return "" +} + +func (x *UpdateConfigurationRequest) GetConfigValue() bool { + if x != nil { + return x.ConfigValue + } + return false +} + +type UpdateConfigurationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateConfigurationResponse) Reset() { + *x = UpdateConfigurationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateConfigurationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateConfigurationResponse) ProtoMessage() {} + +func (x *UpdateConfigurationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[35] + 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 UpdateConfigurationResponse.ProtoReflect.Descriptor instead. +func (*UpdateConfigurationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{35} +} + +// 19.SendInvitation +type SendInvitationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *SendInvitationRequest) Reset() { + *x = SendInvitationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendInvitationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendInvitationRequest) ProtoMessage() {} + +func (x *SendInvitationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[36] + 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 SendInvitationRequest.ProtoReflect.Descriptor instead. +func (*SendInvitationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{36} +} + +func (x *SendInvitationRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type SendInvitationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsSend bool `protobuf:"varint,1,opt,name=is_send,json=isSend,proto3" json:"is_send,omitempty"` +} + +func (x *SendInvitationResponse) Reset() { + *x = SendInvitationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_admin_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendInvitationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendInvitationResponse) ProtoMessage() {} + +func (x *SendInvitationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_admin_proto_msgTypes[37] + 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 SendInvitationResponse.ProtoReflect.Descriptor instead. +func (*SendInvitationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_admin_proto_rawDescGZIP(), []int{37} +} + +func (x *SendInvitationResponse) GetIsSend() bool { + if x != nil { + return x.IsSend + } + return false +} + +var File_rpcs_rpc_admin_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_admin_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x14, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x73, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x14, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x33, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x2f, 0x0a, 0x11, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x92, 0x01, 0x0a, 0x1f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x65, 0x64, 0x69, 0x72, + 0x65, 0x63, 0x74, 0x55, 0x72, 0x6c, 0x22, 0x22, 0x0a, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5d, 0x0a, 0x20, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x22, 0x23, 0x0a, 0x21, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, + 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x22, 0x42, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x22, 0x32, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x33, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x60, 0x0a, + 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, + 0x4b, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x32, 0x0a, 0x1a, + 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x22, 0x33, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x66, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, + 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x52, 0x0a, + 0x19, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0x22, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x39, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x22, 0x50, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x56, 0x69, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x6e, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x64, 0x61, + 0x79, 0x73, 0x22, 0x4c, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x56, 0x69, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x05, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, + 0x22, 0x53, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x6e, 0x64, 0x61, 0x79, 0x73, 0x22, 0x4f, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, + 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x61, 0x74, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x53, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, + 0x6c, 0x79, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x5f, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, + 0x65, 0x5a, 0x6f, 0x6e, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x64, 0x61, 0x79, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x64, 0x61, 0x79, 0x73, 0x22, 0x4f, 0x0a, 0x1f, 0x47, + 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x13, 0x0a, 0x11, + 0x4c, 0x6f, 0x67, 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x6f, 0x67, 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x73, 0x65, + 0x64, 0x49, 0x50, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6c, + 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x61, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6c, 0x6f, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6c, 0x6f, 0x6e, + 0x67, 0x22, 0x7f, 0x0a, 0x07, 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, + 0x49, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x50, 0x12, 0x14, 0x0a, 0x05, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6c, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x61, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6c, 0x6f, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6c, 0x6f, + 0x6e, 0x67, 0x22, 0x43, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x56, 0x69, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x6e, 0x64, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x64, + 0x61, 0x79, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0x43, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x44, 0x61, + 0x69, 0x6c, 0x79, 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x08, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x52, 0x08, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x3a, 0x0a, 0x17, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x3d, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x60, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x1d, 0x0a, 0x1b, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x0a, 0x15, 0x53, 0x65, 0x6e, 0x64, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x31, 0x0a, 0x16, 0x53, 0x65, 0x6e, 0x64, 0x49, + 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, + 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_admin_proto_rawDescOnce sync.Once + file_rpcs_rpc_admin_proto_rawDescData = file_rpcs_rpc_admin_proto_rawDesc +) + +func file_rpcs_rpc_admin_proto_rawDescGZIP() []byte { + file_rpcs_rpc_admin_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_admin_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_admin_proto_rawDescData) + }) + return file_rpcs_rpc_admin_proto_rawDescData +} + +var file_rpcs_rpc_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 38) +var file_rpcs_rpc_admin_proto_goTypes = []interface{}{ + (*UpdateUserBlockRequest)(nil), // 0: pb.UpdateUserBlockRequest + (*UpdateUserBlockResponse)(nil), // 1: pb.UpdateUserBlockResponse + (*DeleteUserRequest)(nil), // 2: pb.DeleteUserRequest + (*DeleteUserResponse)(nil), // 3: pb.DeleteUserResponse + (*CreateSystemNotificationRequest)(nil), // 4: pb.CreateSystemNotificationRequest + (*CreateSystemNotificationResponse)(nil), // 5: pb.CreateSystemNotificationResponse + (*UpdateCommentReportStatusRequest)(nil), // 6: pb.UpdateCommentReportStatusRequest + (*UpdateCommentReportStatusResponse)(nil), // 7: pb.UpdateCommentReportStatusResponse + (*ListSessionRequest)(nil), // 8: pb.ListSessionRequest + (*ListSessionResponse)(nil), // 9: pb.ListSessionResponse + (*GetListSessionCountRequest)(nil), // 10: pb.GetListSessionCountRequest + (*GetListSessionCountResponse)(nil), // 11: pb.GetListSessionCountResponse + (*ListCommentRequest)(nil), // 12: pb.ListCommentRequest + (*ListCommentResponse)(nil), // 13: pb.ListCommentResponse + (*GetListCommentCountRequest)(nil), // 14: pb.GetListCommentCountRequest + (*GetListCommentCountResponse)(nil), // 15: pb.GetListCommentCountResponse + (*ListCommentReportRequest)(nil), // 16: pb.ListCommentReportRequest + (*ListCommentReportResponse)(nil), // 17: pb.ListCommentReportResponse + (*GetListCommentReportCountRequest)(nil), // 18: pb.GetListCommentReportCountRequest + (*GetListCommentReportCountResponse)(nil), // 19: pb.GetListCommentReportCountResponse + (*GetDailyVisitorCountRequest)(nil), // 20: pb.GetDailyVisitorCountRequest + (*GetDailyVisitorCountResponse)(nil), // 21: pb.GetDailyVisitorCountResponse + (*GetDailyActiveUserCountRequest)(nil), // 22: pb.GetDailyActiveUserCountRequest + (*GetDailyActiveUserCountResponse)(nil), // 23: pb.GetDailyActiveUserCountResponse + (*GetDailyCreateUserCountRequest)(nil), // 24: pb.GetDailyCreateUserCountRequest + (*GetDailyCreateUserCountResponse)(nil), // 25: pb.GetDailyCreateUserCountResponse + (*LogVisitorRequest)(nil), // 26: pb.LogVisitorRequest + (*LogVisitorResponse)(nil), // 27: pb.LogVisitorResponse + (*ParsedIPData)(nil), // 28: pb.ParsedIPData + (*Visitor)(nil), // 29: pb.Visitor + (*GetDailyVisitorsRequest)(nil), // 30: pb.GetDailyVisitorsRequest + (*GetDailyVisitorsResponse)(nil), // 31: pb.GetDailyVisitorsResponse + (*GetConfigurationRequest)(nil), // 32: pb.GetConfigurationRequest + (*GetConfigurationResponse)(nil), // 33: pb.GetConfigurationResponse + (*UpdateConfigurationRequest)(nil), // 34: pb.UpdateConfigurationRequest + (*UpdateConfigurationResponse)(nil), // 35: pb.UpdateConfigurationResponse + (*SendInvitationRequest)(nil), // 36: pb.SendInvitationRequest + (*SendInvitationResponse)(nil), // 37: pb.SendInvitationResponse + (*models.SessionInfo)(nil), // 38: pb.SessionInfo + (*models.ListAdminCommentInfo)(nil), // 39: pb.ListAdminCommentInfo + (*models.ListCommentReportInfo)(nil), // 40: pb.ListCommentReportInfo +} +var file_rpcs_rpc_admin_proto_depIdxs = []int32{ + 38, // 0: pb.ListSessionResponse.elements:type_name -> pb.SessionInfo + 39, // 1: pb.ListCommentResponse.elements:type_name -> pb.ListAdminCommentInfo + 40, // 2: pb.ListCommentReportResponse.elements:type_name -> pb.ListCommentReportInfo + 29, // 3: pb.GetDailyVisitorsResponse.visitors:type_name -> pb.Visitor + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_admin_proto_init() } +func file_rpcs_rpc_admin_proto_init() { + if File_rpcs_rpc_admin_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_admin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserBlockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserBlockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateSystemNotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateSystemNotificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCommentReportStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCommentReportStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSessionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSessionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListSessionCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListSessionCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListCommentCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListCommentCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentReportRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentReportResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListCommentReportCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListCommentReportCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDailyVisitorCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDailyVisitorCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDailyActiveUserCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDailyActiveUserCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDailyCreateUserCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDailyCreateUserCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogVisitorRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogVisitorResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ParsedIPData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Visitor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDailyVisitorsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDailyVisitorsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConfigurationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetConfigurationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateConfigurationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateConfigurationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendInvitationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_admin_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendInvitationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_admin_proto_rawDesc, + NumEnums: 0, + NumMessages: 38, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_admin_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_admin_proto_depIdxs, + MessageInfos: file_rpcs_rpc_admin_proto_msgTypes, + }.Build() + File_rpcs_rpc_admin_proto = out.File + file_rpcs_rpc_admin_proto_rawDesc = nil + file_rpcs_rpc_admin_proto_goTypes = nil + file_rpcs_rpc_admin_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_comment.pb.go b/zbook_backend/pb/rpcs/rpc_comment.pb.go new file mode 100644 index 0000000..26ade73 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_comment.pb.go @@ -0,0 +1,914 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_comment.proto + +package rpcs + +import ( + models "github.com/zizdlp/zbook/pb/models" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.CreateComment +type CreateCommentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MarkdownId int64 `protobuf:"varint,1,opt,name=markdown_id,json=markdownId,proto3" json:"markdown_id,omitempty"` + ParentId int64 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` + CommentContent string `protobuf:"bytes,3,opt,name=comment_content,json=commentContent,proto3" json:"comment_content,omitempty"` +} + +func (x *CreateCommentRequest) Reset() { + *x = CreateCommentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCommentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCommentRequest) ProtoMessage() {} + +func (x *CreateCommentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCommentRequest.ProtoReflect.Descriptor instead. +func (*CreateCommentRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateCommentRequest) GetMarkdownId() int64 { + if x != nil { + return x.MarkdownId + } + return 0 +} + +func (x *CreateCommentRequest) GetParentId() int64 { + if x != nil { + return x.ParentId + } + return 0 +} + +func (x *CreateCommentRequest) GetCommentContent() string { + if x != nil { + return x.CommentContent + } + return "" +} + +type CreateCommentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Comment *models.CommentBasicInfo `protobuf:"bytes,1,opt,name=comment,proto3" json:"comment,omitempty"` +} + +func (x *CreateCommentResponse) Reset() { + *x = CreateCommentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCommentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCommentResponse) ProtoMessage() {} + +func (x *CreateCommentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCommentResponse.ProtoReflect.Descriptor instead. +func (*CreateCommentResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateCommentResponse) GetComment() *models.CommentBasicInfo { + if x != nil { + return x.Comment + } + return nil +} + +// 2.DeleteComment +type DeleteCommentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentId int64 `protobuf:"varint,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` +} + +func (x *DeleteCommentRequest) Reset() { + *x = DeleteCommentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteCommentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCommentRequest) ProtoMessage() {} + +func (x *DeleteCommentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCommentRequest.ProtoReflect.Descriptor instead. +func (*DeleteCommentRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{2} +} + +func (x *DeleteCommentRequest) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +type DeleteCommentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteCommentResponse) Reset() { + *x = DeleteCommentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteCommentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCommentResponse) ProtoMessage() {} + +func (x *DeleteCommentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCommentResponse.ProtoReflect.Descriptor instead. +func (*DeleteCommentResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{3} +} + +// 3.ListCommentLevelOne +type ListCommentLevelOneRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MarkdownId int64 `protobuf:"varint,1,opt,name=markdown_id,json=markdownId,proto3" json:"markdown_id,omitempty"` + PageId int32 `protobuf:"varint,2,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *ListCommentLevelOneRequest) Reset() { + *x = ListCommentLevelOneRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentLevelOneRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentLevelOneRequest) ProtoMessage() {} + +func (x *ListCommentLevelOneRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentLevelOneRequest.ProtoReflect.Descriptor instead. +func (*ListCommentLevelOneRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{4} +} + +func (x *ListCommentLevelOneRequest) GetMarkdownId() int64 { + if x != nil { + return x.MarkdownId + } + return 0 +} + +func (x *ListCommentLevelOneRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListCommentLevelOneRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +// 4.ListCommentLevelTwo +type ListCommentLevelTwoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RootId int64 `protobuf:"varint,1,opt,name=root_id,json=rootId,proto3" json:"root_id,omitempty"` + PageId int32 `protobuf:"varint,2,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *ListCommentLevelTwoRequest) Reset() { + *x = ListCommentLevelTwoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentLevelTwoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentLevelTwoRequest) ProtoMessage() {} + +func (x *ListCommentLevelTwoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentLevelTwoRequest.ProtoReflect.Descriptor instead. +func (*ListCommentLevelTwoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{5} +} + +func (x *ListCommentLevelTwoRequest) GetRootId() int64 { + if x != nil { + return x.RootId + } + return 0 +} + +func (x *ListCommentLevelTwoRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListCommentLevelTwoRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ListCommentLevelResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Comments []*models.ListCommentInfo `protobuf:"bytes,1,rep,name=comments,proto3" json:"comments,omitempty"` +} + +func (x *ListCommentLevelResponse) Reset() { + *x = ListCommentLevelResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentLevelResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentLevelResponse) ProtoMessage() {} + +func (x *ListCommentLevelResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentLevelResponse.ProtoReflect.Descriptor instead. +func (*ListCommentLevelResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{6} +} + +func (x *ListCommentLevelResponse) GetComments() []*models.ListCommentInfo { + if x != nil { + return x.Comments + } + return nil +} + +// 5.GetCommentCountInfo +type GetCommentCountInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentId int64 `protobuf:"varint,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` +} + +func (x *GetCommentCountInfoRequest) Reset() { + *x = GetCommentCountInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCommentCountInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCommentCountInfoRequest) ProtoMessage() {} + +func (x *GetCommentCountInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCommentCountInfoRequest.ProtoReflect.Descriptor instead. +func (*GetCommentCountInfoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{7} +} + +func (x *GetCommentCountInfoRequest) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +type GetCommentCountInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentCountInfo *models.CommentCountInfo `protobuf:"bytes,1,opt,name=comment_count_info,json=commentCountInfo,proto3" json:"comment_count_info,omitempty"` +} + +func (x *GetCommentCountInfoResponse) Reset() { + *x = GetCommentCountInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCommentCountInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCommentCountInfoResponse) ProtoMessage() {} + +func (x *GetCommentCountInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCommentCountInfoResponse.ProtoReflect.Descriptor instead. +func (*GetCommentCountInfoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{8} +} + +func (x *GetCommentCountInfoResponse) GetCommentCountInfo() *models.CommentCountInfo { + if x != nil { + return x.CommentCountInfo + } + return nil +} + +// 3.GetListCommentLevelOneCount +type GetListCommentLevelOneCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MarkdownId int64 `protobuf:"varint,1,opt,name=markdown_id,json=markdownId,proto3" json:"markdown_id,omitempty"` +} + +func (x *GetListCommentLevelOneCountRequest) Reset() { + *x = GetListCommentLevelOneCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListCommentLevelOneCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListCommentLevelOneCountRequest) ProtoMessage() {} + +func (x *GetListCommentLevelOneCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListCommentLevelOneCountRequest.ProtoReflect.Descriptor instead. +func (*GetListCommentLevelOneCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{9} +} + +func (x *GetListCommentLevelOneCountRequest) GetMarkdownId() int64 { + if x != nil { + return x.MarkdownId + } + return 0 +} + +// 4.GetListCommentLevelTwoCount +type GetListCommentLevelTwoCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RootId int64 `protobuf:"varint,1,opt,name=root_id,json=rootId,proto3" json:"root_id,omitempty"` +} + +func (x *GetListCommentLevelTwoCountRequest) Reset() { + *x = GetListCommentLevelTwoCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListCommentLevelTwoCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListCommentLevelTwoCountRequest) ProtoMessage() {} + +func (x *GetListCommentLevelTwoCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListCommentLevelTwoCountRequest.ProtoReflect.Descriptor instead. +func (*GetListCommentLevelTwoCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{10} +} + +func (x *GetListCommentLevelTwoCountRequest) GetRootId() int64 { + if x != nil { + return x.RootId + } + return 0 +} + +type GetListCommentLevelCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListCommentLevelCountResponse) Reset() { + *x = GetListCommentLevelCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListCommentLevelCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListCommentLevelCountResponse) ProtoMessage() {} + +func (x *GetListCommentLevelCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListCommentLevelCountResponse.ProtoReflect.Descriptor instead. +func (*GetListCommentLevelCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_proto_rawDescGZIP(), []int{11} +} + +func (x *GetListCommentLevelCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +var File_rpcs_rpc_comment_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_comment_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x14, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x7d, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, + 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, + 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x22, 0x47, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, + 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x35, 0x0a, 0x14, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, + 0x64, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x73, 0x0a, 0x1a, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x72, 0x6b, + 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, + 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, + 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, + 0x6b, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x54, 0x77, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, + 0x07, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x72, 0x6f, 0x6f, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x4b, 0x0a, 0x18, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x3b, 0x0a, 0x1a, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x61, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x45, 0x0a, 0x22, 0x47, 0x65, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x4f, 0x6e, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x64, + 0x22, 0x3d, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x54, 0x77, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x74, 0x49, 0x64, 0x22, + 0x38, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, + 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_comment_proto_rawDescOnce sync.Once + file_rpcs_rpc_comment_proto_rawDescData = file_rpcs_rpc_comment_proto_rawDesc +) + +func file_rpcs_rpc_comment_proto_rawDescGZIP() []byte { + file_rpcs_rpc_comment_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_comment_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_comment_proto_rawDescData) + }) + return file_rpcs_rpc_comment_proto_rawDescData +} + +var file_rpcs_rpc_comment_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_rpcs_rpc_comment_proto_goTypes = []interface{}{ + (*CreateCommentRequest)(nil), // 0: pb.CreateCommentRequest + (*CreateCommentResponse)(nil), // 1: pb.CreateCommentResponse + (*DeleteCommentRequest)(nil), // 2: pb.DeleteCommentRequest + (*DeleteCommentResponse)(nil), // 3: pb.DeleteCommentResponse + (*ListCommentLevelOneRequest)(nil), // 4: pb.ListCommentLevelOneRequest + (*ListCommentLevelTwoRequest)(nil), // 5: pb.ListCommentLevelTwoRequest + (*ListCommentLevelResponse)(nil), // 6: pb.ListCommentLevelResponse + (*GetCommentCountInfoRequest)(nil), // 7: pb.GetCommentCountInfoRequest + (*GetCommentCountInfoResponse)(nil), // 8: pb.GetCommentCountInfoResponse + (*GetListCommentLevelOneCountRequest)(nil), // 9: pb.GetListCommentLevelOneCountRequest + (*GetListCommentLevelTwoCountRequest)(nil), // 10: pb.GetListCommentLevelTwoCountRequest + (*GetListCommentLevelCountResponse)(nil), // 11: pb.GetListCommentLevelCountResponse + (*models.CommentBasicInfo)(nil), // 12: pb.CommentBasicInfo + (*models.ListCommentInfo)(nil), // 13: pb.ListCommentInfo + (*models.CommentCountInfo)(nil), // 14: pb.CommentCountInfo +} +var file_rpcs_rpc_comment_proto_depIdxs = []int32{ + 12, // 0: pb.CreateCommentResponse.comment:type_name -> pb.CommentBasicInfo + 13, // 1: pb.ListCommentLevelResponse.comments:type_name -> pb.ListCommentInfo + 14, // 2: pb.GetCommentCountInfoResponse.comment_count_info:type_name -> pb.CommentCountInfo + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_comment_proto_init() } +func file_rpcs_rpc_comment_proto_init() { + if File_rpcs_rpc_comment_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_comment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCommentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCommentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentLevelOneRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentLevelTwoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentLevelResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCommentCountInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetCommentCountInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListCommentLevelOneCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListCommentLevelTwoCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListCommentLevelCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_comment_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_comment_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_comment_proto_depIdxs, + MessageInfos: file_rpcs_rpc_comment_proto_msgTypes, + }.Build() + File_rpcs_rpc_comment_proto = out.File + file_rpcs_rpc_comment_proto_rawDesc = nil + file_rpcs_rpc_comment_proto_goTypes = nil + file_rpcs_rpc_comment_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_comment_relation.pb.go b/zbook_backend/pb/rpcs/rpc_comment_relation.pb.go new file mode 100644 index 0000000..4d35906 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_comment_relation.pb.go @@ -0,0 +1,488 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_comment_relation.proto + +package rpcs + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.CreateCommentRelation +type CreateCommentRelationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentId int64 `protobuf:"varint,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` + RelationType string `protobuf:"bytes,2,opt,name=relation_type,json=relationType,proto3" json:"relation_type,omitempty"` +} + +func (x *CreateCommentRelationRequest) Reset() { + *x = CreateCommentRelationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCommentRelationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCommentRelationRequest) ProtoMessage() {} + +func (x *CreateCommentRelationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCommentRelationRequest.ProtoReflect.Descriptor instead. +func (*CreateCommentRelationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_relation_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateCommentRelationRequest) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +func (x *CreateCommentRelationRequest) GetRelationType() string { + if x != nil { + return x.RelationType + } + return "" +} + +type CreateCommentRelationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LikeId int64 `protobuf:"varint,1,opt,name=like_id,json=likeId,proto3" json:"like_id,omitempty"` +} + +func (x *CreateCommentRelationResponse) Reset() { + *x = CreateCommentRelationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCommentRelationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCommentRelationResponse) ProtoMessage() {} + +func (x *CreateCommentRelationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCommentRelationResponse.ProtoReflect.Descriptor instead. +func (*CreateCommentRelationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_relation_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateCommentRelationResponse) GetLikeId() int64 { + if x != nil { + return x.LikeId + } + return 0 +} + +// 2.CreateCommentReport +type DeleteCommentRelationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentId int64 `protobuf:"varint,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` + RelationType string `protobuf:"bytes,2,opt,name=relation_type,json=relationType,proto3" json:"relation_type,omitempty"` +} + +func (x *DeleteCommentRelationRequest) Reset() { + *x = DeleteCommentRelationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteCommentRelationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCommentRelationRequest) ProtoMessage() {} + +func (x *DeleteCommentRelationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCommentRelationRequest.ProtoReflect.Descriptor instead. +func (*DeleteCommentRelationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_relation_proto_rawDescGZIP(), []int{2} +} + +func (x *DeleteCommentRelationRequest) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +func (x *DeleteCommentRelationRequest) GetRelationType() string { + if x != nil { + return x.RelationType + } + return "" +} + +type DeleteCommentRelationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteCommentRelationResponse) Reset() { + *x = DeleteCommentRelationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteCommentRelationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCommentRelationResponse) ProtoMessage() {} + +func (x *DeleteCommentRelationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCommentRelationResponse.ProtoReflect.Descriptor instead. +func (*DeleteCommentRelationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_relation_proto_rawDescGZIP(), []int{3} +} + +// 3.DeleteCommentRelation +type CreateCommentReportRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentId int64 `protobuf:"varint,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` + ReportContent string `protobuf:"bytes,2,opt,name=report_content,json=reportContent,proto3" json:"report_content,omitempty"` +} + +func (x *CreateCommentReportRequest) Reset() { + *x = CreateCommentReportRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCommentReportRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCommentReportRequest) ProtoMessage() {} + +func (x *CreateCommentReportRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCommentReportRequest.ProtoReflect.Descriptor instead. +func (*CreateCommentReportRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_relation_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateCommentReportRequest) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +func (x *CreateCommentReportRequest) GetReportContent() string { + if x != nil { + return x.ReportContent + } + return "" +} + +type CreateCommentReportResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CommentId int64 `protobuf:"varint,1,opt,name=comment_id,json=commentId,proto3" json:"comment_id,omitempty"` +} + +func (x *CreateCommentReportResponse) Reset() { + *x = CreateCommentReportResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCommentReportResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCommentReportResponse) ProtoMessage() {} + +func (x *CreateCommentReportResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_comment_relation_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCommentReportResponse.ProtoReflect.Descriptor instead. +func (*CreateCommentReportResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_comment_relation_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateCommentReportResponse) GetCommentId() int64 { + if x != nil { + return x.CommentId + } + return 0 +} + +var File_rpcs_rpc_comment_relation_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_comment_relation_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x62, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x38, 0x0a, 0x1d, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x69, + 0x6b, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x69, 0x6b, + 0x65, 0x49, 0x64, 0x22, 0x62, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x62, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x3c, 0x0a, 0x1b, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, + 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_comment_relation_proto_rawDescOnce sync.Once + file_rpcs_rpc_comment_relation_proto_rawDescData = file_rpcs_rpc_comment_relation_proto_rawDesc +) + +func file_rpcs_rpc_comment_relation_proto_rawDescGZIP() []byte { + file_rpcs_rpc_comment_relation_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_comment_relation_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_comment_relation_proto_rawDescData) + }) + return file_rpcs_rpc_comment_relation_proto_rawDescData +} + +var file_rpcs_rpc_comment_relation_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_rpcs_rpc_comment_relation_proto_goTypes = []interface{}{ + (*CreateCommentRelationRequest)(nil), // 0: pb.CreateCommentRelationRequest + (*CreateCommentRelationResponse)(nil), // 1: pb.CreateCommentRelationResponse + (*DeleteCommentRelationRequest)(nil), // 2: pb.DeleteCommentRelationRequest + (*DeleteCommentRelationResponse)(nil), // 3: pb.DeleteCommentRelationResponse + (*CreateCommentReportRequest)(nil), // 4: pb.CreateCommentReportRequest + (*CreateCommentReportResponse)(nil), // 5: pb.CreateCommentReportResponse +} +var file_rpcs_rpc_comment_relation_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_comment_relation_proto_init() } +func file_rpcs_rpc_comment_relation_proto_init() { + if File_rpcs_rpc_comment_relation_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_comment_relation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommentRelationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_relation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommentRelationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_relation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCommentRelationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_relation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCommentRelationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_relation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommentReportRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_comment_relation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCommentReportResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_comment_relation_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_comment_relation_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_comment_relation_proto_depIdxs, + MessageInfos: file_rpcs_rpc_comment_relation_proto_msgTypes, + }.Build() + File_rpcs_rpc_comment_relation_proto = out.File + file_rpcs_rpc_comment_relation_proto_rawDesc = nil + file_rpcs_rpc_comment_relation_proto_goTypes = nil + file_rpcs_rpc_comment_relation_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_follow.pb.go b/zbook_backend/pb/rpcs/rpc_follow.pb.go new file mode 100644 index 0000000..6670463 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_follow.pb.go @@ -0,0 +1,1062 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_follow.proto + +package rpcs + +import ( + models "github.com/zizdlp/zbook/pb/models" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.CreateFollow +type CreateFollowRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` +} + +func (x *CreateFollowRequest) Reset() { + *x = CreateFollowRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateFollowRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateFollowRequest) ProtoMessage() {} + +func (x *CreateFollowRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateFollowRequest.ProtoReflect.Descriptor instead. +func (*CreateFollowRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateFollowRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type CreateFollowResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Follow *models.Follow `protobuf:"bytes,1,opt,name=follow,proto3" json:"follow,omitempty"` +} + +func (x *CreateFollowResponse) Reset() { + *x = CreateFollowResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateFollowResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateFollowResponse) ProtoMessage() {} + +func (x *CreateFollowResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateFollowResponse.ProtoReflect.Descriptor instead. +func (*CreateFollowResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateFollowResponse) GetFollow() *models.Follow { + if x != nil { + return x.Follow + } + return nil +} + +// 2.GetFollowStatus +type GetFollowStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` +} + +func (x *GetFollowStatusRequest) Reset() { + *x = GetFollowStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFollowStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFollowStatusRequest) ProtoMessage() {} + +func (x *GetFollowStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFollowStatusRequest.ProtoReflect.Descriptor instead. +func (*GetFollowStatusRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{2} +} + +func (x *GetFollowStatusRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type GetFollowStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsFollowing bool `protobuf:"varint,1,opt,name=is_following,json=isFollowing,proto3" json:"is_following,omitempty"` +} + +func (x *GetFollowStatusResponse) Reset() { + *x = GetFollowStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFollowStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFollowStatusResponse) ProtoMessage() {} + +func (x *GetFollowStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFollowStatusResponse.ProtoReflect.Descriptor instead. +func (*GetFollowStatusResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{3} +} + +func (x *GetFollowStatusResponse) GetIsFollowing() bool { + if x != nil { + return x.IsFollowing + } + return false +} + +// 3.DeleteFollow +type DeleteFollowRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` +} + +func (x *DeleteFollowRequest) Reset() { + *x = DeleteFollowRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteFollowRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteFollowRequest) ProtoMessage() {} + +func (x *DeleteFollowRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteFollowRequest.ProtoReflect.Descriptor instead. +func (*DeleteFollowRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{4} +} + +func (x *DeleteFollowRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type DeleteFollowResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Follow *models.Follow `protobuf:"bytes,1,opt,name=follow,proto3" json:"follow,omitempty"` +} + +func (x *DeleteFollowResponse) Reset() { + *x = DeleteFollowResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteFollowResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteFollowResponse) ProtoMessage() {} + +func (x *DeleteFollowResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteFollowResponse.ProtoReflect.Descriptor instead. +func (*DeleteFollowResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteFollowResponse) GetFollow() *models.Follow { + if x != nil { + return x.Follow + } + return nil +} + +// 4.ListFollower +type ListFollowerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + PageId int32 `protobuf:"varint,2,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,4,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListFollowerRequest) Reset() { + *x = ListFollowerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListFollowerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowerRequest) ProtoMessage() {} + +func (x *ListFollowerRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowerRequest.ProtoReflect.Descriptor instead. +func (*ListFollowerRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{6} +} + +func (x *ListFollowerRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListFollowerRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListFollowerRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListFollowerRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListFollowerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListFollowInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListFollowerResponse) Reset() { + *x = ListFollowerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListFollowerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowerResponse) ProtoMessage() {} + +func (x *ListFollowerResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowerResponse.ProtoReflect.Descriptor instead. +func (*ListFollowerResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{7} +} + +func (x *ListFollowerResponse) GetElements() []*models.ListFollowInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 5.GetFollowerCount +type GetFollowerCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *GetFollowerCountRequest) Reset() { + *x = GetFollowerCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFollowerCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFollowerCountRequest) ProtoMessage() {} + +func (x *GetFollowerCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFollowerCountRequest.ProtoReflect.Descriptor instead. +func (*GetFollowerCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{8} +} + +func (x *GetFollowerCountRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetFollowerCountRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type GetFollowerCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetFollowerCountResponse) Reset() { + *x = GetFollowerCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFollowerCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFollowerCountResponse) ProtoMessage() {} + +func (x *GetFollowerCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFollowerCountResponse.ProtoReflect.Descriptor instead. +func (*GetFollowerCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{9} +} + +func (x *GetFollowerCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 6.ListFollowing +type ListFollowingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + PageId int32 `protobuf:"varint,2,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,4,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListFollowingRequest) Reset() { + *x = ListFollowingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListFollowingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowingRequest) ProtoMessage() {} + +func (x *ListFollowingRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowingRequest.ProtoReflect.Descriptor instead. +func (*ListFollowingRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{10} +} + +func (x *ListFollowingRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListFollowingRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListFollowingRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListFollowingRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListFollowingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListFollowInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListFollowingResponse) Reset() { + *x = ListFollowingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListFollowingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowingResponse) ProtoMessage() {} + +func (x *ListFollowingResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowingResponse.ProtoReflect.Descriptor instead. +func (*ListFollowingResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{11} +} + +func (x *ListFollowingResponse) GetElements() []*models.ListFollowInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 7.GetFollowingCount +type GetFollowingCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *GetFollowingCountRequest) Reset() { + *x = GetFollowingCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFollowingCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFollowingCountRequest) ProtoMessage() {} + +func (x *GetFollowingCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFollowingCountRequest.ProtoReflect.Descriptor instead. +func (*GetFollowingCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{12} +} + +func (x *GetFollowingCountRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetFollowingCountRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type GetFollowingCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetFollowingCountResponse) Reset() { + *x = GetFollowingCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_follow_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFollowingCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFollowingCountResponse) ProtoMessage() {} + +func (x *GetFollowingCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_follow_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFollowingCountResponse.ProtoReflect.Descriptor instead. +func (*GetFollowingCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_follow_proto_rawDescGZIP(), []int{13} +} + +func (x *GetFollowingCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +var File_rpcs_rpc_follow_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_follow_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x13, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x73, 0x2f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x31, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6c, + 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x06, 0x66, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, + 0x2e, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x22, + 0x34, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, + 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, + 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3c, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x69, 0x6e, 0x67, 0x22, 0x31, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x6f, 0x6c, + 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, + 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, + 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x22, 0x7d, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, + 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, + 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x22, 0x46, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x4b, 0x0a, 0x17, 0x47, 0x65, 0x74, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x30, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x7e, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, + 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, + 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x47, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, + 0x6c, 0x6f, 0x77, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0x4c, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, + 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, + 0x31, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, + 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_follow_proto_rawDescOnce sync.Once + file_rpcs_rpc_follow_proto_rawDescData = file_rpcs_rpc_follow_proto_rawDesc +) + +func file_rpcs_rpc_follow_proto_rawDescGZIP() []byte { + file_rpcs_rpc_follow_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_follow_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_follow_proto_rawDescData) + }) + return file_rpcs_rpc_follow_proto_rawDescData +} + +var file_rpcs_rpc_follow_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_rpcs_rpc_follow_proto_goTypes = []interface{}{ + (*CreateFollowRequest)(nil), // 0: pb.CreateFollowRequest + (*CreateFollowResponse)(nil), // 1: pb.CreateFollowResponse + (*GetFollowStatusRequest)(nil), // 2: pb.GetFollowStatusRequest + (*GetFollowStatusResponse)(nil), // 3: pb.GetFollowStatusResponse + (*DeleteFollowRequest)(nil), // 4: pb.DeleteFollowRequest + (*DeleteFollowResponse)(nil), // 5: pb.DeleteFollowResponse + (*ListFollowerRequest)(nil), // 6: pb.ListFollowerRequest + (*ListFollowerResponse)(nil), // 7: pb.ListFollowerResponse + (*GetFollowerCountRequest)(nil), // 8: pb.GetFollowerCountRequest + (*GetFollowerCountResponse)(nil), // 9: pb.GetFollowerCountResponse + (*ListFollowingRequest)(nil), // 10: pb.ListFollowingRequest + (*ListFollowingResponse)(nil), // 11: pb.ListFollowingResponse + (*GetFollowingCountRequest)(nil), // 12: pb.GetFollowingCountRequest + (*GetFollowingCountResponse)(nil), // 13: pb.GetFollowingCountResponse + (*models.Follow)(nil), // 14: pb.Follow + (*models.ListFollowInfo)(nil), // 15: pb.ListFollowInfo +} +var file_rpcs_rpc_follow_proto_depIdxs = []int32{ + 14, // 0: pb.CreateFollowResponse.follow:type_name -> pb.Follow + 14, // 1: pb.DeleteFollowResponse.follow:type_name -> pb.Follow + 15, // 2: pb.ListFollowerResponse.elements:type_name -> pb.ListFollowInfo + 15, // 3: pb.ListFollowingResponse.elements:type_name -> pb.ListFollowInfo + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_follow_proto_init() } +func file_rpcs_rpc_follow_proto_init() { + if File_rpcs_rpc_follow_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_follow_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateFollowRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateFollowResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFollowStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFollowStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteFollowRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteFollowResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFollowerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFollowerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFollowerCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFollowerCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFollowingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFollowingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFollowingCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_follow_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFollowingCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_follow_proto_rawDesc, + NumEnums: 0, + NumMessages: 14, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_follow_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_follow_proto_depIdxs, + MessageInfos: file_rpcs_rpc_follow_proto_msgTypes, + }.Build() + File_rpcs_rpc_follow_proto = out.File + file_rpcs_rpc_follow_proto_rawDesc = nil + file_rpcs_rpc_follow_proto_goTypes = nil + file_rpcs_rpc_follow_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_markdown.pb.go b/zbook_backend/pb/rpcs/rpc_markdown.pb.go new file mode 100644 index 0000000..0cd8292 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_markdown.pb.go @@ -0,0 +1,919 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_markdown.proto + +package rpcs + +import ( + models "github.com/zizdlp/zbook/pb/models" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.GetMarkdownContent +type GetMarkdownContentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + RelativePath string `protobuf:"bytes,3,opt,name=relative_path,json=relativePath,proto3" json:"relative_path,omitempty"` +} + +func (x *GetMarkdownContentRequest) Reset() { + *x = GetMarkdownContentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMarkdownContentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMarkdownContentRequest) ProtoMessage() {} + +func (x *GetMarkdownContentRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMarkdownContentRequest.ProtoReflect.Descriptor instead. +func (*GetMarkdownContentRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{0} +} + +func (x *GetMarkdownContentRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetMarkdownContentRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *GetMarkdownContentRequest) GetRelativePath() string { + if x != nil { + return x.RelativePath + } + return "" +} + +type GetMarkdownContentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Markdown *models.Markdown `protobuf:"bytes,1,opt,name=markdown,proto3" json:"markdown,omitempty"` + Prev string `protobuf:"bytes,2,opt,name=prev,proto3" json:"prev,omitempty"` + Next string `protobuf:"bytes,3,opt,name=next,proto3" json:"next,omitempty"` + Footers []*models.FooterSocial `protobuf:"bytes,4,rep,name=footers,proto3" json:"footers,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + ThemeColor string `protobuf:"bytes,6,opt,name=theme_color,json=themeColor,proto3" json:"theme_color,omitempty"` +} + +func (x *GetMarkdownContentResponse) Reset() { + *x = GetMarkdownContentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMarkdownContentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMarkdownContentResponse) ProtoMessage() {} + +func (x *GetMarkdownContentResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMarkdownContentResponse.ProtoReflect.Descriptor instead. +func (*GetMarkdownContentResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{1} +} + +func (x *GetMarkdownContentResponse) GetMarkdown() *models.Markdown { + if x != nil { + return x.Markdown + } + return nil +} + +func (x *GetMarkdownContentResponse) GetPrev() string { + if x != nil { + return x.Prev + } + return "" +} + +func (x *GetMarkdownContentResponse) GetNext() string { + if x != nil { + return x.Next + } + return "" +} + +func (x *GetMarkdownContentResponse) GetFooters() []*models.FooterSocial { + if x != nil { + return x.Footers + } + return nil +} + +func (x *GetMarkdownContentResponse) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *GetMarkdownContentResponse) GetThemeColor() string { + if x != nil { + return x.ThemeColor + } + return "" +} + +// 2.GetMarkdownImage +type GetMarkdownImageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + FilePath string `protobuf:"bytes,3,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` +} + +func (x *GetMarkdownImageRequest) Reset() { + *x = GetMarkdownImageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMarkdownImageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMarkdownImageRequest) ProtoMessage() {} + +func (x *GetMarkdownImageRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMarkdownImageRequest.ProtoReflect.Descriptor instead. +func (*GetMarkdownImageRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{2} +} + +func (x *GetMarkdownImageRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetMarkdownImageRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *GetMarkdownImageRequest) GetFilePath() string { + if x != nil { + return x.FilePath + } + return "" +} + +type GetMarkdownImageResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + File []byte `protobuf:"bytes,1,opt,name=file,proto3" json:"file,omitempty"` +} + +func (x *GetMarkdownImageResponse) Reset() { + *x = GetMarkdownImageResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetMarkdownImageResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMarkdownImageResponse) ProtoMessage() {} + +func (x *GetMarkdownImageResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetMarkdownImageResponse.ProtoReflect.Descriptor instead. +func (*GetMarkdownImageResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{3} +} + +func (x *GetMarkdownImageResponse) GetFile() []byte { + if x != nil { + return x.File + } + return nil +} + +// 3.QueryRepoMarkdown +type QueryRepoMarkdownRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + PlainToTsquery string `protobuf:"bytes,3,opt,name=plain_to_tsquery,json=plainToTsquery,proto3" json:"plain_to_tsquery,omitempty"` + PageId int32 `protobuf:"varint,4,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *QueryRepoMarkdownRequest) Reset() { + *x = QueryRepoMarkdownRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRepoMarkdownRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRepoMarkdownRequest) ProtoMessage() {} + +func (x *QueryRepoMarkdownRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryRepoMarkdownRequest.ProtoReflect.Descriptor instead. +func (*QueryRepoMarkdownRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryRepoMarkdownRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *QueryRepoMarkdownRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *QueryRepoMarkdownRequest) GetPlainToTsquery() string { + if x != nil { + return x.PlainToTsquery + } + return "" +} + +func (x *QueryRepoMarkdownRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *QueryRepoMarkdownRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type QueryRepoMarkdownResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.Markdown `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *QueryRepoMarkdownResponse) Reset() { + *x = QueryRepoMarkdownResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryRepoMarkdownResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryRepoMarkdownResponse) ProtoMessage() {} + +func (x *QueryRepoMarkdownResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryRepoMarkdownResponse.ProtoReflect.Descriptor instead. +func (*QueryRepoMarkdownResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryRepoMarkdownResponse) GetElements() []*models.Markdown { + if x != nil { + return x.Elements + } + return nil +} + +// 4.QueryUserMarkdown +type QueryUserMarkdownRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + PlainToTsquery string `protobuf:"bytes,2,opt,name=plain_to_tsquery,json=plainToTsquery,proto3" json:"plain_to_tsquery,omitempty"` + PageId int32 `protobuf:"varint,3,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *QueryUserMarkdownRequest) Reset() { + *x = QueryUserMarkdownRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryUserMarkdownRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryUserMarkdownRequest) ProtoMessage() {} + +func (x *QueryUserMarkdownRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryUserMarkdownRequest.ProtoReflect.Descriptor instead. +func (*QueryUserMarkdownRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{6} +} + +func (x *QueryUserMarkdownRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *QueryUserMarkdownRequest) GetPlainToTsquery() string { + if x != nil { + return x.PlainToTsquery + } + return "" +} + +func (x *QueryUserMarkdownRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *QueryUserMarkdownRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type QueryUserMarkdownResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.Markdown `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *QueryUserMarkdownResponse) Reset() { + *x = QueryUserMarkdownResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryUserMarkdownResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryUserMarkdownResponse) ProtoMessage() {} + +func (x *QueryUserMarkdownResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryUserMarkdownResponse.ProtoReflect.Descriptor instead. +func (*QueryUserMarkdownResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryUserMarkdownResponse) GetElements() []*models.Markdown { + if x != nil { + return x.Elements + } + return nil +} + +// 4.QueryMarkdown +type QueryMarkdownRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlainToTsquery string `protobuf:"bytes,1,opt,name=plain_to_tsquery,json=plainToTsquery,proto3" json:"plain_to_tsquery,omitempty"` + PageId int32 `protobuf:"varint,2,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *QueryMarkdownRequest) Reset() { + *x = QueryMarkdownRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryMarkdownRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryMarkdownRequest) ProtoMessage() {} + +func (x *QueryMarkdownRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryMarkdownRequest.ProtoReflect.Descriptor instead. +func (*QueryMarkdownRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{8} +} + +func (x *QueryMarkdownRequest) GetPlainToTsquery() string { + if x != nil { + return x.PlainToTsquery + } + return "" +} + +func (x *QueryMarkdownRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *QueryMarkdownRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type QueryMarkdownResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.Markdown `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *QueryMarkdownResponse) Reset() { + *x = QueryMarkdownResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryMarkdownResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryMarkdownResponse) ProtoMessage() {} + +func (x *QueryMarkdownResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_markdown_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryMarkdownResponse.ProtoReflect.Descriptor instead. +func (*QueryMarkdownResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_markdown_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryMarkdownResponse) GetElements() []*models.Markdown { + if x != nil { + return x.Elements + } + return nil +} + +var File_rpcs_rpc_markdown_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_markdown_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x64, + 0x6f, 0x77, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x15, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x79, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x72, 0x6b, + 0x64, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x50, 0x61, 0x74, 0x68, + 0x22, 0xf6, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x28, 0x0a, 0x08, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, + 0x08, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x72, 0x65, + 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x72, 0x65, 0x76, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x65, 0x78, + 0x74, 0x12, 0x2a, 0x0a, 0x07, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x53, 0x6f, + 0x63, 0x69, 0x61, 0x6c, 0x52, 0x07, 0x66, 0x6f, 0x6f, 0x74, 0x65, 0x72, 0x73, 0x12, 0x39, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x68, 0x65, 0x6d, + 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, + 0x68, 0x65, 0x6d, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x22, 0x6f, 0x0a, 0x17, 0x47, 0x65, 0x74, + 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x22, 0x2e, 0x0a, 0x18, 0x47, 0x65, + 0x74, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x22, 0xb3, 0x01, 0x0a, 0x18, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x28, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x74, 0x73, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x54, 0x6f, 0x54, 0x73, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, + 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x22, 0x45, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x72, + 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, + 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x08, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x28, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x74, 0x73, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x69, + 0x6e, 0x54, 0x6f, 0x54, 0x73, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, + 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, + 0x22, 0x45, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, + 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, + 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x08, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x76, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x28, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x6f, 0x5f, 0x74, 0x73, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x6c, 0x61, 0x69, 0x6e, + 0x54, 0x6f, 0x54, 0x73, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, + 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, + 0x41, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, + 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, + 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_markdown_proto_rawDescOnce sync.Once + file_rpcs_rpc_markdown_proto_rawDescData = file_rpcs_rpc_markdown_proto_rawDesc +) + +func file_rpcs_rpc_markdown_proto_rawDescGZIP() []byte { + file_rpcs_rpc_markdown_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_markdown_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_markdown_proto_rawDescData) + }) + return file_rpcs_rpc_markdown_proto_rawDescData +} + +var file_rpcs_rpc_markdown_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_rpcs_rpc_markdown_proto_goTypes = []interface{}{ + (*GetMarkdownContentRequest)(nil), // 0: pb.GetMarkdownContentRequest + (*GetMarkdownContentResponse)(nil), // 1: pb.GetMarkdownContentResponse + (*GetMarkdownImageRequest)(nil), // 2: pb.GetMarkdownImageRequest + (*GetMarkdownImageResponse)(nil), // 3: pb.GetMarkdownImageResponse + (*QueryRepoMarkdownRequest)(nil), // 4: pb.QueryRepoMarkdownRequest + (*QueryRepoMarkdownResponse)(nil), // 5: pb.QueryRepoMarkdownResponse + (*QueryUserMarkdownRequest)(nil), // 6: pb.QueryUserMarkdownRequest + (*QueryUserMarkdownResponse)(nil), // 7: pb.QueryUserMarkdownResponse + (*QueryMarkdownRequest)(nil), // 8: pb.QueryMarkdownRequest + (*QueryMarkdownResponse)(nil), // 9: pb.QueryMarkdownResponse + (*models.Markdown)(nil), // 10: pb.Markdown + (*models.FooterSocial)(nil), // 11: pb.FooterSocial + (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp +} +var file_rpcs_rpc_markdown_proto_depIdxs = []int32{ + 10, // 0: pb.GetMarkdownContentResponse.markdown:type_name -> pb.Markdown + 11, // 1: pb.GetMarkdownContentResponse.footers:type_name -> pb.FooterSocial + 12, // 2: pb.GetMarkdownContentResponse.updated_at:type_name -> google.protobuf.Timestamp + 10, // 3: pb.QueryRepoMarkdownResponse.elements:type_name -> pb.Markdown + 10, // 4: pb.QueryUserMarkdownResponse.elements:type_name -> pb.Markdown + 10, // 5: pb.QueryMarkdownResponse.elements:type_name -> pb.Markdown + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_markdown_proto_init() } +func file_rpcs_rpc_markdown_proto_init() { + if File_rpcs_rpc_markdown_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_markdown_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMarkdownContentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_markdown_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMarkdownContentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_markdown_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMarkdownImageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_markdown_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMarkdownImageResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_markdown_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRepoMarkdownRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_markdown_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryRepoMarkdownResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_markdown_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryUserMarkdownRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_markdown_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryUserMarkdownResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_markdown_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryMarkdownRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_markdown_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryMarkdownResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_markdown_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_markdown_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_markdown_proto_depIdxs, + MessageInfos: file_rpcs_rpc_markdown_proto_msgTypes, + }.Build() + File_rpcs_rpc_markdown_proto = out.File + file_rpcs_rpc_markdown_proto_rawDesc = nil + file_rpcs_rpc_markdown_proto_goTypes = nil + file_rpcs_rpc_markdown_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_notification.pb.go b/zbook_backend/pb/rpcs/rpc_notification.pb.go new file mode 100644 index 0000000..08ff34d --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_notification.pb.go @@ -0,0 +1,1671 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_notification.proto + +package rpcs + +import ( + models "github.com/zizdlp/zbook/pb/models" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.ListFollowerNotification +type ListFollowerNotificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *ListFollowerNotificationRequest) Reset() { + *x = ListFollowerNotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListFollowerNotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowerNotificationRequest) ProtoMessage() {} + +func (x *ListFollowerNotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowerNotificationRequest.ProtoReflect.Descriptor instead. +func (*ListFollowerNotificationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{0} +} + +func (x *ListFollowerNotificationRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListFollowerNotificationRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ListFollowerNotificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Notifications []*models.ListFollowerNotificationInfo `protobuf:"bytes,1,rep,name=notifications,proto3" json:"notifications,omitempty"` +} + +func (x *ListFollowerNotificationResponse) Reset() { + *x = ListFollowerNotificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListFollowerNotificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListFollowerNotificationResponse) ProtoMessage() {} + +func (x *ListFollowerNotificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListFollowerNotificationResponse.ProtoReflect.Descriptor instead. +func (*ListFollowerNotificationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{1} +} + +func (x *ListFollowerNotificationResponse) GetNotifications() []*models.ListFollowerNotificationInfo { + if x != nil { + return x.Notifications + } + return nil +} + +// 2.ListRepoNotification +type ListRepoNotificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *ListRepoNotificationRequest) Reset() { + *x = ListRepoNotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRepoNotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRepoNotificationRequest) ProtoMessage() {} + +func (x *ListRepoNotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRepoNotificationRequest.ProtoReflect.Descriptor instead. +func (*ListRepoNotificationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{2} +} + +func (x *ListRepoNotificationRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListRepoNotificationRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ListRepoNotificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Notifications []*models.ListRepoNotificationInfo `protobuf:"bytes,1,rep,name=notifications,proto3" json:"notifications,omitempty"` +} + +func (x *ListRepoNotificationResponse) Reset() { + *x = ListRepoNotificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRepoNotificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRepoNotificationResponse) ProtoMessage() {} + +func (x *ListRepoNotificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRepoNotificationResponse.ProtoReflect.Descriptor instead. +func (*ListRepoNotificationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{3} +} + +func (x *ListRepoNotificationResponse) GetNotifications() []*models.ListRepoNotificationInfo { + if x != nil { + return x.Notifications + } + return nil +} + +// 3.ListCommentNotification +type ListCommentNotificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *ListCommentNotificationRequest) Reset() { + *x = ListCommentNotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentNotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentNotificationRequest) ProtoMessage() {} + +func (x *ListCommentNotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentNotificationRequest.ProtoReflect.Descriptor instead. +func (*ListCommentNotificationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{4} +} + +func (x *ListCommentNotificationRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListCommentNotificationRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ListCommentNotificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Notifications []*models.ListCommentNotificationInfo `protobuf:"bytes,1,rep,name=notifications,proto3" json:"notifications,omitempty"` +} + +func (x *ListCommentNotificationResponse) Reset() { + *x = ListCommentNotificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListCommentNotificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListCommentNotificationResponse) ProtoMessage() {} + +func (x *ListCommentNotificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListCommentNotificationResponse.ProtoReflect.Descriptor instead. +func (*ListCommentNotificationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{5} +} + +func (x *ListCommentNotificationResponse) GetNotifications() []*models.ListCommentNotificationInfo { + if x != nil { + return x.Notifications + } + return nil +} + +// 4.ListSystemNotification +type ListSystemNotificationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *ListSystemNotificationRequest) Reset() { + *x = ListSystemNotificationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSystemNotificationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSystemNotificationRequest) ProtoMessage() {} + +func (x *ListSystemNotificationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSystemNotificationRequest.ProtoReflect.Descriptor instead. +func (*ListSystemNotificationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{6} +} + +func (x *ListSystemNotificationRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListSystemNotificationRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ListSystemNotificationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Notifications []*models.ListSystemNotificationInfo `protobuf:"bytes,1,rep,name=notifications,proto3" json:"notifications,omitempty"` +} + +func (x *ListSystemNotificationResponse) Reset() { + *x = ListSystemNotificationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListSystemNotificationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListSystemNotificationResponse) ProtoMessage() {} + +func (x *ListSystemNotificationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListSystemNotificationResponse.ProtoReflect.Descriptor instead. +func (*ListSystemNotificationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{7} +} + +func (x *ListSystemNotificationResponse) GetNotifications() []*models.ListSystemNotificationInfo { + if x != nil { + return x.Notifications + } + return nil +} + +// 5.MarkFollowerNotificationReaded +type MarkFollowerNotificationReadedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NotiId int64 `protobuf:"varint,1,opt,name=noti_id,json=notiId,proto3" json:"noti_id,omitempty"` +} + +func (x *MarkFollowerNotificationReadedRequest) Reset() { + *x = MarkFollowerNotificationReadedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarkFollowerNotificationReadedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarkFollowerNotificationReadedRequest) ProtoMessage() {} + +func (x *MarkFollowerNotificationReadedRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MarkFollowerNotificationReadedRequest.ProtoReflect.Descriptor instead. +func (*MarkFollowerNotificationReadedRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{8} +} + +func (x *MarkFollowerNotificationReadedRequest) GetNotiId() int64 { + if x != nil { + return x.NotiId + } + return 0 +} + +// 6.MarkSystemNotificationReaded +type MarkSystemNotificationReadedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NotiId int64 `protobuf:"varint,1,opt,name=noti_id,json=notiId,proto3" json:"noti_id,omitempty"` +} + +func (x *MarkSystemNotificationReadedRequest) Reset() { + *x = MarkSystemNotificationReadedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarkSystemNotificationReadedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarkSystemNotificationReadedRequest) ProtoMessage() {} + +func (x *MarkSystemNotificationReadedRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MarkSystemNotificationReadedRequest.ProtoReflect.Descriptor instead. +func (*MarkSystemNotificationReadedRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{9} +} + +func (x *MarkSystemNotificationReadedRequest) GetNotiId() int64 { + if x != nil { + return x.NotiId + } + return 0 +} + +// 7.MarkCommentNotificationReaded +type MarkCommentNotificationReadedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NotiId int64 `protobuf:"varint,1,opt,name=noti_id,json=notiId,proto3" json:"noti_id,omitempty"` +} + +func (x *MarkCommentNotificationReadedRequest) Reset() { + *x = MarkCommentNotificationReadedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarkCommentNotificationReadedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarkCommentNotificationReadedRequest) ProtoMessage() {} + +func (x *MarkCommentNotificationReadedRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MarkCommentNotificationReadedRequest.ProtoReflect.Descriptor instead. +func (*MarkCommentNotificationReadedRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{10} +} + +func (x *MarkCommentNotificationReadedRequest) GetNotiId() int64 { + if x != nil { + return x.NotiId + } + return 0 +} + +// 8.MarkRepoNotificationReaded +type MarkRepoNotificationReadedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NotiId int64 `protobuf:"varint,1,opt,name=noti_id,json=notiId,proto3" json:"noti_id,omitempty"` +} + +func (x *MarkRepoNotificationReadedRequest) Reset() { + *x = MarkRepoNotificationReadedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MarkRepoNotificationReadedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MarkRepoNotificationReadedRequest) ProtoMessage() {} + +func (x *MarkRepoNotificationReadedRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MarkRepoNotificationReadedRequest.ProtoReflect.Descriptor instead. +func (*MarkRepoNotificationReadedRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{11} +} + +func (x *MarkRepoNotificationReadedRequest) GetNotiId() int64 { + if x != nil { + return x.NotiId + } + return 0 +} + +type SetNotiReadResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetNotiReadResponse) Reset() { + *x = SetNotiReadResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetNotiReadResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetNotiReadResponse) ProtoMessage() {} + +func (x *SetNotiReadResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetNotiReadResponse.ProtoReflect.Descriptor instead. +func (*SetNotiReadResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{12} +} + +// 9.GetUnReadCount +type GetUnReadCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetUnReadCountRequest) Reset() { + *x = GetUnReadCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUnReadCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUnReadCountRequest) ProtoMessage() {} + +func (x *GetUnReadCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUnReadCountRequest.ProtoReflect.Descriptor instead. +func (*GetUnReadCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{13} +} + +type GetUnReadCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UnreadCount int32 `protobuf:"varint,1,opt,name=unread_count,json=unreadCount,proto3" json:"unread_count,omitempty"` +} + +func (x *GetUnReadCountResponse) Reset() { + *x = GetUnReadCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUnReadCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUnReadCountResponse) ProtoMessage() {} + +func (x *GetUnReadCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUnReadCountResponse.ProtoReflect.Descriptor instead. +func (*GetUnReadCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{14} +} + +func (x *GetUnReadCountResponse) GetUnreadCount() int32 { + if x != nil { + return x.UnreadCount + } + return 0 +} + +// 10.ResetUnreadCount +type ResetUnreadCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ResetUnreadCountRequest) Reset() { + *x = ResetUnreadCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResetUnreadCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResetUnreadCountRequest) ProtoMessage() {} + +func (x *ResetUnreadCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResetUnreadCountRequest.ProtoReflect.Descriptor instead. +func (*ResetUnreadCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{15} +} + +type ResetUnreadCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ResetUnreadCountResponse) Reset() { + *x = ResetUnreadCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResetUnreadCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResetUnreadCountResponse) ProtoMessage() {} + +func (x *ResetUnreadCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResetUnreadCountResponse.ProtoReflect.Descriptor instead. +func (*ResetUnreadCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{16} +} + +// 11.GetListFollowerNotificationUnreadedCount +type GetListFollowerNotificationUnreadedCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetListFollowerNotificationUnreadedCountRequest) Reset() { + *x = GetListFollowerNotificationUnreadedCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListFollowerNotificationUnreadedCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListFollowerNotificationUnreadedCountRequest) ProtoMessage() {} + +func (x *GetListFollowerNotificationUnreadedCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListFollowerNotificationUnreadedCountRequest.ProtoReflect.Descriptor instead. +func (*GetListFollowerNotificationUnreadedCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{17} +} + +type GetListFollowerNotificationUnreadedCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListFollowerNotificationUnreadedCountResponse) Reset() { + *x = GetListFollowerNotificationUnreadedCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListFollowerNotificationUnreadedCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListFollowerNotificationUnreadedCountResponse) ProtoMessage() {} + +func (x *GetListFollowerNotificationUnreadedCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListFollowerNotificationUnreadedCountResponse.ProtoReflect.Descriptor instead. +func (*GetListFollowerNotificationUnreadedCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{18} +} + +func (x *GetListFollowerNotificationUnreadedCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 12.GetListRepoNotificationUnreadedCount +type GetListRepoNotificationUnreadedCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetListRepoNotificationUnreadedCountRequest) Reset() { + *x = GetListRepoNotificationUnreadedCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListRepoNotificationUnreadedCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListRepoNotificationUnreadedCountRequest) ProtoMessage() {} + +func (x *GetListRepoNotificationUnreadedCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListRepoNotificationUnreadedCountRequest.ProtoReflect.Descriptor instead. +func (*GetListRepoNotificationUnreadedCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{19} +} + +type GetListRepoNotificationUnreadedCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListRepoNotificationUnreadedCountResponse) Reset() { + *x = GetListRepoNotificationUnreadedCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListRepoNotificationUnreadedCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListRepoNotificationUnreadedCountResponse) ProtoMessage() {} + +func (x *GetListRepoNotificationUnreadedCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListRepoNotificationUnreadedCountResponse.ProtoReflect.Descriptor instead. +func (*GetListRepoNotificationUnreadedCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{20} +} + +func (x *GetListRepoNotificationUnreadedCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 13.GetListCommentNotificationUnreadedCount +type GetListCommentNotificationUnreadedCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetListCommentNotificationUnreadedCountRequest) Reset() { + *x = GetListCommentNotificationUnreadedCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListCommentNotificationUnreadedCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListCommentNotificationUnreadedCountRequest) ProtoMessage() {} + +func (x *GetListCommentNotificationUnreadedCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListCommentNotificationUnreadedCountRequest.ProtoReflect.Descriptor instead. +func (*GetListCommentNotificationUnreadedCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{21} +} + +type GetListCommentNotificationUnreadedCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListCommentNotificationUnreadedCountResponse) Reset() { + *x = GetListCommentNotificationUnreadedCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListCommentNotificationUnreadedCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListCommentNotificationUnreadedCountResponse) ProtoMessage() {} + +func (x *GetListCommentNotificationUnreadedCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListCommentNotificationUnreadedCountResponse.ProtoReflect.Descriptor instead. +func (*GetListCommentNotificationUnreadedCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{22} +} + +func (x *GetListCommentNotificationUnreadedCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 14.GetListSystemNotificationUnreadedCount +type GetListSystemNotificationUnreadedCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetListSystemNotificationUnreadedCountRequest) Reset() { + *x = GetListSystemNotificationUnreadedCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListSystemNotificationUnreadedCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListSystemNotificationUnreadedCountRequest) ProtoMessage() {} + +func (x *GetListSystemNotificationUnreadedCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListSystemNotificationUnreadedCountRequest.ProtoReflect.Descriptor instead. +func (*GetListSystemNotificationUnreadedCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{23} +} + +type GetListSystemNotificationUnreadedCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListSystemNotificationUnreadedCountResponse) Reset() { + *x = GetListSystemNotificationUnreadedCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_notification_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListSystemNotificationUnreadedCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListSystemNotificationUnreadedCountResponse) ProtoMessage() {} + +func (x *GetListSystemNotificationUnreadedCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_notification_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListSystemNotificationUnreadedCountResponse.ProtoReflect.Descriptor instead. +func (*GetListSystemNotificationUnreadedCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_notification_proto_rawDescGZIP(), []int{24} +} + +func (x *GetListSystemNotificationUnreadedCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +var File_rpcs_rpc_notification_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_notification_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, + 0x62, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x57, 0x0a, 0x1f, + 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x6a, 0x0a, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0d, 0x6e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x0d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x22, 0x53, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x62, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x6e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x56, 0x0a, 0x1e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, + 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, + 0x7a, 0x65, 0x22, 0x68, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x6e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x55, 0x0a, 0x1d, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, + 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, + 0x69, 0x7a, 0x65, 0x22, 0x66, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x6e, 0x6f, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x40, 0x0a, 0x25, 0x4d, + 0x61, 0x72, 0x6b, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x49, 0x64, 0x22, 0x3e, 0x0a, + 0x23, 0x4d, 0x61, 0x72, 0x6b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x49, 0x64, 0x22, 0x3f, 0x0a, + 0x24, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x49, 0x64, 0x22, 0x3c, + 0x0a, 0x21, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, + 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x52, 0x65, 0x61, 0x64, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x16, + 0x47, 0x65, 0x74, 0x55, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x75, 0x6e, + 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x19, 0x0a, 0x17, 0x52, 0x65, 0x73, + 0x65, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x1a, 0x0a, 0x18, 0x52, 0x65, 0x73, 0x65, 0x74, 0x55, 0x6e, 0x72, + 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x31, 0x0a, 0x2f, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, + 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x30, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2d, 0x0a, + 0x2b, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x44, 0x0a, 0x2c, + 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x22, 0x30, 0x0a, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x47, 0x0a, 0x2f, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2f, 0x0a, + 0x2d, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, + 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x46, + 0x0a, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, + 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, + 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_rpcs_rpc_notification_proto_rawDescOnce sync.Once + file_rpcs_rpc_notification_proto_rawDescData = file_rpcs_rpc_notification_proto_rawDesc +) + +func file_rpcs_rpc_notification_proto_rawDescGZIP() []byte { + file_rpcs_rpc_notification_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_notification_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_notification_proto_rawDescData) + }) + return file_rpcs_rpc_notification_proto_rawDescData +} + +var file_rpcs_rpc_notification_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_rpcs_rpc_notification_proto_goTypes = []interface{}{ + (*ListFollowerNotificationRequest)(nil), // 0: pb.ListFollowerNotificationRequest + (*ListFollowerNotificationResponse)(nil), // 1: pb.ListFollowerNotificationResponse + (*ListRepoNotificationRequest)(nil), // 2: pb.ListRepoNotificationRequest + (*ListRepoNotificationResponse)(nil), // 3: pb.ListRepoNotificationResponse + (*ListCommentNotificationRequest)(nil), // 4: pb.ListCommentNotificationRequest + (*ListCommentNotificationResponse)(nil), // 5: pb.ListCommentNotificationResponse + (*ListSystemNotificationRequest)(nil), // 6: pb.ListSystemNotificationRequest + (*ListSystemNotificationResponse)(nil), // 7: pb.ListSystemNotificationResponse + (*MarkFollowerNotificationReadedRequest)(nil), // 8: pb.MarkFollowerNotificationReadedRequest + (*MarkSystemNotificationReadedRequest)(nil), // 9: pb.MarkSystemNotificationReadedRequest + (*MarkCommentNotificationReadedRequest)(nil), // 10: pb.MarkCommentNotificationReadedRequest + (*MarkRepoNotificationReadedRequest)(nil), // 11: pb.MarkRepoNotificationReadedRequest + (*SetNotiReadResponse)(nil), // 12: pb.SetNotiReadResponse + (*GetUnReadCountRequest)(nil), // 13: pb.GetUnReadCountRequest + (*GetUnReadCountResponse)(nil), // 14: pb.GetUnReadCountResponse + (*ResetUnreadCountRequest)(nil), // 15: pb.ResetUnreadCountRequest + (*ResetUnreadCountResponse)(nil), // 16: pb.ResetUnreadCountResponse + (*GetListFollowerNotificationUnreadedCountRequest)(nil), // 17: pb.GetListFollowerNotificationUnreadedCountRequest + (*GetListFollowerNotificationUnreadedCountResponse)(nil), // 18: pb.GetListFollowerNotificationUnreadedCountResponse + (*GetListRepoNotificationUnreadedCountRequest)(nil), // 19: pb.GetListRepoNotificationUnreadedCountRequest + (*GetListRepoNotificationUnreadedCountResponse)(nil), // 20: pb.GetListRepoNotificationUnreadedCountResponse + (*GetListCommentNotificationUnreadedCountRequest)(nil), // 21: pb.GetListCommentNotificationUnreadedCountRequest + (*GetListCommentNotificationUnreadedCountResponse)(nil), // 22: pb.GetListCommentNotificationUnreadedCountResponse + (*GetListSystemNotificationUnreadedCountRequest)(nil), // 23: pb.GetListSystemNotificationUnreadedCountRequest + (*GetListSystemNotificationUnreadedCountResponse)(nil), // 24: pb.GetListSystemNotificationUnreadedCountResponse + (*models.ListFollowerNotificationInfo)(nil), // 25: pb.ListFollowerNotificationInfo + (*models.ListRepoNotificationInfo)(nil), // 26: pb.ListRepoNotificationInfo + (*models.ListCommentNotificationInfo)(nil), // 27: pb.ListCommentNotificationInfo + (*models.ListSystemNotificationInfo)(nil), // 28: pb.ListSystemNotificationInfo +} +var file_rpcs_rpc_notification_proto_depIdxs = []int32{ + 25, // 0: pb.ListFollowerNotificationResponse.notifications:type_name -> pb.ListFollowerNotificationInfo + 26, // 1: pb.ListRepoNotificationResponse.notifications:type_name -> pb.ListRepoNotificationInfo + 27, // 2: pb.ListCommentNotificationResponse.notifications:type_name -> pb.ListCommentNotificationInfo + 28, // 3: pb.ListSystemNotificationResponse.notifications:type_name -> pb.ListSystemNotificationInfo + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_notification_proto_init() } +func file_rpcs_rpc_notification_proto_init() { + if File_rpcs_rpc_notification_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_notification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFollowerNotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListFollowerNotificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRepoNotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRepoNotificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentNotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListCommentNotificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSystemNotificationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListSystemNotificationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MarkFollowerNotificationReadedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MarkSystemNotificationReadedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MarkCommentNotificationReadedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MarkRepoNotificationReadedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetNotiReadResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUnReadCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUnReadCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetUnreadCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetUnreadCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListFollowerNotificationUnreadedCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListFollowerNotificationUnreadedCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListRepoNotificationUnreadedCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListRepoNotificationUnreadedCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListCommentNotificationUnreadedCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListCommentNotificationUnreadedCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListSystemNotificationUnreadedCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_notification_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListSystemNotificationUnreadedCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_notification_proto_rawDesc, + NumEnums: 0, + NumMessages: 25, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_notification_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_notification_proto_depIdxs, + MessageInfos: file_rpcs_rpc_notification_proto_msgTypes, + }.Build() + File_rpcs_rpc_notification_proto = out.File + file_rpcs_rpc_notification_proto_rawDesc = nil + file_rpcs_rpc_notification_proto_goTypes = nil + file_rpcs_rpc_notification_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_oauth.pb.go b/zbook_backend/pb/rpcs/rpc_oauth.pb.go new file mode 100644 index 0000000..5ef16c8 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_oauth.pb.go @@ -0,0 +1,661 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_oauth.proto + +package rpcs + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.CreateOAuthLink +type CreateOAuthLinkRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OauthType string `protobuf:"bytes,1,opt,name=oauth_type,json=oauthType,proto3" json:"oauth_type,omitempty"` + AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` +} + +func (x *CreateOAuthLinkRequest) Reset() { + *x = CreateOAuthLinkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOAuthLinkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOAuthLinkRequest) ProtoMessage() {} + +func (x *CreateOAuthLinkRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOAuthLinkRequest.ProtoReflect.Descriptor instead. +func (*CreateOAuthLinkRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_oauth_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateOAuthLinkRequest) GetOauthType() string { + if x != nil { + return x.OauthType + } + return "" +} + +func (x *CreateOAuthLinkRequest) GetAppId() string { + if x != nil { + return x.AppId + } + return "" +} + +type CreateOAuthLinkResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateOAuthLinkResponse) Reset() { + *x = CreateOAuthLinkResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOAuthLinkResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOAuthLinkResponse) ProtoMessage() {} + +func (x *CreateOAuthLinkResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOAuthLinkResponse.ProtoReflect.Descriptor instead. +func (*CreateOAuthLinkResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_oauth_proto_rawDescGZIP(), []int{1} +} + +// 2.CheckOAuthStatus +type CheckOAuthStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CheckOAuthStatusRequest) Reset() { + *x = CheckOAuthStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckOAuthStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckOAuthStatusRequest) ProtoMessage() {} + +func (x *CheckOAuthStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckOAuthStatusRequest.ProtoReflect.Descriptor instead. +func (*CheckOAuthStatusRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_oauth_proto_rawDescGZIP(), []int{2} +} + +type CheckOAuthStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Github bool `protobuf:"varint,1,opt,name=github,proto3" json:"github,omitempty"` + Google bool `protobuf:"varint,2,opt,name=google,proto3" json:"google,omitempty"` +} + +func (x *CheckOAuthStatusResponse) Reset() { + *x = CheckOAuthStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckOAuthStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckOAuthStatusResponse) ProtoMessage() {} + +func (x *CheckOAuthStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckOAuthStatusResponse.ProtoReflect.Descriptor instead. +func (*CheckOAuthStatusResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_oauth_proto_rawDescGZIP(), []int{3} +} + +func (x *CheckOAuthStatusResponse) GetGithub() bool { + if x != nil { + return x.Github + } + return false +} + +func (x *CheckOAuthStatusResponse) GetGoogle() bool { + if x != nil { + return x.Google + } + return false +} + +// 3.DeleteOAuthLink +type DeleteOAuthLinkRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OauthType string `protobuf:"bytes,1,opt,name=oauth_type,json=oauthType,proto3" json:"oauth_type,omitempty"` +} + +func (x *DeleteOAuthLinkRequest) Reset() { + *x = DeleteOAuthLinkRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteOAuthLinkRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteOAuthLinkRequest) ProtoMessage() {} + +func (x *DeleteOAuthLinkRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteOAuthLinkRequest.ProtoReflect.Descriptor instead. +func (*DeleteOAuthLinkRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_oauth_proto_rawDescGZIP(), []int{4} +} + +func (x *DeleteOAuthLinkRequest) GetOauthType() string { + if x != nil { + return x.OauthType + } + return "" +} + +type DeleteOAuthLinkResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteOAuthLinkResponse) Reset() { + *x = DeleteOAuthLinkResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteOAuthLinkResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteOAuthLinkResponse) ProtoMessage() {} + +func (x *DeleteOAuthLinkResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteOAuthLinkResponse.ProtoReflect.Descriptor instead. +func (*DeleteOAuthLinkResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_oauth_proto_rawDescGZIP(), []int{5} +} + +// 4.LoginByOAuth +type LoginByOAuthRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OauthType string `protobuf:"bytes,1,opt,name=oauth_type,json=oauthType,proto3" json:"oauth_type,omitempty"` + AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` + AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` +} + +func (x *LoginByOAuthRequest) Reset() { + *x = LoginByOAuthRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginByOAuthRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginByOAuthRequest) ProtoMessage() {} + +func (x *LoginByOAuthRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginByOAuthRequest.ProtoReflect.Descriptor instead. +func (*LoginByOAuthRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_oauth_proto_rawDescGZIP(), []int{6} +} + +func (x *LoginByOAuthRequest) GetOauthType() string { + if x != nil { + return x.OauthType + } + return "" +} + +func (x *LoginByOAuthRequest) GetAppId() string { + if x != nil { + return x.AppId + } + return "" +} + +func (x *LoginByOAuthRequest) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +type LoginByOAuthResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` + Role string `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` + AccessTokenExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=access_token_expires_at,json=accessTokenExpiresAt,proto3" json:"access_token_expires_at,omitempty"` + RefreshTokenExpiresAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=refresh_token_expires_at,json=refreshTokenExpiresAt,proto3" json:"refresh_token_expires_at,omitempty"` +} + +func (x *LoginByOAuthResponse) Reset() { + *x = LoginByOAuthResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginByOAuthResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginByOAuthResponse) ProtoMessage() {} + +func (x *LoginByOAuthResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_oauth_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginByOAuthResponse.ProtoReflect.Descriptor instead. +func (*LoginByOAuthResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_oauth_proto_rawDescGZIP(), []int{7} +} + +func (x *LoginByOAuthResponse) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *LoginByOAuthResponse) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *LoginByOAuthResponse) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginByOAuthResponse) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *LoginByOAuthResponse) GetAccessTokenExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.AccessTokenExpiresAt + } + return nil +} + +func (x *LoginByOAuthResponse) GetRefreshTokenExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.RefreshTokenExpiresAt + } + return nil +} + +var File_rpcs_rpc_oauth_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_oauth_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6f, 0x61, 0x75, 0x74, 0x68, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4e, 0x0a, 0x16, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x61, 0x75, 0x74, 0x68, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x0a, 0x17, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x4a, 0x0a, 0x18, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x22, 0x37, 0x0a, + 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x69, 0x6e, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x61, 0x75, 0x74, 0x68, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x61, 0x75, + 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x19, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x6e, 0x0a, 0x13, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x79, 0x4f, 0x41, 0x75, 0x74, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x61, 0x75, 0x74, + 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x61, + 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, 0x70, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x22, 0xb6, 0x02, 0x0a, 0x14, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x79, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, + 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x12, 0x51, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x14, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x53, 0x0a, 0x18, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x15, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, + 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_oauth_proto_rawDescOnce sync.Once + file_rpcs_rpc_oauth_proto_rawDescData = file_rpcs_rpc_oauth_proto_rawDesc +) + +func file_rpcs_rpc_oauth_proto_rawDescGZIP() []byte { + file_rpcs_rpc_oauth_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_oauth_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_oauth_proto_rawDescData) + }) + return file_rpcs_rpc_oauth_proto_rawDescData +} + +var file_rpcs_rpc_oauth_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_rpcs_rpc_oauth_proto_goTypes = []interface{}{ + (*CreateOAuthLinkRequest)(nil), // 0: pb.CreateOAuthLinkRequest + (*CreateOAuthLinkResponse)(nil), // 1: pb.CreateOAuthLinkResponse + (*CheckOAuthStatusRequest)(nil), // 2: pb.CheckOAuthStatusRequest + (*CheckOAuthStatusResponse)(nil), // 3: pb.CheckOAuthStatusResponse + (*DeleteOAuthLinkRequest)(nil), // 4: pb.DeleteOAuthLinkRequest + (*DeleteOAuthLinkResponse)(nil), // 5: pb.DeleteOAuthLinkResponse + (*LoginByOAuthRequest)(nil), // 6: pb.LoginByOAuthRequest + (*LoginByOAuthResponse)(nil), // 7: pb.LoginByOAuthResponse + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp +} +var file_rpcs_rpc_oauth_proto_depIdxs = []int32{ + 8, // 0: pb.LoginByOAuthResponse.access_token_expires_at:type_name -> google.protobuf.Timestamp + 8, // 1: pb.LoginByOAuthResponse.refresh_token_expires_at:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_oauth_proto_init() } +func file_rpcs_rpc_oauth_proto_init() { + if File_rpcs_rpc_oauth_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_oauth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateOAuthLinkRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_oauth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateOAuthLinkResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_oauth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckOAuthStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_oauth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckOAuthStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_oauth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteOAuthLinkRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_oauth_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteOAuthLinkResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_oauth_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginByOAuthRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_oauth_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginByOAuthResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_oauth_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_oauth_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_oauth_proto_depIdxs, + MessageInfos: file_rpcs_rpc_oauth_proto_msgTypes, + }.Build() + File_rpcs_rpc_oauth_proto = out.File + file_rpcs_rpc_oauth_proto_rawDesc = nil + file_rpcs_rpc_oauth_proto_goTypes = nil + file_rpcs_rpc_oauth_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_repo.pb.go b/zbook_backend/pb/rpcs/rpc_repo.pb.go new file mode 100644 index 0000000..69e6697 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_repo.pb.go @@ -0,0 +1,2131 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_repo.proto + +package rpcs + +import ( + models "github.com/zizdlp/zbook/pb/models" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.CreateRepo +type CreateRepoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RepoName string `protobuf:"bytes,1,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + RepoDescription string `protobuf:"bytes,2,opt,name=repo_description,json=repoDescription,proto3" json:"repo_description,omitempty"` + GitAddr string `protobuf:"bytes,3,opt,name=git_addr,json=gitAddr,proto3" json:"git_addr,omitempty"` + GitAccessToken string `protobuf:"bytes,4,opt,name=git_access_token,json=gitAccessToken,proto3" json:"git_access_token,omitempty"` + SyncToken string `protobuf:"bytes,5,opt,name=sync_token,json=syncToken,proto3" json:"sync_token,omitempty"` + VisibilityLevel string `protobuf:"bytes,6,opt,name=visibility_level,json=visibilityLevel,proto3" json:"visibility_level,omitempty"` + HomePage string `protobuf:"bytes,7,opt,name=home_page,json=homePage,proto3" json:"home_page,omitempty"` + ThemeSidebar string `protobuf:"bytes,9,opt,name=theme_sidebar,json=themeSidebar,proto3" json:"theme_sidebar,omitempty"` + ThemeColor string `protobuf:"bytes,10,opt,name=theme_color,json=themeColor,proto3" json:"theme_color,omitempty"` +} + +func (x *CreateRepoRequest) Reset() { + *x = CreateRepoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRepoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRepoRequest) ProtoMessage() {} + +func (x *CreateRepoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRepoRequest.ProtoReflect.Descriptor instead. +func (*CreateRepoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateRepoRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *CreateRepoRequest) GetRepoDescription() string { + if x != nil { + return x.RepoDescription + } + return "" +} + +func (x *CreateRepoRequest) GetGitAddr() string { + if x != nil { + return x.GitAddr + } + return "" +} + +func (x *CreateRepoRequest) GetGitAccessToken() string { + if x != nil { + return x.GitAccessToken + } + return "" +} + +func (x *CreateRepoRequest) GetSyncToken() string { + if x != nil { + return x.SyncToken + } + return "" +} + +func (x *CreateRepoRequest) GetVisibilityLevel() string { + if x != nil { + return x.VisibilityLevel + } + return "" +} + +func (x *CreateRepoRequest) GetHomePage() string { + if x != nil { + return x.HomePage + } + return "" +} + +func (x *CreateRepoRequest) GetThemeSidebar() string { + if x != nil { + return x.ThemeSidebar + } + return "" +} + +func (x *CreateRepoRequest) GetThemeColor() string { + if x != nil { + return x.ThemeColor + } + return "" +} + +type CreateRepoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateRepoResponse) Reset() { + *x = CreateRepoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRepoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRepoResponse) ProtoMessage() {} + +func (x *CreateRepoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRepoResponse.ProtoReflect.Descriptor instead. +func (*CreateRepoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{1} +} + +// 2.GetRepoConfig +type GetRepoConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` +} + +func (x *GetRepoConfigRequest) Reset() { + *x = GetRepoConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRepoConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepoConfigRequest) ProtoMessage() {} + +func (x *GetRepoConfigRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepoConfigRequest.ProtoReflect.Descriptor instead. +func (*GetRepoConfigRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{2} +} + +func (x *GetRepoConfigRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetRepoConfigRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +type GetRepoConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Config string `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` + VisibilityLevel string `protobuf:"bytes,3,opt,name=visibility_level,json=visibilityLevel,proto3" json:"visibility_level,omitempty"` + ThemeSidebar string `protobuf:"bytes,4,opt,name=theme_sidebar,json=themeSidebar,proto3" json:"theme_sidebar,omitempty"` + ThemeColor string `protobuf:"bytes,5,opt,name=theme_color,json=themeColor,proto3" json:"theme_color,omitempty"` +} + +func (x *GetRepoConfigResponse) Reset() { + *x = GetRepoConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRepoConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepoConfigResponse) ProtoMessage() {} + +func (x *GetRepoConfigResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepoConfigResponse.ProtoReflect.Descriptor instead. +func (*GetRepoConfigResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{3} +} + +func (x *GetRepoConfigResponse) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetRepoConfigResponse) GetConfig() string { + if x != nil { + return x.Config + } + return "" +} + +func (x *GetRepoConfigResponse) GetVisibilityLevel() string { + if x != nil { + return x.VisibilityLevel + } + return "" +} + +func (x *GetRepoConfigResponse) GetThemeSidebar() string { + if x != nil { + return x.ThemeSidebar + } + return "" +} + +func (x *GetRepoConfigResponse) GetThemeColor() string { + if x != nil { + return x.ThemeColor + } + return "" +} + +// 3.DeleteRepo +type DeleteRepoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` +} + +func (x *DeleteRepoRequest) Reset() { + *x = DeleteRepoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRepoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRepoRequest) ProtoMessage() {} + +func (x *DeleteRepoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRepoRequest.ProtoReflect.Descriptor instead. +func (*DeleteRepoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{4} +} + +func (x *DeleteRepoRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *DeleteRepoRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +type DeleteRepoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteRepoResponse) Reset() { + *x = DeleteRepoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRepoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRepoResponse) ProtoMessage() {} + +func (x *DeleteRepoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRepoResponse.ProtoReflect.Descriptor instead. +func (*DeleteRepoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{5} +} + +// 4.ManualSyncRepo +type ManualSyncRepoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` +} + +func (x *ManualSyncRepoRequest) Reset() { + *x = ManualSyncRepoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ManualSyncRepoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManualSyncRepoRequest) ProtoMessage() {} + +func (x *ManualSyncRepoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ManualSyncRepoRequest.ProtoReflect.Descriptor instead. +func (*ManualSyncRepoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{6} +} + +func (x *ManualSyncRepoRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ManualSyncRepoRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +type ManualSyncRepoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ManualSyncRepoResponse) Reset() { + *x = ManualSyncRepoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ManualSyncRepoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManualSyncRepoResponse) ProtoMessage() {} + +func (x *ManualSyncRepoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ManualSyncRepoResponse.ProtoReflect.Descriptor instead. +func (*ManualSyncRepoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{7} +} + +// 5.AutoSyncRepo +type AutoSyncRepoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + SyncToken string `protobuf:"bytes,3,opt,name=sync_token,json=syncToken,proto3" json:"sync_token,omitempty"` +} + +func (x *AutoSyncRepoRequest) Reset() { + *x = AutoSyncRepoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoSyncRepoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoSyncRepoRequest) ProtoMessage() {} + +func (x *AutoSyncRepoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoSyncRepoRequest.ProtoReflect.Descriptor instead. +func (*AutoSyncRepoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{8} +} + +func (x *AutoSyncRepoRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *AutoSyncRepoRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *AutoSyncRepoRequest) GetSyncToken() string { + if x != nil { + return x.SyncToken + } + return "" +} + +type AutoSyncRepoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AutoSyncRepoResponse) Reset() { + *x = AutoSyncRepoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoSyncRepoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoSyncRepoResponse) ProtoMessage() {} + +func (x *AutoSyncRepoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutoSyncRepoResponse.ProtoReflect.Descriptor instead. +func (*AutoSyncRepoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{9} +} + +// 6.UpdateRepoInfo +type UpdateRepoInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + OldRepoName string `protobuf:"bytes,2,opt,name=old_repo_name,json=oldRepoName,proto3" json:"old_repo_name,omitempty"` + RepoName string `protobuf:"bytes,3,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + GitAccessToken string `protobuf:"bytes,4,opt,name=git_access_token,json=gitAccessToken,proto3" json:"git_access_token,omitempty"` + RepoDescription string `protobuf:"bytes,5,opt,name=repo_description,json=repoDescription,proto3" json:"repo_description,omitempty"` + VisibilityLevel string `protobuf:"bytes,6,opt,name=visibility_level,json=visibilityLevel,proto3" json:"visibility_level,omitempty"` + SyncToken string `protobuf:"bytes,7,opt,name=sync_token,json=syncToken,proto3" json:"sync_token,omitempty"` + HomePage string `protobuf:"bytes,8,opt,name=home_page,json=homePage,proto3" json:"home_page,omitempty"` + ThemeSidebar string `protobuf:"bytes,9,opt,name=theme_sidebar,json=themeSidebar,proto3" json:"theme_sidebar,omitempty"` + ThemeColor string `protobuf:"bytes,10,opt,name=theme_color,json=themeColor,proto3" json:"theme_color,omitempty"` +} + +func (x *UpdateRepoInfoRequest) Reset() { + *x = UpdateRepoInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRepoInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRepoInfoRequest) ProtoMessage() {} + +func (x *UpdateRepoInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRepoInfoRequest.ProtoReflect.Descriptor instead. +func (*UpdateRepoInfoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{10} +} + +func (x *UpdateRepoInfoRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *UpdateRepoInfoRequest) GetOldRepoName() string { + if x != nil { + return x.OldRepoName + } + return "" +} + +func (x *UpdateRepoInfoRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *UpdateRepoInfoRequest) GetGitAccessToken() string { + if x != nil { + return x.GitAccessToken + } + return "" +} + +func (x *UpdateRepoInfoRequest) GetRepoDescription() string { + if x != nil { + return x.RepoDescription + } + return "" +} + +func (x *UpdateRepoInfoRequest) GetVisibilityLevel() string { + if x != nil { + return x.VisibilityLevel + } + return "" +} + +func (x *UpdateRepoInfoRequest) GetSyncToken() string { + if x != nil { + return x.SyncToken + } + return "" +} + +func (x *UpdateRepoInfoRequest) GetHomePage() string { + if x != nil { + return x.HomePage + } + return "" +} + +func (x *UpdateRepoInfoRequest) GetThemeSidebar() string { + if x != nil { + return x.ThemeSidebar + } + return "" +} + +func (x *UpdateRepoInfoRequest) GetThemeColor() string { + if x != nil { + return x.ThemeColor + } + return "" +} + +type UpdateRepoInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateRepoInfoResponse) Reset() { + *x = UpdateRepoInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateRepoInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateRepoInfoResponse) ProtoMessage() {} + +func (x *UpdateRepoInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateRepoInfoResponse.ProtoReflect.Descriptor instead. +func (*UpdateRepoInfoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{11} +} + +// 7.GetRepoBasicInfo +type GetRepoBasicInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` +} + +func (x *GetRepoBasicInfoRequest) Reset() { + *x = GetRepoBasicInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRepoBasicInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepoBasicInfoRequest) ProtoMessage() {} + +func (x *GetRepoBasicInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepoBasicInfoRequest.ProtoReflect.Descriptor instead. +func (*GetRepoBasicInfoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{12} +} + +func (x *GetRepoBasicInfoRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetRepoBasicInfoRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +type GetRepoBasicInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + Avatar []byte `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` + RepoDescription string `protobuf:"bytes,6,opt,name=repo_description,json=repoDescription,proto3" json:"repo_description,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + HomePage string `protobuf:"bytes,8,opt,name=home_page,json=homePage,proto3" json:"home_page,omitempty"` +} + +func (x *GetRepoBasicInfoResponse) Reset() { + *x = GetRepoBasicInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRepoBasicInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepoBasicInfoResponse) ProtoMessage() {} + +func (x *GetRepoBasicInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepoBasicInfoResponse.ProtoReflect.Descriptor instead. +func (*GetRepoBasicInfoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{13} +} + +func (x *GetRepoBasicInfoResponse) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *GetRepoBasicInfoResponse) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetRepoBasicInfoResponse) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *GetRepoBasicInfoResponse) GetAvatar() []byte { + if x != nil { + return x.Avatar + } + return nil +} + +func (x *GetRepoBasicInfoResponse) GetRepoDescription() string { + if x != nil { + return x.RepoDescription + } + return "" +} + +func (x *GetRepoBasicInfoResponse) GetUpdatedAt() *timestamppb.Timestamp { + if x != nil { + return x.UpdatedAt + } + return nil +} + +func (x *GetRepoBasicInfoResponse) GetHomePage() string { + if x != nil { + return x.HomePage + } + return "" +} + +// 9.ListUserOwnRepo +type ListUserOwnRepoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + PageId int32 `protobuf:"varint,2,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,4,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListUserOwnRepoRequest) Reset() { + *x = ListUserOwnRepoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserOwnRepoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserOwnRepoRequest) ProtoMessage() {} + +func (x *ListUserOwnRepoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserOwnRepoRequest.ProtoReflect.Descriptor instead. +func (*ListUserOwnRepoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{14} +} + +func (x *ListUserOwnRepoRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListUserOwnRepoRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListUserOwnRepoRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListUserOwnRepoRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListUserOwnRepoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListRepoInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListUserOwnRepoResponse) Reset() { + *x = ListUserOwnRepoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserOwnRepoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserOwnRepoResponse) ProtoMessage() {} + +func (x *ListUserOwnRepoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserOwnRepoResponse.ProtoReflect.Descriptor instead. +func (*ListUserOwnRepoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{15} +} + +func (x *ListUserOwnRepoResponse) GetElements() []*models.ListRepoInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 10.GetListUserOwnRepoCount +type GetListUserOwnRepoCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *GetListUserOwnRepoCountRequest) Reset() { + *x = GetListUserOwnRepoCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListUserOwnRepoCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListUserOwnRepoCountRequest) ProtoMessage() {} + +func (x *GetListUserOwnRepoCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListUserOwnRepoCountRequest.ProtoReflect.Descriptor instead. +func (*GetListUserOwnRepoCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{16} +} + +func (x *GetListUserOwnRepoCountRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetListUserOwnRepoCountRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type GetListUserOwnRepoCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListUserOwnRepoCountResponse) Reset() { + *x = GetListUserOwnRepoCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListUserOwnRepoCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListUserOwnRepoCountResponse) ProtoMessage() {} + +func (x *GetListUserOwnRepoCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListUserOwnRepoCountResponse.ProtoReflect.Descriptor instead. +func (*GetListUserOwnRepoCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{17} +} + +func (x *GetListUserOwnRepoCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 11.ListUserLikeRepo +type ListUserLikeRepoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + PageId int32 `protobuf:"varint,2,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,4,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListUserLikeRepoRequest) Reset() { + *x = ListUserLikeRepoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserLikeRepoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserLikeRepoRequest) ProtoMessage() {} + +func (x *ListUserLikeRepoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserLikeRepoRequest.ProtoReflect.Descriptor instead. +func (*ListUserLikeRepoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{18} +} + +func (x *ListUserLikeRepoRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListUserLikeRepoRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListUserLikeRepoRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListUserLikeRepoRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListUserLikeRepoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListRepoInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListUserLikeRepoResponse) Reset() { + *x = ListUserLikeRepoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserLikeRepoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserLikeRepoResponse) ProtoMessage() {} + +func (x *ListUserLikeRepoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserLikeRepoResponse.ProtoReflect.Descriptor instead. +func (*ListUserLikeRepoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{19} +} + +func (x *ListUserLikeRepoResponse) GetElements() []*models.ListRepoInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 12.GetListUserLikeRepoCount +type GetListUserLikeRepoCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *GetListUserLikeRepoCountRequest) Reset() { + *x = GetListUserLikeRepoCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListUserLikeRepoCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListUserLikeRepoCountRequest) ProtoMessage() {} + +func (x *GetListUserLikeRepoCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListUserLikeRepoCountRequest.ProtoReflect.Descriptor instead. +func (*GetListUserLikeRepoCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{20} +} + +func (x *GetListUserLikeRepoCountRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetListUserLikeRepoCountRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type GetListUserLikeRepoCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListUserLikeRepoCountResponse) Reset() { + *x = GetListUserLikeRepoCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListUserLikeRepoCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListUserLikeRepoCountResponse) ProtoMessage() {} + +func (x *GetListUserLikeRepoCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListUserLikeRepoCountResponse.ProtoReflect.Descriptor instead. +func (*GetListUserLikeRepoCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{21} +} + +func (x *GetListUserLikeRepoCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 13.ListRepo +type ListRepoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListRepoRequest) Reset() { + *x = ListRepoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRepoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRepoRequest) ProtoMessage() {} + +func (x *ListRepoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRepoRequest.ProtoReflect.Descriptor instead. +func (*ListRepoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{22} +} + +func (x *ListRepoRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListRepoRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListRepoRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListRepoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListRepoInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListRepoResponse) Reset() { + *x = ListRepoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRepoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRepoResponse) ProtoMessage() {} + +func (x *ListRepoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRepoResponse.ProtoReflect.Descriptor instead. +func (*ListRepoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{23} +} + +func (x *ListRepoResponse) GetElements() []*models.ListRepoInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 14.GetListRepoCount +type GetListRepoCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *GetListRepoCountRequest) Reset() { + *x = GetListRepoCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListRepoCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListRepoCountRequest) ProtoMessage() {} + +func (x *GetListRepoCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListRepoCountRequest.ProtoReflect.Descriptor instead. +func (*GetListRepoCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{24} +} + +func (x *GetListRepoCountRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type GetListRepoCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListRepoCountResponse) Reset() { + *x = GetListRepoCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListRepoCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListRepoCountResponse) ProtoMessage() {} + +func (x *GetListRepoCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListRepoCountResponse.ProtoReflect.Descriptor instead. +func (*GetListRepoCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_proto_rawDescGZIP(), []int{25} +} + +func (x *GetListRepoCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +var File_rpcs_rpc_repo_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_repo_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x11, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x73, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x02, + 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x67, + 0x69, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, + 0x69, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x69, 0x74, 0x5f, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x67, 0x69, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x29, 0x0a, 0x10, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x69, 0x73, 0x69, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x6f, + 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, + 0x6f, 0x6d, 0x65, 0x50, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x68, 0x65, 0x6d, 0x65, + 0x5f, 0x73, 0x69, 0x64, 0x65, 0x62, 0x61, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x74, 0x68, 0x65, 0x6d, 0x65, 0x53, 0x69, 0x64, 0x65, 0x62, 0x61, 0x72, 0x12, 0x1f, 0x0a, 0x0b, + 0x74, 0x68, 0x65, 0x6d, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x22, 0x14, 0x0a, + 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x4f, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, + 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xbc, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x23, 0x0a, + 0x0d, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x5f, 0x73, 0x69, 0x64, 0x65, 0x62, 0x61, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x53, 0x69, 0x64, 0x65, 0x62, + 0x61, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x22, 0x4c, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x0a, 0x15, 0x4d, 0x61, 0x6e, 0x75, 0x61, + 0x6c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x4d, 0x61, 0x6e, + 0x75, 0x61, 0x6c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x6d, 0x0a, 0x13, 0x41, 0x75, 0x74, 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x52, + 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0x16, 0x0a, 0x14, 0x41, 0x75, 0x74, 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, + 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xf6, 0x02, 0x0a, 0x15, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x22, 0x0a, 0x0d, 0x6f, 0x6c, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x70, 0x6f, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x28, 0x0a, 0x10, 0x67, 0x69, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x67, 0x69, 0x74, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, + 0x65, 0x70, 0x6f, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x6f, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x6d, 0x65, 0x50, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x5f, 0x73, 0x69, 0x64, 0x65, 0x62, 0x61, 0x72, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x53, 0x69, 0x64, 0x65, 0x62, + 0x61, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x5f, 0x63, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x22, 0x18, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x52, 0x0a, + 0x17, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x84, 0x02, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x42, 0x61, 0x73, + 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, + 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x0a, + 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x61, + 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x68, + 0x6f, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x68, 0x6f, 0x6d, 0x65, 0x50, 0x61, 0x67, 0x65, 0x22, 0x80, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, + 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x47, 0x0a, 0x17, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x22, 0x52, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x37, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x22, 0x81, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, + 0x6b, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, + 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x48, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x4c, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, + 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0x53, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, + 0x6b, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x22, 0x38, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x4c, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x5d, + 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, + 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x40, 0x0a, + 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, + 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0x2f, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x22, 0x30, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, + 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_repo_proto_rawDescOnce sync.Once + file_rpcs_rpc_repo_proto_rawDescData = file_rpcs_rpc_repo_proto_rawDesc +) + +func file_rpcs_rpc_repo_proto_rawDescGZIP() []byte { + file_rpcs_rpc_repo_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_repo_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_repo_proto_rawDescData) + }) + return file_rpcs_rpc_repo_proto_rawDescData +} + +var file_rpcs_rpc_repo_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_rpcs_rpc_repo_proto_goTypes = []interface{}{ + (*CreateRepoRequest)(nil), // 0: pb.CreateRepoRequest + (*CreateRepoResponse)(nil), // 1: pb.CreateRepoResponse + (*GetRepoConfigRequest)(nil), // 2: pb.GetRepoConfigRequest + (*GetRepoConfigResponse)(nil), // 3: pb.GetRepoConfigResponse + (*DeleteRepoRequest)(nil), // 4: pb.DeleteRepoRequest + (*DeleteRepoResponse)(nil), // 5: pb.DeleteRepoResponse + (*ManualSyncRepoRequest)(nil), // 6: pb.ManualSyncRepoRequest + (*ManualSyncRepoResponse)(nil), // 7: pb.ManualSyncRepoResponse + (*AutoSyncRepoRequest)(nil), // 8: pb.AutoSyncRepoRequest + (*AutoSyncRepoResponse)(nil), // 9: pb.AutoSyncRepoResponse + (*UpdateRepoInfoRequest)(nil), // 10: pb.UpdateRepoInfoRequest + (*UpdateRepoInfoResponse)(nil), // 11: pb.UpdateRepoInfoResponse + (*GetRepoBasicInfoRequest)(nil), // 12: pb.GetRepoBasicInfoRequest + (*GetRepoBasicInfoResponse)(nil), // 13: pb.GetRepoBasicInfoResponse + (*ListUserOwnRepoRequest)(nil), // 14: pb.ListUserOwnRepoRequest + (*ListUserOwnRepoResponse)(nil), // 15: pb.ListUserOwnRepoResponse + (*GetListUserOwnRepoCountRequest)(nil), // 16: pb.GetListUserOwnRepoCountRequest + (*GetListUserOwnRepoCountResponse)(nil), // 17: pb.GetListUserOwnRepoCountResponse + (*ListUserLikeRepoRequest)(nil), // 18: pb.ListUserLikeRepoRequest + (*ListUserLikeRepoResponse)(nil), // 19: pb.ListUserLikeRepoResponse + (*GetListUserLikeRepoCountRequest)(nil), // 20: pb.GetListUserLikeRepoCountRequest + (*GetListUserLikeRepoCountResponse)(nil), // 21: pb.GetListUserLikeRepoCountResponse + (*ListRepoRequest)(nil), // 22: pb.ListRepoRequest + (*ListRepoResponse)(nil), // 23: pb.ListRepoResponse + (*GetListRepoCountRequest)(nil), // 24: pb.GetListRepoCountRequest + (*GetListRepoCountResponse)(nil), // 25: pb.GetListRepoCountResponse + (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*models.ListRepoInfo)(nil), // 27: pb.ListRepoInfo +} +var file_rpcs_rpc_repo_proto_depIdxs = []int32{ + 26, // 0: pb.GetRepoBasicInfoResponse.updated_at:type_name -> google.protobuf.Timestamp + 27, // 1: pb.ListUserOwnRepoResponse.elements:type_name -> pb.ListRepoInfo + 27, // 2: pb.ListUserLikeRepoResponse.elements:type_name -> pb.ListRepoInfo + 27, // 3: pb.ListRepoResponse.elements:type_name -> pb.ListRepoInfo + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_repo_proto_init() } +func file_rpcs_rpc_repo_proto_init() { + if File_rpcs_rpc_repo_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_repo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRepoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRepoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRepoConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRepoConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRepoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRepoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManualSyncRepoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManualSyncRepoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AutoSyncRepoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AutoSyncRepoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRepoInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateRepoInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRepoBasicInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRepoBasicInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserOwnRepoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserOwnRepoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListUserOwnRepoCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListUserOwnRepoCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserLikeRepoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserLikeRepoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListUserLikeRepoCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListUserLikeRepoCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRepoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRepoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListRepoCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListRepoCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_repo_proto_rawDesc, + NumEnums: 0, + NumMessages: 26, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_repo_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_repo_proto_depIdxs, + MessageInfos: file_rpcs_rpc_repo_proto_msgTypes, + }.Build() + File_rpcs_rpc_repo_proto = out.File + file_rpcs_rpc_repo_proto_rawDesc = nil + file_rpcs_rpc_repo_proto_goTypes = nil + file_rpcs_rpc_repo_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_repo_relation.pb.go b/zbook_backend/pb/rpcs/rpc_repo_relation.pb.go new file mode 100644 index 0000000..c2a6476 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_repo_relation.pb.go @@ -0,0 +1,954 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_repo_relation.proto + +package rpcs + +import ( + models "github.com/zizdlp/zbook/pb/models" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.CreateRepoRelation +type CreateRepoRelationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + RelationType string `protobuf:"bytes,3,opt,name=relation_type,json=relationType,proto3" json:"relation_type,omitempty"` +} + +func (x *CreateRepoRelationRequest) Reset() { + *x = CreateRepoRelationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRepoRelationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRepoRelationRequest) ProtoMessage() {} + +func (x *CreateRepoRelationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRepoRelationRequest.ProtoReflect.Descriptor instead. +func (*CreateRepoRelationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateRepoRelationRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *CreateRepoRelationRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *CreateRepoRelationRequest) GetRelationType() string { + if x != nil { + return x.RelationType + } + return "" +} + +type CreateRepoRelationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LikeId int64 `protobuf:"varint,1,opt,name=like_id,json=likeId,proto3" json:"like_id,omitempty"` +} + +func (x *CreateRepoRelationResponse) Reset() { + *x = CreateRepoRelationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRepoRelationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRepoRelationResponse) ProtoMessage() {} + +func (x *CreateRepoRelationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRepoRelationResponse.ProtoReflect.Descriptor instead. +func (*CreateRepoRelationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateRepoRelationResponse) GetLikeId() int64 { + if x != nil { + return x.LikeId + } + return 0 +} + +// 2.DeleteRepoRelation +type DeleteRepoRelationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + RelationType string `protobuf:"bytes,3,opt,name=relation_type,json=relationType,proto3" json:"relation_type,omitempty"` +} + +func (x *DeleteRepoRelationRequest) Reset() { + *x = DeleteRepoRelationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRepoRelationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRepoRelationRequest) ProtoMessage() {} + +func (x *DeleteRepoRelationRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRepoRelationRequest.ProtoReflect.Descriptor instead. +func (*DeleteRepoRelationRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{2} +} + +func (x *DeleteRepoRelationRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *DeleteRepoRelationRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *DeleteRepoRelationRequest) GetRelationType() string { + if x != nil { + return x.RelationType + } + return "" +} + +type DeleteRepoRelationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteRepoRelationResponse) Reset() { + *x = DeleteRepoRelationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRepoRelationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRepoRelationResponse) ProtoMessage() {} + +func (x *DeleteRepoRelationResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRepoRelationResponse.ProtoReflect.Descriptor instead. +func (*DeleteRepoRelationResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{3} +} + +// 3.CreateRepoVisibility +type CreateRepoVisibilityRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RepoUsername string `protobuf:"bytes,1,opt,name=repo_username,json=repoUsername,proto3" json:"repo_username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` +} + +func (x *CreateRepoVisibilityRequest) Reset() { + *x = CreateRepoVisibilityRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRepoVisibilityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRepoVisibilityRequest) ProtoMessage() {} + +func (x *CreateRepoVisibilityRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRepoVisibilityRequest.ProtoReflect.Descriptor instead. +func (*CreateRepoVisibilityRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{4} +} + +func (x *CreateRepoVisibilityRequest) GetRepoUsername() string { + if x != nil { + return x.RepoUsername + } + return "" +} + +func (x *CreateRepoVisibilityRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *CreateRepoVisibilityRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type CreateRepoVisibilityResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateRepoVisibilityResponse) Reset() { + *x = CreateRepoVisibilityResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRepoVisibilityResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRepoVisibilityResponse) ProtoMessage() {} + +func (x *CreateRepoVisibilityResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRepoVisibilityResponse.ProtoReflect.Descriptor instead. +func (*CreateRepoVisibilityResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{5} +} + +// 4.DeleteRepoVisibility +type DeleteRepoVisibilityRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RepoUsername string `protobuf:"bytes,1,opt,name=repo_username,json=repoUsername,proto3" json:"repo_username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` +} + +func (x *DeleteRepoVisibilityRequest) Reset() { + *x = DeleteRepoVisibilityRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRepoVisibilityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRepoVisibilityRequest) ProtoMessage() {} + +func (x *DeleteRepoVisibilityRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRepoVisibilityRequest.ProtoReflect.Descriptor instead. +func (*DeleteRepoVisibilityRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{6} +} + +func (x *DeleteRepoVisibilityRequest) GetRepoUsername() string { + if x != nil { + return x.RepoUsername + } + return "" +} + +func (x *DeleteRepoVisibilityRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *DeleteRepoVisibilityRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type DeleteRepoVisibilityResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteRepoVisibilityResponse) Reset() { + *x = DeleteRepoVisibilityResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteRepoVisibilityResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteRepoVisibilityResponse) ProtoMessage() {} + +func (x *DeleteRepoVisibilityResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteRepoVisibilityResponse.ProtoReflect.Descriptor instead. +func (*DeleteRepoVisibilityResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{7} +} + +// 5.ListRepoVisibility +type ListRepoVisibilityRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,4,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` + Query string `protobuf:"bytes,5,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListRepoVisibilityRequest) Reset() { + *x = ListRepoVisibilityRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRepoVisibilityRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRepoVisibilityRequest) ProtoMessage() {} + +func (x *ListRepoVisibilityRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRepoVisibilityRequest.ProtoReflect.Descriptor instead. +func (*ListRepoVisibilityRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{8} +} + +func (x *ListRepoVisibilityRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListRepoVisibilityRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListRepoVisibilityRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ListRepoVisibilityRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +func (x *ListRepoVisibilityRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListRepoVisibilityResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListUserRepoVisiblityInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListRepoVisibilityResponse) Reset() { + *x = ListRepoVisibilityResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListRepoVisibilityResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListRepoVisibilityResponse) ProtoMessage() {} + +func (x *ListRepoVisibilityResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListRepoVisibilityResponse.ProtoReflect.Descriptor instead. +func (*ListRepoVisibilityResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{9} +} + +func (x *ListRepoVisibilityResponse) GetElements() []*models.ListUserRepoVisiblityInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 6.GetRepoVisibilityCount +type GetRepoVisibilityCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + RepoName string `protobuf:"bytes,2,opt,name=repo_name,json=repoName,proto3" json:"repo_name,omitempty"` +} + +func (x *GetRepoVisibilityCountRequest) Reset() { + *x = GetRepoVisibilityCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRepoVisibilityCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepoVisibilityCountRequest) ProtoMessage() {} + +func (x *GetRepoVisibilityCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepoVisibilityCountRequest.ProtoReflect.Descriptor instead. +func (*GetRepoVisibilityCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{10} +} + +func (x *GetRepoVisibilityCountRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetRepoVisibilityCountRequest) GetRepoName() string { + if x != nil { + return x.RepoName + } + return "" +} + +type GetRepoVisibilityCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetRepoVisibilityCountResponse) Reset() { + *x = GetRepoVisibilityCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRepoVisibilityCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRepoVisibilityCountResponse) ProtoMessage() {} + +func (x *GetRepoVisibilityCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_repo_relation_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRepoVisibilityCountResponse.ProtoReflect.Descriptor instead. +func (*GetRepoVisibilityCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_repo_relation_proto_rawDescGZIP(), []int{11} +} + +func (x *GetRepoVisibilityCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +var File_rpcs_rpc_repo_relation_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_repo_relation_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, + 0x70, 0x62, 0x1a, 0x1a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x79, + 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x6c, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x35, 0x0a, 0x1a, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6c, 0x69, 0x6b, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x69, 0x6b, 0x65, 0x49, 0x64, + 0x22, 0x79, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, + 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, + 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7b, 0x0a, 0x1b, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7b, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, + 0x70, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, + 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, + 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, + 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x57, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x74, + 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, + 0x58, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x72, 0x65, 0x70, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x36, 0x0a, 0x1e, 0x47, 0x65, 0x74, + 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, + 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_repo_relation_proto_rawDescOnce sync.Once + file_rpcs_rpc_repo_relation_proto_rawDescData = file_rpcs_rpc_repo_relation_proto_rawDesc +) + +func file_rpcs_rpc_repo_relation_proto_rawDescGZIP() []byte { + file_rpcs_rpc_repo_relation_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_repo_relation_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_repo_relation_proto_rawDescData) + }) + return file_rpcs_rpc_repo_relation_proto_rawDescData +} + +var file_rpcs_rpc_repo_relation_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_rpcs_rpc_repo_relation_proto_goTypes = []interface{}{ + (*CreateRepoRelationRequest)(nil), // 0: pb.CreateRepoRelationRequest + (*CreateRepoRelationResponse)(nil), // 1: pb.CreateRepoRelationResponse + (*DeleteRepoRelationRequest)(nil), // 2: pb.DeleteRepoRelationRequest + (*DeleteRepoRelationResponse)(nil), // 3: pb.DeleteRepoRelationResponse + (*CreateRepoVisibilityRequest)(nil), // 4: pb.CreateRepoVisibilityRequest + (*CreateRepoVisibilityResponse)(nil), // 5: pb.CreateRepoVisibilityResponse + (*DeleteRepoVisibilityRequest)(nil), // 6: pb.DeleteRepoVisibilityRequest + (*DeleteRepoVisibilityResponse)(nil), // 7: pb.DeleteRepoVisibilityResponse + (*ListRepoVisibilityRequest)(nil), // 8: pb.ListRepoVisibilityRequest + (*ListRepoVisibilityResponse)(nil), // 9: pb.ListRepoVisibilityResponse + (*GetRepoVisibilityCountRequest)(nil), // 10: pb.GetRepoVisibilityCountRequest + (*GetRepoVisibilityCountResponse)(nil), // 11: pb.GetRepoVisibilityCountResponse + (*models.ListUserRepoVisiblityInfo)(nil), // 12: pb.ListUserRepoVisiblityInfo +} +var file_rpcs_rpc_repo_relation_proto_depIdxs = []int32{ + 12, // 0: pb.ListRepoVisibilityResponse.elements:type_name -> pb.ListUserRepoVisiblityInfo + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_repo_relation_proto_init() } +func file_rpcs_rpc_repo_relation_proto_init() { + if File_rpcs_rpc_repo_relation_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_repo_relation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRepoRelationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRepoRelationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRepoRelationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRepoRelationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRepoVisibilityRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRepoVisibilityResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRepoVisibilityRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteRepoVisibilityResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRepoVisibilityRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListRepoVisibilityResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRepoVisibilityCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_repo_relation_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRepoVisibilityCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_repo_relation_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_repo_relation_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_repo_relation_proto_depIdxs, + MessageInfos: file_rpcs_rpc_repo_relation_proto_msgTypes, + }.Build() + File_rpcs_rpc_repo_relation_proto = out.File + file_rpcs_rpc_repo_relation_proto_rawDesc = nil + file_rpcs_rpc_repo_relation_proto_goTypes = nil + file_rpcs_rpc_repo_relation_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_user.pb.go b/zbook_backend/pb/rpcs/rpc_user.pb.go new file mode 100644 index 0000000..c179408 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_user.pb.go @@ -0,0 +1,1560 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_user.proto + +package rpcs + +import ( + models "github.com/zizdlp/zbook/pb/models" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.CreateUser +type CreateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + InvitationUrl string `protobuf:"bytes,4,opt,name=invitation_url,json=invitationUrl,proto3" json:"invitation_url,omitempty"` +} + +func (x *CreateUserRequest) Reset() { + *x = CreateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserRequest) ProtoMessage() {} + +func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. +func (*CreateUserRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *CreateUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *CreateUserRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *CreateUserRequest) GetInvitationUrl() string { + if x != nil { + return x.InvitationUrl + } + return "" +} + +type CreateUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateUserResponse) Reset() { + *x = CreateUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserResponse) ProtoMessage() {} + +func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead. +func (*CreateUserResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{1} +} + +// 2.LoginUser +type LoginUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *LoginUserRequest) Reset() { + *x = LoginUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginUserRequest) ProtoMessage() {} + +func (x *LoginUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginUserRequest.ProtoReflect.Descriptor instead. +func (*LoginUserRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{2} +} + +func (x *LoginUserRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *LoginUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type LoginUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` + AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` + AccessTokenExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=access_token_expires_at,json=accessTokenExpiresAt,proto3" json:"access_token_expires_at,omitempty"` + RefreshTokenExpiresAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=refresh_token_expires_at,json=refreshTokenExpiresAt,proto3" json:"refresh_token_expires_at,omitempty"` +} + +func (x *LoginUserResponse) Reset() { + *x = LoginUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginUserResponse) ProtoMessage() {} + +func (x *LoginUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginUserResponse.ProtoReflect.Descriptor instead. +func (*LoginUserResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{3} +} + +func (x *LoginUserResponse) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginUserResponse) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +func (x *LoginUserResponse) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *LoginUserResponse) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +func (x *LoginUserResponse) GetAccessTokenExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.AccessTokenExpiresAt + } + return nil +} + +func (x *LoginUserResponse) GetRefreshTokenExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.RefreshTokenExpiresAt + } + return nil +} + +// 3.UpdateUser +type UpdateUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Motto string `protobuf:"bytes,1,opt,name=motto,proto3" json:"motto,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + Avatar []byte `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` +} + +func (x *UpdateUserRequest) Reset() { + *x = UpdateUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserRequest) ProtoMessage() {} + +func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateUserRequest) GetMotto() string { + if x != nil { + return x.Motto + } + return "" +} + +func (x *UpdateUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *UpdateUserRequest) GetAvatar() []byte { + if x != nil { + return x.Avatar + } + return nil +} + +type UpdateUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateUserResponse) Reset() { + *x = UpdateUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserResponse) ProtoMessage() {} + +func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead. +func (*UpdateUserResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{5} +} + +// 4.UpdateUserOnBoarding +type UpdateUserOnBoardingRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Onboarding bool `protobuf:"varint,1,opt,name=onboarding,proto3" json:"onboarding,omitempty"` +} + +func (x *UpdateUserOnBoardingRequest) Reset() { + *x = UpdateUserOnBoardingRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserOnBoardingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserOnBoardingRequest) ProtoMessage() {} + +func (x *UpdateUserOnBoardingRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserOnBoardingRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserOnBoardingRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{6} +} + +func (x *UpdateUserOnBoardingRequest) GetOnboarding() bool { + if x != nil { + return x.Onboarding + } + return false +} + +type UpdateUserOnBoardingResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Onboarding bool `protobuf:"varint,1,opt,name=onboarding,proto3" json:"onboarding,omitempty"` +} + +func (x *UpdateUserOnBoardingResponse) Reset() { + *x = UpdateUserOnBoardingResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserOnBoardingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserOnBoardingResponse) ProtoMessage() {} + +func (x *UpdateUserOnBoardingResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserOnBoardingResponse.ProtoReflect.Descriptor instead. +func (*UpdateUserOnBoardingResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateUserOnBoardingResponse) GetOnboarding() bool { + if x != nil { + return x.Onboarding + } + return false +} + +// 5.QueryUser +type QueryUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *QueryUserRequest) Reset() { + *x = QueryUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryUserRequest) ProtoMessage() {} + +func (x *QueryUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryUserRequest.ProtoReflect.Descriptor instead. +func (*QueryUserRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{8} +} + +func (x *QueryUserRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *QueryUserRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *QueryUserRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type QueryUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListUserInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *QueryUserResponse) Reset() { + *x = QueryUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryUserResponse) ProtoMessage() {} + +func (x *QueryUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryUserResponse.ProtoReflect.Descriptor instead. +func (*QueryUserResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryUserResponse) GetElements() []*models.ListUserInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 6.GetUserInfo +type GetUserInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + UserCount bool `protobuf:"varint,2,opt,name=user_count,json=userCount,proto3" json:"user_count,omitempty"` + UserBasic bool `protobuf:"varint,3,opt,name=user_basic,json=userBasic,proto3" json:"user_basic,omitempty"` + UserImage bool `protobuf:"varint,4,opt,name=user_image,json=userImage,proto3" json:"user_image,omitempty"` +} + +func (x *GetUserInfoRequest) Reset() { + *x = GetUserInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserInfoRequest) ProtoMessage() {} + +func (x *GetUserInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserInfoRequest.ProtoReflect.Descriptor instead. +func (*GetUserInfoRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{10} +} + +func (x *GetUserInfoRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *GetUserInfoRequest) GetUserCount() bool { + if x != nil { + return x.UserCount + } + return false +} + +func (x *GetUserInfoRequest) GetUserBasic() bool { + if x != nil { + return x.UserBasic + } + return false +} + +func (x *GetUserInfoRequest) GetUserImage() bool { + if x != nil { + return x.UserImage + } + return false +} + +type GetUserInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserCountInfo *models.UserCountInfo `protobuf:"bytes,1,opt,name=user_count_info,json=userCountInfo,proto3" json:"user_count_info,omitempty"` + UserBasicInfo *models.UserBasicInfo `protobuf:"bytes,2,opt,name=user_basic_info,json=userBasicInfo,proto3" json:"user_basic_info,omitempty"` + UserImageInfo *models.UserImageInfo `protobuf:"bytes,3,opt,name=user_image_info,json=userImageInfo,proto3" json:"user_image_info,omitempty"` +} + +func (x *GetUserInfoResponse) Reset() { + *x = GetUserInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserInfoResponse) ProtoMessage() {} + +func (x *GetUserInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserInfoResponse.ProtoReflect.Descriptor instead. +func (*GetUserInfoResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{11} +} + +func (x *GetUserInfoResponse) GetUserCountInfo() *models.UserCountInfo { + if x != nil { + return x.UserCountInfo + } + return nil +} + +func (x *GetUserInfoResponse) GetUserBasicInfo() *models.UserBasicInfo { + if x != nil { + return x.UserBasicInfo + } + return nil +} + +func (x *GetUserInfoResponse) GetUserImageInfo() *models.UserImageInfo { + if x != nil { + return x.UserImageInfo + } + return nil +} + +// 7.GetUserAvatar +type GetUserAvatarRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` +} + +func (x *GetUserAvatarRequest) Reset() { + *x = GetUserAvatarRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserAvatarRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserAvatarRequest) ProtoMessage() {} + +func (x *GetUserAvatarRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserAvatarRequest.ProtoReflect.Descriptor instead. +func (*GetUserAvatarRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{12} +} + +func (x *GetUserAvatarRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +type GetUserAvatarResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Avatar []byte `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar,omitempty"` +} + +func (x *GetUserAvatarResponse) Reset() { + *x = GetUserAvatarResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetUserAvatarResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetUserAvatarResponse) ProtoMessage() {} + +func (x *GetUserAvatarResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetUserAvatarResponse.ProtoReflect.Descriptor instead. +func (*GetUserAvatarResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{13} +} + +func (x *GetUserAvatarResponse) GetAvatar() []byte { + if x != nil { + return x.Avatar + } + return nil +} + +// 8.ListUser +type ListUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId int32 `protobuf:"varint,1,opt,name=page_id,json=pageId,proto3" json:"page_id,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *ListUserRequest) Reset() { + *x = ListUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserRequest) ProtoMessage() {} + +func (x *ListUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserRequest.ProtoReflect.Descriptor instead. +func (*ListUserRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{14} +} + +func (x *ListUserRequest) GetPageId() int32 { + if x != nil { + return x.PageId + } + return 0 +} + +func (x *ListUserRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListUserRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type ListUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*models.ListUserInfo `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *ListUserResponse) Reset() { + *x = ListUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUserResponse) ProtoMessage() {} + +func (x *ListUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListUserResponse.ProtoReflect.Descriptor instead. +func (*ListUserResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{15} +} + +func (x *ListUserResponse) GetElements() []*models.ListUserInfo { + if x != nil { + return x.Elements + } + return nil +} + +// 9.GetListUserCount +type GetListUserCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *GetListUserCountRequest) Reset() { + *x = GetListUserCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListUserCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListUserCountRequest) ProtoMessage() {} + +func (x *GetListUserCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListUserCountRequest.ProtoReflect.Descriptor instead. +func (*GetListUserCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{16} +} + +func (x *GetListUserCountRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type GetListUserCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetListUserCountResponse) Reset() { + *x = GetListUserCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetListUserCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListUserCountResponse) ProtoMessage() {} + +func (x *GetListUserCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListUserCountResponse.ProtoReflect.Descriptor instead. +func (*GetListUserCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{17} +} + +func (x *GetListUserCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +// 10.GetQueryUserCount +type GetQueryUserCountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` +} + +func (x *GetQueryUserCountRequest) Reset() { + *x = GetQueryUserCountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetQueryUserCountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetQueryUserCountRequest) ProtoMessage() {} + +func (x *GetQueryUserCountRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetQueryUserCountRequest.ProtoReflect.Descriptor instead. +func (*GetQueryUserCountRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{18} +} + +func (x *GetQueryUserCountRequest) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +type GetQueryUserCountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` +} + +func (x *GetQueryUserCountResponse) Reset() { + *x = GetQueryUserCountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_user_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetQueryUserCountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetQueryUserCountResponse) ProtoMessage() {} + +func (x *GetQueryUserCountResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_user_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetQueryUserCountResponse.ProtoReflect.Descriptor instead. +func (*GetQueryUserCountResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_user_proto_rawDescGZIP(), []int{19} +} + +func (x *GetQueryUserCountResponse) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +var File_rpcs_rpc_user_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_user_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x88, 0x01, + 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x22, 0x14, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, + 0x0a, 0x10, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x22, 0xb3, 0x02, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x23, 0x0a, + 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x51, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x14, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x41, 0x74, 0x12, 0x53, 0x0a, 0x18, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, + 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x15, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x22, 0x5d, 0x0a, 0x11, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x74, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x6d, 0x6f, 0x74, 0x74, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x14, 0x0a, 0x12, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3d, 0x0a, 0x1b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x6e, 0x42, + 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, + 0x0a, 0x0a, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x3e, + 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x6e, 0x42, 0x6f, + 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, + 0x0a, 0x0a, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x5e, + 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x41, + 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0x8d, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x73, 0x69, + 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x42, 0x61, 0x73, + 0x69, 0x63, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x22, 0xc6, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x0f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x39, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x73, + 0x69, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x39, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0d, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x32, 0x0a, 0x14, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2f, + 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, + 0x5d, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x40, + 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x22, 0x2f, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x22, 0x30, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x22, 0x30, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x31, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, + 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_user_proto_rawDescOnce sync.Once + file_rpcs_rpc_user_proto_rawDescData = file_rpcs_rpc_user_proto_rawDesc +) + +func file_rpcs_rpc_user_proto_rawDescGZIP() []byte { + file_rpcs_rpc_user_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_user_proto_rawDescData) + }) + return file_rpcs_rpc_user_proto_rawDescData +} + +var file_rpcs_rpc_user_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_rpcs_rpc_user_proto_goTypes = []interface{}{ + (*CreateUserRequest)(nil), // 0: pb.CreateUserRequest + (*CreateUserResponse)(nil), // 1: pb.CreateUserResponse + (*LoginUserRequest)(nil), // 2: pb.LoginUserRequest + (*LoginUserResponse)(nil), // 3: pb.LoginUserResponse + (*UpdateUserRequest)(nil), // 4: pb.UpdateUserRequest + (*UpdateUserResponse)(nil), // 5: pb.UpdateUserResponse + (*UpdateUserOnBoardingRequest)(nil), // 6: pb.UpdateUserOnBoardingRequest + (*UpdateUserOnBoardingResponse)(nil), // 7: pb.UpdateUserOnBoardingResponse + (*QueryUserRequest)(nil), // 8: pb.QueryUserRequest + (*QueryUserResponse)(nil), // 9: pb.QueryUserResponse + (*GetUserInfoRequest)(nil), // 10: pb.GetUserInfoRequest + (*GetUserInfoResponse)(nil), // 11: pb.GetUserInfoResponse + (*GetUserAvatarRequest)(nil), // 12: pb.GetUserAvatarRequest + (*GetUserAvatarResponse)(nil), // 13: pb.GetUserAvatarResponse + (*ListUserRequest)(nil), // 14: pb.ListUserRequest + (*ListUserResponse)(nil), // 15: pb.ListUserResponse + (*GetListUserCountRequest)(nil), // 16: pb.GetListUserCountRequest + (*GetListUserCountResponse)(nil), // 17: pb.GetListUserCountResponse + (*GetQueryUserCountRequest)(nil), // 18: pb.GetQueryUserCountRequest + (*GetQueryUserCountResponse)(nil), // 19: pb.GetQueryUserCountResponse + (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp + (*models.ListUserInfo)(nil), // 21: pb.ListUserInfo + (*models.UserCountInfo)(nil), // 22: pb.UserCountInfo + (*models.UserBasicInfo)(nil), // 23: pb.UserBasicInfo + (*models.UserImageInfo)(nil), // 24: pb.UserImageInfo +} +var file_rpcs_rpc_user_proto_depIdxs = []int32{ + 20, // 0: pb.LoginUserResponse.access_token_expires_at:type_name -> google.protobuf.Timestamp + 20, // 1: pb.LoginUserResponse.refresh_token_expires_at:type_name -> google.protobuf.Timestamp + 21, // 2: pb.QueryUserResponse.elements:type_name -> pb.ListUserInfo + 22, // 3: pb.GetUserInfoResponse.user_count_info:type_name -> pb.UserCountInfo + 23, // 4: pb.GetUserInfoResponse.user_basic_info:type_name -> pb.UserBasicInfo + 24, // 5: pb.GetUserInfoResponse.user_image_info:type_name -> pb.UserImageInfo + 21, // 6: pb.ListUserResponse.elements:type_name -> pb.ListUserInfo + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_user_proto_init() } +func file_rpcs_rpc_user_proto_init() { + if File_rpcs_rpc_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserOnBoardingRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserOnBoardingResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserAvatarRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetUserAvatarResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUserResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListUserCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetListUserCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetQueryUserCountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_user_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetQueryUserCountResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 20, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_user_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_user_proto_depIdxs, + MessageInfos: file_rpcs_rpc_user_proto_msgTypes, + }.Build() + File_rpcs_rpc_user_proto = out.File + file_rpcs_rpc_user_proto_rawDesc = nil + file_rpcs_rpc_user_proto_goTypes = nil + file_rpcs_rpc_user_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/rpcs/rpc_verification.pb.go b/zbook_backend/pb/rpcs/rpc_verification.pb.go new file mode 100644 index 0000000..86d80a7 --- /dev/null +++ b/zbook_backend/pb/rpcs/rpc_verification.pb.go @@ -0,0 +1,761 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: rpcs/rpc_verification.proto + +package rpcs + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// 1.VerifyEmail +type VerifyEmailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VerificationUrl string `protobuf:"bytes,1,opt,name=verification_url,json=verificationUrl,proto3" json:"verification_url,omitempty"` +} + +func (x *VerifyEmailRequest) Reset() { + *x = VerifyEmailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyEmailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyEmailRequest) ProtoMessage() {} + +func (x *VerifyEmailRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyEmailRequest.ProtoReflect.Descriptor instead. +func (*VerifyEmailRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{0} +} + +func (x *VerifyEmailRequest) GetVerificationUrl() string { + if x != nil { + return x.VerificationUrl + } + return "" +} + +type VerifyEmailResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsVerified bool `protobuf:"varint,1,opt,name=is_verified,json=isVerified,proto3" json:"is_verified,omitempty"` +} + +func (x *VerifyEmailResponse) Reset() { + *x = VerifyEmailResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyEmailResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyEmailResponse) ProtoMessage() {} + +func (x *VerifyEmailResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VerifyEmailResponse.ProtoReflect.Descriptor instead. +func (*VerifyEmailResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{1} +} + +func (x *VerifyEmailResponse) GetIsVerified() bool { + if x != nil { + return x.IsVerified + } + return false +} + +// 2.ResetPassword +type ResetPasswordRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + VerificationUrl string `protobuf:"bytes,1,opt,name=verification_url,json=verificationUrl,proto3" json:"verification_url,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *ResetPasswordRequest) Reset() { + *x = ResetPasswordRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResetPasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResetPasswordRequest) ProtoMessage() {} + +func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResetPasswordRequest.ProtoReflect.Descriptor instead. +func (*ResetPasswordRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{2} +} + +func (x *ResetPasswordRequest) GetVerificationUrl() string { + if x != nil { + return x.VerificationUrl + } + return "" +} + +func (x *ResetPasswordRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *ResetPasswordRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type ResetPasswordResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsReset bool `protobuf:"varint,1,opt,name=is_reset,json=isReset,proto3" json:"is_reset,omitempty"` +} + +func (x *ResetPasswordResponse) Reset() { + *x = ResetPasswordResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResetPasswordResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResetPasswordResponse) ProtoMessage() {} + +func (x *ResetPasswordResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResetPasswordResponse.ProtoReflect.Descriptor instead. +func (*ResetPasswordResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{3} +} + +func (x *ResetPasswordResponse) GetIsReset() bool { + if x != nil { + return x.IsReset + } + return false +} + +// 3.SendEmailToResetPassword +type SendEmailToResetPasswordRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *SendEmailToResetPasswordRequest) Reset() { + *x = SendEmailToResetPasswordRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendEmailToResetPasswordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendEmailToResetPasswordRequest) ProtoMessage() {} + +func (x *SendEmailToResetPasswordRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendEmailToResetPasswordRequest.ProtoReflect.Descriptor instead. +func (*SendEmailToResetPasswordRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{4} +} + +func (x *SendEmailToResetPasswordRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type SendEmailToResetPasswordResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsSend bool `protobuf:"varint,1,opt,name=is_send,json=isSend,proto3" json:"is_send,omitempty"` +} + +func (x *SendEmailToResetPasswordResponse) Reset() { + *x = SendEmailToResetPasswordResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendEmailToResetPasswordResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendEmailToResetPasswordResponse) ProtoMessage() {} + +func (x *SendEmailToResetPasswordResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendEmailToResetPasswordResponse.ProtoReflect.Descriptor instead. +func (*SendEmailToResetPasswordResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{5} +} + +func (x *SendEmailToResetPasswordResponse) GetIsSend() bool { + if x != nil { + return x.IsSend + } + return false +} + +// 4.SendEmailToVerifyEmail +type SendEmailToVerifyEmailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *SendEmailToVerifyEmailRequest) Reset() { + *x = SendEmailToVerifyEmailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendEmailToVerifyEmailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendEmailToVerifyEmailRequest) ProtoMessage() {} + +func (x *SendEmailToVerifyEmailRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendEmailToVerifyEmailRequest.ProtoReflect.Descriptor instead. +func (*SendEmailToVerifyEmailRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{6} +} + +func (x *SendEmailToVerifyEmailRequest) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type SendEmailToVerifyEmailResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsSend bool `protobuf:"varint,1,opt,name=is_send,json=isSend,proto3" json:"is_send,omitempty"` +} + +func (x *SendEmailToVerifyEmailResponse) Reset() { + *x = SendEmailToVerifyEmailResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendEmailToVerifyEmailResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendEmailToVerifyEmailResponse) ProtoMessage() {} + +func (x *SendEmailToVerifyEmailResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendEmailToVerifyEmailResponse.ProtoReflect.Descriptor instead. +func (*SendEmailToVerifyEmailResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{7} +} + +func (x *SendEmailToVerifyEmailResponse) GetIsSend() bool { + if x != nil { + return x.IsSend + } + return false +} + +// 5.RefreshToken +type RefreshTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` +} + +func (x *RefreshTokenRequest) Reset() { + *x = RefreshTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshTokenRequest) ProtoMessage() {} + +func (x *RefreshTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead. +func (*RefreshTokenRequest) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{8} +} + +func (x *RefreshTokenRequest) GetRefreshToken() string { + if x != nil { + return x.RefreshToken + } + return "" +} + +type RefreshTokenResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + AccessTokenExpiresAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=access_token_expires_at,json=accessTokenExpiresAt,proto3" json:"access_token_expires_at,omitempty"` +} + +func (x *RefreshTokenResponse) Reset() { + *x = RefreshTokenResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpcs_rpc_verification_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RefreshTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RefreshTokenResponse) ProtoMessage() {} + +func (x *RefreshTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpcs_rpc_verification_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RefreshTokenResponse.ProtoReflect.Descriptor instead. +func (*RefreshTokenResponse) Descriptor() ([]byte, []int) { + return file_rpcs_rpc_verification_proto_rawDescGZIP(), []int{9} +} + +func (x *RefreshTokenResponse) GetAccessToken() string { + if x != nil { + return x.AccessToken + } + return "" +} + +func (x *RefreshTokenResponse) GetAccessTokenExpiresAt() *timestamppb.Timestamp { + if x != nil { + return x.AccessTokenExpiresAt + } + return nil +} + +var File_rpcs_rpc_verification_proto protoreflect.FileDescriptor + +var file_rpcs_rpc_verification_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, + 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x3f, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x55, 0x72, 0x6c, 0x22, 0x36, 0x0a, 0x13, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, + 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, + 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0a, 0x69, 0x73, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x22, 0x73, 0x0a, 0x14, 0x52, + 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x22, 0x32, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, + 0x72, 0x65, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x52, + 0x65, 0x73, 0x65, 0x74, 0x22, 0x37, 0x0a, 0x1f, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6d, 0x61, 0x69, + 0x6c, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x3b, 0x0a, + 0x20, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x65, + 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53, 0x65, 0x6e, 0x64, 0x22, 0x35, 0x0a, 0x1d, 0x53, 0x65, + 0x6e, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, + 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x22, 0x39, 0x0a, 0x1e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53, 0x65, 0x6e, 0x64, 0x22, 0x3a, 0x0a, 0x13, + 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8c, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x51, 0x0a, 0x17, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x14, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x45, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x42, 0x21, 0x5a, 0x1f, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, + 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_rpcs_rpc_verification_proto_rawDescOnce sync.Once + file_rpcs_rpc_verification_proto_rawDescData = file_rpcs_rpc_verification_proto_rawDesc +) + +func file_rpcs_rpc_verification_proto_rawDescGZIP() []byte { + file_rpcs_rpc_verification_proto_rawDescOnce.Do(func() { + file_rpcs_rpc_verification_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpcs_rpc_verification_proto_rawDescData) + }) + return file_rpcs_rpc_verification_proto_rawDescData +} + +var file_rpcs_rpc_verification_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_rpcs_rpc_verification_proto_goTypes = []interface{}{ + (*VerifyEmailRequest)(nil), // 0: pb.VerifyEmailRequest + (*VerifyEmailResponse)(nil), // 1: pb.VerifyEmailResponse + (*ResetPasswordRequest)(nil), // 2: pb.ResetPasswordRequest + (*ResetPasswordResponse)(nil), // 3: pb.ResetPasswordResponse + (*SendEmailToResetPasswordRequest)(nil), // 4: pb.SendEmailToResetPasswordRequest + (*SendEmailToResetPasswordResponse)(nil), // 5: pb.SendEmailToResetPasswordResponse + (*SendEmailToVerifyEmailRequest)(nil), // 6: pb.SendEmailToVerifyEmailRequest + (*SendEmailToVerifyEmailResponse)(nil), // 7: pb.SendEmailToVerifyEmailResponse + (*RefreshTokenRequest)(nil), // 8: pb.RefreshTokenRequest + (*RefreshTokenResponse)(nil), // 9: pb.RefreshTokenResponse + (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp +} +var file_rpcs_rpc_verification_proto_depIdxs = []int32{ + 10, // 0: pb.RefreshTokenResponse.access_token_expires_at:type_name -> google.protobuf.Timestamp + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_rpcs_rpc_verification_proto_init() } +func file_rpcs_rpc_verification_proto_init() { + if File_rpcs_rpc_verification_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_rpcs_rpc_verification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyEmailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_verification_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyEmailResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_verification_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetPasswordRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_verification_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResetPasswordResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_verification_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendEmailToResetPasswordRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_verification_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendEmailToResetPasswordResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_verification_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendEmailToVerifyEmailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_verification_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendEmailToVerifyEmailResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_verification_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpcs_rpc_verification_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RefreshTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_rpcs_rpc_verification_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_rpcs_rpc_verification_proto_goTypes, + DependencyIndexes: file_rpcs_rpc_verification_proto_depIdxs, + MessageInfos: file_rpcs_rpc_verification_proto_msgTypes, + }.Build() + File_rpcs_rpc_verification_proto = out.File + file_rpcs_rpc_verification_proto_rawDesc = nil + file_rpcs_rpc_verification_proto_goTypes = nil + file_rpcs_rpc_verification_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_admin.pb.go b/zbook_backend/pb/service_zbook_admin.pb.go new file mode 100644 index 0000000..cf95335 --- /dev/null +++ b/zbook_backend/pb/service_zbook_admin.pb.go @@ -0,0 +1,354 @@ +// clang-format off + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_admin.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_admin_proto protoreflect.FileDescriptor + +var file_service_zbook_admin_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x72, + 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, + 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x32, 0x98, 0x19, 0x0a, 0x0a, 0x5a, 0x42, 0x6f, 0x6f, 0x6b, 0x41, 0x64, 0x6d, + 0x69, 0x6e, 0x12, 0x95, 0x01, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x49, 0x92, 0x41, 0x26, 0x12, 0x08, 0x62, 0x61, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x1a, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x20, 0x62, 0x61, 0x6e, 0x20, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, + 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x80, 0x01, 0x0a, 0x0a, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x92, 0x41, 0x26, 0x12, 0x08, 0x62, + 0x61, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x1a, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, + 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x62, 0x61, 0x6e, 0x20, 0x20, 0x75, + 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, + 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x12, 0xcb, 0x01, + 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x64, 0x92, 0x41, 0x38, 0x12, 0x12, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x1a, 0x22, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x6e, 0x6f, + 0x74, 0x69, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, + 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x6e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xc0, 0x01, 0x0a, 0x19, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x92, 0x41, 0x28, 0x12, 0x0a, 0x20, 0x6c, 0x69, + 0x73, 0x74, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x1a, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, + 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x62, 0x61, 0x6e, 0x20, 0x20, 0x75, + 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, + 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x99, + 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x59, 0x92, 0x41, 0x3b, 0x12, 0x13, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x20, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x24, 0x55, 0x73, 0x65, 0x20, 0x74, + 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x6c, 0x69, 0x73, 0x74, + 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, + 0x73, 0x74, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0xc0, 0x01, 0x0a, 0x13, 0x47, + 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x68, 0x92, 0x41, 0x40, 0x12, 0x16, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x26, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, + 0x6f, 0x20, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, + 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x92, 0x01, + 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x2e, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x52, + 0x92, 0x41, 0x34, 0x12, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x20, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, + 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, + 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, + 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0xca, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0x92, 0x41, 0x4a, + 0x12, 0x1b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x2b, 0x55, + 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, + 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0xb5, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x63, 0x92, 0x41, 0x3e, 0x12, 0x13, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x27, 0x55, 0x73, + 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x69, + 0x73, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, + 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0xee, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x83, 0x01, 0x92, 0x41, 0x54, 0x12, 0x20, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x55, 0x73, 0x65, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x26, 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, + 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xbe, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, + 0x44, 0x61, 0x69, 0x6c, 0x79, 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x56, + 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, + 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x92, 0x41, 0x3a, 0x12, 0x13, 0x67, 0x65, 0x74, 0x20, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x23, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, + 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x76, 0x69, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xcb, 0x01, 0x0a, 0x17, 0x47, 0x65, + 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, + 0x69, 0x6c, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x67, + 0x92, 0x41, 0x3a, 0x12, 0x13, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x23, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, + 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xcb, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x44, + 0x61, 0x69, 0x6c, 0x79, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, + 0x79, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, + 0x44, 0x61, 0x69, 0x6c, 0x79, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x67, 0x92, 0x41, + 0x3a, 0x12, 0x13, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, + 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x23, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, + 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x61, + 0x69, 0x6c, 0x79, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x94, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x56, 0x69, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x56, 0x69, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, + 0x2e, 0x4c, 0x6f, 0x67, 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x57, 0x92, 0x41, 0x3a, 0x12, 0x13, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x23, 0x55, + 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x67, + 0x65, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, + 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, + 0x2f, 0x6c, 0x6f, 0x67, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x97, 0x01, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, + 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x56, + 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, + 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x56, 0x69, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0x92, 0x41, + 0x24, 0x12, 0x08, 0x70, 0x61, 0x72, 0x73, 0x65, 0x20, 0x69, 0x70, 0x1a, 0x18, 0x55, 0x73, 0x65, + 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x72, + 0x73, 0x65, 0x20, 0x69, 0x70, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, + 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x61, 0x69, 0x6c, 0x79, 0x5f, 0x76, 0x69, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x9f, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2d, 0x12, 0x08, 0x70, 0x61, 0x72, + 0x73, 0x65, 0x20, 0x69, 0x70, 0x1a, 0x21, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, + 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, + 0x2a, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xa2, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x4a, 0x92, 0x41, 0x24, 0x12, 0x08, 0x70, 0x61, 0x72, 0x73, 0x65, 0x20, 0x69, 0x70, + 0x1a, 0x18, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, + 0x6f, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x20, 0x69, 0x70, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, + 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x9e, 0x01, + 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, + 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x92, 0x41, 0x32, 0x12, 0x0f, 0x73, 0x65, + 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1f, 0x55, + 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x73, + 0x65, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x72, + 0x92, 0x41, 0x53, 0x12, 0x51, 0x0a, 0x09, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x70, 0x69, + 0x22, 0x3f, 0x0a, 0x0a, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, + 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, + 0x10, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, + 0x6d, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_admin_proto_goTypes = []interface{}{ + (*rpcs.UpdateUserBlockRequest)(nil), // 0: pb.UpdateUserBlockRequest + (*rpcs.DeleteUserRequest)(nil), // 1: pb.DeleteUserRequest + (*rpcs.CreateSystemNotificationRequest)(nil), // 2: pb.CreateSystemNotificationRequest + (*rpcs.UpdateCommentReportStatusRequest)(nil), // 3: pb.UpdateCommentReportStatusRequest + (*rpcs.ListSessionRequest)(nil), // 4: pb.ListSessionRequest + (*rpcs.GetListSessionCountRequest)(nil), // 5: pb.GetListSessionCountRequest + (*rpcs.ListCommentRequest)(nil), // 6: pb.ListCommentRequest + (*rpcs.GetListCommentCountRequest)(nil), // 7: pb.GetListCommentCountRequest + (*rpcs.ListCommentReportRequest)(nil), // 8: pb.ListCommentReportRequest + (*rpcs.GetListCommentReportCountRequest)(nil), // 9: pb.GetListCommentReportCountRequest + (*rpcs.GetDailyVisitorCountRequest)(nil), // 10: pb.GetDailyVisitorCountRequest + (*rpcs.GetDailyActiveUserCountRequest)(nil), // 11: pb.GetDailyActiveUserCountRequest + (*rpcs.GetDailyCreateUserCountRequest)(nil), // 12: pb.GetDailyCreateUserCountRequest + (*rpcs.LogVisitorRequest)(nil), // 13: pb.LogVisitorRequest + (*rpcs.GetDailyVisitorsRequest)(nil), // 14: pb.GetDailyVisitorsRequest + (*rpcs.GetConfigurationRequest)(nil), // 15: pb.GetConfigurationRequest + (*rpcs.UpdateConfigurationRequest)(nil), // 16: pb.UpdateConfigurationRequest + (*rpcs.SendInvitationRequest)(nil), // 17: pb.SendInvitationRequest + (*rpcs.UpdateUserBlockResponse)(nil), // 18: pb.UpdateUserBlockResponse + (*rpcs.DeleteUserResponse)(nil), // 19: pb.DeleteUserResponse + (*rpcs.CreateSystemNotificationResponse)(nil), // 20: pb.CreateSystemNotificationResponse + (*rpcs.UpdateCommentReportStatusResponse)(nil), // 21: pb.UpdateCommentReportStatusResponse + (*rpcs.ListSessionResponse)(nil), // 22: pb.ListSessionResponse + (*rpcs.GetListSessionCountResponse)(nil), // 23: pb.GetListSessionCountResponse + (*rpcs.ListCommentResponse)(nil), // 24: pb.ListCommentResponse + (*rpcs.GetListCommentCountResponse)(nil), // 25: pb.GetListCommentCountResponse + (*rpcs.ListCommentReportResponse)(nil), // 26: pb.ListCommentReportResponse + (*rpcs.GetListCommentReportCountResponse)(nil), // 27: pb.GetListCommentReportCountResponse + (*rpcs.GetDailyVisitorCountResponse)(nil), // 28: pb.GetDailyVisitorCountResponse + (*rpcs.GetDailyActiveUserCountResponse)(nil), // 29: pb.GetDailyActiveUserCountResponse + (*rpcs.GetDailyCreateUserCountResponse)(nil), // 30: pb.GetDailyCreateUserCountResponse + (*rpcs.LogVisitorResponse)(nil), // 31: pb.LogVisitorResponse + (*rpcs.GetDailyVisitorsResponse)(nil), // 32: pb.GetDailyVisitorsResponse + (*rpcs.GetConfigurationResponse)(nil), // 33: pb.GetConfigurationResponse + (*rpcs.UpdateConfigurationResponse)(nil), // 34: pb.UpdateConfigurationResponse + (*rpcs.SendInvitationResponse)(nil), // 35: pb.SendInvitationResponse +} +var file_service_zbook_admin_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookAdmin.UpdateUserBlock:input_type -> pb.UpdateUserBlockRequest + 1, // 1: pb.ZBookAdmin.DeleteUser:input_type -> pb.DeleteUserRequest + 2, // 2: pb.ZBookAdmin.CreateSystemNotification:input_type -> pb.CreateSystemNotificationRequest + 3, // 3: pb.ZBookAdmin.UpdateCommentReportStatus:input_type -> pb.UpdateCommentReportStatusRequest + 4, // 4: pb.ZBookAdmin.ListSession:input_type -> pb.ListSessionRequest + 5, // 5: pb.ZBookAdmin.GetListSessionCount:input_type -> pb.GetListSessionCountRequest + 6, // 6: pb.ZBookAdmin.ListComment:input_type -> pb.ListCommentRequest + 7, // 7: pb.ZBookAdmin.GetListCommentCount:input_type -> pb.GetListCommentCountRequest + 8, // 8: pb.ZBookAdmin.ListCommentReport:input_type -> pb.ListCommentReportRequest + 9, // 9: pb.ZBookAdmin.GetListCommentReportCount:input_type -> pb.GetListCommentReportCountRequest + 10, // 10: pb.ZBookAdmin.GetDailyVisitorCount:input_type -> pb.GetDailyVisitorCountRequest + 11, // 11: pb.ZBookAdmin.GetDailyActiveUserCount:input_type -> pb.GetDailyActiveUserCountRequest + 12, // 12: pb.ZBookAdmin.GetDailyCreateUserCount:input_type -> pb.GetDailyCreateUserCountRequest + 13, // 13: pb.ZBookAdmin.LogVisitor:input_type -> pb.LogVisitorRequest + 14, // 14: pb.ZBookAdmin.GetDailyVisitors:input_type -> pb.GetDailyVisitorsRequest + 15, // 15: pb.ZBookAdmin.GetConfiguration:input_type -> pb.GetConfigurationRequest + 16, // 16: pb.ZBookAdmin.UpdateConfiguration:input_type -> pb.UpdateConfigurationRequest + 17, // 17: pb.ZBookAdmin.SendInvitation:input_type -> pb.SendInvitationRequest + 18, // 18: pb.ZBookAdmin.UpdateUserBlock:output_type -> pb.UpdateUserBlockResponse + 19, // 19: pb.ZBookAdmin.DeleteUser:output_type -> pb.DeleteUserResponse + 20, // 20: pb.ZBookAdmin.CreateSystemNotification:output_type -> pb.CreateSystemNotificationResponse + 21, // 21: pb.ZBookAdmin.UpdateCommentReportStatus:output_type -> pb.UpdateCommentReportStatusResponse + 22, // 22: pb.ZBookAdmin.ListSession:output_type -> pb.ListSessionResponse + 23, // 23: pb.ZBookAdmin.GetListSessionCount:output_type -> pb.GetListSessionCountResponse + 24, // 24: pb.ZBookAdmin.ListComment:output_type -> pb.ListCommentResponse + 25, // 25: pb.ZBookAdmin.GetListCommentCount:output_type -> pb.GetListCommentCountResponse + 26, // 26: pb.ZBookAdmin.ListCommentReport:output_type -> pb.ListCommentReportResponse + 27, // 27: pb.ZBookAdmin.GetListCommentReportCount:output_type -> pb.GetListCommentReportCountResponse + 28, // 28: pb.ZBookAdmin.GetDailyVisitorCount:output_type -> pb.GetDailyVisitorCountResponse + 29, // 29: pb.ZBookAdmin.GetDailyActiveUserCount:output_type -> pb.GetDailyActiveUserCountResponse + 30, // 30: pb.ZBookAdmin.GetDailyCreateUserCount:output_type -> pb.GetDailyCreateUserCountResponse + 31, // 31: pb.ZBookAdmin.LogVisitor:output_type -> pb.LogVisitorResponse + 32, // 32: pb.ZBookAdmin.GetDailyVisitors:output_type -> pb.GetDailyVisitorsResponse + 33, // 33: pb.ZBookAdmin.GetConfiguration:output_type -> pb.GetConfigurationResponse + 34, // 34: pb.ZBookAdmin.UpdateConfiguration:output_type -> pb.UpdateConfigurationResponse + 35, // 35: pb.ZBookAdmin.SendInvitation:output_type -> pb.SendInvitationResponse + 18, // [18:36] is the sub-list for method output_type + 0, // [0:18] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_admin_proto_init() } +func file_service_zbook_admin_proto_init() { + if File_service_zbook_admin_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_admin_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_admin_proto_goTypes, + DependencyIndexes: file_service_zbook_admin_proto_depIdxs, + }.Build() + File_service_zbook_admin_proto = out.File + file_service_zbook_admin_proto_rawDesc = nil + file_service_zbook_admin_proto_goTypes = nil + file_service_zbook_admin_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_admin.pb.gw.go b/zbook_backend/pb/service_zbook_admin.pb.gw.go new file mode 100644 index 0000000..ff9eb86 --- /dev/null +++ b/zbook_backend/pb/service_zbook_admin.pb.gw.go @@ -0,0 +1,1473 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_admin.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookAdmin_UpdateUserBlock_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateUserBlockRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUserBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_UpdateUserBlock_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateUserBlockRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUserBlock(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_DeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_DeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteUser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_CreateSystemNotification_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateSystemNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateSystemNotification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_CreateSystemNotification_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateSystemNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateSystemNotification(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_UpdateCommentReportStatus_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateCommentReportStatusRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateCommentReportStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_UpdateCommentReportStatus_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateCommentReportStatusRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateCommentReportStatus(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_ListSession_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListSessionRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListSession(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_ListSession_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListSessionRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListSession(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_GetListSessionCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListSessionCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListSessionCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_GetListSessionCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListSessionCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListSessionCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_ListComment_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_ListComment_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListComment(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_GetListCommentCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListCommentCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_GetListCommentCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListCommentCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_ListCommentReport_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentReportRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListCommentReport(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_ListCommentReport_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentReportRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListCommentReport(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_GetListCommentReportCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentReportCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListCommentReportCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_GetListCommentReportCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentReportCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListCommentReportCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_GetDailyVisitorCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetDailyVisitorCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetDailyVisitorCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_GetDailyVisitorCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetDailyVisitorCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetDailyVisitorCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_GetDailyActiveUserCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetDailyActiveUserCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetDailyActiveUserCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_GetDailyActiveUserCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetDailyActiveUserCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetDailyActiveUserCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_GetDailyCreateUserCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetDailyCreateUserCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetDailyCreateUserCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_GetDailyCreateUserCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetDailyCreateUserCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetDailyCreateUserCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_LogVisitor_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.LogVisitorRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LogVisitor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_LogVisitor_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.LogVisitorRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LogVisitor(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_GetDailyVisitors_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetDailyVisitorsRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetDailyVisitors(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_GetDailyVisitors_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetDailyVisitorsRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetDailyVisitors(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_GetConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetConfigurationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetConfiguration(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_GetConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetConfigurationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetConfiguration(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_UpdateConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateConfigurationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateConfiguration(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_UpdateConfiguration_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateConfigurationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateConfiguration(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookAdmin_SendInvitation_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookAdminClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.SendInvitationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SendInvitation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookAdmin_SendInvitation_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookAdminServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.SendInvitationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SendInvitation(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookAdminHandlerServer registers the http handlers for service ZBookAdmin to "mux". +// UnaryRPC :call ZBookAdminServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookAdminHandlerFromEndpoint instead. +func RegisterZBookAdminHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookAdminServer) error { + + mux.Handle("POST", pattern_ZBookAdmin_UpdateUserBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/UpdateUserBlock", runtime.WithHTTPPathPattern("/v1/update_user_block")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_UpdateUserBlock_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_UpdateUserBlock_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/DeleteUser", runtime.WithHTTPPathPattern("/v1/delete_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_DeleteUser_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_DeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_CreateSystemNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/CreateSystemNotification", runtime.WithHTTPPathPattern("/v1/create_system_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_CreateSystemNotification_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_CreateSystemNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_UpdateCommentReportStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/UpdateCommentReportStatus", runtime.WithHTTPPathPattern("/v1/update_comment_report_status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_UpdateCommentReportStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_UpdateCommentReportStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_ListSession_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/ListSession", runtime.WithHTTPPathPattern("/v1/list_session")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_ListSession_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_ListSession_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetListSessionCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/GetListSessionCount", runtime.WithHTTPPathPattern("/v1/get_list_session_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_GetListSessionCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetListSessionCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_ListComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/ListComment", runtime.WithHTTPPathPattern("/v1/list_comment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_ListComment_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_ListComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetListCommentCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/GetListCommentCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_GetListCommentCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetListCommentCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_ListCommentReport_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/ListCommentReport", runtime.WithHTTPPathPattern("/v1/list_comment_report")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_ListCommentReport_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_ListCommentReport_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetListCommentReportCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/GetListCommentReportCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_report_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_GetListCommentReportCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetListCommentReportCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetDailyVisitorCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/GetDailyVisitorCount", runtime.WithHTTPPathPattern("/v1/get_daily_visitor_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_GetDailyVisitorCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetDailyVisitorCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetDailyActiveUserCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/GetDailyActiveUserCount", runtime.WithHTTPPathPattern("/v1/get_daily_active_user_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_GetDailyActiveUserCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetDailyActiveUserCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetDailyCreateUserCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/GetDailyCreateUserCount", runtime.WithHTTPPathPattern("/v1/get_daily_create_user_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_GetDailyCreateUserCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetDailyCreateUserCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_LogVisitor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/LogVisitor", runtime.WithHTTPPathPattern("/v1/log_visitor")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_LogVisitor_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_LogVisitor_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetDailyVisitors_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/GetDailyVisitors", runtime.WithHTTPPathPattern("/v1/get_daily_visitors")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_GetDailyVisitors_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetDailyVisitors_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/GetConfiguration", runtime.WithHTTPPathPattern("/v1/get_configuration")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_GetConfiguration_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_UpdateConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/UpdateConfiguration", runtime.WithHTTPPathPattern("/v1/update_configuration")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_UpdateConfiguration_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_UpdateConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_SendInvitation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookAdmin/SendInvitation", runtime.WithHTTPPathPattern("/v1/create_invitation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookAdmin_SendInvitation_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_SendInvitation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookAdminHandlerFromEndpoint is same as RegisterZBookAdminHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookAdminHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookAdminHandler(ctx, mux, conn) +} + +// RegisterZBookAdminHandler registers the http handlers for service ZBookAdmin to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookAdminHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookAdminHandlerClient(ctx, mux, NewZBookAdminClient(conn)) +} + +// RegisterZBookAdminHandlerClient registers the http handlers for service ZBookAdmin +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookAdminClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookAdminClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookAdminClient" to call the correct interceptors. +func RegisterZBookAdminHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookAdminClient) error { + + mux.Handle("POST", pattern_ZBookAdmin_UpdateUserBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/UpdateUserBlock", runtime.WithHTTPPathPattern("/v1/update_user_block")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_UpdateUserBlock_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_UpdateUserBlock_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/DeleteUser", runtime.WithHTTPPathPattern("/v1/delete_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_DeleteUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_DeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_CreateSystemNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/CreateSystemNotification", runtime.WithHTTPPathPattern("/v1/create_system_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_CreateSystemNotification_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_CreateSystemNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_UpdateCommentReportStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/UpdateCommentReportStatus", runtime.WithHTTPPathPattern("/v1/update_comment_report_status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_UpdateCommentReportStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_UpdateCommentReportStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_ListSession_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/ListSession", runtime.WithHTTPPathPattern("/v1/list_session")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_ListSession_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_ListSession_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetListSessionCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/GetListSessionCount", runtime.WithHTTPPathPattern("/v1/get_list_session_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_GetListSessionCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetListSessionCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_ListComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/ListComment", runtime.WithHTTPPathPattern("/v1/list_comment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_ListComment_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_ListComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetListCommentCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/GetListCommentCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_GetListCommentCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetListCommentCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_ListCommentReport_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/ListCommentReport", runtime.WithHTTPPathPattern("/v1/list_comment_report")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_ListCommentReport_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_ListCommentReport_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetListCommentReportCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/GetListCommentReportCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_report_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_GetListCommentReportCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetListCommentReportCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetDailyVisitorCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/GetDailyVisitorCount", runtime.WithHTTPPathPattern("/v1/get_daily_visitor_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_GetDailyVisitorCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetDailyVisitorCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetDailyActiveUserCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/GetDailyActiveUserCount", runtime.WithHTTPPathPattern("/v1/get_daily_active_user_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_GetDailyActiveUserCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetDailyActiveUserCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetDailyCreateUserCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/GetDailyCreateUserCount", runtime.WithHTTPPathPattern("/v1/get_daily_create_user_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_GetDailyCreateUserCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetDailyCreateUserCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_LogVisitor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/LogVisitor", runtime.WithHTTPPathPattern("/v1/log_visitor")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_LogVisitor_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_LogVisitor_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetDailyVisitors_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/GetDailyVisitors", runtime.WithHTTPPathPattern("/v1/get_daily_visitors")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_GetDailyVisitors_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetDailyVisitors_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_GetConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/GetConfiguration", runtime.WithHTTPPathPattern("/v1/get_configuration")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_GetConfiguration_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_GetConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_UpdateConfiguration_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/UpdateConfiguration", runtime.WithHTTPPathPattern("/v1/update_configuration")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_UpdateConfiguration_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_UpdateConfiguration_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookAdmin_SendInvitation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookAdmin/SendInvitation", runtime.WithHTTPPathPattern("/v1/create_invitation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookAdmin_SendInvitation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookAdmin_SendInvitation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookAdmin_UpdateUserBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_user_block"}, "")) + + pattern_ZBookAdmin_DeleteUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "delete_user"}, "")) + + pattern_ZBookAdmin_CreateSystemNotification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_system_notification"}, "")) + + pattern_ZBookAdmin_UpdateCommentReportStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_comment_report_status"}, "")) + + pattern_ZBookAdmin_ListSession_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_session"}, "")) + + pattern_ZBookAdmin_GetListSessionCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_session_count"}, "")) + + pattern_ZBookAdmin_ListComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_comment"}, "")) + + pattern_ZBookAdmin_GetListCommentCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_comment_count"}, "")) + + pattern_ZBookAdmin_ListCommentReport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_comment_report"}, "")) + + pattern_ZBookAdmin_GetListCommentReportCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_comment_report_count"}, "")) + + pattern_ZBookAdmin_GetDailyVisitorCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_daily_visitor_count"}, "")) + + pattern_ZBookAdmin_GetDailyActiveUserCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_daily_active_user_count"}, "")) + + pattern_ZBookAdmin_GetDailyCreateUserCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_daily_create_user_count"}, "")) + + pattern_ZBookAdmin_LogVisitor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "log_visitor"}, "")) + + pattern_ZBookAdmin_GetDailyVisitors_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_daily_visitors"}, "")) + + pattern_ZBookAdmin_GetConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_configuration"}, "")) + + pattern_ZBookAdmin_UpdateConfiguration_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_configuration"}, "")) + + pattern_ZBookAdmin_SendInvitation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_invitation"}, "")) +) + +var ( + forward_ZBookAdmin_UpdateUserBlock_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_DeleteUser_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_CreateSystemNotification_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_UpdateCommentReportStatus_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_ListSession_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_GetListSessionCount_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_ListComment_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_GetListCommentCount_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_ListCommentReport_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_GetListCommentReportCount_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_GetDailyVisitorCount_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_GetDailyActiveUserCount_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_GetDailyCreateUserCount_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_LogVisitor_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_GetDailyVisitors_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_GetConfiguration_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_UpdateConfiguration_0 = runtime.ForwardResponseMessage + + forward_ZBookAdmin_SendInvitation_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_admin_grpc.pb.go b/zbook_backend/pb/service_zbook_admin_grpc.pb.go new file mode 100644 index 0000000..b999908 --- /dev/null +++ b/zbook_backend/pb/service_zbook_admin_grpc.pb.go @@ -0,0 +1,777 @@ +// clang-format off + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_admin.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookAdmin_UpdateUserBlock_FullMethodName = "/pb.ZBookAdmin/UpdateUserBlock" + ZBookAdmin_DeleteUser_FullMethodName = "/pb.ZBookAdmin/DeleteUser" + ZBookAdmin_CreateSystemNotification_FullMethodName = "/pb.ZBookAdmin/CreateSystemNotification" + ZBookAdmin_UpdateCommentReportStatus_FullMethodName = "/pb.ZBookAdmin/UpdateCommentReportStatus" + ZBookAdmin_ListSession_FullMethodName = "/pb.ZBookAdmin/ListSession" + ZBookAdmin_GetListSessionCount_FullMethodName = "/pb.ZBookAdmin/GetListSessionCount" + ZBookAdmin_ListComment_FullMethodName = "/pb.ZBookAdmin/ListComment" + ZBookAdmin_GetListCommentCount_FullMethodName = "/pb.ZBookAdmin/GetListCommentCount" + ZBookAdmin_ListCommentReport_FullMethodName = "/pb.ZBookAdmin/ListCommentReport" + ZBookAdmin_GetListCommentReportCount_FullMethodName = "/pb.ZBookAdmin/GetListCommentReportCount" + ZBookAdmin_GetDailyVisitorCount_FullMethodName = "/pb.ZBookAdmin/GetDailyVisitorCount" + ZBookAdmin_GetDailyActiveUserCount_FullMethodName = "/pb.ZBookAdmin/GetDailyActiveUserCount" + ZBookAdmin_GetDailyCreateUserCount_FullMethodName = "/pb.ZBookAdmin/GetDailyCreateUserCount" + ZBookAdmin_LogVisitor_FullMethodName = "/pb.ZBookAdmin/LogVisitor" + ZBookAdmin_GetDailyVisitors_FullMethodName = "/pb.ZBookAdmin/GetDailyVisitors" + ZBookAdmin_GetConfiguration_FullMethodName = "/pb.ZBookAdmin/GetConfiguration" + ZBookAdmin_UpdateConfiguration_FullMethodName = "/pb.ZBookAdmin/UpdateConfiguration" + ZBookAdmin_SendInvitation_FullMethodName = "/pb.ZBookAdmin/SendInvitation" +) + +// ZBookAdminClient is the client API for ZBookAdmin service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookAdminClient interface { + // 1.UpdateUserBlock + UpdateUserBlock(ctx context.Context, in *rpcs.UpdateUserBlockRequest, opts ...grpc.CallOption) (*rpcs.UpdateUserBlockResponse, error) + // 2.DeleteUser + DeleteUser(ctx context.Context, in *rpcs.DeleteUserRequest, opts ...grpc.CallOption) (*rpcs.DeleteUserResponse, error) + // 3.CreateSystemNotification + CreateSystemNotification(ctx context.Context, in *rpcs.CreateSystemNotificationRequest, opts ...grpc.CallOption) (*rpcs.CreateSystemNotificationResponse, error) + // 4.UpdateCommentReportStatus + UpdateCommentReportStatus(ctx context.Context, in *rpcs.UpdateCommentReportStatusRequest, opts ...grpc.CallOption) (*rpcs.UpdateCommentReportStatusResponse, error) + // 5.ListSession + ListSession(ctx context.Context, in *rpcs.ListSessionRequest, opts ...grpc.CallOption) (*rpcs.ListSessionResponse, error) + // 6.GetListSessionCount + GetListSessionCount(ctx context.Context, in *rpcs.GetListSessionCountRequest, opts ...grpc.CallOption) (*rpcs.GetListSessionCountResponse, error) + // 7.ListComment + ListComment(ctx context.Context, in *rpcs.ListCommentRequest, opts ...grpc.CallOption) (*rpcs.ListCommentResponse, error) + // 8.GetListCommentCount + GetListCommentCount(ctx context.Context, in *rpcs.GetListCommentCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentCountResponse, error) + // 9.ListCommentReport + ListCommentReport(ctx context.Context, in *rpcs.ListCommentReportRequest, opts ...grpc.CallOption) (*rpcs.ListCommentReportResponse, error) + // 10.GetListCommentReportCount + GetListCommentReportCount(ctx context.Context, in *rpcs.GetListCommentReportCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentReportCountResponse, error) + // 11.GetDailyVisitorCount + GetDailyVisitorCount(ctx context.Context, in *rpcs.GetDailyVisitorCountRequest, opts ...grpc.CallOption) (*rpcs.GetDailyVisitorCountResponse, error) + // 12.GetDailyActiveUserCount + GetDailyActiveUserCount(ctx context.Context, in *rpcs.GetDailyActiveUserCountRequest, opts ...grpc.CallOption) (*rpcs.GetDailyActiveUserCountResponse, error) + // 13.GetDailyCreateUserCount + GetDailyCreateUserCount(ctx context.Context, in *rpcs.GetDailyCreateUserCountRequest, opts ...grpc.CallOption) (*rpcs.GetDailyCreateUserCountResponse, error) + // 14.LogVisitor + LogVisitor(ctx context.Context, in *rpcs.LogVisitorRequest, opts ...grpc.CallOption) (*rpcs.LogVisitorResponse, error) + // 16.GetDailyVisitors + GetDailyVisitors(ctx context.Context, in *rpcs.GetDailyVisitorsRequest, opts ...grpc.CallOption) (*rpcs.GetDailyVisitorsResponse, error) + // 17.GetConfiguration + GetConfiguration(ctx context.Context, in *rpcs.GetConfigurationRequest, opts ...grpc.CallOption) (*rpcs.GetConfigurationResponse, error) + // 18.UpdateConfiguration + UpdateConfiguration(ctx context.Context, in *rpcs.UpdateConfigurationRequest, opts ...grpc.CallOption) (*rpcs.UpdateConfigurationResponse, error) + // 19.SendInvitation + SendInvitation(ctx context.Context, in *rpcs.SendInvitationRequest, opts ...grpc.CallOption) (*rpcs.SendInvitationResponse, error) +} + +type zBookAdminClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookAdminClient(cc grpc.ClientConnInterface) ZBookAdminClient { + return &zBookAdminClient{cc} +} + +func (c *zBookAdminClient) UpdateUserBlock(ctx context.Context, in *rpcs.UpdateUserBlockRequest, opts ...grpc.CallOption) (*rpcs.UpdateUserBlockResponse, error) { + out := new(rpcs.UpdateUserBlockResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_UpdateUserBlock_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) DeleteUser(ctx context.Context, in *rpcs.DeleteUserRequest, opts ...grpc.CallOption) (*rpcs.DeleteUserResponse, error) { + out := new(rpcs.DeleteUserResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_DeleteUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) CreateSystemNotification(ctx context.Context, in *rpcs.CreateSystemNotificationRequest, opts ...grpc.CallOption) (*rpcs.CreateSystemNotificationResponse, error) { + out := new(rpcs.CreateSystemNotificationResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_CreateSystemNotification_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) UpdateCommentReportStatus(ctx context.Context, in *rpcs.UpdateCommentReportStatusRequest, opts ...grpc.CallOption) (*rpcs.UpdateCommentReportStatusResponse, error) { + out := new(rpcs.UpdateCommentReportStatusResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_UpdateCommentReportStatus_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) ListSession(ctx context.Context, in *rpcs.ListSessionRequest, opts ...grpc.CallOption) (*rpcs.ListSessionResponse, error) { + out := new(rpcs.ListSessionResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_ListSession_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) GetListSessionCount(ctx context.Context, in *rpcs.GetListSessionCountRequest, opts ...grpc.CallOption) (*rpcs.GetListSessionCountResponse, error) { + out := new(rpcs.GetListSessionCountResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_GetListSessionCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) ListComment(ctx context.Context, in *rpcs.ListCommentRequest, opts ...grpc.CallOption) (*rpcs.ListCommentResponse, error) { + out := new(rpcs.ListCommentResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_ListComment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) GetListCommentCount(ctx context.Context, in *rpcs.GetListCommentCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentCountResponse, error) { + out := new(rpcs.GetListCommentCountResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_GetListCommentCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) ListCommentReport(ctx context.Context, in *rpcs.ListCommentReportRequest, opts ...grpc.CallOption) (*rpcs.ListCommentReportResponse, error) { + out := new(rpcs.ListCommentReportResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_ListCommentReport_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) GetListCommentReportCount(ctx context.Context, in *rpcs.GetListCommentReportCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentReportCountResponse, error) { + out := new(rpcs.GetListCommentReportCountResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_GetListCommentReportCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) GetDailyVisitorCount(ctx context.Context, in *rpcs.GetDailyVisitorCountRequest, opts ...grpc.CallOption) (*rpcs.GetDailyVisitorCountResponse, error) { + out := new(rpcs.GetDailyVisitorCountResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_GetDailyVisitorCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) GetDailyActiveUserCount(ctx context.Context, in *rpcs.GetDailyActiveUserCountRequest, opts ...grpc.CallOption) (*rpcs.GetDailyActiveUserCountResponse, error) { + out := new(rpcs.GetDailyActiveUserCountResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_GetDailyActiveUserCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) GetDailyCreateUserCount(ctx context.Context, in *rpcs.GetDailyCreateUserCountRequest, opts ...grpc.CallOption) (*rpcs.GetDailyCreateUserCountResponse, error) { + out := new(rpcs.GetDailyCreateUserCountResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_GetDailyCreateUserCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) LogVisitor(ctx context.Context, in *rpcs.LogVisitorRequest, opts ...grpc.CallOption) (*rpcs.LogVisitorResponse, error) { + out := new(rpcs.LogVisitorResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_LogVisitor_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) GetDailyVisitors(ctx context.Context, in *rpcs.GetDailyVisitorsRequest, opts ...grpc.CallOption) (*rpcs.GetDailyVisitorsResponse, error) { + out := new(rpcs.GetDailyVisitorsResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_GetDailyVisitors_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) GetConfiguration(ctx context.Context, in *rpcs.GetConfigurationRequest, opts ...grpc.CallOption) (*rpcs.GetConfigurationResponse, error) { + out := new(rpcs.GetConfigurationResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_GetConfiguration_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) UpdateConfiguration(ctx context.Context, in *rpcs.UpdateConfigurationRequest, opts ...grpc.CallOption) (*rpcs.UpdateConfigurationResponse, error) { + out := new(rpcs.UpdateConfigurationResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_UpdateConfiguration_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookAdminClient) SendInvitation(ctx context.Context, in *rpcs.SendInvitationRequest, opts ...grpc.CallOption) (*rpcs.SendInvitationResponse, error) { + out := new(rpcs.SendInvitationResponse) + err := c.cc.Invoke(ctx, ZBookAdmin_SendInvitation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookAdminServer is the server API for ZBookAdmin service. +// All implementations must embed UnimplementedZBookAdminServer +// for forward compatibility +type ZBookAdminServer interface { + // 1.UpdateUserBlock + UpdateUserBlock(context.Context, *rpcs.UpdateUserBlockRequest) (*rpcs.UpdateUserBlockResponse, error) + // 2.DeleteUser + DeleteUser(context.Context, *rpcs.DeleteUserRequest) (*rpcs.DeleteUserResponse, error) + // 3.CreateSystemNotification + CreateSystemNotification(context.Context, *rpcs.CreateSystemNotificationRequest) (*rpcs.CreateSystemNotificationResponse, error) + // 4.UpdateCommentReportStatus + UpdateCommentReportStatus(context.Context, *rpcs.UpdateCommentReportStatusRequest) (*rpcs.UpdateCommentReportStatusResponse, error) + // 5.ListSession + ListSession(context.Context, *rpcs.ListSessionRequest) (*rpcs.ListSessionResponse, error) + // 6.GetListSessionCount + GetListSessionCount(context.Context, *rpcs.GetListSessionCountRequest) (*rpcs.GetListSessionCountResponse, error) + // 7.ListComment + ListComment(context.Context, *rpcs.ListCommentRequest) (*rpcs.ListCommentResponse, error) + // 8.GetListCommentCount + GetListCommentCount(context.Context, *rpcs.GetListCommentCountRequest) (*rpcs.GetListCommentCountResponse, error) + // 9.ListCommentReport + ListCommentReport(context.Context, *rpcs.ListCommentReportRequest) (*rpcs.ListCommentReportResponse, error) + // 10.GetListCommentReportCount + GetListCommentReportCount(context.Context, *rpcs.GetListCommentReportCountRequest) (*rpcs.GetListCommentReportCountResponse, error) + // 11.GetDailyVisitorCount + GetDailyVisitorCount(context.Context, *rpcs.GetDailyVisitorCountRequest) (*rpcs.GetDailyVisitorCountResponse, error) + // 12.GetDailyActiveUserCount + GetDailyActiveUserCount(context.Context, *rpcs.GetDailyActiveUserCountRequest) (*rpcs.GetDailyActiveUserCountResponse, error) + // 13.GetDailyCreateUserCount + GetDailyCreateUserCount(context.Context, *rpcs.GetDailyCreateUserCountRequest) (*rpcs.GetDailyCreateUserCountResponse, error) + // 14.LogVisitor + LogVisitor(context.Context, *rpcs.LogVisitorRequest) (*rpcs.LogVisitorResponse, error) + // 16.GetDailyVisitors + GetDailyVisitors(context.Context, *rpcs.GetDailyVisitorsRequest) (*rpcs.GetDailyVisitorsResponse, error) + // 17.GetConfiguration + GetConfiguration(context.Context, *rpcs.GetConfigurationRequest) (*rpcs.GetConfigurationResponse, error) + // 18.UpdateConfiguration + UpdateConfiguration(context.Context, *rpcs.UpdateConfigurationRequest) (*rpcs.UpdateConfigurationResponse, error) + // 19.SendInvitation + SendInvitation(context.Context, *rpcs.SendInvitationRequest) (*rpcs.SendInvitationResponse, error) + mustEmbedUnimplementedZBookAdminServer() +} + +// UnimplementedZBookAdminServer must be embedded to have forward compatible implementations. +type UnimplementedZBookAdminServer struct { +} + +func (UnimplementedZBookAdminServer) UpdateUserBlock(context.Context, *rpcs.UpdateUserBlockRequest) (*rpcs.UpdateUserBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserBlock not implemented") +} +func (UnimplementedZBookAdminServer) DeleteUser(context.Context, *rpcs.DeleteUserRequest) (*rpcs.DeleteUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") +} +func (UnimplementedZBookAdminServer) CreateSystemNotification(context.Context, *rpcs.CreateSystemNotificationRequest) (*rpcs.CreateSystemNotificationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateSystemNotification not implemented") +} +func (UnimplementedZBookAdminServer) UpdateCommentReportStatus(context.Context, *rpcs.UpdateCommentReportStatusRequest) (*rpcs.UpdateCommentReportStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCommentReportStatus not implemented") +} +func (UnimplementedZBookAdminServer) ListSession(context.Context, *rpcs.ListSessionRequest) (*rpcs.ListSessionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSession not implemented") +} +func (UnimplementedZBookAdminServer) GetListSessionCount(context.Context, *rpcs.GetListSessionCountRequest) (*rpcs.GetListSessionCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListSessionCount not implemented") +} +func (UnimplementedZBookAdminServer) ListComment(context.Context, *rpcs.ListCommentRequest) (*rpcs.ListCommentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListComment not implemented") +} +func (UnimplementedZBookAdminServer) GetListCommentCount(context.Context, *rpcs.GetListCommentCountRequest) (*rpcs.GetListCommentCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListCommentCount not implemented") +} +func (UnimplementedZBookAdminServer) ListCommentReport(context.Context, *rpcs.ListCommentReportRequest) (*rpcs.ListCommentReportResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCommentReport not implemented") +} +func (UnimplementedZBookAdminServer) GetListCommentReportCount(context.Context, *rpcs.GetListCommentReportCountRequest) (*rpcs.GetListCommentReportCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListCommentReportCount not implemented") +} +func (UnimplementedZBookAdminServer) GetDailyVisitorCount(context.Context, *rpcs.GetDailyVisitorCountRequest) (*rpcs.GetDailyVisitorCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDailyVisitorCount not implemented") +} +func (UnimplementedZBookAdminServer) GetDailyActiveUserCount(context.Context, *rpcs.GetDailyActiveUserCountRequest) (*rpcs.GetDailyActiveUserCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDailyActiveUserCount not implemented") +} +func (UnimplementedZBookAdminServer) GetDailyCreateUserCount(context.Context, *rpcs.GetDailyCreateUserCountRequest) (*rpcs.GetDailyCreateUserCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDailyCreateUserCount not implemented") +} +func (UnimplementedZBookAdminServer) LogVisitor(context.Context, *rpcs.LogVisitorRequest) (*rpcs.LogVisitorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LogVisitor not implemented") +} +func (UnimplementedZBookAdminServer) GetDailyVisitors(context.Context, *rpcs.GetDailyVisitorsRequest) (*rpcs.GetDailyVisitorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDailyVisitors not implemented") +} +func (UnimplementedZBookAdminServer) GetConfiguration(context.Context, *rpcs.GetConfigurationRequest) (*rpcs.GetConfigurationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConfiguration not implemented") +} +func (UnimplementedZBookAdminServer) UpdateConfiguration(context.Context, *rpcs.UpdateConfigurationRequest) (*rpcs.UpdateConfigurationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateConfiguration not implemented") +} +func (UnimplementedZBookAdminServer) SendInvitation(context.Context, *rpcs.SendInvitationRequest) (*rpcs.SendInvitationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendInvitation not implemented") +} +func (UnimplementedZBookAdminServer) mustEmbedUnimplementedZBookAdminServer() {} + +// UnsafeZBookAdminServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookAdminServer will +// result in compilation errors. +type UnsafeZBookAdminServer interface { + mustEmbedUnimplementedZBookAdminServer() +} + +func RegisterZBookAdminServer(s grpc.ServiceRegistrar, srv ZBookAdminServer) { + s.RegisterService(&ZBookAdmin_ServiceDesc, srv) +} + +func _ZBookAdmin_UpdateUserBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.UpdateUserBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).UpdateUserBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_UpdateUserBlock_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).UpdateUserBlock(ctx, req.(*rpcs.UpdateUserBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.DeleteUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).DeleteUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_DeleteUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).DeleteUser(ctx, req.(*rpcs.DeleteUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_CreateSystemNotification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateSystemNotificationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).CreateSystemNotification(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_CreateSystemNotification_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).CreateSystemNotification(ctx, req.(*rpcs.CreateSystemNotificationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_UpdateCommentReportStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.UpdateCommentReportStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).UpdateCommentReportStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_UpdateCommentReportStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).UpdateCommentReportStatus(ctx, req.(*rpcs.UpdateCommentReportStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_ListSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListSessionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).ListSession(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_ListSession_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).ListSession(ctx, req.(*rpcs.ListSessionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_GetListSessionCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListSessionCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).GetListSessionCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_GetListSessionCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).GetListSessionCount(ctx, req.(*rpcs.GetListSessionCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_ListComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).ListComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_ListComment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).ListComment(ctx, req.(*rpcs.ListCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_GetListCommentCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListCommentCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).GetListCommentCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_GetListCommentCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).GetListCommentCount(ctx, req.(*rpcs.GetListCommentCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_ListCommentReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListCommentReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).ListCommentReport(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_ListCommentReport_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).ListCommentReport(ctx, req.(*rpcs.ListCommentReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_GetListCommentReportCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListCommentReportCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).GetListCommentReportCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_GetListCommentReportCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).GetListCommentReportCount(ctx, req.(*rpcs.GetListCommentReportCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_GetDailyVisitorCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetDailyVisitorCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).GetDailyVisitorCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_GetDailyVisitorCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).GetDailyVisitorCount(ctx, req.(*rpcs.GetDailyVisitorCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_GetDailyActiveUserCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetDailyActiveUserCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).GetDailyActiveUserCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_GetDailyActiveUserCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).GetDailyActiveUserCount(ctx, req.(*rpcs.GetDailyActiveUserCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_GetDailyCreateUserCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetDailyCreateUserCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).GetDailyCreateUserCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_GetDailyCreateUserCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).GetDailyCreateUserCount(ctx, req.(*rpcs.GetDailyCreateUserCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_LogVisitor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.LogVisitorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).LogVisitor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_LogVisitor_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).LogVisitor(ctx, req.(*rpcs.LogVisitorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_GetDailyVisitors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetDailyVisitorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).GetDailyVisitors(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_GetDailyVisitors_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).GetDailyVisitors(ctx, req.(*rpcs.GetDailyVisitorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_GetConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).GetConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_GetConfiguration_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).GetConfiguration(ctx, req.(*rpcs.GetConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_UpdateConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.UpdateConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).UpdateConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_UpdateConfiguration_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).UpdateConfiguration(ctx, req.(*rpcs.UpdateConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookAdmin_SendInvitation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.SendInvitationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookAdminServer).SendInvitation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookAdmin_SendInvitation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookAdminServer).SendInvitation(ctx, req.(*rpcs.SendInvitationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookAdmin_ServiceDesc is the grpc.ServiceDesc for ZBookAdmin service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookAdmin_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookAdmin", + HandlerType: (*ZBookAdminServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateUserBlock", + Handler: _ZBookAdmin_UpdateUserBlock_Handler, + }, + { + MethodName: "DeleteUser", + Handler: _ZBookAdmin_DeleteUser_Handler, + }, + { + MethodName: "CreateSystemNotification", + Handler: _ZBookAdmin_CreateSystemNotification_Handler, + }, + { + MethodName: "UpdateCommentReportStatus", + Handler: _ZBookAdmin_UpdateCommentReportStatus_Handler, + }, + { + MethodName: "ListSession", + Handler: _ZBookAdmin_ListSession_Handler, + }, + { + MethodName: "GetListSessionCount", + Handler: _ZBookAdmin_GetListSessionCount_Handler, + }, + { + MethodName: "ListComment", + Handler: _ZBookAdmin_ListComment_Handler, + }, + { + MethodName: "GetListCommentCount", + Handler: _ZBookAdmin_GetListCommentCount_Handler, + }, + { + MethodName: "ListCommentReport", + Handler: _ZBookAdmin_ListCommentReport_Handler, + }, + { + MethodName: "GetListCommentReportCount", + Handler: _ZBookAdmin_GetListCommentReportCount_Handler, + }, + { + MethodName: "GetDailyVisitorCount", + Handler: _ZBookAdmin_GetDailyVisitorCount_Handler, + }, + { + MethodName: "GetDailyActiveUserCount", + Handler: _ZBookAdmin_GetDailyActiveUserCount_Handler, + }, + { + MethodName: "GetDailyCreateUserCount", + Handler: _ZBookAdmin_GetDailyCreateUserCount_Handler, + }, + { + MethodName: "LogVisitor", + Handler: _ZBookAdmin_LogVisitor_Handler, + }, + { + MethodName: "GetDailyVisitors", + Handler: _ZBookAdmin_GetDailyVisitors_Handler, + }, + { + MethodName: "GetConfiguration", + Handler: _ZBookAdmin_GetConfiguration_Handler, + }, + { + MethodName: "UpdateConfiguration", + Handler: _ZBookAdmin_UpdateConfiguration_Handler, + }, + { + MethodName: "SendInvitation", + Handler: _ZBookAdmin_SendInvitation_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_admin.proto", +} diff --git a/zbook_backend/pb/service_zbook_comment.pb.go b/zbook_backend/pb/service_zbook_comment.pb.go new file mode 100644 index 0000000..9dfb1dc --- /dev/null +++ b/zbook_backend/pb/service_zbook_comment.pb.go @@ -0,0 +1,191 @@ +// clang-format off + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_comment.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_comment_proto protoreflect.FileDescriptor + +var file_service_zbook_comment_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, + 0x62, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x16, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xbe, 0x0a, 0x0a, 0x0c, 0x5a, 0x42, 0x6f, 0x6f, + 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x88, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x42, 0x92, 0x41, 0x22, 0x12, 0x12, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe4, 0xb8, 0x80, 0xe7, + 0xba, 0xa7, 0xe8, 0xaf, 0x84, 0xe8, 0xae, 0xba, 0x1a, 0x0c, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, + 0xe8, 0xaf, 0x84, 0xe8, 0xae, 0xba, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, + 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x96, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x30, 0x12, + 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x1a, + 0x1e, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, + 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0xbe, 0x01, 0x0a, + 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x4f, 0x6e, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x69, 0x92, 0x41, 0x41, 0x12, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x1a, + 0x27, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, + 0x20, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x6f, 0x6e, 0x65, + 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, + 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x6e, 0x65, 0x12, 0xbd, 0x01, + 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, + 0x65, 0x6c, 0x54, 0x77, 0x6f, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x54, 0x77, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x68, 0x92, 0x41, 0x40, 0x12, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x77, 0x6f, + 0x1a, 0x26, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, + 0x6f, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x77, 0x6f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, + 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x77, 0x6f, 0x12, 0xc3, 0x01, + 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6b, 0x92, 0x41, 0x43, 0x12, 0x16, 0x67, 0x65, 0x74, + 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x1a, 0x29, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, + 0x69, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x69, + 0x6e, 0x66, 0x6f, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x12, 0xe0, 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4f, 0x6e, 0x65, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x73, 0x92, 0x41, 0x41, 0x12, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6c, 0x65, 0x76, + 0x65, 0x6c, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x27, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x6f, 0x6e, 0x65, 0x20, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, + 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x6f, 0x6e, 0x65, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xdf, 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x54, 0x77, + 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x54, + 0x77, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0x92, 0x41, 0x40, 0x12, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x77, + 0x6f, 0x1a, 0x26, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, + 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, 0x77, 0x6f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, + 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x74, + 0x77, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x72, 0x92, 0x41, 0x53, 0x12, 0x51, 0x0a, + 0x09, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x70, 0x69, 0x22, 0x3f, 0x0a, 0x0a, 0x7a, 0x69, + 0x7a, 0x64, 0x6c, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, + 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, + 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, 0x7a, 0x69, 0x7a, 0x64, 0x6c, + 0x70, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x32, 0x03, 0x30, 0x2e, 0x31, + 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, + 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_comment_proto_goTypes = []interface{}{ + (*rpcs.CreateCommentRequest)(nil), // 0: pb.CreateCommentRequest + (*rpcs.DeleteCommentRequest)(nil), // 1: pb.DeleteCommentRequest + (*rpcs.ListCommentLevelOneRequest)(nil), // 2: pb.ListCommentLevelOneRequest + (*rpcs.ListCommentLevelTwoRequest)(nil), // 3: pb.ListCommentLevelTwoRequest + (*rpcs.GetCommentCountInfoRequest)(nil), // 4: pb.GetCommentCountInfoRequest + (*rpcs.GetListCommentLevelOneCountRequest)(nil), // 5: pb.GetListCommentLevelOneCountRequest + (*rpcs.GetListCommentLevelTwoCountRequest)(nil), // 6: pb.GetListCommentLevelTwoCountRequest + (*rpcs.CreateCommentResponse)(nil), // 7: pb.CreateCommentResponse + (*rpcs.DeleteCommentResponse)(nil), // 8: pb.DeleteCommentResponse + (*rpcs.ListCommentLevelResponse)(nil), // 9: pb.ListCommentLevelResponse + (*rpcs.GetCommentCountInfoResponse)(nil), // 10: pb.GetCommentCountInfoResponse + (*rpcs.GetListCommentLevelCountResponse)(nil), // 11: pb.GetListCommentLevelCountResponse +} +var file_service_zbook_comment_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookComment.CreateComment:input_type -> pb.CreateCommentRequest + 1, // 1: pb.ZBookComment.DeleteComment:input_type -> pb.DeleteCommentRequest + 2, // 2: pb.ZBookComment.ListCommentLevelOne:input_type -> pb.ListCommentLevelOneRequest + 3, // 3: pb.ZBookComment.ListCommentLevelTwo:input_type -> pb.ListCommentLevelTwoRequest + 4, // 4: pb.ZBookComment.GetCommentCountInfo:input_type -> pb.GetCommentCountInfoRequest + 5, // 5: pb.ZBookComment.GetListCommentLevelOneCount:input_type -> pb.GetListCommentLevelOneCountRequest + 6, // 6: pb.ZBookComment.GetListCommentLevelTwoCount:input_type -> pb.GetListCommentLevelTwoCountRequest + 7, // 7: pb.ZBookComment.CreateComment:output_type -> pb.CreateCommentResponse + 8, // 8: pb.ZBookComment.DeleteComment:output_type -> pb.DeleteCommentResponse + 9, // 9: pb.ZBookComment.ListCommentLevelOne:output_type -> pb.ListCommentLevelResponse + 9, // 10: pb.ZBookComment.ListCommentLevelTwo:output_type -> pb.ListCommentLevelResponse + 10, // 11: pb.ZBookComment.GetCommentCountInfo:output_type -> pb.GetCommentCountInfoResponse + 11, // 12: pb.ZBookComment.GetListCommentLevelOneCount:output_type -> pb.GetListCommentLevelCountResponse + 11, // 13: pb.ZBookComment.GetListCommentLevelTwoCount:output_type -> pb.GetListCommentLevelCountResponse + 7, // [7:14] is the sub-list for method output_type + 0, // [0:7] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_comment_proto_init() } +func file_service_zbook_comment_proto_init() { + if File_service_zbook_comment_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_comment_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_comment_proto_goTypes, + DependencyIndexes: file_service_zbook_comment_proto_depIdxs, + }.Build() + File_service_zbook_comment_proto = out.File + file_service_zbook_comment_proto_rawDesc = nil + file_service_zbook_comment_proto_goTypes = nil + file_service_zbook_comment_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_comment.pb.gw.go b/zbook_backend/pb/service_zbook_comment.pb.gw.go new file mode 100644 index 0000000..2dee8bc --- /dev/null +++ b/zbook_backend/pb/service_zbook_comment.pb.gw.go @@ -0,0 +1,626 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_comment.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookComment_CreateComment_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateCommentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookComment_CreateComment_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateCommentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateComment(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookComment_DeleteComment_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteCommentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteComment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookComment_DeleteComment_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteCommentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteComment(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookComment_ListCommentLevelOne_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentLevelOneRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListCommentLevelOne(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookComment_ListCommentLevelOne_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentLevelOneRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListCommentLevelOne(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookComment_ListCommentLevelTwo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentLevelTwoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListCommentLevelTwo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookComment_ListCommentLevelTwo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentLevelTwoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListCommentLevelTwo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookComment_GetCommentCountInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetCommentCountInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetCommentCountInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookComment_GetCommentCountInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetCommentCountInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetCommentCountInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookComment_GetListCommentLevelOneCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentLevelOneCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListCommentLevelOneCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookComment_GetListCommentLevelOneCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentLevelOneCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListCommentLevelOneCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookComment_GetListCommentLevelTwoCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentLevelTwoCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListCommentLevelTwoCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookComment_GetListCommentLevelTwoCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentLevelTwoCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListCommentLevelTwoCount(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookCommentHandlerServer registers the http handlers for service ZBookComment to "mux". +// UnaryRPC :call ZBookCommentServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookCommentHandlerFromEndpoint instead. +func RegisterZBookCommentHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookCommentServer) error { + + mux.Handle("POST", pattern_ZBookComment_CreateComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookComment/CreateComment", runtime.WithHTTPPathPattern("/v1/create_comment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookComment_CreateComment_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_CreateComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_DeleteComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookComment/DeleteComment", runtime.WithHTTPPathPattern("/v1/delete_comment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookComment_DeleteComment_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_DeleteComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_ListCommentLevelOne_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookComment/ListCommentLevelOne", runtime.WithHTTPPathPattern("/v1/list_comment_level_one")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookComment_ListCommentLevelOne_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_ListCommentLevelOne_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_ListCommentLevelTwo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookComment/ListCommentLevelTwo", runtime.WithHTTPPathPattern("/v1/list_comment_level_two")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookComment_ListCommentLevelTwo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_ListCommentLevelTwo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_GetCommentCountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookComment/GetCommentCountInfo", runtime.WithHTTPPathPattern("/v1/get_comment_count_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookComment_GetCommentCountInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_GetCommentCountInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_GetListCommentLevelOneCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookComment/GetListCommentLevelOneCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_level_one_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookComment_GetListCommentLevelOneCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_GetListCommentLevelOneCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_GetListCommentLevelTwoCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookComment/GetListCommentLevelTwoCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_level_two_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookComment_GetListCommentLevelTwoCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_GetListCommentLevelTwoCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookCommentHandlerFromEndpoint is same as RegisterZBookCommentHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookCommentHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookCommentHandler(ctx, mux, conn) +} + +// RegisterZBookCommentHandler registers the http handlers for service ZBookComment to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookCommentHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookCommentHandlerClient(ctx, mux, NewZBookCommentClient(conn)) +} + +// RegisterZBookCommentHandlerClient registers the http handlers for service ZBookComment +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookCommentClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookCommentClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookCommentClient" to call the correct interceptors. +func RegisterZBookCommentHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookCommentClient) error { + + mux.Handle("POST", pattern_ZBookComment_CreateComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookComment/CreateComment", runtime.WithHTTPPathPattern("/v1/create_comment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookComment_CreateComment_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_CreateComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_DeleteComment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookComment/DeleteComment", runtime.WithHTTPPathPattern("/v1/delete_comment")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookComment_DeleteComment_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_DeleteComment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_ListCommentLevelOne_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookComment/ListCommentLevelOne", runtime.WithHTTPPathPattern("/v1/list_comment_level_one")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookComment_ListCommentLevelOne_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_ListCommentLevelOne_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_ListCommentLevelTwo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookComment/ListCommentLevelTwo", runtime.WithHTTPPathPattern("/v1/list_comment_level_two")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookComment_ListCommentLevelTwo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_ListCommentLevelTwo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_GetCommentCountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookComment/GetCommentCountInfo", runtime.WithHTTPPathPattern("/v1/get_comment_count_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookComment_GetCommentCountInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_GetCommentCountInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_GetListCommentLevelOneCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookComment/GetListCommentLevelOneCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_level_one_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookComment_GetListCommentLevelOneCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_GetListCommentLevelOneCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookComment_GetListCommentLevelTwoCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookComment/GetListCommentLevelTwoCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_level_two_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookComment_GetListCommentLevelTwoCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookComment_GetListCommentLevelTwoCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookComment_CreateComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_comment"}, "")) + + pattern_ZBookComment_DeleteComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "delete_comment"}, "")) + + pattern_ZBookComment_ListCommentLevelOne_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_comment_level_one"}, "")) + + pattern_ZBookComment_ListCommentLevelTwo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_comment_level_two"}, "")) + + pattern_ZBookComment_GetCommentCountInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_comment_count_info"}, "")) + + pattern_ZBookComment_GetListCommentLevelOneCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_comment_level_one_count"}, "")) + + pattern_ZBookComment_GetListCommentLevelTwoCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_comment_level_two_count"}, "")) +) + +var ( + forward_ZBookComment_CreateComment_0 = runtime.ForwardResponseMessage + + forward_ZBookComment_DeleteComment_0 = runtime.ForwardResponseMessage + + forward_ZBookComment_ListCommentLevelOne_0 = runtime.ForwardResponseMessage + + forward_ZBookComment_ListCommentLevelTwo_0 = runtime.ForwardResponseMessage + + forward_ZBookComment_GetCommentCountInfo_0 = runtime.ForwardResponseMessage + + forward_ZBookComment_GetListCommentLevelOneCount_0 = runtime.ForwardResponseMessage + + forward_ZBookComment_GetListCommentLevelTwoCount_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_comment_grpc.pb.go b/zbook_backend/pb/service_zbook_comment_grpc.pb.go new file mode 100644 index 0000000..0107037 --- /dev/null +++ b/zbook_backend/pb/service_zbook_comment_grpc.pb.go @@ -0,0 +1,348 @@ +// clang-format off + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_comment.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookComment_CreateComment_FullMethodName = "/pb.ZBookComment/CreateComment" + ZBookComment_DeleteComment_FullMethodName = "/pb.ZBookComment/DeleteComment" + ZBookComment_ListCommentLevelOne_FullMethodName = "/pb.ZBookComment/ListCommentLevelOne" + ZBookComment_ListCommentLevelTwo_FullMethodName = "/pb.ZBookComment/ListCommentLevelTwo" + ZBookComment_GetCommentCountInfo_FullMethodName = "/pb.ZBookComment/GetCommentCountInfo" + ZBookComment_GetListCommentLevelOneCount_FullMethodName = "/pb.ZBookComment/GetListCommentLevelOneCount" + ZBookComment_GetListCommentLevelTwoCount_FullMethodName = "/pb.ZBookComment/GetListCommentLevelTwoCount" +) + +// ZBookCommentClient is the client API for ZBookComment service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookCommentClient interface { + // 1.CreateComment + CreateComment(ctx context.Context, in *rpcs.CreateCommentRequest, opts ...grpc.CallOption) (*rpcs.CreateCommentResponse, error) + // 2.DeleteComment + DeleteComment(ctx context.Context, in *rpcs.DeleteCommentRequest, opts ...grpc.CallOption) (*rpcs.DeleteCommentResponse, error) + // 3.ListCommentLevelOne + ListCommentLevelOne(ctx context.Context, in *rpcs.ListCommentLevelOneRequest, opts ...grpc.CallOption) (*rpcs.ListCommentLevelResponse, error) + // 4.ListCommentLevelTwo + ListCommentLevelTwo(ctx context.Context, in *rpcs.ListCommentLevelTwoRequest, opts ...grpc.CallOption) (*rpcs.ListCommentLevelResponse, error) + // 5.GetCommentCountInfo + GetCommentCountInfo(ctx context.Context, in *rpcs.GetCommentCountInfoRequest, opts ...grpc.CallOption) (*rpcs.GetCommentCountInfoResponse, error) + // 3.GetListCommentLevelOneCount + GetListCommentLevelOneCount(ctx context.Context, in *rpcs.GetListCommentLevelOneCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentLevelCountResponse, error) + // 4.GetListCommentLevelTwoCount + GetListCommentLevelTwoCount(ctx context.Context, in *rpcs.GetListCommentLevelTwoCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentLevelCountResponse, error) +} + +type zBookCommentClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookCommentClient(cc grpc.ClientConnInterface) ZBookCommentClient { + return &zBookCommentClient{cc} +} + +func (c *zBookCommentClient) CreateComment(ctx context.Context, in *rpcs.CreateCommentRequest, opts ...grpc.CallOption) (*rpcs.CreateCommentResponse, error) { + out := new(rpcs.CreateCommentResponse) + err := c.cc.Invoke(ctx, ZBookComment_CreateComment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookCommentClient) DeleteComment(ctx context.Context, in *rpcs.DeleteCommentRequest, opts ...grpc.CallOption) (*rpcs.DeleteCommentResponse, error) { + out := new(rpcs.DeleteCommentResponse) + err := c.cc.Invoke(ctx, ZBookComment_DeleteComment_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookCommentClient) ListCommentLevelOne(ctx context.Context, in *rpcs.ListCommentLevelOneRequest, opts ...grpc.CallOption) (*rpcs.ListCommentLevelResponse, error) { + out := new(rpcs.ListCommentLevelResponse) + err := c.cc.Invoke(ctx, ZBookComment_ListCommentLevelOne_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookCommentClient) ListCommentLevelTwo(ctx context.Context, in *rpcs.ListCommentLevelTwoRequest, opts ...grpc.CallOption) (*rpcs.ListCommentLevelResponse, error) { + out := new(rpcs.ListCommentLevelResponse) + err := c.cc.Invoke(ctx, ZBookComment_ListCommentLevelTwo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookCommentClient) GetCommentCountInfo(ctx context.Context, in *rpcs.GetCommentCountInfoRequest, opts ...grpc.CallOption) (*rpcs.GetCommentCountInfoResponse, error) { + out := new(rpcs.GetCommentCountInfoResponse) + err := c.cc.Invoke(ctx, ZBookComment_GetCommentCountInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookCommentClient) GetListCommentLevelOneCount(ctx context.Context, in *rpcs.GetListCommentLevelOneCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentLevelCountResponse, error) { + out := new(rpcs.GetListCommentLevelCountResponse) + err := c.cc.Invoke(ctx, ZBookComment_GetListCommentLevelOneCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookCommentClient) GetListCommentLevelTwoCount(ctx context.Context, in *rpcs.GetListCommentLevelTwoCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentLevelCountResponse, error) { + out := new(rpcs.GetListCommentLevelCountResponse) + err := c.cc.Invoke(ctx, ZBookComment_GetListCommentLevelTwoCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookCommentServer is the server API for ZBookComment service. +// All implementations must embed UnimplementedZBookCommentServer +// for forward compatibility +type ZBookCommentServer interface { + // 1.CreateComment + CreateComment(context.Context, *rpcs.CreateCommentRequest) (*rpcs.CreateCommentResponse, error) + // 2.DeleteComment + DeleteComment(context.Context, *rpcs.DeleteCommentRequest) (*rpcs.DeleteCommentResponse, error) + // 3.ListCommentLevelOne + ListCommentLevelOne(context.Context, *rpcs.ListCommentLevelOneRequest) (*rpcs.ListCommentLevelResponse, error) + // 4.ListCommentLevelTwo + ListCommentLevelTwo(context.Context, *rpcs.ListCommentLevelTwoRequest) (*rpcs.ListCommentLevelResponse, error) + // 5.GetCommentCountInfo + GetCommentCountInfo(context.Context, *rpcs.GetCommentCountInfoRequest) (*rpcs.GetCommentCountInfoResponse, error) + // 3.GetListCommentLevelOneCount + GetListCommentLevelOneCount(context.Context, *rpcs.GetListCommentLevelOneCountRequest) (*rpcs.GetListCommentLevelCountResponse, error) + // 4.GetListCommentLevelTwoCount + GetListCommentLevelTwoCount(context.Context, *rpcs.GetListCommentLevelTwoCountRequest) (*rpcs.GetListCommentLevelCountResponse, error) + mustEmbedUnimplementedZBookCommentServer() +} + +// UnimplementedZBookCommentServer must be embedded to have forward compatible implementations. +type UnimplementedZBookCommentServer struct { +} + +func (UnimplementedZBookCommentServer) CreateComment(context.Context, *rpcs.CreateCommentRequest) (*rpcs.CreateCommentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateComment not implemented") +} +func (UnimplementedZBookCommentServer) DeleteComment(context.Context, *rpcs.DeleteCommentRequest) (*rpcs.DeleteCommentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteComment not implemented") +} +func (UnimplementedZBookCommentServer) ListCommentLevelOne(context.Context, *rpcs.ListCommentLevelOneRequest) (*rpcs.ListCommentLevelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCommentLevelOne not implemented") +} +func (UnimplementedZBookCommentServer) ListCommentLevelTwo(context.Context, *rpcs.ListCommentLevelTwoRequest) (*rpcs.ListCommentLevelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCommentLevelTwo not implemented") +} +func (UnimplementedZBookCommentServer) GetCommentCountInfo(context.Context, *rpcs.GetCommentCountInfoRequest) (*rpcs.GetCommentCountInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCommentCountInfo not implemented") +} +func (UnimplementedZBookCommentServer) GetListCommentLevelOneCount(context.Context, *rpcs.GetListCommentLevelOneCountRequest) (*rpcs.GetListCommentLevelCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListCommentLevelOneCount not implemented") +} +func (UnimplementedZBookCommentServer) GetListCommentLevelTwoCount(context.Context, *rpcs.GetListCommentLevelTwoCountRequest) (*rpcs.GetListCommentLevelCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListCommentLevelTwoCount not implemented") +} +func (UnimplementedZBookCommentServer) mustEmbedUnimplementedZBookCommentServer() {} + +// UnsafeZBookCommentServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookCommentServer will +// result in compilation errors. +type UnsafeZBookCommentServer interface { + mustEmbedUnimplementedZBookCommentServer() +} + +func RegisterZBookCommentServer(s grpc.ServiceRegistrar, srv ZBookCommentServer) { + s.RegisterService(&ZBookComment_ServiceDesc, srv) +} + +func _ZBookComment_CreateComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentServer).CreateComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookComment_CreateComment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentServer).CreateComment(ctx, req.(*rpcs.CreateCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookComment_DeleteComment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.DeleteCommentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentServer).DeleteComment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookComment_DeleteComment_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentServer).DeleteComment(ctx, req.(*rpcs.DeleteCommentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookComment_ListCommentLevelOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListCommentLevelOneRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentServer).ListCommentLevelOne(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookComment_ListCommentLevelOne_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentServer).ListCommentLevelOne(ctx, req.(*rpcs.ListCommentLevelOneRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookComment_ListCommentLevelTwo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListCommentLevelTwoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentServer).ListCommentLevelTwo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookComment_ListCommentLevelTwo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentServer).ListCommentLevelTwo(ctx, req.(*rpcs.ListCommentLevelTwoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookComment_GetCommentCountInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetCommentCountInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentServer).GetCommentCountInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookComment_GetCommentCountInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentServer).GetCommentCountInfo(ctx, req.(*rpcs.GetCommentCountInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookComment_GetListCommentLevelOneCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListCommentLevelOneCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentServer).GetListCommentLevelOneCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookComment_GetListCommentLevelOneCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentServer).GetListCommentLevelOneCount(ctx, req.(*rpcs.GetListCommentLevelOneCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookComment_GetListCommentLevelTwoCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListCommentLevelTwoCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentServer).GetListCommentLevelTwoCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookComment_GetListCommentLevelTwoCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentServer).GetListCommentLevelTwoCount(ctx, req.(*rpcs.GetListCommentLevelTwoCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookComment_ServiceDesc is the grpc.ServiceDesc for ZBookComment service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookComment_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookComment", + HandlerType: (*ZBookCommentServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateComment", + Handler: _ZBookComment_CreateComment_Handler, + }, + { + MethodName: "DeleteComment", + Handler: _ZBookComment_DeleteComment_Handler, + }, + { + MethodName: "ListCommentLevelOne", + Handler: _ZBookComment_ListCommentLevelOne_Handler, + }, + { + MethodName: "ListCommentLevelTwo", + Handler: _ZBookComment_ListCommentLevelTwo_Handler, + }, + { + MethodName: "GetCommentCountInfo", + Handler: _ZBookComment_GetCommentCountInfo_Handler, + }, + { + MethodName: "GetListCommentLevelOneCount", + Handler: _ZBookComment_GetListCommentLevelOneCount_Handler, + }, + { + MethodName: "GetListCommentLevelTwoCount", + Handler: _ZBookComment_GetListCommentLevelTwoCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_comment.proto", +} diff --git a/zbook_backend/pb/service_zbook_comment_relation.pb.go b/zbook_backend/pb/service_zbook_comment_relation.pb.go new file mode 100644 index 0000000..b150b5c --- /dev/null +++ b/zbook_backend/pb/service_zbook_comment_relation.pb.go @@ -0,0 +1,131 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_comment_relation.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_comment_relation_proto protoreflect.FileDescriptor + +var file_service_zbook_comment_relation_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, + 0x70, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xf0, 0x04, 0x0a, 0x14, 0x5a, 0x42, + 0x6f, 0x6f, 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0xc7, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x69, 0x92, 0x41, 0x40, 0x12, 0x16, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x6c, + 0x69, 0x6b, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x26, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, + 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xc3, 0x01, 0x0a, + 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6b, 0x92, 0x41, 0x44, 0x12, 0x18, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x28, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, + 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x12, 0xc7, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x69, 0x92, 0x41, 0x40, 0x12, 0x16, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x6c, + 0x69, 0x6b, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x26, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, + 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x72, 0x92, 0x41, + 0x53, 0x12, 0x51, 0x0a, 0x09, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x70, 0x69, 0x22, 0x3f, + 0x0a, 0x0a, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, 0x74, + 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, 0x7a, + 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x32, + 0x03, 0x30, 0x2e, 0x31, 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_comment_relation_proto_goTypes = []interface{}{ + (*rpcs.CreateCommentRelationRequest)(nil), // 0: pb.CreateCommentRelationRequest + (*rpcs.CreateCommentReportRequest)(nil), // 1: pb.CreateCommentReportRequest + (*rpcs.DeleteCommentRelationRequest)(nil), // 2: pb.DeleteCommentRelationRequest + (*rpcs.CreateCommentRelationResponse)(nil), // 3: pb.CreateCommentRelationResponse + (*rpcs.CreateCommentReportResponse)(nil), // 4: pb.CreateCommentReportResponse + (*rpcs.DeleteCommentRelationResponse)(nil), // 5: pb.DeleteCommentRelationResponse +} +var file_service_zbook_comment_relation_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookCommentRelation.CreateCommentRelation:input_type -> pb.CreateCommentRelationRequest + 1, // 1: pb.ZBookCommentRelation.CreateCommentReport:input_type -> pb.CreateCommentReportRequest + 2, // 2: pb.ZBookCommentRelation.DeleteCommentRelation:input_type -> pb.DeleteCommentRelationRequest + 3, // 3: pb.ZBookCommentRelation.CreateCommentRelation:output_type -> pb.CreateCommentRelationResponse + 4, // 4: pb.ZBookCommentRelation.CreateCommentReport:output_type -> pb.CreateCommentReportResponse + 5, // 5: pb.ZBookCommentRelation.DeleteCommentRelation:output_type -> pb.DeleteCommentRelationResponse + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_comment_relation_proto_init() } +func file_service_zbook_comment_relation_proto_init() { + if File_service_zbook_comment_relation_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_comment_relation_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_comment_relation_proto_goTypes, + DependencyIndexes: file_service_zbook_comment_relation_proto_depIdxs, + }.Build() + File_service_zbook_comment_relation_proto = out.File + file_service_zbook_comment_relation_proto_rawDesc = nil + file_service_zbook_comment_relation_proto_goTypes = nil + file_service_zbook_comment_relation_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_comment_relation.pb.gw.go b/zbook_backend/pb/service_zbook_comment_relation.pb.gw.go new file mode 100644 index 0000000..17899c5 --- /dev/null +++ b/zbook_backend/pb/service_zbook_comment_relation.pb.gw.go @@ -0,0 +1,318 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_comment_relation.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookCommentRelation_CreateCommentRelation_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentRelationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateCommentRelationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateCommentRelation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookCommentRelation_CreateCommentRelation_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentRelationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateCommentRelationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateCommentRelation(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookCommentRelation_CreateCommentReport_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentRelationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateCommentReportRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateCommentReport(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookCommentRelation_CreateCommentReport_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentRelationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateCommentReportRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateCommentReport(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookCommentRelation_DeleteCommentRelation_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookCommentRelationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteCommentRelationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteCommentRelation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookCommentRelation_DeleteCommentRelation_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookCommentRelationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteCommentRelationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteCommentRelation(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookCommentRelationHandlerServer registers the http handlers for service ZBookCommentRelation to "mux". +// UnaryRPC :call ZBookCommentRelationServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookCommentRelationHandlerFromEndpoint instead. +func RegisterZBookCommentRelationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookCommentRelationServer) error { + + mux.Handle("POST", pattern_ZBookCommentRelation_CreateCommentRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookCommentRelation/CreateCommentRelation", runtime.WithHTTPPathPattern("/v1/create_comment_relation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookCommentRelation_CreateCommentRelation_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookCommentRelation_CreateCommentRelation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookCommentRelation_CreateCommentReport_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookCommentRelation/CreateCommentReport", runtime.WithHTTPPathPattern("/v1/create_comment_report")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookCommentRelation_CreateCommentReport_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookCommentRelation_CreateCommentReport_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookCommentRelation_DeleteCommentRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookCommentRelation/DeleteCommentRelation", runtime.WithHTTPPathPattern("/v1/delete_comment_relation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookCommentRelation_DeleteCommentRelation_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookCommentRelation_DeleteCommentRelation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookCommentRelationHandlerFromEndpoint is same as RegisterZBookCommentRelationHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookCommentRelationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookCommentRelationHandler(ctx, mux, conn) +} + +// RegisterZBookCommentRelationHandler registers the http handlers for service ZBookCommentRelation to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookCommentRelationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookCommentRelationHandlerClient(ctx, mux, NewZBookCommentRelationClient(conn)) +} + +// RegisterZBookCommentRelationHandlerClient registers the http handlers for service ZBookCommentRelation +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookCommentRelationClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookCommentRelationClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookCommentRelationClient" to call the correct interceptors. +func RegisterZBookCommentRelationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookCommentRelationClient) error { + + mux.Handle("POST", pattern_ZBookCommentRelation_CreateCommentRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookCommentRelation/CreateCommentRelation", runtime.WithHTTPPathPattern("/v1/create_comment_relation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookCommentRelation_CreateCommentRelation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookCommentRelation_CreateCommentRelation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookCommentRelation_CreateCommentReport_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookCommentRelation/CreateCommentReport", runtime.WithHTTPPathPattern("/v1/create_comment_report")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookCommentRelation_CreateCommentReport_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookCommentRelation_CreateCommentReport_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookCommentRelation_DeleteCommentRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookCommentRelation/DeleteCommentRelation", runtime.WithHTTPPathPattern("/v1/delete_comment_relation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookCommentRelation_DeleteCommentRelation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookCommentRelation_DeleteCommentRelation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookCommentRelation_CreateCommentRelation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_comment_relation"}, "")) + + pattern_ZBookCommentRelation_CreateCommentReport_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_comment_report"}, "")) + + pattern_ZBookCommentRelation_DeleteCommentRelation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "delete_comment_relation"}, "")) +) + +var ( + forward_ZBookCommentRelation_CreateCommentRelation_0 = runtime.ForwardResponseMessage + + forward_ZBookCommentRelation_CreateCommentReport_0 = runtime.ForwardResponseMessage + + forward_ZBookCommentRelation_DeleteCommentRelation_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_comment_relation_grpc.pb.go b/zbook_backend/pb/service_zbook_comment_relation_grpc.pb.go new file mode 100644 index 0000000..5c89beb --- /dev/null +++ b/zbook_backend/pb/service_zbook_comment_relation_grpc.pb.go @@ -0,0 +1,190 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_comment_relation.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookCommentRelation_CreateCommentRelation_FullMethodName = "/pb.ZBookCommentRelation/CreateCommentRelation" + ZBookCommentRelation_CreateCommentReport_FullMethodName = "/pb.ZBookCommentRelation/CreateCommentReport" + ZBookCommentRelation_DeleteCommentRelation_FullMethodName = "/pb.ZBookCommentRelation/DeleteCommentRelation" +) + +// ZBookCommentRelationClient is the client API for ZBookCommentRelation service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookCommentRelationClient interface { + // 1.CreateCommentRelation + CreateCommentRelation(ctx context.Context, in *rpcs.CreateCommentRelationRequest, opts ...grpc.CallOption) (*rpcs.CreateCommentRelationResponse, error) + // 2.CreateCommentReport + CreateCommentReport(ctx context.Context, in *rpcs.CreateCommentReportRequest, opts ...grpc.CallOption) (*rpcs.CreateCommentReportResponse, error) + // 3.DeleteCommentRelation + DeleteCommentRelation(ctx context.Context, in *rpcs.DeleteCommentRelationRequest, opts ...grpc.CallOption) (*rpcs.DeleteCommentRelationResponse, error) +} + +type zBookCommentRelationClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookCommentRelationClient(cc grpc.ClientConnInterface) ZBookCommentRelationClient { + return &zBookCommentRelationClient{cc} +} + +func (c *zBookCommentRelationClient) CreateCommentRelation(ctx context.Context, in *rpcs.CreateCommentRelationRequest, opts ...grpc.CallOption) (*rpcs.CreateCommentRelationResponse, error) { + out := new(rpcs.CreateCommentRelationResponse) + err := c.cc.Invoke(ctx, ZBookCommentRelation_CreateCommentRelation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookCommentRelationClient) CreateCommentReport(ctx context.Context, in *rpcs.CreateCommentReportRequest, opts ...grpc.CallOption) (*rpcs.CreateCommentReportResponse, error) { + out := new(rpcs.CreateCommentReportResponse) + err := c.cc.Invoke(ctx, ZBookCommentRelation_CreateCommentReport_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookCommentRelationClient) DeleteCommentRelation(ctx context.Context, in *rpcs.DeleteCommentRelationRequest, opts ...grpc.CallOption) (*rpcs.DeleteCommentRelationResponse, error) { + out := new(rpcs.DeleteCommentRelationResponse) + err := c.cc.Invoke(ctx, ZBookCommentRelation_DeleteCommentRelation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookCommentRelationServer is the server API for ZBookCommentRelation service. +// All implementations must embed UnimplementedZBookCommentRelationServer +// for forward compatibility +type ZBookCommentRelationServer interface { + // 1.CreateCommentRelation + CreateCommentRelation(context.Context, *rpcs.CreateCommentRelationRequest) (*rpcs.CreateCommentRelationResponse, error) + // 2.CreateCommentReport + CreateCommentReport(context.Context, *rpcs.CreateCommentReportRequest) (*rpcs.CreateCommentReportResponse, error) + // 3.DeleteCommentRelation + DeleteCommentRelation(context.Context, *rpcs.DeleteCommentRelationRequest) (*rpcs.DeleteCommentRelationResponse, error) + mustEmbedUnimplementedZBookCommentRelationServer() +} + +// UnimplementedZBookCommentRelationServer must be embedded to have forward compatible implementations. +type UnimplementedZBookCommentRelationServer struct { +} + +func (UnimplementedZBookCommentRelationServer) CreateCommentRelation(context.Context, *rpcs.CreateCommentRelationRequest) (*rpcs.CreateCommentRelationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateCommentRelation not implemented") +} +func (UnimplementedZBookCommentRelationServer) CreateCommentReport(context.Context, *rpcs.CreateCommentReportRequest) (*rpcs.CreateCommentReportResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateCommentReport not implemented") +} +func (UnimplementedZBookCommentRelationServer) DeleteCommentRelation(context.Context, *rpcs.DeleteCommentRelationRequest) (*rpcs.DeleteCommentRelationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteCommentRelation not implemented") +} +func (UnimplementedZBookCommentRelationServer) mustEmbedUnimplementedZBookCommentRelationServer() {} + +// UnsafeZBookCommentRelationServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookCommentRelationServer will +// result in compilation errors. +type UnsafeZBookCommentRelationServer interface { + mustEmbedUnimplementedZBookCommentRelationServer() +} + +func RegisterZBookCommentRelationServer(s grpc.ServiceRegistrar, srv ZBookCommentRelationServer) { + s.RegisterService(&ZBookCommentRelation_ServiceDesc, srv) +} + +func _ZBookCommentRelation_CreateCommentRelation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateCommentRelationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentRelationServer).CreateCommentRelation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookCommentRelation_CreateCommentRelation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentRelationServer).CreateCommentRelation(ctx, req.(*rpcs.CreateCommentRelationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookCommentRelation_CreateCommentReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateCommentReportRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentRelationServer).CreateCommentReport(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookCommentRelation_CreateCommentReport_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentRelationServer).CreateCommentReport(ctx, req.(*rpcs.CreateCommentReportRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookCommentRelation_DeleteCommentRelation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.DeleteCommentRelationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookCommentRelationServer).DeleteCommentRelation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookCommentRelation_DeleteCommentRelation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookCommentRelationServer).DeleteCommentRelation(ctx, req.(*rpcs.DeleteCommentRelationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookCommentRelation_ServiceDesc is the grpc.ServiceDesc for ZBookCommentRelation service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookCommentRelation_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookCommentRelation", + HandlerType: (*ZBookCommentRelationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateCommentRelation", + Handler: _ZBookCommentRelation_CreateCommentRelation_Handler, + }, + { + MethodName: "CreateCommentReport", + Handler: _ZBookCommentRelation_CreateCommentReport_Handler, + }, + { + MethodName: "DeleteCommentRelation", + Handler: _ZBookCommentRelation_DeleteCommentRelation_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_comment_relation.proto", +} diff --git a/zbook_backend/pb/service_zbook_follow.pb.go b/zbook_backend/pb/service_zbook_follow.pb.go new file mode 100644 index 0000000..48b687e --- /dev/null +++ b/zbook_backend/pb/service_zbook_follow.pb.go @@ -0,0 +1,182 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_follow.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_follow_proto protoreflect.FileDescriptor + +var file_service_zbook_follow_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, + 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, + 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xb5, 0x09, 0x0a, 0x0b, 0x5a, 0x42, 0x6f, 0x6f, 0x6b, 0x46, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0xa9, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, 0x92, 0x41, 0x47, 0x12, 0x0c, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x1a, 0x37, 0x55, 0x73, + 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x20, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x20, 0x74, 0x77, 0x6f, + 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x12, 0xa9, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5d, + 0x92, 0x41, 0x3a, 0x12, 0x13, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x23, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, + 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x90, 0x01, + 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x17, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x4d, 0x92, 0x41, 0x2e, 0x12, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x66, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x1a, 0x1d, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, + 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x66, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, + 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x12, 0xa1, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x72, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0x92, 0x41, 0x3f, 0x12, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x20, + 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, + 0x72, 0x1a, 0x25, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, + 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, + 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, + 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x72, 0x12, 0xb2, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x46, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x92, 0x41, 0x3f, 0x12, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x20, + 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, + 0x72, 0x1a, 0x25, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, + 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, + 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, + 0x2a, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xa7, 0x01, 0x0a, 0x0d, 0x4c, 0x69, + 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x2e, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x61, 0x92, 0x41, 0x41, 0x12, 0x17, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x20, 0x66, 0x6f, 0x6c, + 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x26, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x6c, 0x69, 0x73, 0x74, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x6f, + 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, + 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x69, 0x6e, 0x67, 0x12, 0xb7, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x65, 0x92, 0x41, 0x40, 0x12, 0x17, 0x6c, 0x69, 0x73, + 0x74, 0x20, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, + 0x75, 0x73, 0x65, 0x72, 0x1a, 0x25, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, + 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x66, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x72, 0x92, + 0x41, 0x53, 0x12, 0x51, 0x0a, 0x09, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x70, 0x69, 0x22, + 0x3f, 0x0a, 0x0a, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, + 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, + 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, + 0x32, 0x03, 0x30, 0x2e, 0x31, 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_follow_proto_goTypes = []interface{}{ + (*rpcs.CreateFollowRequest)(nil), // 0: pb.CreateFollowRequest + (*rpcs.GetFollowStatusRequest)(nil), // 1: pb.GetFollowStatusRequest + (*rpcs.DeleteFollowRequest)(nil), // 2: pb.DeleteFollowRequest + (*rpcs.ListFollowerRequest)(nil), // 3: pb.ListFollowerRequest + (*rpcs.GetFollowerCountRequest)(nil), // 4: pb.GetFollowerCountRequest + (*rpcs.ListFollowingRequest)(nil), // 5: pb.ListFollowingRequest + (*rpcs.GetFollowingCountRequest)(nil), // 6: pb.GetFollowingCountRequest + (*rpcs.CreateFollowResponse)(nil), // 7: pb.CreateFollowResponse + (*rpcs.GetFollowStatusResponse)(nil), // 8: pb.GetFollowStatusResponse + (*rpcs.DeleteFollowResponse)(nil), // 9: pb.DeleteFollowResponse + (*rpcs.ListFollowerResponse)(nil), // 10: pb.ListFollowerResponse + (*rpcs.GetFollowerCountResponse)(nil), // 11: pb.GetFollowerCountResponse + (*rpcs.ListFollowingResponse)(nil), // 12: pb.ListFollowingResponse + (*rpcs.GetFollowingCountResponse)(nil), // 13: pb.GetFollowingCountResponse +} +var file_service_zbook_follow_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookFollow.CreateFollow:input_type -> pb.CreateFollowRequest + 1, // 1: pb.ZBookFollow.GetFollowStatus:input_type -> pb.GetFollowStatusRequest + 2, // 2: pb.ZBookFollow.DeleteFollow:input_type -> pb.DeleteFollowRequest + 3, // 3: pb.ZBookFollow.ListFollower:input_type -> pb.ListFollowerRequest + 4, // 4: pb.ZBookFollow.GetFollowerCount:input_type -> pb.GetFollowerCountRequest + 5, // 5: pb.ZBookFollow.ListFollowing:input_type -> pb.ListFollowingRequest + 6, // 6: pb.ZBookFollow.GetFollowingCount:input_type -> pb.GetFollowingCountRequest + 7, // 7: pb.ZBookFollow.CreateFollow:output_type -> pb.CreateFollowResponse + 8, // 8: pb.ZBookFollow.GetFollowStatus:output_type -> pb.GetFollowStatusResponse + 9, // 9: pb.ZBookFollow.DeleteFollow:output_type -> pb.DeleteFollowResponse + 10, // 10: pb.ZBookFollow.ListFollower:output_type -> pb.ListFollowerResponse + 11, // 11: pb.ZBookFollow.GetFollowerCount:output_type -> pb.GetFollowerCountResponse + 12, // 12: pb.ZBookFollow.ListFollowing:output_type -> pb.ListFollowingResponse + 13, // 13: pb.ZBookFollow.GetFollowingCount:output_type -> pb.GetFollowingCountResponse + 7, // [7:14] is the sub-list for method output_type + 0, // [0:7] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_follow_proto_init() } +func file_service_zbook_follow_proto_init() { + if File_service_zbook_follow_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_follow_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_follow_proto_goTypes, + DependencyIndexes: file_service_zbook_follow_proto_depIdxs, + }.Build() + File_service_zbook_follow_proto = out.File + file_service_zbook_follow_proto_rawDesc = nil + file_service_zbook_follow_proto_goTypes = nil + file_service_zbook_follow_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_follow.pb.gw.go b/zbook_backend/pb/service_zbook_follow.pb.gw.go new file mode 100644 index 0000000..872dc63 --- /dev/null +++ b/zbook_backend/pb/service_zbook_follow.pb.gw.go @@ -0,0 +1,626 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_follow.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookFollow_CreateFollow_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookFollowClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateFollowRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateFollow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookFollow_CreateFollow_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookFollowServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateFollowRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateFollow(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookFollow_GetFollowStatus_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookFollowClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetFollowStatusRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetFollowStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookFollow_GetFollowStatus_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookFollowServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetFollowStatusRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetFollowStatus(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookFollow_DeleteFollow_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookFollowClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteFollowRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteFollow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookFollow_DeleteFollow_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookFollowServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteFollowRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteFollow(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookFollow_ListFollower_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookFollowClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListFollowerRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListFollower(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookFollow_ListFollower_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookFollowServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListFollowerRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListFollower(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookFollow_GetFollowerCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookFollowClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetFollowerCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetFollowerCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookFollow_GetFollowerCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookFollowServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetFollowerCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetFollowerCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookFollow_ListFollowing_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookFollowClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListFollowingRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListFollowing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookFollow_ListFollowing_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookFollowServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListFollowingRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListFollowing(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookFollow_GetFollowingCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookFollowClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetFollowingCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetFollowingCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookFollow_GetFollowingCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookFollowServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetFollowingCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetFollowingCount(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookFollowHandlerServer registers the http handlers for service ZBookFollow to "mux". +// UnaryRPC :call ZBookFollowServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookFollowHandlerFromEndpoint instead. +func RegisterZBookFollowHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookFollowServer) error { + + mux.Handle("POST", pattern_ZBookFollow_CreateFollow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookFollow/CreateFollow", runtime.WithHTTPPathPattern("/v1/create_follow")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookFollow_CreateFollow_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_CreateFollow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_GetFollowStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookFollow/GetFollowStatus", runtime.WithHTTPPathPattern("/v1/get_follow_status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookFollow_GetFollowStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_GetFollowStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_DeleteFollow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookFollow/DeleteFollow", runtime.WithHTTPPathPattern("/v1/delete_follow")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookFollow_DeleteFollow_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_DeleteFollow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_ListFollower_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookFollow/ListFollower", runtime.WithHTTPPathPattern("/v1/list_follower")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookFollow_ListFollower_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_ListFollower_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_GetFollowerCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookFollow/GetFollowerCount", runtime.WithHTTPPathPattern("/v1/get_follower_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookFollow_GetFollowerCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_GetFollowerCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_ListFollowing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookFollow/ListFollowing", runtime.WithHTTPPathPattern("/v1/list_following")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookFollow_ListFollowing_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_ListFollowing_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_GetFollowingCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookFollow/GetFollowingCount", runtime.WithHTTPPathPattern("/v1/get_following_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookFollow_GetFollowingCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_GetFollowingCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookFollowHandlerFromEndpoint is same as RegisterZBookFollowHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookFollowHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookFollowHandler(ctx, mux, conn) +} + +// RegisterZBookFollowHandler registers the http handlers for service ZBookFollow to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookFollowHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookFollowHandlerClient(ctx, mux, NewZBookFollowClient(conn)) +} + +// RegisterZBookFollowHandlerClient registers the http handlers for service ZBookFollow +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookFollowClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookFollowClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookFollowClient" to call the correct interceptors. +func RegisterZBookFollowHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookFollowClient) error { + + mux.Handle("POST", pattern_ZBookFollow_CreateFollow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookFollow/CreateFollow", runtime.WithHTTPPathPattern("/v1/create_follow")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookFollow_CreateFollow_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_CreateFollow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_GetFollowStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookFollow/GetFollowStatus", runtime.WithHTTPPathPattern("/v1/get_follow_status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookFollow_GetFollowStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_GetFollowStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_DeleteFollow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookFollow/DeleteFollow", runtime.WithHTTPPathPattern("/v1/delete_follow")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookFollow_DeleteFollow_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_DeleteFollow_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_ListFollower_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookFollow/ListFollower", runtime.WithHTTPPathPattern("/v1/list_follower")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookFollow_ListFollower_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_ListFollower_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_GetFollowerCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookFollow/GetFollowerCount", runtime.WithHTTPPathPattern("/v1/get_follower_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookFollow_GetFollowerCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_GetFollowerCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_ListFollowing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookFollow/ListFollowing", runtime.WithHTTPPathPattern("/v1/list_following")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookFollow_ListFollowing_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_ListFollowing_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookFollow_GetFollowingCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookFollow/GetFollowingCount", runtime.WithHTTPPathPattern("/v1/get_following_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookFollow_GetFollowingCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookFollow_GetFollowingCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookFollow_CreateFollow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_follow"}, "")) + + pattern_ZBookFollow_GetFollowStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_follow_status"}, "")) + + pattern_ZBookFollow_DeleteFollow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "delete_follow"}, "")) + + pattern_ZBookFollow_ListFollower_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_follower"}, "")) + + pattern_ZBookFollow_GetFollowerCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_follower_count"}, "")) + + pattern_ZBookFollow_ListFollowing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_following"}, "")) + + pattern_ZBookFollow_GetFollowingCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_following_count"}, "")) +) + +var ( + forward_ZBookFollow_CreateFollow_0 = runtime.ForwardResponseMessage + + forward_ZBookFollow_GetFollowStatus_0 = runtime.ForwardResponseMessage + + forward_ZBookFollow_DeleteFollow_0 = runtime.ForwardResponseMessage + + forward_ZBookFollow_ListFollower_0 = runtime.ForwardResponseMessage + + forward_ZBookFollow_GetFollowerCount_0 = runtime.ForwardResponseMessage + + forward_ZBookFollow_ListFollowing_0 = runtime.ForwardResponseMessage + + forward_ZBookFollow_GetFollowingCount_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_follow_grpc.pb.go b/zbook_backend/pb/service_zbook_follow_grpc.pb.go new file mode 100644 index 0000000..b6ed9e8 --- /dev/null +++ b/zbook_backend/pb/service_zbook_follow_grpc.pb.go @@ -0,0 +1,346 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_follow.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookFollow_CreateFollow_FullMethodName = "/pb.ZBookFollow/CreateFollow" + ZBookFollow_GetFollowStatus_FullMethodName = "/pb.ZBookFollow/GetFollowStatus" + ZBookFollow_DeleteFollow_FullMethodName = "/pb.ZBookFollow/DeleteFollow" + ZBookFollow_ListFollower_FullMethodName = "/pb.ZBookFollow/ListFollower" + ZBookFollow_GetFollowerCount_FullMethodName = "/pb.ZBookFollow/GetFollowerCount" + ZBookFollow_ListFollowing_FullMethodName = "/pb.ZBookFollow/ListFollowing" + ZBookFollow_GetFollowingCount_FullMethodName = "/pb.ZBookFollow/GetFollowingCount" +) + +// ZBookFollowClient is the client API for ZBookFollow service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookFollowClient interface { + // 1.CreateFollow + CreateFollow(ctx context.Context, in *rpcs.CreateFollowRequest, opts ...grpc.CallOption) (*rpcs.CreateFollowResponse, error) + // 2.GetFollowStatus + GetFollowStatus(ctx context.Context, in *rpcs.GetFollowStatusRequest, opts ...grpc.CallOption) (*rpcs.GetFollowStatusResponse, error) + // 3.DeleteFollow + DeleteFollow(ctx context.Context, in *rpcs.DeleteFollowRequest, opts ...grpc.CallOption) (*rpcs.DeleteFollowResponse, error) + // 4.ListFollower + ListFollower(ctx context.Context, in *rpcs.ListFollowerRequest, opts ...grpc.CallOption) (*rpcs.ListFollowerResponse, error) + // 5. + GetFollowerCount(ctx context.Context, in *rpcs.GetFollowerCountRequest, opts ...grpc.CallOption) (*rpcs.GetFollowerCountResponse, error) + // 6.ListFollowing + ListFollowing(ctx context.Context, in *rpcs.ListFollowingRequest, opts ...grpc.CallOption) (*rpcs.ListFollowingResponse, error) + // 7.GetFollowingCount + GetFollowingCount(ctx context.Context, in *rpcs.GetFollowingCountRequest, opts ...grpc.CallOption) (*rpcs.GetFollowingCountResponse, error) +} + +type zBookFollowClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookFollowClient(cc grpc.ClientConnInterface) ZBookFollowClient { + return &zBookFollowClient{cc} +} + +func (c *zBookFollowClient) CreateFollow(ctx context.Context, in *rpcs.CreateFollowRequest, opts ...grpc.CallOption) (*rpcs.CreateFollowResponse, error) { + out := new(rpcs.CreateFollowResponse) + err := c.cc.Invoke(ctx, ZBookFollow_CreateFollow_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookFollowClient) GetFollowStatus(ctx context.Context, in *rpcs.GetFollowStatusRequest, opts ...grpc.CallOption) (*rpcs.GetFollowStatusResponse, error) { + out := new(rpcs.GetFollowStatusResponse) + err := c.cc.Invoke(ctx, ZBookFollow_GetFollowStatus_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookFollowClient) DeleteFollow(ctx context.Context, in *rpcs.DeleteFollowRequest, opts ...grpc.CallOption) (*rpcs.DeleteFollowResponse, error) { + out := new(rpcs.DeleteFollowResponse) + err := c.cc.Invoke(ctx, ZBookFollow_DeleteFollow_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookFollowClient) ListFollower(ctx context.Context, in *rpcs.ListFollowerRequest, opts ...grpc.CallOption) (*rpcs.ListFollowerResponse, error) { + out := new(rpcs.ListFollowerResponse) + err := c.cc.Invoke(ctx, ZBookFollow_ListFollower_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookFollowClient) GetFollowerCount(ctx context.Context, in *rpcs.GetFollowerCountRequest, opts ...grpc.CallOption) (*rpcs.GetFollowerCountResponse, error) { + out := new(rpcs.GetFollowerCountResponse) + err := c.cc.Invoke(ctx, ZBookFollow_GetFollowerCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookFollowClient) ListFollowing(ctx context.Context, in *rpcs.ListFollowingRequest, opts ...grpc.CallOption) (*rpcs.ListFollowingResponse, error) { + out := new(rpcs.ListFollowingResponse) + err := c.cc.Invoke(ctx, ZBookFollow_ListFollowing_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookFollowClient) GetFollowingCount(ctx context.Context, in *rpcs.GetFollowingCountRequest, opts ...grpc.CallOption) (*rpcs.GetFollowingCountResponse, error) { + out := new(rpcs.GetFollowingCountResponse) + err := c.cc.Invoke(ctx, ZBookFollow_GetFollowingCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookFollowServer is the server API for ZBookFollow service. +// All implementations must embed UnimplementedZBookFollowServer +// for forward compatibility +type ZBookFollowServer interface { + // 1.CreateFollow + CreateFollow(context.Context, *rpcs.CreateFollowRequest) (*rpcs.CreateFollowResponse, error) + // 2.GetFollowStatus + GetFollowStatus(context.Context, *rpcs.GetFollowStatusRequest) (*rpcs.GetFollowStatusResponse, error) + // 3.DeleteFollow + DeleteFollow(context.Context, *rpcs.DeleteFollowRequest) (*rpcs.DeleteFollowResponse, error) + // 4.ListFollower + ListFollower(context.Context, *rpcs.ListFollowerRequest) (*rpcs.ListFollowerResponse, error) + // 5. + GetFollowerCount(context.Context, *rpcs.GetFollowerCountRequest) (*rpcs.GetFollowerCountResponse, error) + // 6.ListFollowing + ListFollowing(context.Context, *rpcs.ListFollowingRequest) (*rpcs.ListFollowingResponse, error) + // 7.GetFollowingCount + GetFollowingCount(context.Context, *rpcs.GetFollowingCountRequest) (*rpcs.GetFollowingCountResponse, error) + mustEmbedUnimplementedZBookFollowServer() +} + +// UnimplementedZBookFollowServer must be embedded to have forward compatible implementations. +type UnimplementedZBookFollowServer struct { +} + +func (UnimplementedZBookFollowServer) CreateFollow(context.Context, *rpcs.CreateFollowRequest) (*rpcs.CreateFollowResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateFollow not implemented") +} +func (UnimplementedZBookFollowServer) GetFollowStatus(context.Context, *rpcs.GetFollowStatusRequest) (*rpcs.GetFollowStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFollowStatus not implemented") +} +func (UnimplementedZBookFollowServer) DeleteFollow(context.Context, *rpcs.DeleteFollowRequest) (*rpcs.DeleteFollowResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteFollow not implemented") +} +func (UnimplementedZBookFollowServer) ListFollower(context.Context, *rpcs.ListFollowerRequest) (*rpcs.ListFollowerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListFollower not implemented") +} +func (UnimplementedZBookFollowServer) GetFollowerCount(context.Context, *rpcs.GetFollowerCountRequest) (*rpcs.GetFollowerCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFollowerCount not implemented") +} +func (UnimplementedZBookFollowServer) ListFollowing(context.Context, *rpcs.ListFollowingRequest) (*rpcs.ListFollowingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListFollowing not implemented") +} +func (UnimplementedZBookFollowServer) GetFollowingCount(context.Context, *rpcs.GetFollowingCountRequest) (*rpcs.GetFollowingCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFollowingCount not implemented") +} +func (UnimplementedZBookFollowServer) mustEmbedUnimplementedZBookFollowServer() {} + +// UnsafeZBookFollowServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookFollowServer will +// result in compilation errors. +type UnsafeZBookFollowServer interface { + mustEmbedUnimplementedZBookFollowServer() +} + +func RegisterZBookFollowServer(s grpc.ServiceRegistrar, srv ZBookFollowServer) { + s.RegisterService(&ZBookFollow_ServiceDesc, srv) +} + +func _ZBookFollow_CreateFollow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateFollowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookFollowServer).CreateFollow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookFollow_CreateFollow_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookFollowServer).CreateFollow(ctx, req.(*rpcs.CreateFollowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookFollow_GetFollowStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetFollowStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookFollowServer).GetFollowStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookFollow_GetFollowStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookFollowServer).GetFollowStatus(ctx, req.(*rpcs.GetFollowStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookFollow_DeleteFollow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.DeleteFollowRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookFollowServer).DeleteFollow(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookFollow_DeleteFollow_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookFollowServer).DeleteFollow(ctx, req.(*rpcs.DeleteFollowRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookFollow_ListFollower_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListFollowerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookFollowServer).ListFollower(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookFollow_ListFollower_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookFollowServer).ListFollower(ctx, req.(*rpcs.ListFollowerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookFollow_GetFollowerCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetFollowerCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookFollowServer).GetFollowerCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookFollow_GetFollowerCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookFollowServer).GetFollowerCount(ctx, req.(*rpcs.GetFollowerCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookFollow_ListFollowing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListFollowingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookFollowServer).ListFollowing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookFollow_ListFollowing_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookFollowServer).ListFollowing(ctx, req.(*rpcs.ListFollowingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookFollow_GetFollowingCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetFollowingCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookFollowServer).GetFollowingCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookFollow_GetFollowingCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookFollowServer).GetFollowingCount(ctx, req.(*rpcs.GetFollowingCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookFollow_ServiceDesc is the grpc.ServiceDesc for ZBookFollow service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookFollow_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookFollow", + HandlerType: (*ZBookFollowServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateFollow", + Handler: _ZBookFollow_CreateFollow_Handler, + }, + { + MethodName: "GetFollowStatus", + Handler: _ZBookFollow_GetFollowStatus_Handler, + }, + { + MethodName: "DeleteFollow", + Handler: _ZBookFollow_DeleteFollow_Handler, + }, + { + MethodName: "ListFollower", + Handler: _ZBookFollow_ListFollower_Handler, + }, + { + MethodName: "GetFollowerCount", + Handler: _ZBookFollow_GetFollowerCount_Handler, + }, + { + MethodName: "ListFollowing", + Handler: _ZBookFollow_ListFollowing_Handler, + }, + { + MethodName: "GetFollowingCount", + Handler: _ZBookFollow_GetFollowingCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_follow.proto", +} diff --git a/zbook_backend/pb/service_zbook_markdown.pb.go b/zbook_backend/pb/service_zbook_markdown.pb.go new file mode 100644 index 0000000..b778f44 --- /dev/null +++ b/zbook_backend/pb/service_zbook_markdown.pb.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_markdown.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_markdown_proto protoreflect.FileDescriptor + +var file_service_zbook_markdown_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, + 0x70, 0x62, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, + 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x64, + 0x6f, 0x77, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xe0, 0x06, 0x0a, 0x0d, 0x5a, 0x42, + 0x6f, 0x6f, 0x6b, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0xa8, 0x01, 0x0a, 0x12, + 0x47, 0x65, 0x74, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x72, 0x6b, 0x64, + 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, + 0x77, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x53, 0x92, 0x41, 0x2d, 0x12, 0x0c, 0x67, 0x65, 0x74, 0x20, 0x6d, 0x61, 0x72, 0x6b, + 0x64, 0x6f, 0x77, 0x6e, 0x1a, 0x1d, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, + 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x67, 0x65, 0x74, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x64, + 0x6f, 0x77, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x9f, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4d, 0x61, + 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2c, 0x12, 0x14, 0xe8, 0x8e, 0xb7, + 0xe5, 0x8f, 0x96, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x1a, 0x14, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, + 0x6e, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, + 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, + 0x77, 0x6e, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0xb2, 0x01, 0x0a, 0x11, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x1c, + 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x72, + 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, + 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x4d, 0x61, 0x72, 0x6b, 0x64, + 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, 0x92, 0x41, 0x3b, + 0x12, 0x13, 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, + 0x20, 0x72, 0x65, 0x70, 0x6f, 0x1a, 0x24, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, + 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x6d, 0x61, + 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0xb2, 0x01, + 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x64, + 0x6f, 0x77, 0x6e, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, + 0x65, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, + 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x60, 0x92, 0x41, 0x3b, 0x12, 0x13, 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x6d, 0x61, 0x72, + 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x24, 0x55, 0x73, 0x65, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, + 0x77, 0x6e, 0x12, 0x97, 0x01, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, + 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, + 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, + 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x51, 0x92, 0x41, 0x31, 0x12, 0x0e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x1a, 0x1f, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x20, 0x71, 0x75, 0x65, 0x72, 0x79, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x5f, 0x6d, 0x61, 0x72, 0x6b, 0x64, 0x6f, 0x77, 0x6e, 0x42, 0x72, 0x92, 0x41, + 0x53, 0x12, 0x51, 0x0a, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x61, 0x70, 0x69, 0x22, 0x3f, + 0x0a, 0x0a, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, 0x74, + 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, 0x7a, + 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x32, + 0x03, 0x30, 0x2e, 0x31, 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_markdown_proto_goTypes = []interface{}{ + (*rpcs.GetMarkdownContentRequest)(nil), // 0: pb.GetMarkdownContentRequest + (*rpcs.GetMarkdownImageRequest)(nil), // 1: pb.GetMarkdownImageRequest + (*rpcs.QueryRepoMarkdownRequest)(nil), // 2: pb.QueryRepoMarkdownRequest + (*rpcs.QueryUserMarkdownRequest)(nil), // 3: pb.QueryUserMarkdownRequest + (*rpcs.QueryMarkdownRequest)(nil), // 4: pb.QueryMarkdownRequest + (*rpcs.GetMarkdownContentResponse)(nil), // 5: pb.GetMarkdownContentResponse + (*rpcs.GetMarkdownImageResponse)(nil), // 6: pb.GetMarkdownImageResponse + (*rpcs.QueryRepoMarkdownResponse)(nil), // 7: pb.QueryRepoMarkdownResponse + (*rpcs.QueryUserMarkdownResponse)(nil), // 8: pb.QueryUserMarkdownResponse + (*rpcs.QueryMarkdownResponse)(nil), // 9: pb.QueryMarkdownResponse +} +var file_service_zbook_markdown_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookMarkdown.GetMarkdownContent:input_type -> pb.GetMarkdownContentRequest + 1, // 1: pb.ZBookMarkdown.GetMarkdownImage:input_type -> pb.GetMarkdownImageRequest + 2, // 2: pb.ZBookMarkdown.QueryRepoMarkdown:input_type -> pb.QueryRepoMarkdownRequest + 3, // 3: pb.ZBookMarkdown.QueryUserMarkdown:input_type -> pb.QueryUserMarkdownRequest + 4, // 4: pb.ZBookMarkdown.QueryMarkdown:input_type -> pb.QueryMarkdownRequest + 5, // 5: pb.ZBookMarkdown.GetMarkdownContent:output_type -> pb.GetMarkdownContentResponse + 6, // 6: pb.ZBookMarkdown.GetMarkdownImage:output_type -> pb.GetMarkdownImageResponse + 7, // 7: pb.ZBookMarkdown.QueryRepoMarkdown:output_type -> pb.QueryRepoMarkdownResponse + 8, // 8: pb.ZBookMarkdown.QueryUserMarkdown:output_type -> pb.QueryUserMarkdownResponse + 9, // 9: pb.ZBookMarkdown.QueryMarkdown:output_type -> pb.QueryMarkdownResponse + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_markdown_proto_init() } +func file_service_zbook_markdown_proto_init() { + if File_service_zbook_markdown_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_markdown_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_markdown_proto_goTypes, + DependencyIndexes: file_service_zbook_markdown_proto_depIdxs, + }.Build() + File_service_zbook_markdown_proto = out.File + file_service_zbook_markdown_proto_rawDesc = nil + file_service_zbook_markdown_proto_goTypes = nil + file_service_zbook_markdown_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_markdown.pb.gw.go b/zbook_backend/pb/service_zbook_markdown.pb.gw.go new file mode 100644 index 0000000..0c97d26 --- /dev/null +++ b/zbook_backend/pb/service_zbook_markdown.pb.gw.go @@ -0,0 +1,472 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_markdown.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookMarkdown_GetMarkdownContent_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookMarkdownClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetMarkdownContentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetMarkdownContent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookMarkdown_GetMarkdownContent_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookMarkdownServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetMarkdownContentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetMarkdownContent(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookMarkdown_GetMarkdownImage_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookMarkdownClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetMarkdownImageRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetMarkdownImage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookMarkdown_GetMarkdownImage_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookMarkdownServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetMarkdownImageRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetMarkdownImage(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookMarkdown_QueryRepoMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookMarkdownClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.QueryRepoMarkdownRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryRepoMarkdown(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookMarkdown_QueryRepoMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookMarkdownServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.QueryRepoMarkdownRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryRepoMarkdown(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookMarkdown_QueryUserMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookMarkdownClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.QueryUserMarkdownRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryUserMarkdown(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookMarkdown_QueryUserMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookMarkdownServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.QueryUserMarkdownRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryUserMarkdown(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookMarkdown_QueryMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookMarkdownClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.QueryMarkdownRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryMarkdown(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookMarkdown_QueryMarkdown_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookMarkdownServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.QueryMarkdownRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryMarkdown(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookMarkdownHandlerServer registers the http handlers for service ZBookMarkdown to "mux". +// UnaryRPC :call ZBookMarkdownServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookMarkdownHandlerFromEndpoint instead. +func RegisterZBookMarkdownHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookMarkdownServer) error { + + mux.Handle("POST", pattern_ZBookMarkdown_GetMarkdownContent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookMarkdown/GetMarkdownContent", runtime.WithHTTPPathPattern("/v1/get_markdown_content")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookMarkdown_GetMarkdownContent_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_GetMarkdownContent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookMarkdown_GetMarkdownImage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookMarkdown/GetMarkdownImage", runtime.WithHTTPPathPattern("/v1/get_markdown_image")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookMarkdown_GetMarkdownImage_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_GetMarkdownImage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookMarkdown_QueryRepoMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookMarkdown/QueryRepoMarkdown", runtime.WithHTTPPathPattern("/v1/query_repo_markdown")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookMarkdown_QueryRepoMarkdown_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_QueryRepoMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookMarkdown_QueryUserMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookMarkdown/QueryUserMarkdown", runtime.WithHTTPPathPattern("/v1/query_user_markdown")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookMarkdown_QueryUserMarkdown_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_QueryUserMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookMarkdown_QueryMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookMarkdown/QueryMarkdown", runtime.WithHTTPPathPattern("/v1/query_markdown")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookMarkdown_QueryMarkdown_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_QueryMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookMarkdownHandlerFromEndpoint is same as RegisterZBookMarkdownHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookMarkdownHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookMarkdownHandler(ctx, mux, conn) +} + +// RegisterZBookMarkdownHandler registers the http handlers for service ZBookMarkdown to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookMarkdownHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookMarkdownHandlerClient(ctx, mux, NewZBookMarkdownClient(conn)) +} + +// RegisterZBookMarkdownHandlerClient registers the http handlers for service ZBookMarkdown +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookMarkdownClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookMarkdownClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookMarkdownClient" to call the correct interceptors. +func RegisterZBookMarkdownHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookMarkdownClient) error { + + mux.Handle("POST", pattern_ZBookMarkdown_GetMarkdownContent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookMarkdown/GetMarkdownContent", runtime.WithHTTPPathPattern("/v1/get_markdown_content")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookMarkdown_GetMarkdownContent_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_GetMarkdownContent_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookMarkdown_GetMarkdownImage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookMarkdown/GetMarkdownImage", runtime.WithHTTPPathPattern("/v1/get_markdown_image")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookMarkdown_GetMarkdownImage_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_GetMarkdownImage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookMarkdown_QueryRepoMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookMarkdown/QueryRepoMarkdown", runtime.WithHTTPPathPattern("/v1/query_repo_markdown")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookMarkdown_QueryRepoMarkdown_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_QueryRepoMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookMarkdown_QueryUserMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookMarkdown/QueryUserMarkdown", runtime.WithHTTPPathPattern("/v1/query_user_markdown")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookMarkdown_QueryUserMarkdown_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_QueryUserMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookMarkdown_QueryMarkdown_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookMarkdown/QueryMarkdown", runtime.WithHTTPPathPattern("/v1/query_markdown")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookMarkdown_QueryMarkdown_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookMarkdown_QueryMarkdown_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookMarkdown_GetMarkdownContent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_markdown_content"}, "")) + + pattern_ZBookMarkdown_GetMarkdownImage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_markdown_image"}, "")) + + pattern_ZBookMarkdown_QueryRepoMarkdown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "query_repo_markdown"}, "")) + + pattern_ZBookMarkdown_QueryUserMarkdown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "query_user_markdown"}, "")) + + pattern_ZBookMarkdown_QueryMarkdown_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "query_markdown"}, "")) +) + +var ( + forward_ZBookMarkdown_GetMarkdownContent_0 = runtime.ForwardResponseMessage + + forward_ZBookMarkdown_GetMarkdownImage_0 = runtime.ForwardResponseMessage + + forward_ZBookMarkdown_QueryRepoMarkdown_0 = runtime.ForwardResponseMessage + + forward_ZBookMarkdown_QueryUserMarkdown_0 = runtime.ForwardResponseMessage + + forward_ZBookMarkdown_QueryMarkdown_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_markdown_grpc.pb.go b/zbook_backend/pb/service_zbook_markdown_grpc.pb.go new file mode 100644 index 0000000..445e455 --- /dev/null +++ b/zbook_backend/pb/service_zbook_markdown_grpc.pb.go @@ -0,0 +1,268 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_markdown.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookMarkdown_GetMarkdownContent_FullMethodName = "/pb.ZBookMarkdown/GetMarkdownContent" + ZBookMarkdown_GetMarkdownImage_FullMethodName = "/pb.ZBookMarkdown/GetMarkdownImage" + ZBookMarkdown_QueryRepoMarkdown_FullMethodName = "/pb.ZBookMarkdown/QueryRepoMarkdown" + ZBookMarkdown_QueryUserMarkdown_FullMethodName = "/pb.ZBookMarkdown/QueryUserMarkdown" + ZBookMarkdown_QueryMarkdown_FullMethodName = "/pb.ZBookMarkdown/QueryMarkdown" +) + +// ZBookMarkdownClient is the client API for ZBookMarkdown service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookMarkdownClient interface { + // 1.GetMarkdownContent + GetMarkdownContent(ctx context.Context, in *rpcs.GetMarkdownContentRequest, opts ...grpc.CallOption) (*rpcs.GetMarkdownContentResponse, error) + // 2.GetMarkdownImage + GetMarkdownImage(ctx context.Context, in *rpcs.GetMarkdownImageRequest, opts ...grpc.CallOption) (*rpcs.GetMarkdownImageResponse, error) + // 3.QueryRepoMarkdown + QueryRepoMarkdown(ctx context.Context, in *rpcs.QueryRepoMarkdownRequest, opts ...grpc.CallOption) (*rpcs.QueryRepoMarkdownResponse, error) + // 4.QueryUserMarkdown + QueryUserMarkdown(ctx context.Context, in *rpcs.QueryUserMarkdownRequest, opts ...grpc.CallOption) (*rpcs.QueryUserMarkdownResponse, error) + // 5.QueryMarkdown + QueryMarkdown(ctx context.Context, in *rpcs.QueryMarkdownRequest, opts ...grpc.CallOption) (*rpcs.QueryMarkdownResponse, error) +} + +type zBookMarkdownClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookMarkdownClient(cc grpc.ClientConnInterface) ZBookMarkdownClient { + return &zBookMarkdownClient{cc} +} + +func (c *zBookMarkdownClient) GetMarkdownContent(ctx context.Context, in *rpcs.GetMarkdownContentRequest, opts ...grpc.CallOption) (*rpcs.GetMarkdownContentResponse, error) { + out := new(rpcs.GetMarkdownContentResponse) + err := c.cc.Invoke(ctx, ZBookMarkdown_GetMarkdownContent_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookMarkdownClient) GetMarkdownImage(ctx context.Context, in *rpcs.GetMarkdownImageRequest, opts ...grpc.CallOption) (*rpcs.GetMarkdownImageResponse, error) { + out := new(rpcs.GetMarkdownImageResponse) + err := c.cc.Invoke(ctx, ZBookMarkdown_GetMarkdownImage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookMarkdownClient) QueryRepoMarkdown(ctx context.Context, in *rpcs.QueryRepoMarkdownRequest, opts ...grpc.CallOption) (*rpcs.QueryRepoMarkdownResponse, error) { + out := new(rpcs.QueryRepoMarkdownResponse) + err := c.cc.Invoke(ctx, ZBookMarkdown_QueryRepoMarkdown_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookMarkdownClient) QueryUserMarkdown(ctx context.Context, in *rpcs.QueryUserMarkdownRequest, opts ...grpc.CallOption) (*rpcs.QueryUserMarkdownResponse, error) { + out := new(rpcs.QueryUserMarkdownResponse) + err := c.cc.Invoke(ctx, ZBookMarkdown_QueryUserMarkdown_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookMarkdownClient) QueryMarkdown(ctx context.Context, in *rpcs.QueryMarkdownRequest, opts ...grpc.CallOption) (*rpcs.QueryMarkdownResponse, error) { + out := new(rpcs.QueryMarkdownResponse) + err := c.cc.Invoke(ctx, ZBookMarkdown_QueryMarkdown_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookMarkdownServer is the server API for ZBookMarkdown service. +// All implementations must embed UnimplementedZBookMarkdownServer +// for forward compatibility +type ZBookMarkdownServer interface { + // 1.GetMarkdownContent + GetMarkdownContent(context.Context, *rpcs.GetMarkdownContentRequest) (*rpcs.GetMarkdownContentResponse, error) + // 2.GetMarkdownImage + GetMarkdownImage(context.Context, *rpcs.GetMarkdownImageRequest) (*rpcs.GetMarkdownImageResponse, error) + // 3.QueryRepoMarkdown + QueryRepoMarkdown(context.Context, *rpcs.QueryRepoMarkdownRequest) (*rpcs.QueryRepoMarkdownResponse, error) + // 4.QueryUserMarkdown + QueryUserMarkdown(context.Context, *rpcs.QueryUserMarkdownRequest) (*rpcs.QueryUserMarkdownResponse, error) + // 5.QueryMarkdown + QueryMarkdown(context.Context, *rpcs.QueryMarkdownRequest) (*rpcs.QueryMarkdownResponse, error) + mustEmbedUnimplementedZBookMarkdownServer() +} + +// UnimplementedZBookMarkdownServer must be embedded to have forward compatible implementations. +type UnimplementedZBookMarkdownServer struct { +} + +func (UnimplementedZBookMarkdownServer) GetMarkdownContent(context.Context, *rpcs.GetMarkdownContentRequest) (*rpcs.GetMarkdownContentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMarkdownContent not implemented") +} +func (UnimplementedZBookMarkdownServer) GetMarkdownImage(context.Context, *rpcs.GetMarkdownImageRequest) (*rpcs.GetMarkdownImageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMarkdownImage not implemented") +} +func (UnimplementedZBookMarkdownServer) QueryRepoMarkdown(context.Context, *rpcs.QueryRepoMarkdownRequest) (*rpcs.QueryRepoMarkdownResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryRepoMarkdown not implemented") +} +func (UnimplementedZBookMarkdownServer) QueryUserMarkdown(context.Context, *rpcs.QueryUserMarkdownRequest) (*rpcs.QueryUserMarkdownResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryUserMarkdown not implemented") +} +func (UnimplementedZBookMarkdownServer) QueryMarkdown(context.Context, *rpcs.QueryMarkdownRequest) (*rpcs.QueryMarkdownResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryMarkdown not implemented") +} +func (UnimplementedZBookMarkdownServer) mustEmbedUnimplementedZBookMarkdownServer() {} + +// UnsafeZBookMarkdownServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookMarkdownServer will +// result in compilation errors. +type UnsafeZBookMarkdownServer interface { + mustEmbedUnimplementedZBookMarkdownServer() +} + +func RegisterZBookMarkdownServer(s grpc.ServiceRegistrar, srv ZBookMarkdownServer) { + s.RegisterService(&ZBookMarkdown_ServiceDesc, srv) +} + +func _ZBookMarkdown_GetMarkdownContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetMarkdownContentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookMarkdownServer).GetMarkdownContent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookMarkdown_GetMarkdownContent_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookMarkdownServer).GetMarkdownContent(ctx, req.(*rpcs.GetMarkdownContentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookMarkdown_GetMarkdownImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetMarkdownImageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookMarkdownServer).GetMarkdownImage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookMarkdown_GetMarkdownImage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookMarkdownServer).GetMarkdownImage(ctx, req.(*rpcs.GetMarkdownImageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookMarkdown_QueryRepoMarkdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.QueryRepoMarkdownRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookMarkdownServer).QueryRepoMarkdown(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookMarkdown_QueryRepoMarkdown_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookMarkdownServer).QueryRepoMarkdown(ctx, req.(*rpcs.QueryRepoMarkdownRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookMarkdown_QueryUserMarkdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.QueryUserMarkdownRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookMarkdownServer).QueryUserMarkdown(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookMarkdown_QueryUserMarkdown_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookMarkdownServer).QueryUserMarkdown(ctx, req.(*rpcs.QueryUserMarkdownRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookMarkdown_QueryMarkdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.QueryMarkdownRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookMarkdownServer).QueryMarkdown(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookMarkdown_QueryMarkdown_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookMarkdownServer).QueryMarkdown(ctx, req.(*rpcs.QueryMarkdownRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookMarkdown_ServiceDesc is the grpc.ServiceDesc for ZBookMarkdown service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookMarkdown_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookMarkdown", + HandlerType: (*ZBookMarkdownServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetMarkdownContent", + Handler: _ZBookMarkdown_GetMarkdownContent_Handler, + }, + { + MethodName: "GetMarkdownImage", + Handler: _ZBookMarkdown_GetMarkdownImage_Handler, + }, + { + MethodName: "QueryRepoMarkdown", + Handler: _ZBookMarkdown_QueryRepoMarkdown_Handler, + }, + { + MethodName: "QueryUserMarkdown", + Handler: _ZBookMarkdown_QueryUserMarkdown_Handler, + }, + { + MethodName: "QueryMarkdown", + Handler: _ZBookMarkdown_QueryMarkdown_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_markdown.proto", +} diff --git a/zbook_backend/pb/service_zbook_notification.pb.go b/zbook_backend/pb/service_zbook_notification.pb.go new file mode 100644 index 0000000..fe6b95e --- /dev/null +++ b/zbook_backend/pb/service_zbook_notification.pb.go @@ -0,0 +1,350 @@ +// clang-format off + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_notification.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_notification_proto protoreflect.FileDescriptor + +var file_service_zbook_notification_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x32, 0xf4, 0x1a, 0x0a, 0x11, 0x5a, 0x42, 0x6f, 0x6f, 0x6b, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x84, 0x02, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x9c, 0x01, 0x92, 0x41, 0x70, 0x12, 0x36, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, + 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, + 0x9a, 0x84, 0xe5, 0x85, 0xb3, 0xe6, 0xb3, 0xa8, 0xe8, 0x80, 0x85, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, + 0xa5, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x36, 0xe5, + 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, + 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe5, 0x85, 0xb3, 0xe6, 0xb3, 0xa8, + 0xe8, 0x80, 0x85, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, + 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, + 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x72, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xee, + 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x92, 0x01, 0x92, 0x41, 0x6a, + 0x12, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, + 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe5, 0xb8, 0x96, + 0xe5, 0xad, 0x90, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, + 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, + 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, + 0x9a, 0x84, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0xe5, 0xbd, + 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, + 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, + 0x70, 0x6f, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0xfa, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x70, 0x62, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x95, 0x01, 0x92, 0x41, 0x6a, 0x12, 0x33, 0xe5, 0x88, 0x86, 0xe9, + 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, + 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe8, 0xaf, 0x84, 0xe8, 0xae, 0xba, 0xe9, 0x80, 0x9a, + 0xe7, 0x9f, 0xa5, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, + 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, + 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe8, 0xaf, 0x84, 0xe8, + 0xae, 0xba, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, + 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, + 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xdd, 0x01, 0x0a, + 0x16, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, + 0x92, 0x41, 0x52, 0x12, 0x27, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, + 0x96, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, + 0xe7, 0xb3, 0xbb, 0xe7, 0xbb, 0x9f, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0x1a, 0x27, 0xe5, 0x88, + 0x86, 0xe9, 0xa1, 0xb5, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, + 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe7, 0xb3, 0xbb, 0xe7, 0xbb, 0x9f, 0xe9, + 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, + 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, + 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xe4, 0x01, 0x0a, + 0x1e, 0x4d, 0x61, 0x72, 0x6b, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, + 0x29, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, + 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, + 0x64, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, + 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x7e, 0x92, 0x41, 0x4b, 0x12, 0x21, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x66, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x1a, 0x26, 0x55, 0x73, 0x65, + 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x74, + 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x72, + 0x65, 0x61, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, + 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x61, + 0x64, 0x65, 0x64, 0x12, 0xcf, 0x01, 0x0a, 0x1c, 0x4d, 0x61, 0x72, 0x6b, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x61, 0x64, 0x65, 0x64, 0x12, 0x27, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, + 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6d, 0x92, 0x41, 0x3c, 0x12, 0x14, 0x73, 0x65, 0x74, + 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x72, 0x65, 0x61, + 0x64, 0x1a, 0x24, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, + 0x74, 0x6f, 0x20, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x6f, + 0x74, 0x69, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x01, 0x2a, + 0x22, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, + 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, 0xd4, 0x01, 0x0a, 0x1d, 0x4d, 0x61, 0x72, 0x6b, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, 0x28, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x72, + 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x52, 0x65, + 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x70, 0x92, 0x41, 0x3e, 0x12, + 0x15, 0x73, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x6f, 0x74, + 0x69, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x1a, 0x25, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, + 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, 0xc7, 0x01, 0x0a, + 0x1a, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, 0x25, 0x2e, 0x70, 0x62, + 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x52, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x69, 0x92, 0x41, 0x3a, + 0x12, 0x13, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x69, + 0x5f, 0x72, 0x65, 0x61, 0x64, 0x1a, 0x23, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, + 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, + 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, + 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x61, 0x72, 0x6b, 0x5f, 0x72, 0x65, + 0x70, 0x6f, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x12, 0x9f, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x6e, + 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x55, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x52, + 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x56, 0x92, 0x41, 0x34, 0x12, 0x10, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x61, + 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x20, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, + 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x6e, 0x72, + 0x65, 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, + 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x6e, 0x72, 0x65, + 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xab, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x73, + 0x65, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x73, 0x65, 0x74, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x92, 0x41, 0x38, 0x12, 0x12, 0x72, + 0x65, 0x73, 0x65, 0x74, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x1a, 0x22, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, + 0x74, 0x6f, 0x20, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xc7, 0x02, 0x0a, 0x28, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x33, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x4e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, + 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xaf, + 0x01, 0x92, 0x41, 0x70, 0x12, 0x36, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, + 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, + 0x84, 0xe5, 0x85, 0xb3, 0xe6, 0xb3, 0xa8, 0xe8, 0x80, 0x85, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, + 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x36, 0xe5, 0x88, + 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, + 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe5, 0x85, 0xb3, 0xe6, 0xb3, 0xa8, 0xe8, + 0x80, 0x85, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, + 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x3a, 0x01, 0x2a, 0x22, 0x31, 0x2f, + 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x66, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0xb1, 0x02, 0x0a, 0x24, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, + 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x70, 0x62, 0x2e, + 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa5, 0x01, 0x92, + 0x41, 0x6a, 0x12, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, + 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe5, + 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, + 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, + 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, + 0xb7, 0xe7, 0x9a, 0x84, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, + 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x32, 0x3a, 0x01, 0x2a, 0x22, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, + 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xbd, 0x02, 0x0a, 0x27, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x32, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa8, 0x01, 0x92, 0x41, 0x6a, 0x12, + 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, + 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe8, 0xaf, 0x84, 0xe8, + 0xae, 0xba, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, + 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, + 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, + 0x84, 0xe8, 0xaf, 0x84, 0xe8, 0xae, 0xba, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0xe5, 0xbd, 0x92, + 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x3a, + 0x01, 0x2a, 0x22, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0xa1, 0x02, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x31, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x6e, + 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8f, 0x01, 0x92, 0x41, 0x52, 0x12, 0x27, 0xe5, 0x88, + 0x86, 0xe9, 0xa1, 0xb5, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, + 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe7, 0xb3, 0xbb, 0xe7, 0xbb, 0x9f, 0xe9, + 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0x1a, 0x27, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe8, 0x8e, 0xb7, + 0xe5, 0x8f, 0x96, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe7, + 0x9a, 0x84, 0xe7, 0xb3, 0xbb, 0xe7, 0xbb, 0x9f, 0xe9, 0x80, 0x9a, 0xe7, 0x9f, 0xa5, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x34, 0x3a, 0x01, 0x2a, 0x22, 0x2f, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x6e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x61, 0x64, + 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x72, 0x92, 0x41, 0x53, 0x12, 0x51, 0x0a, + 0x09, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x70, 0x69, 0x22, 0x3f, 0x0a, 0x0a, 0x7a, 0x69, + 0x7a, 0x64, 0x6c, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, + 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, + 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, 0x7a, 0x69, 0x7a, 0x64, 0x6c, + 0x70, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x32, 0x03, 0x30, 0x2e, 0x31, + 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, + 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_notification_proto_goTypes = []interface{}{ + (*rpcs.ListFollowerNotificationRequest)(nil), // 0: pb.ListFollowerNotificationRequest + (*rpcs.ListRepoNotificationRequest)(nil), // 1: pb.ListRepoNotificationRequest + (*rpcs.ListCommentNotificationRequest)(nil), // 2: pb.ListCommentNotificationRequest + (*rpcs.ListSystemNotificationRequest)(nil), // 3: pb.ListSystemNotificationRequest + (*rpcs.MarkFollowerNotificationReadedRequest)(nil), // 4: pb.MarkFollowerNotificationReadedRequest + (*rpcs.MarkSystemNotificationReadedRequest)(nil), // 5: pb.MarkSystemNotificationReadedRequest + (*rpcs.MarkCommentNotificationReadedRequest)(nil), // 6: pb.MarkCommentNotificationReadedRequest + (*rpcs.MarkRepoNotificationReadedRequest)(nil), // 7: pb.MarkRepoNotificationReadedRequest + (*rpcs.GetUnReadCountRequest)(nil), // 8: pb.GetUnReadCountRequest + (*rpcs.ResetUnreadCountRequest)(nil), // 9: pb.ResetUnreadCountRequest + (*rpcs.GetListFollowerNotificationUnreadedCountRequest)(nil), // 10: pb.GetListFollowerNotificationUnreadedCountRequest + (*rpcs.GetListRepoNotificationUnreadedCountRequest)(nil), // 11: pb.GetListRepoNotificationUnreadedCountRequest + (*rpcs.GetListCommentNotificationUnreadedCountRequest)(nil), // 12: pb.GetListCommentNotificationUnreadedCountRequest + (*rpcs.GetListSystemNotificationUnreadedCountRequest)(nil), // 13: pb.GetListSystemNotificationUnreadedCountRequest + (*rpcs.ListFollowerNotificationResponse)(nil), // 14: pb.ListFollowerNotificationResponse + (*rpcs.ListRepoNotificationResponse)(nil), // 15: pb.ListRepoNotificationResponse + (*rpcs.ListCommentNotificationResponse)(nil), // 16: pb.ListCommentNotificationResponse + (*rpcs.ListSystemNotificationResponse)(nil), // 17: pb.ListSystemNotificationResponse + (*rpcs.SetNotiReadResponse)(nil), // 18: pb.SetNotiReadResponse + (*rpcs.GetUnReadCountResponse)(nil), // 19: pb.GetUnReadCountResponse + (*rpcs.ResetUnreadCountResponse)(nil), // 20: pb.ResetUnreadCountResponse + (*rpcs.GetListFollowerNotificationUnreadedCountResponse)(nil), // 21: pb.GetListFollowerNotificationUnreadedCountResponse + (*rpcs.GetListRepoNotificationUnreadedCountResponse)(nil), // 22: pb.GetListRepoNotificationUnreadedCountResponse + (*rpcs.GetListCommentNotificationUnreadedCountResponse)(nil), // 23: pb.GetListCommentNotificationUnreadedCountResponse + (*rpcs.GetListSystemNotificationUnreadedCountResponse)(nil), // 24: pb.GetListSystemNotificationUnreadedCountResponse +} +var file_service_zbook_notification_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookNotification.ListFollowerNotification:input_type -> pb.ListFollowerNotificationRequest + 1, // 1: pb.ZBookNotification.ListRepoNotification:input_type -> pb.ListRepoNotificationRequest + 2, // 2: pb.ZBookNotification.ListCommentNotification:input_type -> pb.ListCommentNotificationRequest + 3, // 3: pb.ZBookNotification.ListSystemNotification:input_type -> pb.ListSystemNotificationRequest + 4, // 4: pb.ZBookNotification.MarkFollowerNotificationReaded:input_type -> pb.MarkFollowerNotificationReadedRequest + 5, // 5: pb.ZBookNotification.MarkSystemNotificationReaded:input_type -> pb.MarkSystemNotificationReadedRequest + 6, // 6: pb.ZBookNotification.MarkCommentNotificationReaded:input_type -> pb.MarkCommentNotificationReadedRequest + 7, // 7: pb.ZBookNotification.MarkRepoNotificationReaded:input_type -> pb.MarkRepoNotificationReadedRequest + 8, // 8: pb.ZBookNotification.GetUnReadCount:input_type -> pb.GetUnReadCountRequest + 9, // 9: pb.ZBookNotification.ResetUnreadCount:input_type -> pb.ResetUnreadCountRequest + 10, // 10: pb.ZBookNotification.GetListFollowerNotificationUnreadedCount:input_type -> pb.GetListFollowerNotificationUnreadedCountRequest + 11, // 11: pb.ZBookNotification.GetListRepoNotificationUnreadedCount:input_type -> pb.GetListRepoNotificationUnreadedCountRequest + 12, // 12: pb.ZBookNotification.GetListCommentNotificationUnreadedCount:input_type -> pb.GetListCommentNotificationUnreadedCountRequest + 13, // 13: pb.ZBookNotification.GetListSystemNotificationUnreadedCount:input_type -> pb.GetListSystemNotificationUnreadedCountRequest + 14, // 14: pb.ZBookNotification.ListFollowerNotification:output_type -> pb.ListFollowerNotificationResponse + 15, // 15: pb.ZBookNotification.ListRepoNotification:output_type -> pb.ListRepoNotificationResponse + 16, // 16: pb.ZBookNotification.ListCommentNotification:output_type -> pb.ListCommentNotificationResponse + 17, // 17: pb.ZBookNotification.ListSystemNotification:output_type -> pb.ListSystemNotificationResponse + 18, // 18: pb.ZBookNotification.MarkFollowerNotificationReaded:output_type -> pb.SetNotiReadResponse + 18, // 19: pb.ZBookNotification.MarkSystemNotificationReaded:output_type -> pb.SetNotiReadResponse + 18, // 20: pb.ZBookNotification.MarkCommentNotificationReaded:output_type -> pb.SetNotiReadResponse + 18, // 21: pb.ZBookNotification.MarkRepoNotificationReaded:output_type -> pb.SetNotiReadResponse + 19, // 22: pb.ZBookNotification.GetUnReadCount:output_type -> pb.GetUnReadCountResponse + 20, // 23: pb.ZBookNotification.ResetUnreadCount:output_type -> pb.ResetUnreadCountResponse + 21, // 24: pb.ZBookNotification.GetListFollowerNotificationUnreadedCount:output_type -> pb.GetListFollowerNotificationUnreadedCountResponse + 22, // 25: pb.ZBookNotification.GetListRepoNotificationUnreadedCount:output_type -> pb.GetListRepoNotificationUnreadedCountResponse + 23, // 26: pb.ZBookNotification.GetListCommentNotificationUnreadedCount:output_type -> pb.GetListCommentNotificationUnreadedCountResponse + 24, // 27: pb.ZBookNotification.GetListSystemNotificationUnreadedCount:output_type -> pb.GetListSystemNotificationUnreadedCountResponse + 14, // [14:28] is the sub-list for method output_type + 0, // [0:14] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_notification_proto_init() } +func file_service_zbook_notification_proto_init() { + if File_service_zbook_notification_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_notification_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_notification_proto_goTypes, + DependencyIndexes: file_service_zbook_notification_proto_depIdxs, + }.Build() + File_service_zbook_notification_proto = out.File + file_service_zbook_notification_proto_rawDesc = nil + file_service_zbook_notification_proto_goTypes = nil + file_service_zbook_notification_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_notification.pb.gw.go b/zbook_backend/pb/service_zbook_notification.pb.gw.go new file mode 100644 index 0000000..ed2fc96 --- /dev/null +++ b/zbook_backend/pb/service_zbook_notification.pb.gw.go @@ -0,0 +1,1165 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_notification.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookNotification_ListFollowerNotification_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListFollowerNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListFollowerNotification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_ListFollowerNotification_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListFollowerNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListFollowerNotification(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_ListRepoNotification_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListRepoNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListRepoNotification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_ListRepoNotification_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListRepoNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListRepoNotification(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_ListCommentNotification_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListCommentNotification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_ListCommentNotification_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListCommentNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListCommentNotification(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_ListSystemNotification_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListSystemNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListSystemNotification(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_ListSystemNotification_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListSystemNotificationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListSystemNotification(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_MarkFollowerNotificationReaded_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.MarkFollowerNotificationReadedRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MarkFollowerNotificationReaded(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_MarkFollowerNotificationReaded_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.MarkFollowerNotificationReadedRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MarkFollowerNotificationReaded(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_MarkSystemNotificationReaded_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.MarkSystemNotificationReadedRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MarkSystemNotificationReaded(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_MarkSystemNotificationReaded_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.MarkSystemNotificationReadedRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MarkSystemNotificationReaded(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_MarkCommentNotificationReaded_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.MarkCommentNotificationReadedRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MarkCommentNotificationReaded(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_MarkCommentNotificationReaded_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.MarkCommentNotificationReadedRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MarkCommentNotificationReaded(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_MarkRepoNotificationReaded_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.MarkRepoNotificationReadedRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MarkRepoNotificationReaded(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_MarkRepoNotificationReaded_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.MarkRepoNotificationReadedRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MarkRepoNotificationReaded(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_GetUnReadCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetUnReadCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetUnReadCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_GetUnReadCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetUnReadCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetUnReadCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_ResetUnreadCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ResetUnreadCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ResetUnreadCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_ResetUnreadCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ResetUnreadCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ResetUnreadCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_GetListFollowerNotificationUnreadedCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListFollowerNotificationUnreadedCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListFollowerNotificationUnreadedCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_GetListFollowerNotificationUnreadedCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListFollowerNotificationUnreadedCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListFollowerNotificationUnreadedCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_GetListRepoNotificationUnreadedCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListRepoNotificationUnreadedCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListRepoNotificationUnreadedCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_GetListRepoNotificationUnreadedCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListRepoNotificationUnreadedCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListRepoNotificationUnreadedCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_GetListCommentNotificationUnreadedCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentNotificationUnreadedCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListCommentNotificationUnreadedCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_GetListCommentNotificationUnreadedCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListCommentNotificationUnreadedCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListCommentNotificationUnreadedCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookNotification_GetListSystemNotificationUnreadedCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookNotificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListSystemNotificationUnreadedCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListSystemNotificationUnreadedCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookNotification_GetListSystemNotificationUnreadedCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookNotificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListSystemNotificationUnreadedCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListSystemNotificationUnreadedCount(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookNotificationHandlerServer registers the http handlers for service ZBookNotification to "mux". +// UnaryRPC :call ZBookNotificationServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookNotificationHandlerFromEndpoint instead. +func RegisterZBookNotificationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookNotificationServer) error { + + mux.Handle("POST", pattern_ZBookNotification_ListFollowerNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/ListFollowerNotification", runtime.WithHTTPPathPattern("/v1/list_follower_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_ListFollowerNotification_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ListFollowerNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_ListRepoNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/ListRepoNotification", runtime.WithHTTPPathPattern("/v1/list_repo_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_ListRepoNotification_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ListRepoNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_ListCommentNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/ListCommentNotification", runtime.WithHTTPPathPattern("/v1/list_comment_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_ListCommentNotification_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ListCommentNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_ListSystemNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/ListSystemNotification", runtime.WithHTTPPathPattern("/v1/list_system_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_ListSystemNotification_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ListSystemNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_MarkFollowerNotificationReaded_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/MarkFollowerNotificationReaded", runtime.WithHTTPPathPattern("/v1/mark_follower_notification_readed")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_MarkFollowerNotificationReaded_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_MarkFollowerNotificationReaded_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_MarkSystemNotificationReaded_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/MarkSystemNotificationReaded", runtime.WithHTTPPathPattern("/v1/mark_system_notification_readed")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_MarkSystemNotificationReaded_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_MarkSystemNotificationReaded_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_MarkCommentNotificationReaded_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/MarkCommentNotificationReaded", runtime.WithHTTPPathPattern("/v1/mark_comment_notification_readed")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_MarkCommentNotificationReaded_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_MarkCommentNotificationReaded_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_MarkRepoNotificationReaded_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/MarkRepoNotificationReaded", runtime.WithHTTPPathPattern("/v1/mark_repo_notification_readed")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_MarkRepoNotificationReaded_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_MarkRepoNotificationReaded_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetUnReadCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/GetUnReadCount", runtime.WithHTTPPathPattern("/v1/get_unread_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_GetUnReadCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetUnReadCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_ResetUnreadCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/ResetUnreadCount", runtime.WithHTTPPathPattern("/v1/reset_unread_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_ResetUnreadCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ResetUnreadCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetListFollowerNotificationUnreadedCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/GetListFollowerNotificationUnreadedCount", runtime.WithHTTPPathPattern("/v1/get_list_follower_notification_unreaded_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_GetListFollowerNotificationUnreadedCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetListFollowerNotificationUnreadedCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetListRepoNotificationUnreadedCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/GetListRepoNotificationUnreadedCount", runtime.WithHTTPPathPattern("/v1/get_list_repo_notification_unreaded_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_GetListRepoNotificationUnreadedCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetListRepoNotificationUnreadedCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetListCommentNotificationUnreadedCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/GetListCommentNotificationUnreadedCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_notification_unreaded_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_GetListCommentNotificationUnreadedCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetListCommentNotificationUnreadedCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetListSystemNotificationUnreadedCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookNotification/GetListSystemNotificationUnreadedCount", runtime.WithHTTPPathPattern("/v1/get_list_system_notification_unreaded_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookNotification_GetListSystemNotificationUnreadedCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetListSystemNotificationUnreadedCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookNotificationHandlerFromEndpoint is same as RegisterZBookNotificationHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookNotificationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookNotificationHandler(ctx, mux, conn) +} + +// RegisterZBookNotificationHandler registers the http handlers for service ZBookNotification to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookNotificationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookNotificationHandlerClient(ctx, mux, NewZBookNotificationClient(conn)) +} + +// RegisterZBookNotificationHandlerClient registers the http handlers for service ZBookNotification +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookNotificationClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookNotificationClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookNotificationClient" to call the correct interceptors. +func RegisterZBookNotificationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookNotificationClient) error { + + mux.Handle("POST", pattern_ZBookNotification_ListFollowerNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/ListFollowerNotification", runtime.WithHTTPPathPattern("/v1/list_follower_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_ListFollowerNotification_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ListFollowerNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_ListRepoNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/ListRepoNotification", runtime.WithHTTPPathPattern("/v1/list_repo_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_ListRepoNotification_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ListRepoNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_ListCommentNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/ListCommentNotification", runtime.WithHTTPPathPattern("/v1/list_comment_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_ListCommentNotification_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ListCommentNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_ListSystemNotification_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/ListSystemNotification", runtime.WithHTTPPathPattern("/v1/list_system_notification")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_ListSystemNotification_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ListSystemNotification_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_MarkFollowerNotificationReaded_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/MarkFollowerNotificationReaded", runtime.WithHTTPPathPattern("/v1/mark_follower_notification_readed")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_MarkFollowerNotificationReaded_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_MarkFollowerNotificationReaded_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_MarkSystemNotificationReaded_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/MarkSystemNotificationReaded", runtime.WithHTTPPathPattern("/v1/mark_system_notification_readed")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_MarkSystemNotificationReaded_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_MarkSystemNotificationReaded_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_MarkCommentNotificationReaded_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/MarkCommentNotificationReaded", runtime.WithHTTPPathPattern("/v1/mark_comment_notification_readed")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_MarkCommentNotificationReaded_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_MarkCommentNotificationReaded_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_MarkRepoNotificationReaded_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/MarkRepoNotificationReaded", runtime.WithHTTPPathPattern("/v1/mark_repo_notification_readed")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_MarkRepoNotificationReaded_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_MarkRepoNotificationReaded_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetUnReadCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/GetUnReadCount", runtime.WithHTTPPathPattern("/v1/get_unread_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_GetUnReadCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetUnReadCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_ResetUnreadCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/ResetUnreadCount", runtime.WithHTTPPathPattern("/v1/reset_unread_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_ResetUnreadCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_ResetUnreadCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetListFollowerNotificationUnreadedCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/GetListFollowerNotificationUnreadedCount", runtime.WithHTTPPathPattern("/v1/get_list_follower_notification_unreaded_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_GetListFollowerNotificationUnreadedCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetListFollowerNotificationUnreadedCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetListRepoNotificationUnreadedCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/GetListRepoNotificationUnreadedCount", runtime.WithHTTPPathPattern("/v1/get_list_repo_notification_unreaded_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_GetListRepoNotificationUnreadedCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetListRepoNotificationUnreadedCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetListCommentNotificationUnreadedCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/GetListCommentNotificationUnreadedCount", runtime.WithHTTPPathPattern("/v1/get_list_comment_notification_unreaded_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_GetListCommentNotificationUnreadedCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetListCommentNotificationUnreadedCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookNotification_GetListSystemNotificationUnreadedCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookNotification/GetListSystemNotificationUnreadedCount", runtime.WithHTTPPathPattern("/v1/get_list_system_notification_unreaded_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookNotification_GetListSystemNotificationUnreadedCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookNotification_GetListSystemNotificationUnreadedCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookNotification_ListFollowerNotification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_follower_notification"}, "")) + + pattern_ZBookNotification_ListRepoNotification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_repo_notification"}, "")) + + pattern_ZBookNotification_ListCommentNotification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_comment_notification"}, "")) + + pattern_ZBookNotification_ListSystemNotification_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_system_notification"}, "")) + + pattern_ZBookNotification_MarkFollowerNotificationReaded_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "mark_follower_notification_readed"}, "")) + + pattern_ZBookNotification_MarkSystemNotificationReaded_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "mark_system_notification_readed"}, "")) + + pattern_ZBookNotification_MarkCommentNotificationReaded_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "mark_comment_notification_readed"}, "")) + + pattern_ZBookNotification_MarkRepoNotificationReaded_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "mark_repo_notification_readed"}, "")) + + pattern_ZBookNotification_GetUnReadCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_unread_count"}, "")) + + pattern_ZBookNotification_ResetUnreadCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "reset_unread_count"}, "")) + + pattern_ZBookNotification_GetListFollowerNotificationUnreadedCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_follower_notification_unreaded_count"}, "")) + + pattern_ZBookNotification_GetListRepoNotificationUnreadedCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_repo_notification_unreaded_count"}, "")) + + pattern_ZBookNotification_GetListCommentNotificationUnreadedCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_comment_notification_unreaded_count"}, "")) + + pattern_ZBookNotification_GetListSystemNotificationUnreadedCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_system_notification_unreaded_count"}, "")) +) + +var ( + forward_ZBookNotification_ListFollowerNotification_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_ListRepoNotification_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_ListCommentNotification_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_ListSystemNotification_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_MarkFollowerNotificationReaded_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_MarkSystemNotificationReaded_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_MarkCommentNotificationReaded_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_MarkRepoNotificationReaded_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_GetUnReadCount_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_ResetUnreadCount_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_GetListFollowerNotificationUnreadedCount_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_GetListRepoNotificationUnreadedCount_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_GetListCommentNotificationUnreadedCount_0 = runtime.ForwardResponseMessage + + forward_ZBookNotification_GetListSystemNotificationUnreadedCount_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_notification_grpc.pb.go b/zbook_backend/pb/service_zbook_notification_grpc.pb.go new file mode 100644 index 0000000..d0b54d2 --- /dev/null +++ b/zbook_backend/pb/service_zbook_notification_grpc.pb.go @@ -0,0 +1,621 @@ +// clang-format off + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_notification.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookNotification_ListFollowerNotification_FullMethodName = "/pb.ZBookNotification/ListFollowerNotification" + ZBookNotification_ListRepoNotification_FullMethodName = "/pb.ZBookNotification/ListRepoNotification" + ZBookNotification_ListCommentNotification_FullMethodName = "/pb.ZBookNotification/ListCommentNotification" + ZBookNotification_ListSystemNotification_FullMethodName = "/pb.ZBookNotification/ListSystemNotification" + ZBookNotification_MarkFollowerNotificationReaded_FullMethodName = "/pb.ZBookNotification/MarkFollowerNotificationReaded" + ZBookNotification_MarkSystemNotificationReaded_FullMethodName = "/pb.ZBookNotification/MarkSystemNotificationReaded" + ZBookNotification_MarkCommentNotificationReaded_FullMethodName = "/pb.ZBookNotification/MarkCommentNotificationReaded" + ZBookNotification_MarkRepoNotificationReaded_FullMethodName = "/pb.ZBookNotification/MarkRepoNotificationReaded" + ZBookNotification_GetUnReadCount_FullMethodName = "/pb.ZBookNotification/GetUnReadCount" + ZBookNotification_ResetUnreadCount_FullMethodName = "/pb.ZBookNotification/ResetUnreadCount" + ZBookNotification_GetListFollowerNotificationUnreadedCount_FullMethodName = "/pb.ZBookNotification/GetListFollowerNotificationUnreadedCount" + ZBookNotification_GetListRepoNotificationUnreadedCount_FullMethodName = "/pb.ZBookNotification/GetListRepoNotificationUnreadedCount" + ZBookNotification_GetListCommentNotificationUnreadedCount_FullMethodName = "/pb.ZBookNotification/GetListCommentNotificationUnreadedCount" + ZBookNotification_GetListSystemNotificationUnreadedCount_FullMethodName = "/pb.ZBookNotification/GetListSystemNotificationUnreadedCount" +) + +// ZBookNotificationClient is the client API for ZBookNotification service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookNotificationClient interface { + // 1.ListFollowerNotification + ListFollowerNotification(ctx context.Context, in *rpcs.ListFollowerNotificationRequest, opts ...grpc.CallOption) (*rpcs.ListFollowerNotificationResponse, error) + // 2.ListRepoNotification + ListRepoNotification(ctx context.Context, in *rpcs.ListRepoNotificationRequest, opts ...grpc.CallOption) (*rpcs.ListRepoNotificationResponse, error) + // 3.ListCommentNotification + ListCommentNotification(ctx context.Context, in *rpcs.ListCommentNotificationRequest, opts ...grpc.CallOption) (*rpcs.ListCommentNotificationResponse, error) + // 4.ListSystemNotification + ListSystemNotification(ctx context.Context, in *rpcs.ListSystemNotificationRequest, opts ...grpc.CallOption) (*rpcs.ListSystemNotificationResponse, error) + // 5.MarkFollowerNotificationReaded + MarkFollowerNotificationReaded(ctx context.Context, in *rpcs.MarkFollowerNotificationReadedRequest, opts ...grpc.CallOption) (*rpcs.SetNotiReadResponse, error) + // 6.MarkSystemNotificationReaded + MarkSystemNotificationReaded(ctx context.Context, in *rpcs.MarkSystemNotificationReadedRequest, opts ...grpc.CallOption) (*rpcs.SetNotiReadResponse, error) + // 7.MarkCommentNotificationReaded + MarkCommentNotificationReaded(ctx context.Context, in *rpcs.MarkCommentNotificationReadedRequest, opts ...grpc.CallOption) (*rpcs.SetNotiReadResponse, error) + // 8.MarkRepoNotificationReaded + MarkRepoNotificationReaded(ctx context.Context, in *rpcs.MarkRepoNotificationReadedRequest, opts ...grpc.CallOption) (*rpcs.SetNotiReadResponse, error) + // 9.GetUnReadCount + GetUnReadCount(ctx context.Context, in *rpcs.GetUnReadCountRequest, opts ...grpc.CallOption) (*rpcs.GetUnReadCountResponse, error) + // 10.ResetUnreadCount + ResetUnreadCount(ctx context.Context, in *rpcs.ResetUnreadCountRequest, opts ...grpc.CallOption) (*rpcs.ResetUnreadCountResponse, error) + // 11.GetListFollowerNotificationUnreadedCount + GetListFollowerNotificationUnreadedCount(ctx context.Context, in *rpcs.GetListFollowerNotificationUnreadedCountRequest, opts ...grpc.CallOption) (*rpcs.GetListFollowerNotificationUnreadedCountResponse, error) + // 12.GetListRepoNotificationUnreadedCount + GetListRepoNotificationUnreadedCount(ctx context.Context, in *rpcs.GetListRepoNotificationUnreadedCountRequest, opts ...grpc.CallOption) (*rpcs.GetListRepoNotificationUnreadedCountResponse, error) + // 13.GetListCommentNotificationUnreadedCount + GetListCommentNotificationUnreadedCount(ctx context.Context, in *rpcs.GetListCommentNotificationUnreadedCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentNotificationUnreadedCountResponse, error) + // 14.GetListSystemNotificationUnreadedCount + GetListSystemNotificationUnreadedCount(ctx context.Context, in *rpcs.GetListSystemNotificationUnreadedCountRequest, opts ...grpc.CallOption) (*rpcs.GetListSystemNotificationUnreadedCountResponse, error) +} + +type zBookNotificationClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookNotificationClient(cc grpc.ClientConnInterface) ZBookNotificationClient { + return &zBookNotificationClient{cc} +} + +func (c *zBookNotificationClient) ListFollowerNotification(ctx context.Context, in *rpcs.ListFollowerNotificationRequest, opts ...grpc.CallOption) (*rpcs.ListFollowerNotificationResponse, error) { + out := new(rpcs.ListFollowerNotificationResponse) + err := c.cc.Invoke(ctx, ZBookNotification_ListFollowerNotification_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) ListRepoNotification(ctx context.Context, in *rpcs.ListRepoNotificationRequest, opts ...grpc.CallOption) (*rpcs.ListRepoNotificationResponse, error) { + out := new(rpcs.ListRepoNotificationResponse) + err := c.cc.Invoke(ctx, ZBookNotification_ListRepoNotification_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) ListCommentNotification(ctx context.Context, in *rpcs.ListCommentNotificationRequest, opts ...grpc.CallOption) (*rpcs.ListCommentNotificationResponse, error) { + out := new(rpcs.ListCommentNotificationResponse) + err := c.cc.Invoke(ctx, ZBookNotification_ListCommentNotification_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) ListSystemNotification(ctx context.Context, in *rpcs.ListSystemNotificationRequest, opts ...grpc.CallOption) (*rpcs.ListSystemNotificationResponse, error) { + out := new(rpcs.ListSystemNotificationResponse) + err := c.cc.Invoke(ctx, ZBookNotification_ListSystemNotification_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) MarkFollowerNotificationReaded(ctx context.Context, in *rpcs.MarkFollowerNotificationReadedRequest, opts ...grpc.CallOption) (*rpcs.SetNotiReadResponse, error) { + out := new(rpcs.SetNotiReadResponse) + err := c.cc.Invoke(ctx, ZBookNotification_MarkFollowerNotificationReaded_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) MarkSystemNotificationReaded(ctx context.Context, in *rpcs.MarkSystemNotificationReadedRequest, opts ...grpc.CallOption) (*rpcs.SetNotiReadResponse, error) { + out := new(rpcs.SetNotiReadResponse) + err := c.cc.Invoke(ctx, ZBookNotification_MarkSystemNotificationReaded_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) MarkCommentNotificationReaded(ctx context.Context, in *rpcs.MarkCommentNotificationReadedRequest, opts ...grpc.CallOption) (*rpcs.SetNotiReadResponse, error) { + out := new(rpcs.SetNotiReadResponse) + err := c.cc.Invoke(ctx, ZBookNotification_MarkCommentNotificationReaded_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) MarkRepoNotificationReaded(ctx context.Context, in *rpcs.MarkRepoNotificationReadedRequest, opts ...grpc.CallOption) (*rpcs.SetNotiReadResponse, error) { + out := new(rpcs.SetNotiReadResponse) + err := c.cc.Invoke(ctx, ZBookNotification_MarkRepoNotificationReaded_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) GetUnReadCount(ctx context.Context, in *rpcs.GetUnReadCountRequest, opts ...grpc.CallOption) (*rpcs.GetUnReadCountResponse, error) { + out := new(rpcs.GetUnReadCountResponse) + err := c.cc.Invoke(ctx, ZBookNotification_GetUnReadCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) ResetUnreadCount(ctx context.Context, in *rpcs.ResetUnreadCountRequest, opts ...grpc.CallOption) (*rpcs.ResetUnreadCountResponse, error) { + out := new(rpcs.ResetUnreadCountResponse) + err := c.cc.Invoke(ctx, ZBookNotification_ResetUnreadCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) GetListFollowerNotificationUnreadedCount(ctx context.Context, in *rpcs.GetListFollowerNotificationUnreadedCountRequest, opts ...grpc.CallOption) (*rpcs.GetListFollowerNotificationUnreadedCountResponse, error) { + out := new(rpcs.GetListFollowerNotificationUnreadedCountResponse) + err := c.cc.Invoke(ctx, ZBookNotification_GetListFollowerNotificationUnreadedCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) GetListRepoNotificationUnreadedCount(ctx context.Context, in *rpcs.GetListRepoNotificationUnreadedCountRequest, opts ...grpc.CallOption) (*rpcs.GetListRepoNotificationUnreadedCountResponse, error) { + out := new(rpcs.GetListRepoNotificationUnreadedCountResponse) + err := c.cc.Invoke(ctx, ZBookNotification_GetListRepoNotificationUnreadedCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) GetListCommentNotificationUnreadedCount(ctx context.Context, in *rpcs.GetListCommentNotificationUnreadedCountRequest, opts ...grpc.CallOption) (*rpcs.GetListCommentNotificationUnreadedCountResponse, error) { + out := new(rpcs.GetListCommentNotificationUnreadedCountResponse) + err := c.cc.Invoke(ctx, ZBookNotification_GetListCommentNotificationUnreadedCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookNotificationClient) GetListSystemNotificationUnreadedCount(ctx context.Context, in *rpcs.GetListSystemNotificationUnreadedCountRequest, opts ...grpc.CallOption) (*rpcs.GetListSystemNotificationUnreadedCountResponse, error) { + out := new(rpcs.GetListSystemNotificationUnreadedCountResponse) + err := c.cc.Invoke(ctx, ZBookNotification_GetListSystemNotificationUnreadedCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookNotificationServer is the server API for ZBookNotification service. +// All implementations must embed UnimplementedZBookNotificationServer +// for forward compatibility +type ZBookNotificationServer interface { + // 1.ListFollowerNotification + ListFollowerNotification(context.Context, *rpcs.ListFollowerNotificationRequest) (*rpcs.ListFollowerNotificationResponse, error) + // 2.ListRepoNotification + ListRepoNotification(context.Context, *rpcs.ListRepoNotificationRequest) (*rpcs.ListRepoNotificationResponse, error) + // 3.ListCommentNotification + ListCommentNotification(context.Context, *rpcs.ListCommentNotificationRequest) (*rpcs.ListCommentNotificationResponse, error) + // 4.ListSystemNotification + ListSystemNotification(context.Context, *rpcs.ListSystemNotificationRequest) (*rpcs.ListSystemNotificationResponse, error) + // 5.MarkFollowerNotificationReaded + MarkFollowerNotificationReaded(context.Context, *rpcs.MarkFollowerNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) + // 6.MarkSystemNotificationReaded + MarkSystemNotificationReaded(context.Context, *rpcs.MarkSystemNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) + // 7.MarkCommentNotificationReaded + MarkCommentNotificationReaded(context.Context, *rpcs.MarkCommentNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) + // 8.MarkRepoNotificationReaded + MarkRepoNotificationReaded(context.Context, *rpcs.MarkRepoNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) + // 9.GetUnReadCount + GetUnReadCount(context.Context, *rpcs.GetUnReadCountRequest) (*rpcs.GetUnReadCountResponse, error) + // 10.ResetUnreadCount + ResetUnreadCount(context.Context, *rpcs.ResetUnreadCountRequest) (*rpcs.ResetUnreadCountResponse, error) + // 11.GetListFollowerNotificationUnreadedCount + GetListFollowerNotificationUnreadedCount(context.Context, *rpcs.GetListFollowerNotificationUnreadedCountRequest) (*rpcs.GetListFollowerNotificationUnreadedCountResponse, error) + // 12.GetListRepoNotificationUnreadedCount + GetListRepoNotificationUnreadedCount(context.Context, *rpcs.GetListRepoNotificationUnreadedCountRequest) (*rpcs.GetListRepoNotificationUnreadedCountResponse, error) + // 13.GetListCommentNotificationUnreadedCount + GetListCommentNotificationUnreadedCount(context.Context, *rpcs.GetListCommentNotificationUnreadedCountRequest) (*rpcs.GetListCommentNotificationUnreadedCountResponse, error) + // 14.GetListSystemNotificationUnreadedCount + GetListSystemNotificationUnreadedCount(context.Context, *rpcs.GetListSystemNotificationUnreadedCountRequest) (*rpcs.GetListSystemNotificationUnreadedCountResponse, error) + mustEmbedUnimplementedZBookNotificationServer() +} + +// UnimplementedZBookNotificationServer must be embedded to have forward compatible implementations. +type UnimplementedZBookNotificationServer struct { +} + +func (UnimplementedZBookNotificationServer) ListFollowerNotification(context.Context, *rpcs.ListFollowerNotificationRequest) (*rpcs.ListFollowerNotificationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListFollowerNotification not implemented") +} +func (UnimplementedZBookNotificationServer) ListRepoNotification(context.Context, *rpcs.ListRepoNotificationRequest) (*rpcs.ListRepoNotificationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRepoNotification not implemented") +} +func (UnimplementedZBookNotificationServer) ListCommentNotification(context.Context, *rpcs.ListCommentNotificationRequest) (*rpcs.ListCommentNotificationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListCommentNotification not implemented") +} +func (UnimplementedZBookNotificationServer) ListSystemNotification(context.Context, *rpcs.ListSystemNotificationRequest) (*rpcs.ListSystemNotificationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListSystemNotification not implemented") +} +func (UnimplementedZBookNotificationServer) MarkFollowerNotificationReaded(context.Context, *rpcs.MarkFollowerNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MarkFollowerNotificationReaded not implemented") +} +func (UnimplementedZBookNotificationServer) MarkSystemNotificationReaded(context.Context, *rpcs.MarkSystemNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MarkSystemNotificationReaded not implemented") +} +func (UnimplementedZBookNotificationServer) MarkCommentNotificationReaded(context.Context, *rpcs.MarkCommentNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MarkCommentNotificationReaded not implemented") +} +func (UnimplementedZBookNotificationServer) MarkRepoNotificationReaded(context.Context, *rpcs.MarkRepoNotificationReadedRequest) (*rpcs.SetNotiReadResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MarkRepoNotificationReaded not implemented") +} +func (UnimplementedZBookNotificationServer) GetUnReadCount(context.Context, *rpcs.GetUnReadCountRequest) (*rpcs.GetUnReadCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUnReadCount not implemented") +} +func (UnimplementedZBookNotificationServer) ResetUnreadCount(context.Context, *rpcs.ResetUnreadCountRequest) (*rpcs.ResetUnreadCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResetUnreadCount not implemented") +} +func (UnimplementedZBookNotificationServer) GetListFollowerNotificationUnreadedCount(context.Context, *rpcs.GetListFollowerNotificationUnreadedCountRequest) (*rpcs.GetListFollowerNotificationUnreadedCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListFollowerNotificationUnreadedCount not implemented") +} +func (UnimplementedZBookNotificationServer) GetListRepoNotificationUnreadedCount(context.Context, *rpcs.GetListRepoNotificationUnreadedCountRequest) (*rpcs.GetListRepoNotificationUnreadedCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListRepoNotificationUnreadedCount not implemented") +} +func (UnimplementedZBookNotificationServer) GetListCommentNotificationUnreadedCount(context.Context, *rpcs.GetListCommentNotificationUnreadedCountRequest) (*rpcs.GetListCommentNotificationUnreadedCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListCommentNotificationUnreadedCount not implemented") +} +func (UnimplementedZBookNotificationServer) GetListSystemNotificationUnreadedCount(context.Context, *rpcs.GetListSystemNotificationUnreadedCountRequest) (*rpcs.GetListSystemNotificationUnreadedCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListSystemNotificationUnreadedCount not implemented") +} +func (UnimplementedZBookNotificationServer) mustEmbedUnimplementedZBookNotificationServer() {} + +// UnsafeZBookNotificationServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookNotificationServer will +// result in compilation errors. +type UnsafeZBookNotificationServer interface { + mustEmbedUnimplementedZBookNotificationServer() +} + +func RegisterZBookNotificationServer(s grpc.ServiceRegistrar, srv ZBookNotificationServer) { + s.RegisterService(&ZBookNotification_ServiceDesc, srv) +} + +func _ZBookNotification_ListFollowerNotification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListFollowerNotificationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).ListFollowerNotification(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_ListFollowerNotification_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).ListFollowerNotification(ctx, req.(*rpcs.ListFollowerNotificationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_ListRepoNotification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListRepoNotificationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).ListRepoNotification(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_ListRepoNotification_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).ListRepoNotification(ctx, req.(*rpcs.ListRepoNotificationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_ListCommentNotification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListCommentNotificationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).ListCommentNotification(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_ListCommentNotification_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).ListCommentNotification(ctx, req.(*rpcs.ListCommentNotificationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_ListSystemNotification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListSystemNotificationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).ListSystemNotification(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_ListSystemNotification_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).ListSystemNotification(ctx, req.(*rpcs.ListSystemNotificationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_MarkFollowerNotificationReaded_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.MarkFollowerNotificationReadedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).MarkFollowerNotificationReaded(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_MarkFollowerNotificationReaded_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).MarkFollowerNotificationReaded(ctx, req.(*rpcs.MarkFollowerNotificationReadedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_MarkSystemNotificationReaded_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.MarkSystemNotificationReadedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).MarkSystemNotificationReaded(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_MarkSystemNotificationReaded_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).MarkSystemNotificationReaded(ctx, req.(*rpcs.MarkSystemNotificationReadedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_MarkCommentNotificationReaded_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.MarkCommentNotificationReadedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).MarkCommentNotificationReaded(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_MarkCommentNotificationReaded_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).MarkCommentNotificationReaded(ctx, req.(*rpcs.MarkCommentNotificationReadedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_MarkRepoNotificationReaded_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.MarkRepoNotificationReadedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).MarkRepoNotificationReaded(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_MarkRepoNotificationReaded_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).MarkRepoNotificationReaded(ctx, req.(*rpcs.MarkRepoNotificationReadedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_GetUnReadCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetUnReadCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).GetUnReadCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_GetUnReadCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).GetUnReadCount(ctx, req.(*rpcs.GetUnReadCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_ResetUnreadCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ResetUnreadCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).ResetUnreadCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_ResetUnreadCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).ResetUnreadCount(ctx, req.(*rpcs.ResetUnreadCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_GetListFollowerNotificationUnreadedCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListFollowerNotificationUnreadedCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).GetListFollowerNotificationUnreadedCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_GetListFollowerNotificationUnreadedCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).GetListFollowerNotificationUnreadedCount(ctx, req.(*rpcs.GetListFollowerNotificationUnreadedCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_GetListRepoNotificationUnreadedCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListRepoNotificationUnreadedCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).GetListRepoNotificationUnreadedCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_GetListRepoNotificationUnreadedCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).GetListRepoNotificationUnreadedCount(ctx, req.(*rpcs.GetListRepoNotificationUnreadedCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_GetListCommentNotificationUnreadedCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListCommentNotificationUnreadedCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).GetListCommentNotificationUnreadedCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_GetListCommentNotificationUnreadedCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).GetListCommentNotificationUnreadedCount(ctx, req.(*rpcs.GetListCommentNotificationUnreadedCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookNotification_GetListSystemNotificationUnreadedCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListSystemNotificationUnreadedCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookNotificationServer).GetListSystemNotificationUnreadedCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookNotification_GetListSystemNotificationUnreadedCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookNotificationServer).GetListSystemNotificationUnreadedCount(ctx, req.(*rpcs.GetListSystemNotificationUnreadedCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookNotification_ServiceDesc is the grpc.ServiceDesc for ZBookNotification service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookNotification_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookNotification", + HandlerType: (*ZBookNotificationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListFollowerNotification", + Handler: _ZBookNotification_ListFollowerNotification_Handler, + }, + { + MethodName: "ListRepoNotification", + Handler: _ZBookNotification_ListRepoNotification_Handler, + }, + { + MethodName: "ListCommentNotification", + Handler: _ZBookNotification_ListCommentNotification_Handler, + }, + { + MethodName: "ListSystemNotification", + Handler: _ZBookNotification_ListSystemNotification_Handler, + }, + { + MethodName: "MarkFollowerNotificationReaded", + Handler: _ZBookNotification_MarkFollowerNotificationReaded_Handler, + }, + { + MethodName: "MarkSystemNotificationReaded", + Handler: _ZBookNotification_MarkSystemNotificationReaded_Handler, + }, + { + MethodName: "MarkCommentNotificationReaded", + Handler: _ZBookNotification_MarkCommentNotificationReaded_Handler, + }, + { + MethodName: "MarkRepoNotificationReaded", + Handler: _ZBookNotification_MarkRepoNotificationReaded_Handler, + }, + { + MethodName: "GetUnReadCount", + Handler: _ZBookNotification_GetUnReadCount_Handler, + }, + { + MethodName: "ResetUnreadCount", + Handler: _ZBookNotification_ResetUnreadCount_Handler, + }, + { + MethodName: "GetListFollowerNotificationUnreadedCount", + Handler: _ZBookNotification_GetListFollowerNotificationUnreadedCount_Handler, + }, + { + MethodName: "GetListRepoNotificationUnreadedCount", + Handler: _ZBookNotification_GetListRepoNotificationUnreadedCount_Handler, + }, + { + MethodName: "GetListCommentNotificationUnreadedCount", + Handler: _ZBookNotification_GetListCommentNotificationUnreadedCount_Handler, + }, + { + MethodName: "GetListSystemNotificationUnreadedCount", + Handler: _ZBookNotification_GetListSystemNotificationUnreadedCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_notification.proto", +} diff --git a/zbook_backend/pb/service_zbook_oauth.pb.go b/zbook_backend/pb/service_zbook_oauth.pb.go new file mode 100644 index 0000000..8550b51 --- /dev/null +++ b/zbook_backend/pb/service_zbook_oauth.pb.go @@ -0,0 +1,138 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_oauth.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_oauth_proto protoreflect.FileDescriptor + +var file_service_zbook_oauth_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x6f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x72, + 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x32, 0xaf, 0x05, 0x0a, 0x0a, 0x5a, 0x42, 0x6f, 0x6f, 0x6b, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x12, 0xae, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x41, + 0x75, 0x74, 0x68, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x62, 0x92, 0x41, 0x3f, 0x12, 0x15, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x65, 0x77, + 0x20, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x26, 0x55, 0x73, 0x65, + 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x20, 0x75, + 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x76, + 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6c, + 0x69, 0x6e, 0x6b, 0x12, 0xab, 0x01, 0x0a, 0x10, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x4f, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x92, 0x41, 0x38, 0x12, 0x12, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20, + 0x6f, 0x61, 0x75, 0x74, 0x68, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, 0x22, 0x55, 0x73, + 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, + 0x65, 0x63, 0x6b, 0x20, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x41, 0x75, 0x74, + 0x68, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5a, + 0x92, 0x41, 0x37, 0x12, 0x11, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x6f, 0x61, 0x75, 0x74, + 0x68, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x22, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, + 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, + 0x6f, 0x61, 0x75, 0x74, 0x68, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, + 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, + 0x6f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x98, 0x01, 0x0a, 0x0c, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x79, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x12, 0x17, 0x2e, 0x70, 0x62, + 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x42, 0x79, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x42, + 0x79, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, + 0x92, 0x41, 0x35, 0x12, 0x10, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x20, 0x6f, 0x61, 0x75, 0x74, 0x68, + 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x21, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, + 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x20, 0x20, 0x6f, 0x61, + 0x75, 0x74, 0x68, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, + 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x5f, + 0x6f, 0x61, 0x75, 0x74, 0x68, 0x42, 0x72, 0x92, 0x41, 0x53, 0x12, 0x51, 0x0a, 0x09, 0x7a, 0x62, + 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x70, 0x69, 0x22, 0x3f, 0x0a, 0x0a, 0x7a, 0x69, 0x7a, 0x64, 0x6c, + 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, + 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x40, 0x67, + 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x5a, 0x1a, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, + 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var file_service_zbook_oauth_proto_goTypes = []interface{}{ + (*rpcs.CreateOAuthLinkRequest)(nil), // 0: pb.CreateOAuthLinkRequest + (*rpcs.CheckOAuthStatusRequest)(nil), // 1: pb.CheckOAuthStatusRequest + (*rpcs.DeleteOAuthLinkRequest)(nil), // 2: pb.DeleteOAuthLinkRequest + (*rpcs.LoginByOAuthRequest)(nil), // 3: pb.LoginByOAuthRequest + (*rpcs.CreateOAuthLinkResponse)(nil), // 4: pb.CreateOAuthLinkResponse + (*rpcs.CheckOAuthStatusResponse)(nil), // 5: pb.CheckOAuthStatusResponse + (*rpcs.DeleteOAuthLinkResponse)(nil), // 6: pb.DeleteOAuthLinkResponse + (*rpcs.LoginByOAuthResponse)(nil), // 7: pb.LoginByOAuthResponse +} +var file_service_zbook_oauth_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookOAuth.CreateOAuthLink:input_type -> pb.CreateOAuthLinkRequest + 1, // 1: pb.ZBookOAuth.CheckOAuthStatus:input_type -> pb.CheckOAuthStatusRequest + 2, // 2: pb.ZBookOAuth.DeleteOAuthLink:input_type -> pb.DeleteOAuthLinkRequest + 3, // 3: pb.ZBookOAuth.LoginByOAuth:input_type -> pb.LoginByOAuthRequest + 4, // 4: pb.ZBookOAuth.CreateOAuthLink:output_type -> pb.CreateOAuthLinkResponse + 5, // 5: pb.ZBookOAuth.CheckOAuthStatus:output_type -> pb.CheckOAuthStatusResponse + 6, // 6: pb.ZBookOAuth.DeleteOAuthLink:output_type -> pb.DeleteOAuthLinkResponse + 7, // 7: pb.ZBookOAuth.LoginByOAuth:output_type -> pb.LoginByOAuthResponse + 4, // [4:8] is the sub-list for method output_type + 0, // [0:4] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_oauth_proto_init() } +func file_service_zbook_oauth_proto_init() { + if File_service_zbook_oauth_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_oauth_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_oauth_proto_goTypes, + DependencyIndexes: file_service_zbook_oauth_proto_depIdxs, + }.Build() + File_service_zbook_oauth_proto = out.File + file_service_zbook_oauth_proto_rawDesc = nil + file_service_zbook_oauth_proto_goTypes = nil + file_service_zbook_oauth_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_oauth.pb.gw.go b/zbook_backend/pb/service_zbook_oauth.pb.gw.go new file mode 100644 index 0000000..337df04 --- /dev/null +++ b/zbook_backend/pb/service_zbook_oauth.pb.gw.go @@ -0,0 +1,395 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_oauth.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookOAuth_CreateOAuthLink_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookOAuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateOAuthLinkRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateOAuthLink(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookOAuth_CreateOAuthLink_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookOAuthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateOAuthLinkRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateOAuthLink(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookOAuth_CheckOAuthStatus_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookOAuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CheckOAuthStatusRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CheckOAuthStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookOAuth_CheckOAuthStatus_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookOAuthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CheckOAuthStatusRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CheckOAuthStatus(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookOAuth_DeleteOAuthLink_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookOAuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteOAuthLinkRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteOAuthLink(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookOAuth_DeleteOAuthLink_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookOAuthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteOAuthLinkRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteOAuthLink(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookOAuth_LoginByOAuth_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookOAuthClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.LoginByOAuthRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LoginByOAuth(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookOAuth_LoginByOAuth_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookOAuthServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.LoginByOAuthRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LoginByOAuth(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookOAuthHandlerServer registers the http handlers for service ZBookOAuth to "mux". +// UnaryRPC :call ZBookOAuthServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookOAuthHandlerFromEndpoint instead. +func RegisterZBookOAuthHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookOAuthServer) error { + + mux.Handle("POST", pattern_ZBookOAuth_CreateOAuthLink_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookOAuth/CreateOAuthLink", runtime.WithHTTPPathPattern("/v1/create_oauth_link")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookOAuth_CreateOAuthLink_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookOAuth_CreateOAuthLink_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookOAuth_CheckOAuthStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookOAuth/CheckOAuthStatus", runtime.WithHTTPPathPattern("/v1/check_oauth_status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookOAuth_CheckOAuthStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookOAuth_CheckOAuthStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookOAuth_DeleteOAuthLink_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookOAuth/DeleteOAuthLink", runtime.WithHTTPPathPattern("/v1/delete_oauth_link")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookOAuth_DeleteOAuthLink_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookOAuth_DeleteOAuthLink_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookOAuth_LoginByOAuth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookOAuth/LoginByOAuth", runtime.WithHTTPPathPattern("/v1/login_by_oauth")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookOAuth_LoginByOAuth_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookOAuth_LoginByOAuth_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookOAuthHandlerFromEndpoint is same as RegisterZBookOAuthHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookOAuthHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookOAuthHandler(ctx, mux, conn) +} + +// RegisterZBookOAuthHandler registers the http handlers for service ZBookOAuth to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookOAuthHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookOAuthHandlerClient(ctx, mux, NewZBookOAuthClient(conn)) +} + +// RegisterZBookOAuthHandlerClient registers the http handlers for service ZBookOAuth +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookOAuthClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookOAuthClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookOAuthClient" to call the correct interceptors. +func RegisterZBookOAuthHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookOAuthClient) error { + + mux.Handle("POST", pattern_ZBookOAuth_CreateOAuthLink_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookOAuth/CreateOAuthLink", runtime.WithHTTPPathPattern("/v1/create_oauth_link")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookOAuth_CreateOAuthLink_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookOAuth_CreateOAuthLink_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookOAuth_CheckOAuthStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookOAuth/CheckOAuthStatus", runtime.WithHTTPPathPattern("/v1/check_oauth_status")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookOAuth_CheckOAuthStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookOAuth_CheckOAuthStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookOAuth_DeleteOAuthLink_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookOAuth/DeleteOAuthLink", runtime.WithHTTPPathPattern("/v1/delete_oauth_link")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookOAuth_DeleteOAuthLink_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookOAuth_DeleteOAuthLink_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookOAuth_LoginByOAuth_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookOAuth/LoginByOAuth", runtime.WithHTTPPathPattern("/v1/login_by_oauth")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookOAuth_LoginByOAuth_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookOAuth_LoginByOAuth_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookOAuth_CreateOAuthLink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_oauth_link"}, "")) + + pattern_ZBookOAuth_CheckOAuthStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "check_oauth_status"}, "")) + + pattern_ZBookOAuth_DeleteOAuthLink_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "delete_oauth_link"}, "")) + + pattern_ZBookOAuth_LoginByOAuth_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "login_by_oauth"}, "")) +) + +var ( + forward_ZBookOAuth_CreateOAuthLink_0 = runtime.ForwardResponseMessage + + forward_ZBookOAuth_CheckOAuthStatus_0 = runtime.ForwardResponseMessage + + forward_ZBookOAuth_DeleteOAuthLink_0 = runtime.ForwardResponseMessage + + forward_ZBookOAuth_LoginByOAuth_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_oauth_grpc.pb.go b/zbook_backend/pb/service_zbook_oauth_grpc.pb.go new file mode 100644 index 0000000..7e98520 --- /dev/null +++ b/zbook_backend/pb/service_zbook_oauth_grpc.pb.go @@ -0,0 +1,229 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_oauth.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookOAuth_CreateOAuthLink_FullMethodName = "/pb.ZBookOAuth/CreateOAuthLink" + ZBookOAuth_CheckOAuthStatus_FullMethodName = "/pb.ZBookOAuth/CheckOAuthStatus" + ZBookOAuth_DeleteOAuthLink_FullMethodName = "/pb.ZBookOAuth/DeleteOAuthLink" + ZBookOAuth_LoginByOAuth_FullMethodName = "/pb.ZBookOAuth/LoginByOAuth" +) + +// ZBookOAuthClient is the client API for ZBookOAuth service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookOAuthClient interface { + // 1.CreateOAuthLink + CreateOAuthLink(ctx context.Context, in *rpcs.CreateOAuthLinkRequest, opts ...grpc.CallOption) (*rpcs.CreateOAuthLinkResponse, error) + // 2.CheckOAuthStatus + CheckOAuthStatus(ctx context.Context, in *rpcs.CheckOAuthStatusRequest, opts ...grpc.CallOption) (*rpcs.CheckOAuthStatusResponse, error) + // 3.DeleteOAuthLink + DeleteOAuthLink(ctx context.Context, in *rpcs.DeleteOAuthLinkRequest, opts ...grpc.CallOption) (*rpcs.DeleteOAuthLinkResponse, error) + // 4.LoginByOAuth + LoginByOAuth(ctx context.Context, in *rpcs.LoginByOAuthRequest, opts ...grpc.CallOption) (*rpcs.LoginByOAuthResponse, error) +} + +type zBookOAuthClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookOAuthClient(cc grpc.ClientConnInterface) ZBookOAuthClient { + return &zBookOAuthClient{cc} +} + +func (c *zBookOAuthClient) CreateOAuthLink(ctx context.Context, in *rpcs.CreateOAuthLinkRequest, opts ...grpc.CallOption) (*rpcs.CreateOAuthLinkResponse, error) { + out := new(rpcs.CreateOAuthLinkResponse) + err := c.cc.Invoke(ctx, ZBookOAuth_CreateOAuthLink_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookOAuthClient) CheckOAuthStatus(ctx context.Context, in *rpcs.CheckOAuthStatusRequest, opts ...grpc.CallOption) (*rpcs.CheckOAuthStatusResponse, error) { + out := new(rpcs.CheckOAuthStatusResponse) + err := c.cc.Invoke(ctx, ZBookOAuth_CheckOAuthStatus_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookOAuthClient) DeleteOAuthLink(ctx context.Context, in *rpcs.DeleteOAuthLinkRequest, opts ...grpc.CallOption) (*rpcs.DeleteOAuthLinkResponse, error) { + out := new(rpcs.DeleteOAuthLinkResponse) + err := c.cc.Invoke(ctx, ZBookOAuth_DeleteOAuthLink_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookOAuthClient) LoginByOAuth(ctx context.Context, in *rpcs.LoginByOAuthRequest, opts ...grpc.CallOption) (*rpcs.LoginByOAuthResponse, error) { + out := new(rpcs.LoginByOAuthResponse) + err := c.cc.Invoke(ctx, ZBookOAuth_LoginByOAuth_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookOAuthServer is the server API for ZBookOAuth service. +// All implementations must embed UnimplementedZBookOAuthServer +// for forward compatibility +type ZBookOAuthServer interface { + // 1.CreateOAuthLink + CreateOAuthLink(context.Context, *rpcs.CreateOAuthLinkRequest) (*rpcs.CreateOAuthLinkResponse, error) + // 2.CheckOAuthStatus + CheckOAuthStatus(context.Context, *rpcs.CheckOAuthStatusRequest) (*rpcs.CheckOAuthStatusResponse, error) + // 3.DeleteOAuthLink + DeleteOAuthLink(context.Context, *rpcs.DeleteOAuthLinkRequest) (*rpcs.DeleteOAuthLinkResponse, error) + // 4.LoginByOAuth + LoginByOAuth(context.Context, *rpcs.LoginByOAuthRequest) (*rpcs.LoginByOAuthResponse, error) + mustEmbedUnimplementedZBookOAuthServer() +} + +// UnimplementedZBookOAuthServer must be embedded to have forward compatible implementations. +type UnimplementedZBookOAuthServer struct { +} + +func (UnimplementedZBookOAuthServer) CreateOAuthLink(context.Context, *rpcs.CreateOAuthLinkRequest) (*rpcs.CreateOAuthLinkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateOAuthLink not implemented") +} +func (UnimplementedZBookOAuthServer) CheckOAuthStatus(context.Context, *rpcs.CheckOAuthStatusRequest) (*rpcs.CheckOAuthStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckOAuthStatus not implemented") +} +func (UnimplementedZBookOAuthServer) DeleteOAuthLink(context.Context, *rpcs.DeleteOAuthLinkRequest) (*rpcs.DeleteOAuthLinkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteOAuthLink not implemented") +} +func (UnimplementedZBookOAuthServer) LoginByOAuth(context.Context, *rpcs.LoginByOAuthRequest) (*rpcs.LoginByOAuthResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoginByOAuth not implemented") +} +func (UnimplementedZBookOAuthServer) mustEmbedUnimplementedZBookOAuthServer() {} + +// UnsafeZBookOAuthServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookOAuthServer will +// result in compilation errors. +type UnsafeZBookOAuthServer interface { + mustEmbedUnimplementedZBookOAuthServer() +} + +func RegisterZBookOAuthServer(s grpc.ServiceRegistrar, srv ZBookOAuthServer) { + s.RegisterService(&ZBookOAuth_ServiceDesc, srv) +} + +func _ZBookOAuth_CreateOAuthLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateOAuthLinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookOAuthServer).CreateOAuthLink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookOAuth_CreateOAuthLink_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookOAuthServer).CreateOAuthLink(ctx, req.(*rpcs.CreateOAuthLinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookOAuth_CheckOAuthStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CheckOAuthStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookOAuthServer).CheckOAuthStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookOAuth_CheckOAuthStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookOAuthServer).CheckOAuthStatus(ctx, req.(*rpcs.CheckOAuthStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookOAuth_DeleteOAuthLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.DeleteOAuthLinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookOAuthServer).DeleteOAuthLink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookOAuth_DeleteOAuthLink_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookOAuthServer).DeleteOAuthLink(ctx, req.(*rpcs.DeleteOAuthLinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookOAuth_LoginByOAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.LoginByOAuthRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookOAuthServer).LoginByOAuth(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookOAuth_LoginByOAuth_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookOAuthServer).LoginByOAuth(ctx, req.(*rpcs.LoginByOAuthRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookOAuth_ServiceDesc is the grpc.ServiceDesc for ZBookOAuth service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookOAuth_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookOAuth", + HandlerType: (*ZBookOAuthServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateOAuthLink", + Handler: _ZBookOAuth_CreateOAuthLink_Handler, + }, + { + MethodName: "CheckOAuthStatus", + Handler: _ZBookOAuth_CheckOAuthStatus_Handler, + }, + { + MethodName: "DeleteOAuthLink", + Handler: _ZBookOAuth_DeleteOAuthLink_Handler, + }, + { + MethodName: "LoginByOAuth", + Handler: _ZBookOAuth_LoginByOAuth_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_oauth.proto", +} diff --git a/zbook_backend/pb/service_zbook_repo.pb.go b/zbook_backend/pb/service_zbook_repo.pb.go new file mode 100644 index 0000000..b21abd0 --- /dev/null +++ b/zbook_backend/pb/service_zbook_repo.pb.go @@ -0,0 +1,274 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_repo.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_repo_proto protoreflect.FileDescriptor + +var file_service_zbook_repo_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x72, 0x65, 0x70, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x72, 0x70, + 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x32, 0xff, 0x11, 0x0a, 0x09, 0x5a, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x70, 0x6f, 0x12, + 0x84, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x15, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x47, 0x92, + 0x41, 0x2a, 0x12, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x1a, + 0x1b, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, + 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x12, 0x9a, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x70, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x54, 0x92, + 0x41, 0x33, 0x12, 0x0f, 0x67, 0x65, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x20, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x1a, 0x20, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, + 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x67, 0x65, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x20, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, + 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x84, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x70, 0x6f, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x47, 0x92, 0x41, 0x2a, 0x12, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x72, + 0x65, 0x70, 0x6f, 0x1a, 0x1b, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, + 0x69, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x72, 0x65, 0x70, 0x6f, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x12, 0xa5, 0x01, 0x0a, 0x0e, 0x4d, + 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x19, 0x2e, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x70, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, + 0x6e, 0x75, 0x61, 0x6c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, 0x92, 0x41, 0x3a, 0x12, 0x1b, 0xe6, 0x89, 0x8b, 0xe5, 0x8a, + 0xa8, 0xe4, 0xb8, 0x8e, 0xe8, 0xbf, 0x9c, 0xe7, 0xab, 0xaf, 0xe5, 0x90, 0x8c, 0xe6, 0xad, 0xa5, + 0xe4, 0xbb, 0x93, 0xe5, 0xba, 0x93, 0x1a, 0x1b, 0xe6, 0x89, 0x8b, 0xe5, 0x8a, 0xa8, 0xe4, 0xb8, + 0x8e, 0xe8, 0xbf, 0x9c, 0xe7, 0xab, 0xaf, 0xe5, 0x90, 0x8c, 0xe6, 0xad, 0xa5, 0xe4, 0xbb, 0x93, + 0xe5, 0xba, 0x93, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x76, + 0x31, 0x2f, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x72, 0x65, + 0x70, 0x6f, 0x12, 0x97, 0x01, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x52, + 0x65, 0x70, 0x6f, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x53, 0x79, 0x6e, + 0x63, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, + 0x62, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x54, 0x92, 0x41, 0x34, 0x12, 0x18, 0xe8, 0x87, 0xaa, + 0xe5, 0x8a, 0xa8, 0xe8, 0xbf, 0x9c, 0xe7, 0xab, 0xaf, 0xe5, 0x90, 0x8c, 0xe6, 0xad, 0xa5, 0xe4, + 0xbb, 0x93, 0xe5, 0xba, 0x93, 0x1a, 0x18, 0xe8, 0x87, 0xaa, 0xe5, 0x8a, 0xa8, 0xe8, 0xbf, 0x9c, + 0xe7, 0xab, 0xaf, 0xe5, 0x90, 0x8c, 0xe6, 0xad, 0xa5, 0xe4, 0xbb, 0x93, 0xe5, 0xba, 0x93, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, + 0x74, 0x6f, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x12, 0x95, 0x01, 0x0a, + 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0x92, 0x41, 0x2a, 0x12, 0x0b, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x1a, 0x1b, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x20, 0x72, 0x65, 0x70, 0x6f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, + 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x12, 0xa2, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x70, 0x6f, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x2e, 0x12, 0x0d, 0x67, 0x65, 0x74, 0x20, 0x72, + 0x65, 0x70, 0x6f, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x1a, 0x1d, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, + 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x72, 0x65, + 0x70, 0x6f, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, + 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x62, + 0x61, 0x73, 0x69, 0x63, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0xcf, 0x01, 0x0a, 0x0f, 0x4c, 0x69, + 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x12, 0x1a, 0x2e, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, 0x65, + 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x82, 0x01, 0x92, 0x41, 0x5e, 0x12, 0x27, 0xe5, 0x88, + 0x97, 0xe5, 0x87, 0xba, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, + 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, + 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, + 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, + 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, + 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, + 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x6f, 0x77, 0x6e, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x12, 0xf1, 0x01, 0x0a, 0x17, + 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, 0x65, + 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, + 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x77, 0x6e, 0x52, + 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x8c, 0x01, 0x92, 0x41, 0x5e, 0x12, 0x27, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe7, 0x94, + 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, + 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, + 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, + 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe5, + 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, + 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, + 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x6f, 0x77, 0x6e, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0xdc, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x6b, 0x65, + 0x52, 0x65, 0x70, 0x6f, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x4c, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, + 0x69, 0x6b, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x8c, 0x01, 0x92, 0x41, 0x67, 0x12, 0x2a, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe7, 0x94, 0xa8, + 0xe6, 0x88, 0xb7, 0xe5, 0x8f, 0xaf, 0xe8, 0xa7, 0x81, 0xe5, 0x96, 0x9c, 0xe6, 0xac, 0xa2, 0xe5, + 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, + 0xaf, 0x1a, 0x39, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, + 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x96, 0x9c, 0xe6, 0xac, + 0xa2, 0xe5, 0x8f, 0xaf, 0xe8, 0xa7, 0x81, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, + 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x6b, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x12, 0xf5, + 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, + 0x6b, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x6b, 0x65, + 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x4c, 0x69, 0x6b, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8d, 0x01, 0x92, 0x41, 0x5e, 0x12, 0x27, 0xe5, 0x88, + 0x97, 0xe5, 0x87, 0xba, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, + 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, + 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, + 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, + 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, + 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, + 0x3a, 0x01, 0x2a, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x6b, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x80, 0x01, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x70, 0x6f, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, + 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, + 0x92, 0x41, 0x2e, 0x12, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x1a, 0x21, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x76, 0x31, 0x2f, + 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x12, 0xa7, 0x01, 0x0a, 0x10, 0x47, 0x65, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, + 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x33, 0x12, 0x0e, + 0x67, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0x21, + 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, + 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, + 0x67, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x42, 0x72, 0x92, 0x41, 0x53, 0x12, 0x51, 0x0a, 0x09, 0x7a, 0x62, 0x6f, 0x6f, + 0x6b, 0x20, 0x61, 0x70, 0x69, 0x22, 0x3f, 0x0a, 0x0a, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2e, + 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, + 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x40, 0x67, 0x6d, 0x61, + 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x5a, 0x1a, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, + 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_repo_proto_goTypes = []interface{}{ + (*rpcs.CreateRepoRequest)(nil), // 0: pb.CreateRepoRequest + (*rpcs.GetRepoConfigRequest)(nil), // 1: pb.GetRepoConfigRequest + (*rpcs.DeleteRepoRequest)(nil), // 2: pb.DeleteRepoRequest + (*rpcs.ManualSyncRepoRequest)(nil), // 3: pb.ManualSyncRepoRequest + (*rpcs.AutoSyncRepoRequest)(nil), // 4: pb.AutoSyncRepoRequest + (*rpcs.UpdateRepoInfoRequest)(nil), // 5: pb.UpdateRepoInfoRequest + (*rpcs.GetRepoBasicInfoRequest)(nil), // 6: pb.GetRepoBasicInfoRequest + (*rpcs.ListUserOwnRepoRequest)(nil), // 7: pb.ListUserOwnRepoRequest + (*rpcs.GetListUserOwnRepoCountRequest)(nil), // 8: pb.GetListUserOwnRepoCountRequest + (*rpcs.ListUserLikeRepoRequest)(nil), // 9: pb.ListUserLikeRepoRequest + (*rpcs.GetListUserLikeRepoCountRequest)(nil), // 10: pb.GetListUserLikeRepoCountRequest + (*rpcs.ListRepoRequest)(nil), // 11: pb.ListRepoRequest + (*rpcs.GetListRepoCountRequest)(nil), // 12: pb.GetListRepoCountRequest + (*rpcs.CreateRepoResponse)(nil), // 13: pb.CreateRepoResponse + (*rpcs.GetRepoConfigResponse)(nil), // 14: pb.GetRepoConfigResponse + (*rpcs.DeleteRepoResponse)(nil), // 15: pb.DeleteRepoResponse + (*rpcs.ManualSyncRepoResponse)(nil), // 16: pb.ManualSyncRepoResponse + (*rpcs.AutoSyncRepoResponse)(nil), // 17: pb.AutoSyncRepoResponse + (*rpcs.UpdateRepoInfoResponse)(nil), // 18: pb.UpdateRepoInfoResponse + (*rpcs.GetRepoBasicInfoResponse)(nil), // 19: pb.GetRepoBasicInfoResponse + (*rpcs.ListUserOwnRepoResponse)(nil), // 20: pb.ListUserOwnRepoResponse + (*rpcs.GetListUserOwnRepoCountResponse)(nil), // 21: pb.GetListUserOwnRepoCountResponse + (*rpcs.ListUserLikeRepoResponse)(nil), // 22: pb.ListUserLikeRepoResponse + (*rpcs.GetListUserLikeRepoCountResponse)(nil), // 23: pb.GetListUserLikeRepoCountResponse + (*rpcs.ListRepoResponse)(nil), // 24: pb.ListRepoResponse + (*rpcs.GetListRepoCountResponse)(nil), // 25: pb.GetListRepoCountResponse +} +var file_service_zbook_repo_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookRepo.CreateRepo:input_type -> pb.CreateRepoRequest + 1, // 1: pb.ZBookRepo.GetRepoConfig:input_type -> pb.GetRepoConfigRequest + 2, // 2: pb.ZBookRepo.DeleteRepo:input_type -> pb.DeleteRepoRequest + 3, // 3: pb.ZBookRepo.ManualSyncRepo:input_type -> pb.ManualSyncRepoRequest + 4, // 4: pb.ZBookRepo.AutoSyncRepo:input_type -> pb.AutoSyncRepoRequest + 5, // 5: pb.ZBookRepo.UpdateRepoInfo:input_type -> pb.UpdateRepoInfoRequest + 6, // 6: pb.ZBookRepo.GetRepoBasicInfo:input_type -> pb.GetRepoBasicInfoRequest + 7, // 7: pb.ZBookRepo.ListUserOwnRepo:input_type -> pb.ListUserOwnRepoRequest + 8, // 8: pb.ZBookRepo.GetListUserOwnRepoCount:input_type -> pb.GetListUserOwnRepoCountRequest + 9, // 9: pb.ZBookRepo.ListUserLikeRepo:input_type -> pb.ListUserLikeRepoRequest + 10, // 10: pb.ZBookRepo.GetListUserLikeRepoCount:input_type -> pb.GetListUserLikeRepoCountRequest + 11, // 11: pb.ZBookRepo.ListRepo:input_type -> pb.ListRepoRequest + 12, // 12: pb.ZBookRepo.GetListRepoCount:input_type -> pb.GetListRepoCountRequest + 13, // 13: pb.ZBookRepo.CreateRepo:output_type -> pb.CreateRepoResponse + 14, // 14: pb.ZBookRepo.GetRepoConfig:output_type -> pb.GetRepoConfigResponse + 15, // 15: pb.ZBookRepo.DeleteRepo:output_type -> pb.DeleteRepoResponse + 16, // 16: pb.ZBookRepo.ManualSyncRepo:output_type -> pb.ManualSyncRepoResponse + 17, // 17: pb.ZBookRepo.AutoSyncRepo:output_type -> pb.AutoSyncRepoResponse + 18, // 18: pb.ZBookRepo.UpdateRepoInfo:output_type -> pb.UpdateRepoInfoResponse + 19, // 19: pb.ZBookRepo.GetRepoBasicInfo:output_type -> pb.GetRepoBasicInfoResponse + 20, // 20: pb.ZBookRepo.ListUserOwnRepo:output_type -> pb.ListUserOwnRepoResponse + 21, // 21: pb.ZBookRepo.GetListUserOwnRepoCount:output_type -> pb.GetListUserOwnRepoCountResponse + 22, // 22: pb.ZBookRepo.ListUserLikeRepo:output_type -> pb.ListUserLikeRepoResponse + 23, // 23: pb.ZBookRepo.GetListUserLikeRepoCount:output_type -> pb.GetListUserLikeRepoCountResponse + 24, // 24: pb.ZBookRepo.ListRepo:output_type -> pb.ListRepoResponse + 25, // 25: pb.ZBookRepo.GetListRepoCount:output_type -> pb.GetListRepoCountResponse + 13, // [13:26] is the sub-list for method output_type + 0, // [0:13] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_repo_proto_init() } +func file_service_zbook_repo_proto_init() { + if File_service_zbook_repo_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_repo_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_repo_proto_goTypes, + DependencyIndexes: file_service_zbook_repo_proto_depIdxs, + }.Build() + File_service_zbook_repo_proto = out.File + file_service_zbook_repo_proto_rawDesc = nil + file_service_zbook_repo_proto_goTypes = nil + file_service_zbook_repo_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_repo.pb.gw.go b/zbook_backend/pb/service_zbook_repo.pb.gw.go new file mode 100644 index 0000000..2cde24a --- /dev/null +++ b/zbook_backend/pb/service_zbook_repo.pb.gw.go @@ -0,0 +1,1088 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_repo.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookRepo_CreateRepo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_CreateRepo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateRepo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_GetRepoConfig_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetRepoConfigRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetRepoConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_GetRepoConfig_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetRepoConfigRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetRepoConfig(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_DeleteRepo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_DeleteRepo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteRepo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_ManualSyncRepo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ManualSyncRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ManualSyncRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_ManualSyncRepo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ManualSyncRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ManualSyncRepo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_AutoSyncRepo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.AutoSyncRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AutoSyncRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_AutoSyncRepo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.AutoSyncRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AutoSyncRepo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_UpdateRepoInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateRepoInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateRepoInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_UpdateRepoInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateRepoInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateRepoInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_GetRepoBasicInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetRepoBasicInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetRepoBasicInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_GetRepoBasicInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetRepoBasicInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetRepoBasicInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_ListUserOwnRepo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListUserOwnRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListUserOwnRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_ListUserOwnRepo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListUserOwnRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListUserOwnRepo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_GetListUserOwnRepoCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListUserOwnRepoCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListUserOwnRepoCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_GetListUserOwnRepoCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListUserOwnRepoCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListUserOwnRepoCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_ListUserLikeRepo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListUserLikeRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListUserLikeRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_ListUserLikeRepo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListUserLikeRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListUserLikeRepo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_GetListUserLikeRepoCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListUserLikeRepoCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListUserLikeRepoCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_GetListUserLikeRepoCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListUserLikeRepoCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListUserLikeRepoCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_ListRepo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListRepo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_ListRepo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListRepoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListRepo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepo_GetListRepoCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListRepoCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListRepoCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepo_GetListRepoCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListRepoCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListRepoCount(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookRepoHandlerServer registers the http handlers for service ZBookRepo to "mux". +// UnaryRPC :call ZBookRepoServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookRepoHandlerFromEndpoint instead. +func RegisterZBookRepoHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookRepoServer) error { + + mux.Handle("POST", pattern_ZBookRepo_CreateRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/CreateRepo", runtime.WithHTTPPathPattern("/v1/create_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_CreateRepo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_CreateRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetRepoConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/GetRepoConfig", runtime.WithHTTPPathPattern("/v1/get_repo_config")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_GetRepoConfig_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetRepoConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_DeleteRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/DeleteRepo", runtime.WithHTTPPathPattern("/v1/delete_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_DeleteRepo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_DeleteRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_ManualSyncRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/ManualSyncRepo", runtime.WithHTTPPathPattern("/v1/manual_sync_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_ManualSyncRepo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_ManualSyncRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_AutoSyncRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/AutoSyncRepo", runtime.WithHTTPPathPattern("/v1/auto_sync_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_AutoSyncRepo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_AutoSyncRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_UpdateRepoInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/UpdateRepoInfo", runtime.WithHTTPPathPattern("/v1/update_repo_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_UpdateRepoInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_UpdateRepoInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetRepoBasicInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/GetRepoBasicInfo", runtime.WithHTTPPathPattern("/v1/get_repo_basic_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_GetRepoBasicInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetRepoBasicInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_ListUserOwnRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/ListUserOwnRepo", runtime.WithHTTPPathPattern("/v1/list_user_own_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_ListUserOwnRepo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_ListUserOwnRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetListUserOwnRepoCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/GetListUserOwnRepoCount", runtime.WithHTTPPathPattern("/v1/get_list_user_own_repo_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_GetListUserOwnRepoCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetListUserOwnRepoCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_ListUserLikeRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/ListUserLikeRepo", runtime.WithHTTPPathPattern("/v1/list_user_like_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_ListUserLikeRepo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_ListUserLikeRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetListUserLikeRepoCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/GetListUserLikeRepoCount", runtime.WithHTTPPathPattern("/v1/get_list_user_like_repo_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_GetListUserLikeRepoCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetListUserLikeRepoCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_ListRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/ListRepo", runtime.WithHTTPPathPattern("/v1/list_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_ListRepo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_ListRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetListRepoCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepo/GetListRepoCount", runtime.WithHTTPPathPattern("/v1/get_list_repo_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepo_GetListRepoCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetListRepoCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookRepoHandlerFromEndpoint is same as RegisterZBookRepoHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookRepoHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookRepoHandler(ctx, mux, conn) +} + +// RegisterZBookRepoHandler registers the http handlers for service ZBookRepo to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookRepoHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookRepoHandlerClient(ctx, mux, NewZBookRepoClient(conn)) +} + +// RegisterZBookRepoHandlerClient registers the http handlers for service ZBookRepo +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookRepoClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookRepoClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookRepoClient" to call the correct interceptors. +func RegisterZBookRepoHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookRepoClient) error { + + mux.Handle("POST", pattern_ZBookRepo_CreateRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/CreateRepo", runtime.WithHTTPPathPattern("/v1/create_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_CreateRepo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_CreateRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetRepoConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/GetRepoConfig", runtime.WithHTTPPathPattern("/v1/get_repo_config")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_GetRepoConfig_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetRepoConfig_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_DeleteRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/DeleteRepo", runtime.WithHTTPPathPattern("/v1/delete_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_DeleteRepo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_DeleteRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_ManualSyncRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/ManualSyncRepo", runtime.WithHTTPPathPattern("/v1/manual_sync_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_ManualSyncRepo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_ManualSyncRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_AutoSyncRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/AutoSyncRepo", runtime.WithHTTPPathPattern("/v1/auto_sync_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_AutoSyncRepo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_AutoSyncRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_UpdateRepoInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/UpdateRepoInfo", runtime.WithHTTPPathPattern("/v1/update_repo_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_UpdateRepoInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_UpdateRepoInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetRepoBasicInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/GetRepoBasicInfo", runtime.WithHTTPPathPattern("/v1/get_repo_basic_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_GetRepoBasicInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetRepoBasicInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_ListUserOwnRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/ListUserOwnRepo", runtime.WithHTTPPathPattern("/v1/list_user_own_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_ListUserOwnRepo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_ListUserOwnRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetListUserOwnRepoCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/GetListUserOwnRepoCount", runtime.WithHTTPPathPattern("/v1/get_list_user_own_repo_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_GetListUserOwnRepoCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetListUserOwnRepoCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_ListUserLikeRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/ListUserLikeRepo", runtime.WithHTTPPathPattern("/v1/list_user_like_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_ListUserLikeRepo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_ListUserLikeRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetListUserLikeRepoCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/GetListUserLikeRepoCount", runtime.WithHTTPPathPattern("/v1/get_list_user_like_repo_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_GetListUserLikeRepoCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetListUserLikeRepoCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_ListRepo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/ListRepo", runtime.WithHTTPPathPattern("/v1/list_repo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_ListRepo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_ListRepo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepo_GetListRepoCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepo/GetListRepoCount", runtime.WithHTTPPathPattern("/v1/get_list_repo_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepo_GetListRepoCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepo_GetListRepoCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookRepo_CreateRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_repo"}, "")) + + pattern_ZBookRepo_GetRepoConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_repo_config"}, "")) + + pattern_ZBookRepo_DeleteRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "delete_repo"}, "")) + + pattern_ZBookRepo_ManualSyncRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "manual_sync_repo"}, "")) + + pattern_ZBookRepo_AutoSyncRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "auto_sync_repo"}, "")) + + pattern_ZBookRepo_UpdateRepoInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_repo_info"}, "")) + + pattern_ZBookRepo_GetRepoBasicInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_repo_basic_info"}, "")) + + pattern_ZBookRepo_ListUserOwnRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_user_own_repo"}, "")) + + pattern_ZBookRepo_GetListUserOwnRepoCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_user_own_repo_count"}, "")) + + pattern_ZBookRepo_ListUserLikeRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_user_like_repo"}, "")) + + pattern_ZBookRepo_GetListUserLikeRepoCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_user_like_repo_count"}, "")) + + pattern_ZBookRepo_ListRepo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_repo"}, "")) + + pattern_ZBookRepo_GetListRepoCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_repo_count"}, "")) +) + +var ( + forward_ZBookRepo_CreateRepo_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_GetRepoConfig_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_DeleteRepo_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_ManualSyncRepo_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_AutoSyncRepo_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_UpdateRepoInfo_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_GetRepoBasicInfo_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_ListUserOwnRepo_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_GetListUserOwnRepoCount_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_ListUserLikeRepo_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_GetListUserLikeRepoCount_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_ListRepo_0 = runtime.ForwardResponseMessage + + forward_ZBookRepo_GetListRepoCount_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_repo_grpc.pb.go b/zbook_backend/pb/service_zbook_repo_grpc.pb.go new file mode 100644 index 0000000..98b1107 --- /dev/null +++ b/zbook_backend/pb/service_zbook_repo_grpc.pb.go @@ -0,0 +1,580 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_repo.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookRepo_CreateRepo_FullMethodName = "/pb.ZBookRepo/CreateRepo" + ZBookRepo_GetRepoConfig_FullMethodName = "/pb.ZBookRepo/GetRepoConfig" + ZBookRepo_DeleteRepo_FullMethodName = "/pb.ZBookRepo/DeleteRepo" + ZBookRepo_ManualSyncRepo_FullMethodName = "/pb.ZBookRepo/ManualSyncRepo" + ZBookRepo_AutoSyncRepo_FullMethodName = "/pb.ZBookRepo/AutoSyncRepo" + ZBookRepo_UpdateRepoInfo_FullMethodName = "/pb.ZBookRepo/UpdateRepoInfo" + ZBookRepo_GetRepoBasicInfo_FullMethodName = "/pb.ZBookRepo/GetRepoBasicInfo" + ZBookRepo_ListUserOwnRepo_FullMethodName = "/pb.ZBookRepo/ListUserOwnRepo" + ZBookRepo_GetListUserOwnRepoCount_FullMethodName = "/pb.ZBookRepo/GetListUserOwnRepoCount" + ZBookRepo_ListUserLikeRepo_FullMethodName = "/pb.ZBookRepo/ListUserLikeRepo" + ZBookRepo_GetListUserLikeRepoCount_FullMethodName = "/pb.ZBookRepo/GetListUserLikeRepoCount" + ZBookRepo_ListRepo_FullMethodName = "/pb.ZBookRepo/ListRepo" + ZBookRepo_GetListRepoCount_FullMethodName = "/pb.ZBookRepo/GetListRepoCount" +) + +// ZBookRepoClient is the client API for ZBookRepo service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookRepoClient interface { + // 1.CreateRepo + CreateRepo(ctx context.Context, in *rpcs.CreateRepoRequest, opts ...grpc.CallOption) (*rpcs.CreateRepoResponse, error) + // 2.GetRepoConfig + GetRepoConfig(ctx context.Context, in *rpcs.GetRepoConfigRequest, opts ...grpc.CallOption) (*rpcs.GetRepoConfigResponse, error) + // 3.DeleteRepo + DeleteRepo(ctx context.Context, in *rpcs.DeleteRepoRequest, opts ...grpc.CallOption) (*rpcs.DeleteRepoResponse, error) + // 4.ManualSyncRepo + ManualSyncRepo(ctx context.Context, in *rpcs.ManualSyncRepoRequest, opts ...grpc.CallOption) (*rpcs.ManualSyncRepoResponse, error) + // 5.AutoSyncRepo + AutoSyncRepo(ctx context.Context, in *rpcs.AutoSyncRepoRequest, opts ...grpc.CallOption) (*rpcs.AutoSyncRepoResponse, error) + // 6.UpdateRepoInfo + UpdateRepoInfo(ctx context.Context, in *rpcs.UpdateRepoInfoRequest, opts ...grpc.CallOption) (*rpcs.UpdateRepoInfoResponse, error) + // 7.GetRepoBasicInfo + GetRepoBasicInfo(ctx context.Context, in *rpcs.GetRepoBasicInfoRequest, opts ...grpc.CallOption) (*rpcs.GetRepoBasicInfoResponse, error) + // 9.ListUserOwnRepo + ListUserOwnRepo(ctx context.Context, in *rpcs.ListUserOwnRepoRequest, opts ...grpc.CallOption) (*rpcs.ListUserOwnRepoResponse, error) + // 10.GetListUserOwnRepoCount + GetListUserOwnRepoCount(ctx context.Context, in *rpcs.GetListUserOwnRepoCountRequest, opts ...grpc.CallOption) (*rpcs.GetListUserOwnRepoCountResponse, error) + // 11.ListUserLikeRepo + ListUserLikeRepo(ctx context.Context, in *rpcs.ListUserLikeRepoRequest, opts ...grpc.CallOption) (*rpcs.ListUserLikeRepoResponse, error) + // 12.GetListUserLikeRepoCount + GetListUserLikeRepoCount(ctx context.Context, in *rpcs.GetListUserLikeRepoCountRequest, opts ...grpc.CallOption) (*rpcs.GetListUserLikeRepoCountResponse, error) + // 13.ListRepo + ListRepo(ctx context.Context, in *rpcs.ListRepoRequest, opts ...grpc.CallOption) (*rpcs.ListRepoResponse, error) + // 14.GetListRepoCount + GetListRepoCount(ctx context.Context, in *rpcs.GetListRepoCountRequest, opts ...grpc.CallOption) (*rpcs.GetListRepoCountResponse, error) +} + +type zBookRepoClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookRepoClient(cc grpc.ClientConnInterface) ZBookRepoClient { + return &zBookRepoClient{cc} +} + +func (c *zBookRepoClient) CreateRepo(ctx context.Context, in *rpcs.CreateRepoRequest, opts ...grpc.CallOption) (*rpcs.CreateRepoResponse, error) { + out := new(rpcs.CreateRepoResponse) + err := c.cc.Invoke(ctx, ZBookRepo_CreateRepo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) GetRepoConfig(ctx context.Context, in *rpcs.GetRepoConfigRequest, opts ...grpc.CallOption) (*rpcs.GetRepoConfigResponse, error) { + out := new(rpcs.GetRepoConfigResponse) + err := c.cc.Invoke(ctx, ZBookRepo_GetRepoConfig_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) DeleteRepo(ctx context.Context, in *rpcs.DeleteRepoRequest, opts ...grpc.CallOption) (*rpcs.DeleteRepoResponse, error) { + out := new(rpcs.DeleteRepoResponse) + err := c.cc.Invoke(ctx, ZBookRepo_DeleteRepo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) ManualSyncRepo(ctx context.Context, in *rpcs.ManualSyncRepoRequest, opts ...grpc.CallOption) (*rpcs.ManualSyncRepoResponse, error) { + out := new(rpcs.ManualSyncRepoResponse) + err := c.cc.Invoke(ctx, ZBookRepo_ManualSyncRepo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) AutoSyncRepo(ctx context.Context, in *rpcs.AutoSyncRepoRequest, opts ...grpc.CallOption) (*rpcs.AutoSyncRepoResponse, error) { + out := new(rpcs.AutoSyncRepoResponse) + err := c.cc.Invoke(ctx, ZBookRepo_AutoSyncRepo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) UpdateRepoInfo(ctx context.Context, in *rpcs.UpdateRepoInfoRequest, opts ...grpc.CallOption) (*rpcs.UpdateRepoInfoResponse, error) { + out := new(rpcs.UpdateRepoInfoResponse) + err := c.cc.Invoke(ctx, ZBookRepo_UpdateRepoInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) GetRepoBasicInfo(ctx context.Context, in *rpcs.GetRepoBasicInfoRequest, opts ...grpc.CallOption) (*rpcs.GetRepoBasicInfoResponse, error) { + out := new(rpcs.GetRepoBasicInfoResponse) + err := c.cc.Invoke(ctx, ZBookRepo_GetRepoBasicInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) ListUserOwnRepo(ctx context.Context, in *rpcs.ListUserOwnRepoRequest, opts ...grpc.CallOption) (*rpcs.ListUserOwnRepoResponse, error) { + out := new(rpcs.ListUserOwnRepoResponse) + err := c.cc.Invoke(ctx, ZBookRepo_ListUserOwnRepo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) GetListUserOwnRepoCount(ctx context.Context, in *rpcs.GetListUserOwnRepoCountRequest, opts ...grpc.CallOption) (*rpcs.GetListUserOwnRepoCountResponse, error) { + out := new(rpcs.GetListUserOwnRepoCountResponse) + err := c.cc.Invoke(ctx, ZBookRepo_GetListUserOwnRepoCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) ListUserLikeRepo(ctx context.Context, in *rpcs.ListUserLikeRepoRequest, opts ...grpc.CallOption) (*rpcs.ListUserLikeRepoResponse, error) { + out := new(rpcs.ListUserLikeRepoResponse) + err := c.cc.Invoke(ctx, ZBookRepo_ListUserLikeRepo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) GetListUserLikeRepoCount(ctx context.Context, in *rpcs.GetListUserLikeRepoCountRequest, opts ...grpc.CallOption) (*rpcs.GetListUserLikeRepoCountResponse, error) { + out := new(rpcs.GetListUserLikeRepoCountResponse) + err := c.cc.Invoke(ctx, ZBookRepo_GetListUserLikeRepoCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) ListRepo(ctx context.Context, in *rpcs.ListRepoRequest, opts ...grpc.CallOption) (*rpcs.ListRepoResponse, error) { + out := new(rpcs.ListRepoResponse) + err := c.cc.Invoke(ctx, ZBookRepo_ListRepo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoClient) GetListRepoCount(ctx context.Context, in *rpcs.GetListRepoCountRequest, opts ...grpc.CallOption) (*rpcs.GetListRepoCountResponse, error) { + out := new(rpcs.GetListRepoCountResponse) + err := c.cc.Invoke(ctx, ZBookRepo_GetListRepoCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookRepoServer is the server API for ZBookRepo service. +// All implementations must embed UnimplementedZBookRepoServer +// for forward compatibility +type ZBookRepoServer interface { + // 1.CreateRepo + CreateRepo(context.Context, *rpcs.CreateRepoRequest) (*rpcs.CreateRepoResponse, error) + // 2.GetRepoConfig + GetRepoConfig(context.Context, *rpcs.GetRepoConfigRequest) (*rpcs.GetRepoConfigResponse, error) + // 3.DeleteRepo + DeleteRepo(context.Context, *rpcs.DeleteRepoRequest) (*rpcs.DeleteRepoResponse, error) + // 4.ManualSyncRepo + ManualSyncRepo(context.Context, *rpcs.ManualSyncRepoRequest) (*rpcs.ManualSyncRepoResponse, error) + // 5.AutoSyncRepo + AutoSyncRepo(context.Context, *rpcs.AutoSyncRepoRequest) (*rpcs.AutoSyncRepoResponse, error) + // 6.UpdateRepoInfo + UpdateRepoInfo(context.Context, *rpcs.UpdateRepoInfoRequest) (*rpcs.UpdateRepoInfoResponse, error) + // 7.GetRepoBasicInfo + GetRepoBasicInfo(context.Context, *rpcs.GetRepoBasicInfoRequest) (*rpcs.GetRepoBasicInfoResponse, error) + // 9.ListUserOwnRepo + ListUserOwnRepo(context.Context, *rpcs.ListUserOwnRepoRequest) (*rpcs.ListUserOwnRepoResponse, error) + // 10.GetListUserOwnRepoCount + GetListUserOwnRepoCount(context.Context, *rpcs.GetListUserOwnRepoCountRequest) (*rpcs.GetListUserOwnRepoCountResponse, error) + // 11.ListUserLikeRepo + ListUserLikeRepo(context.Context, *rpcs.ListUserLikeRepoRequest) (*rpcs.ListUserLikeRepoResponse, error) + // 12.GetListUserLikeRepoCount + GetListUserLikeRepoCount(context.Context, *rpcs.GetListUserLikeRepoCountRequest) (*rpcs.GetListUserLikeRepoCountResponse, error) + // 13.ListRepo + ListRepo(context.Context, *rpcs.ListRepoRequest) (*rpcs.ListRepoResponse, error) + // 14.GetListRepoCount + GetListRepoCount(context.Context, *rpcs.GetListRepoCountRequest) (*rpcs.GetListRepoCountResponse, error) + mustEmbedUnimplementedZBookRepoServer() +} + +// UnimplementedZBookRepoServer must be embedded to have forward compatible implementations. +type UnimplementedZBookRepoServer struct { +} + +func (UnimplementedZBookRepoServer) CreateRepo(context.Context, *rpcs.CreateRepoRequest) (*rpcs.CreateRepoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRepo not implemented") +} +func (UnimplementedZBookRepoServer) GetRepoConfig(context.Context, *rpcs.GetRepoConfigRequest) (*rpcs.GetRepoConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRepoConfig not implemented") +} +func (UnimplementedZBookRepoServer) DeleteRepo(context.Context, *rpcs.DeleteRepoRequest) (*rpcs.DeleteRepoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRepo not implemented") +} +func (UnimplementedZBookRepoServer) ManualSyncRepo(context.Context, *rpcs.ManualSyncRepoRequest) (*rpcs.ManualSyncRepoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ManualSyncRepo not implemented") +} +func (UnimplementedZBookRepoServer) AutoSyncRepo(context.Context, *rpcs.AutoSyncRepoRequest) (*rpcs.AutoSyncRepoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AutoSyncRepo not implemented") +} +func (UnimplementedZBookRepoServer) UpdateRepoInfo(context.Context, *rpcs.UpdateRepoInfoRequest) (*rpcs.UpdateRepoInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRepoInfo not implemented") +} +func (UnimplementedZBookRepoServer) GetRepoBasicInfo(context.Context, *rpcs.GetRepoBasicInfoRequest) (*rpcs.GetRepoBasicInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRepoBasicInfo not implemented") +} +func (UnimplementedZBookRepoServer) ListUserOwnRepo(context.Context, *rpcs.ListUserOwnRepoRequest) (*rpcs.ListUserOwnRepoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUserOwnRepo not implemented") +} +func (UnimplementedZBookRepoServer) GetListUserOwnRepoCount(context.Context, *rpcs.GetListUserOwnRepoCountRequest) (*rpcs.GetListUserOwnRepoCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListUserOwnRepoCount not implemented") +} +func (UnimplementedZBookRepoServer) ListUserLikeRepo(context.Context, *rpcs.ListUserLikeRepoRequest) (*rpcs.ListUserLikeRepoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUserLikeRepo not implemented") +} +func (UnimplementedZBookRepoServer) GetListUserLikeRepoCount(context.Context, *rpcs.GetListUserLikeRepoCountRequest) (*rpcs.GetListUserLikeRepoCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListUserLikeRepoCount not implemented") +} +func (UnimplementedZBookRepoServer) ListRepo(context.Context, *rpcs.ListRepoRequest) (*rpcs.ListRepoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRepo not implemented") +} +func (UnimplementedZBookRepoServer) GetListRepoCount(context.Context, *rpcs.GetListRepoCountRequest) (*rpcs.GetListRepoCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListRepoCount not implemented") +} +func (UnimplementedZBookRepoServer) mustEmbedUnimplementedZBookRepoServer() {} + +// UnsafeZBookRepoServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookRepoServer will +// result in compilation errors. +type UnsafeZBookRepoServer interface { + mustEmbedUnimplementedZBookRepoServer() +} + +func RegisterZBookRepoServer(s grpc.ServiceRegistrar, srv ZBookRepoServer) { + s.RegisterService(&ZBookRepo_ServiceDesc, srv) +} + +func _ZBookRepo_CreateRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).CreateRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_CreateRepo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).CreateRepo(ctx, req.(*rpcs.CreateRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_GetRepoConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetRepoConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).GetRepoConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_GetRepoConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).GetRepoConfig(ctx, req.(*rpcs.GetRepoConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_DeleteRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.DeleteRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).DeleteRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_DeleteRepo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).DeleteRepo(ctx, req.(*rpcs.DeleteRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_ManualSyncRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ManualSyncRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).ManualSyncRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_ManualSyncRepo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).ManualSyncRepo(ctx, req.(*rpcs.ManualSyncRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_AutoSyncRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.AutoSyncRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).AutoSyncRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_AutoSyncRepo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).AutoSyncRepo(ctx, req.(*rpcs.AutoSyncRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_UpdateRepoInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.UpdateRepoInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).UpdateRepoInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_UpdateRepoInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).UpdateRepoInfo(ctx, req.(*rpcs.UpdateRepoInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_GetRepoBasicInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetRepoBasicInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).GetRepoBasicInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_GetRepoBasicInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).GetRepoBasicInfo(ctx, req.(*rpcs.GetRepoBasicInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_ListUserOwnRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListUserOwnRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).ListUserOwnRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_ListUserOwnRepo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).ListUserOwnRepo(ctx, req.(*rpcs.ListUserOwnRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_GetListUserOwnRepoCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListUserOwnRepoCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).GetListUserOwnRepoCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_GetListUserOwnRepoCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).GetListUserOwnRepoCount(ctx, req.(*rpcs.GetListUserOwnRepoCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_ListUserLikeRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListUserLikeRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).ListUserLikeRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_ListUserLikeRepo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).ListUserLikeRepo(ctx, req.(*rpcs.ListUserLikeRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_GetListUserLikeRepoCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListUserLikeRepoCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).GetListUserLikeRepoCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_GetListUserLikeRepoCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).GetListUserLikeRepoCount(ctx, req.(*rpcs.GetListUserLikeRepoCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_ListRepo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListRepoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).ListRepo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_ListRepo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).ListRepo(ctx, req.(*rpcs.ListRepoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepo_GetListRepoCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListRepoCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoServer).GetListRepoCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepo_GetListRepoCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoServer).GetListRepoCount(ctx, req.(*rpcs.GetListRepoCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookRepo_ServiceDesc is the grpc.ServiceDesc for ZBookRepo service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookRepo_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookRepo", + HandlerType: (*ZBookRepoServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateRepo", + Handler: _ZBookRepo_CreateRepo_Handler, + }, + { + MethodName: "GetRepoConfig", + Handler: _ZBookRepo_GetRepoConfig_Handler, + }, + { + MethodName: "DeleteRepo", + Handler: _ZBookRepo_DeleteRepo_Handler, + }, + { + MethodName: "ManualSyncRepo", + Handler: _ZBookRepo_ManualSyncRepo_Handler, + }, + { + MethodName: "AutoSyncRepo", + Handler: _ZBookRepo_AutoSyncRepo_Handler, + }, + { + MethodName: "UpdateRepoInfo", + Handler: _ZBookRepo_UpdateRepoInfo_Handler, + }, + { + MethodName: "GetRepoBasicInfo", + Handler: _ZBookRepo_GetRepoBasicInfo_Handler, + }, + { + MethodName: "ListUserOwnRepo", + Handler: _ZBookRepo_ListUserOwnRepo_Handler, + }, + { + MethodName: "GetListUserOwnRepoCount", + Handler: _ZBookRepo_GetListUserOwnRepoCount_Handler, + }, + { + MethodName: "ListUserLikeRepo", + Handler: _ZBookRepo_ListUserLikeRepo_Handler, + }, + { + MethodName: "GetListUserLikeRepoCount", + Handler: _ZBookRepo_GetListUserLikeRepoCount_Handler, + }, + { + MethodName: "ListRepo", + Handler: _ZBookRepo_ListRepo_Handler, + }, + { + MethodName: "GetListRepoCount", + Handler: _ZBookRepo_GetListRepoCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_repo.proto", +} diff --git a/zbook_backend/pb/service_zbook_repo_relation.pb.go b/zbook_backend/pb/service_zbook_repo_relation.pb.go new file mode 100644 index 0000000..fd272a6 --- /dev/null +++ b/zbook_backend/pb/service_zbook_repo_relation.pb.go @@ -0,0 +1,186 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_repo_relation.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_repo_relation_proto protoreflect.FileDescriptor + +var file_service_zbook_repo_relation_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, + 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, + 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x32, 0x98, 0x0a, 0x0a, 0x11, 0x5a, 0x42, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x70, + 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xb5, 0x01, 0x0a, 0x12, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x60, 0x92, 0x41, 0x3a, 0x12, 0x13, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x6c, 0x69, 0x6b, + 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x1a, 0x23, 0x55, 0x73, 0x65, 0x20, 0x74, + 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0xb5, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, + 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, 0x92, 0x41, 0x3a, 0x12, 0x13, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x70, + 0x6f, 0x1a, 0x23, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, + 0x74, 0x6f, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x6f, + 0x6e, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, + 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, + 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0xe2, 0x01, 0x0a, 0x14, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x86, 0x01, 0x92, 0x41, 0x5e, 0x12, 0x27, 0xe5, 0x88, 0x97, + 0xe5, 0x87, 0xba, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe5, + 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, + 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, + 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, + 0x9b, 0xe5, 0xbb, 0xba, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, + 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, + 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x72, + 0x65, 0x70, 0x6f, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0xe2, + 0x01, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, + 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x86, 0x01, 0x92, 0x41, 0x5e, + 0x12, 0x27, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, + 0x9b, 0xe5, 0xbb, 0xba, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, + 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, + 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, + 0xe6, 0x88, 0xb7, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, + 0x9a, 0x84, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x12, 0xda, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, + 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x84, 0x01, 0x92, 0x41, 0x5e, 0x12, + 0x27, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, 0x9b, + 0xe5, 0xbb, 0xba, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, 0xe5, + 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, + 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, + 0x88, 0xb7, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, + 0x84, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, + 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x12, 0xeb, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x2e, 0x70, 0x62, + 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, + 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x89, 0x01, 0x92, 0x41, 0x5e, 0x12, 0x27, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, + 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0xe5, 0xb8, 0x96, 0xe5, + 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, + 0xaf, 0x1a, 0x33, 0xe5, 0x88, 0x86, 0xe9, 0xa1, 0xb5, 0xe5, 0x88, 0x97, 0xe5, 0x87, 0xba, 0xe6, + 0x8c, 0x87, 0xe5, 0xae, 0x9a, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, + 0xba, 0xe5, 0xb8, 0x96, 0xe5, 0xad, 0x90, 0xe7, 0x9a, 0x84, 0xe5, 0xbd, 0x92, 0xe5, 0xb1, 0x9e, + 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, + 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x5f, 0x76, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x80, + 0x01, 0x92, 0x41, 0x61, 0x12, 0x5f, 0x0a, 0x17, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x72, 0x65, + 0x70, 0x6f, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x70, 0x69, 0x22, + 0x3f, 0x0a, 0x0a, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, + 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, + 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, + 0x32, 0x03, 0x30, 0x2e, 0x31, 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x7a, 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_repo_relation_proto_goTypes = []interface{}{ + (*rpcs.CreateRepoRelationRequest)(nil), // 0: pb.CreateRepoRelationRequest + (*rpcs.DeleteRepoRelationRequest)(nil), // 1: pb.DeleteRepoRelationRequest + (*rpcs.CreateRepoVisibilityRequest)(nil), // 2: pb.CreateRepoVisibilityRequest + (*rpcs.DeleteRepoVisibilityRequest)(nil), // 3: pb.DeleteRepoVisibilityRequest + (*rpcs.ListRepoVisibilityRequest)(nil), // 4: pb.ListRepoVisibilityRequest + (*rpcs.GetRepoVisibilityCountRequest)(nil), // 5: pb.GetRepoVisibilityCountRequest + (*rpcs.CreateRepoRelationResponse)(nil), // 6: pb.CreateRepoRelationResponse + (*rpcs.DeleteRepoRelationResponse)(nil), // 7: pb.DeleteRepoRelationResponse + (*rpcs.CreateRepoVisibilityResponse)(nil), // 8: pb.CreateRepoVisibilityResponse + (*rpcs.DeleteRepoVisibilityResponse)(nil), // 9: pb.DeleteRepoVisibilityResponse + (*rpcs.ListRepoVisibilityResponse)(nil), // 10: pb.ListRepoVisibilityResponse + (*rpcs.GetRepoVisibilityCountResponse)(nil), // 11: pb.GetRepoVisibilityCountResponse +} +var file_service_zbook_repo_relation_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookRepoRelation.CreateRepoRelation:input_type -> pb.CreateRepoRelationRequest + 1, // 1: pb.ZBookRepoRelation.DeleteRepoRelation:input_type -> pb.DeleteRepoRelationRequest + 2, // 2: pb.ZBookRepoRelation.CreateRepoVisibility:input_type -> pb.CreateRepoVisibilityRequest + 3, // 3: pb.ZBookRepoRelation.DeleteRepoVisibility:input_type -> pb.DeleteRepoVisibilityRequest + 4, // 4: pb.ZBookRepoRelation.ListRepoVisibility:input_type -> pb.ListRepoVisibilityRequest + 5, // 5: pb.ZBookRepoRelation.GetRepoVisibilityCount:input_type -> pb.GetRepoVisibilityCountRequest + 6, // 6: pb.ZBookRepoRelation.CreateRepoRelation:output_type -> pb.CreateRepoRelationResponse + 7, // 7: pb.ZBookRepoRelation.DeleteRepoRelation:output_type -> pb.DeleteRepoRelationResponse + 8, // 8: pb.ZBookRepoRelation.CreateRepoVisibility:output_type -> pb.CreateRepoVisibilityResponse + 9, // 9: pb.ZBookRepoRelation.DeleteRepoVisibility:output_type -> pb.DeleteRepoVisibilityResponse + 10, // 10: pb.ZBookRepoRelation.ListRepoVisibility:output_type -> pb.ListRepoVisibilityResponse + 11, // 11: pb.ZBookRepoRelation.GetRepoVisibilityCount:output_type -> pb.GetRepoVisibilityCountResponse + 6, // [6:12] is the sub-list for method output_type + 0, // [0:6] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_repo_relation_proto_init() } +func file_service_zbook_repo_relation_proto_init() { + if File_service_zbook_repo_relation_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_repo_relation_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_repo_relation_proto_goTypes, + DependencyIndexes: file_service_zbook_repo_relation_proto_depIdxs, + }.Build() + File_service_zbook_repo_relation_proto = out.File + file_service_zbook_repo_relation_proto_rawDesc = nil + file_service_zbook_repo_relation_proto_goTypes = nil + file_service_zbook_repo_relation_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_repo_relation.pb.gw.go b/zbook_backend/pb/service_zbook_repo_relation.pb.gw.go new file mode 100644 index 0000000..f5ddc74 --- /dev/null +++ b/zbook_backend/pb/service_zbook_repo_relation.pb.gw.go @@ -0,0 +1,549 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_repo_relation.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookRepoRelation_CreateRepoRelation_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoRelationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateRepoRelationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateRepoRelation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepoRelation_CreateRepoRelation_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoRelationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateRepoRelationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateRepoRelation(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepoRelation_DeleteRepoRelation_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoRelationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteRepoRelationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteRepoRelation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepoRelation_DeleteRepoRelation_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoRelationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteRepoRelationRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteRepoRelation(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepoRelation_CreateRepoVisibility_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoRelationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateRepoVisibilityRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateRepoVisibility(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepoRelation_CreateRepoVisibility_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoRelationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateRepoVisibilityRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateRepoVisibility(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepoRelation_DeleteRepoVisibility_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoRelationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteRepoVisibilityRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DeleteRepoVisibility(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepoRelation_DeleteRepoVisibility_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoRelationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.DeleteRepoVisibilityRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DeleteRepoVisibility(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepoRelation_ListRepoVisibility_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoRelationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListRepoVisibilityRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListRepoVisibility(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepoRelation_ListRepoVisibility_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoRelationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListRepoVisibilityRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListRepoVisibility(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookRepoRelation_GetRepoVisibilityCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookRepoRelationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetRepoVisibilityCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetRepoVisibilityCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookRepoRelation_GetRepoVisibilityCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookRepoRelationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetRepoVisibilityCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetRepoVisibilityCount(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookRepoRelationHandlerServer registers the http handlers for service ZBookRepoRelation to "mux". +// UnaryRPC :call ZBookRepoRelationServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookRepoRelationHandlerFromEndpoint instead. +func RegisterZBookRepoRelationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookRepoRelationServer) error { + + mux.Handle("POST", pattern_ZBookRepoRelation_CreateRepoRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepoRelation/CreateRepoRelation", runtime.WithHTTPPathPattern("/v1/create_repo_relation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepoRelation_CreateRepoRelation_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_CreateRepoRelation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_DeleteRepoRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepoRelation/DeleteRepoRelation", runtime.WithHTTPPathPattern("/v1/delete_repo_relation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepoRelation_DeleteRepoRelation_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_DeleteRepoRelation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_CreateRepoVisibility_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepoRelation/CreateRepoVisibility", runtime.WithHTTPPathPattern("/v1/create_repo_visibility")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepoRelation_CreateRepoVisibility_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_CreateRepoVisibility_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_DeleteRepoVisibility_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepoRelation/DeleteRepoVisibility", runtime.WithHTTPPathPattern("/v1/delete_repo_visibility")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepoRelation_DeleteRepoVisibility_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_DeleteRepoVisibility_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_ListRepoVisibility_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepoRelation/ListRepoVisibility", runtime.WithHTTPPathPattern("/v1/list_repo_visibility")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepoRelation_ListRepoVisibility_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_ListRepoVisibility_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_GetRepoVisibilityCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookRepoRelation/GetRepoVisibilityCount", runtime.WithHTTPPathPattern("/v1/get_repo_visibility_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookRepoRelation_GetRepoVisibilityCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_GetRepoVisibilityCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookRepoRelationHandlerFromEndpoint is same as RegisterZBookRepoRelationHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookRepoRelationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookRepoRelationHandler(ctx, mux, conn) +} + +// RegisterZBookRepoRelationHandler registers the http handlers for service ZBookRepoRelation to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookRepoRelationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookRepoRelationHandlerClient(ctx, mux, NewZBookRepoRelationClient(conn)) +} + +// RegisterZBookRepoRelationHandlerClient registers the http handlers for service ZBookRepoRelation +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookRepoRelationClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookRepoRelationClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookRepoRelationClient" to call the correct interceptors. +func RegisterZBookRepoRelationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookRepoRelationClient) error { + + mux.Handle("POST", pattern_ZBookRepoRelation_CreateRepoRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepoRelation/CreateRepoRelation", runtime.WithHTTPPathPattern("/v1/create_repo_relation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepoRelation_CreateRepoRelation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_CreateRepoRelation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_DeleteRepoRelation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepoRelation/DeleteRepoRelation", runtime.WithHTTPPathPattern("/v1/delete_repo_relation")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepoRelation_DeleteRepoRelation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_DeleteRepoRelation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_CreateRepoVisibility_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepoRelation/CreateRepoVisibility", runtime.WithHTTPPathPattern("/v1/create_repo_visibility")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepoRelation_CreateRepoVisibility_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_CreateRepoVisibility_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_DeleteRepoVisibility_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepoRelation/DeleteRepoVisibility", runtime.WithHTTPPathPattern("/v1/delete_repo_visibility")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepoRelation_DeleteRepoVisibility_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_DeleteRepoVisibility_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_ListRepoVisibility_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepoRelation/ListRepoVisibility", runtime.WithHTTPPathPattern("/v1/list_repo_visibility")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepoRelation_ListRepoVisibility_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_ListRepoVisibility_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookRepoRelation_GetRepoVisibilityCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookRepoRelation/GetRepoVisibilityCount", runtime.WithHTTPPathPattern("/v1/get_repo_visibility_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookRepoRelation_GetRepoVisibilityCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookRepoRelation_GetRepoVisibilityCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookRepoRelation_CreateRepoRelation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_repo_relation"}, "")) + + pattern_ZBookRepoRelation_DeleteRepoRelation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "delete_repo_relation"}, "")) + + pattern_ZBookRepoRelation_CreateRepoVisibility_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_repo_visibility"}, "")) + + pattern_ZBookRepoRelation_DeleteRepoVisibility_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "delete_repo_visibility"}, "")) + + pattern_ZBookRepoRelation_ListRepoVisibility_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_repo_visibility"}, "")) + + pattern_ZBookRepoRelation_GetRepoVisibilityCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_repo_visibility_count"}, "")) +) + +var ( + forward_ZBookRepoRelation_CreateRepoRelation_0 = runtime.ForwardResponseMessage + + forward_ZBookRepoRelation_DeleteRepoRelation_0 = runtime.ForwardResponseMessage + + forward_ZBookRepoRelation_CreateRepoVisibility_0 = runtime.ForwardResponseMessage + + forward_ZBookRepoRelation_DeleteRepoVisibility_0 = runtime.ForwardResponseMessage + + forward_ZBookRepoRelation_ListRepoVisibility_0 = runtime.ForwardResponseMessage + + forward_ZBookRepoRelation_GetRepoVisibilityCount_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_repo_relation_grpc.pb.go b/zbook_backend/pb/service_zbook_repo_relation_grpc.pb.go new file mode 100644 index 0000000..954bbf7 --- /dev/null +++ b/zbook_backend/pb/service_zbook_repo_relation_grpc.pb.go @@ -0,0 +1,307 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_repo_relation.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookRepoRelation_CreateRepoRelation_FullMethodName = "/pb.ZBookRepoRelation/CreateRepoRelation" + ZBookRepoRelation_DeleteRepoRelation_FullMethodName = "/pb.ZBookRepoRelation/DeleteRepoRelation" + ZBookRepoRelation_CreateRepoVisibility_FullMethodName = "/pb.ZBookRepoRelation/CreateRepoVisibility" + ZBookRepoRelation_DeleteRepoVisibility_FullMethodName = "/pb.ZBookRepoRelation/DeleteRepoVisibility" + ZBookRepoRelation_ListRepoVisibility_FullMethodName = "/pb.ZBookRepoRelation/ListRepoVisibility" + ZBookRepoRelation_GetRepoVisibilityCount_FullMethodName = "/pb.ZBookRepoRelation/GetRepoVisibilityCount" +) + +// ZBookRepoRelationClient is the client API for ZBookRepoRelation service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookRepoRelationClient interface { + // 1.CreateRepoRelation + CreateRepoRelation(ctx context.Context, in *rpcs.CreateRepoRelationRequest, opts ...grpc.CallOption) (*rpcs.CreateRepoRelationResponse, error) + // 2.DeleteRepoRelation + DeleteRepoRelation(ctx context.Context, in *rpcs.DeleteRepoRelationRequest, opts ...grpc.CallOption) (*rpcs.DeleteRepoRelationResponse, error) + // 3.CreateRepoVisibility + CreateRepoVisibility(ctx context.Context, in *rpcs.CreateRepoVisibilityRequest, opts ...grpc.CallOption) (*rpcs.CreateRepoVisibilityResponse, error) + // 4.DeleteRepoVisibility + DeleteRepoVisibility(ctx context.Context, in *rpcs.DeleteRepoVisibilityRequest, opts ...grpc.CallOption) (*rpcs.DeleteRepoVisibilityResponse, error) + // 5.ListRepoVisibility + ListRepoVisibility(ctx context.Context, in *rpcs.ListRepoVisibilityRequest, opts ...grpc.CallOption) (*rpcs.ListRepoVisibilityResponse, error) + // 6.GetRepoVisibilityCount + GetRepoVisibilityCount(ctx context.Context, in *rpcs.GetRepoVisibilityCountRequest, opts ...grpc.CallOption) (*rpcs.GetRepoVisibilityCountResponse, error) +} + +type zBookRepoRelationClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookRepoRelationClient(cc grpc.ClientConnInterface) ZBookRepoRelationClient { + return &zBookRepoRelationClient{cc} +} + +func (c *zBookRepoRelationClient) CreateRepoRelation(ctx context.Context, in *rpcs.CreateRepoRelationRequest, opts ...grpc.CallOption) (*rpcs.CreateRepoRelationResponse, error) { + out := new(rpcs.CreateRepoRelationResponse) + err := c.cc.Invoke(ctx, ZBookRepoRelation_CreateRepoRelation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoRelationClient) DeleteRepoRelation(ctx context.Context, in *rpcs.DeleteRepoRelationRequest, opts ...grpc.CallOption) (*rpcs.DeleteRepoRelationResponse, error) { + out := new(rpcs.DeleteRepoRelationResponse) + err := c.cc.Invoke(ctx, ZBookRepoRelation_DeleteRepoRelation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoRelationClient) CreateRepoVisibility(ctx context.Context, in *rpcs.CreateRepoVisibilityRequest, opts ...grpc.CallOption) (*rpcs.CreateRepoVisibilityResponse, error) { + out := new(rpcs.CreateRepoVisibilityResponse) + err := c.cc.Invoke(ctx, ZBookRepoRelation_CreateRepoVisibility_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoRelationClient) DeleteRepoVisibility(ctx context.Context, in *rpcs.DeleteRepoVisibilityRequest, opts ...grpc.CallOption) (*rpcs.DeleteRepoVisibilityResponse, error) { + out := new(rpcs.DeleteRepoVisibilityResponse) + err := c.cc.Invoke(ctx, ZBookRepoRelation_DeleteRepoVisibility_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoRelationClient) ListRepoVisibility(ctx context.Context, in *rpcs.ListRepoVisibilityRequest, opts ...grpc.CallOption) (*rpcs.ListRepoVisibilityResponse, error) { + out := new(rpcs.ListRepoVisibilityResponse) + err := c.cc.Invoke(ctx, ZBookRepoRelation_ListRepoVisibility_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookRepoRelationClient) GetRepoVisibilityCount(ctx context.Context, in *rpcs.GetRepoVisibilityCountRequest, opts ...grpc.CallOption) (*rpcs.GetRepoVisibilityCountResponse, error) { + out := new(rpcs.GetRepoVisibilityCountResponse) + err := c.cc.Invoke(ctx, ZBookRepoRelation_GetRepoVisibilityCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookRepoRelationServer is the server API for ZBookRepoRelation service. +// All implementations must embed UnimplementedZBookRepoRelationServer +// for forward compatibility +type ZBookRepoRelationServer interface { + // 1.CreateRepoRelation + CreateRepoRelation(context.Context, *rpcs.CreateRepoRelationRequest) (*rpcs.CreateRepoRelationResponse, error) + // 2.DeleteRepoRelation + DeleteRepoRelation(context.Context, *rpcs.DeleteRepoRelationRequest) (*rpcs.DeleteRepoRelationResponse, error) + // 3.CreateRepoVisibility + CreateRepoVisibility(context.Context, *rpcs.CreateRepoVisibilityRequest) (*rpcs.CreateRepoVisibilityResponse, error) + // 4.DeleteRepoVisibility + DeleteRepoVisibility(context.Context, *rpcs.DeleteRepoVisibilityRequest) (*rpcs.DeleteRepoVisibilityResponse, error) + // 5.ListRepoVisibility + ListRepoVisibility(context.Context, *rpcs.ListRepoVisibilityRequest) (*rpcs.ListRepoVisibilityResponse, error) + // 6.GetRepoVisibilityCount + GetRepoVisibilityCount(context.Context, *rpcs.GetRepoVisibilityCountRequest) (*rpcs.GetRepoVisibilityCountResponse, error) + mustEmbedUnimplementedZBookRepoRelationServer() +} + +// UnimplementedZBookRepoRelationServer must be embedded to have forward compatible implementations. +type UnimplementedZBookRepoRelationServer struct { +} + +func (UnimplementedZBookRepoRelationServer) CreateRepoRelation(context.Context, *rpcs.CreateRepoRelationRequest) (*rpcs.CreateRepoRelationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRepoRelation not implemented") +} +func (UnimplementedZBookRepoRelationServer) DeleteRepoRelation(context.Context, *rpcs.DeleteRepoRelationRequest) (*rpcs.DeleteRepoRelationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRepoRelation not implemented") +} +func (UnimplementedZBookRepoRelationServer) CreateRepoVisibility(context.Context, *rpcs.CreateRepoVisibilityRequest) (*rpcs.CreateRepoVisibilityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRepoVisibility not implemented") +} +func (UnimplementedZBookRepoRelationServer) DeleteRepoVisibility(context.Context, *rpcs.DeleteRepoVisibilityRequest) (*rpcs.DeleteRepoVisibilityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteRepoVisibility not implemented") +} +func (UnimplementedZBookRepoRelationServer) ListRepoVisibility(context.Context, *rpcs.ListRepoVisibilityRequest) (*rpcs.ListRepoVisibilityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRepoVisibility not implemented") +} +func (UnimplementedZBookRepoRelationServer) GetRepoVisibilityCount(context.Context, *rpcs.GetRepoVisibilityCountRequest) (*rpcs.GetRepoVisibilityCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRepoVisibilityCount not implemented") +} +func (UnimplementedZBookRepoRelationServer) mustEmbedUnimplementedZBookRepoRelationServer() {} + +// UnsafeZBookRepoRelationServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookRepoRelationServer will +// result in compilation errors. +type UnsafeZBookRepoRelationServer interface { + mustEmbedUnimplementedZBookRepoRelationServer() +} + +func RegisterZBookRepoRelationServer(s grpc.ServiceRegistrar, srv ZBookRepoRelationServer) { + s.RegisterService(&ZBookRepoRelation_ServiceDesc, srv) +} + +func _ZBookRepoRelation_CreateRepoRelation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateRepoRelationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoRelationServer).CreateRepoRelation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepoRelation_CreateRepoRelation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoRelationServer).CreateRepoRelation(ctx, req.(*rpcs.CreateRepoRelationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepoRelation_DeleteRepoRelation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.DeleteRepoRelationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoRelationServer).DeleteRepoRelation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepoRelation_DeleteRepoRelation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoRelationServer).DeleteRepoRelation(ctx, req.(*rpcs.DeleteRepoRelationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepoRelation_CreateRepoVisibility_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateRepoVisibilityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoRelationServer).CreateRepoVisibility(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepoRelation_CreateRepoVisibility_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoRelationServer).CreateRepoVisibility(ctx, req.(*rpcs.CreateRepoVisibilityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepoRelation_DeleteRepoVisibility_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.DeleteRepoVisibilityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoRelationServer).DeleteRepoVisibility(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepoRelation_DeleteRepoVisibility_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoRelationServer).DeleteRepoVisibility(ctx, req.(*rpcs.DeleteRepoVisibilityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepoRelation_ListRepoVisibility_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListRepoVisibilityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoRelationServer).ListRepoVisibility(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepoRelation_ListRepoVisibility_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoRelationServer).ListRepoVisibility(ctx, req.(*rpcs.ListRepoVisibilityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookRepoRelation_GetRepoVisibilityCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetRepoVisibilityCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookRepoRelationServer).GetRepoVisibilityCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookRepoRelation_GetRepoVisibilityCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookRepoRelationServer).GetRepoVisibilityCount(ctx, req.(*rpcs.GetRepoVisibilityCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookRepoRelation_ServiceDesc is the grpc.ServiceDesc for ZBookRepoRelation service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookRepoRelation_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookRepoRelation", + HandlerType: (*ZBookRepoRelationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateRepoRelation", + Handler: _ZBookRepoRelation_CreateRepoRelation_Handler, + }, + { + MethodName: "DeleteRepoRelation", + Handler: _ZBookRepoRelation_DeleteRepoRelation_Handler, + }, + { + MethodName: "CreateRepoVisibility", + Handler: _ZBookRepoRelation_CreateRepoVisibility_Handler, + }, + { + MethodName: "DeleteRepoVisibility", + Handler: _ZBookRepoRelation_DeleteRepoVisibility_Handler, + }, + { + MethodName: "ListRepoVisibility", + Handler: _ZBookRepoRelation_ListRepoVisibility_Handler, + }, + { + MethodName: "GetRepoVisibilityCount", + Handler: _ZBookRepoRelation_GetRepoVisibilityCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_repo_relation.proto", +} diff --git a/zbook_backend/pb/service_zbook_user.pb.go b/zbook_backend/pb/service_zbook_user.pb.go new file mode 100644 index 0000000..08dc0b4 --- /dev/null +++ b/zbook_backend/pb/service_zbook_user.pb.go @@ -0,0 +1,214 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_user.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_user_proto protoreflect.FileDescriptor + +var file_service_zbook_user_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, + 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x72, 0x70, + 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x32, 0xf5, 0x0b, 0x0a, 0x09, 0x5a, 0x42, 0x6f, 0x6f, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x8d, 0x01, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, + 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, + 0x41, 0x33, 0x12, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x75, + 0x73, 0x65, 0x72, 0x1a, 0x20, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, + 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x6e, 0x65, 0x77, + 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x12, + 0x7f, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x45, 0x92, 0x41, 0x29, 0x12, 0x0a, + 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x1b, 0x55, 0x73, 0x65, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x6f, 0x67, 0x69, + 0x6e, 0x20, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, + 0x22, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x12, 0x87, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, + 0x92, 0x41, 0x2d, 0x12, 0x0c, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x75, 0x73, 0x65, + 0x72, 0x1a, 0x1d, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, + 0x74, 0x6f, 0x20, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x20, 0x75, 0x73, 0x65, 0x72, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x12, 0xb0, 0x01, 0x0a, 0x14, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x6e, 0x42, 0x6f, 0x61, 0x72, 0x64, + 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x4f, 0x6e, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x4f, 0x6e, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x92, 0x41, 0x2d, 0x12, 0x0c, 0x20, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x1d, 0x55, 0x73, 0x65, 0x20, 0x74, + 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x20, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x20, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, + 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x8a, 0x01, + 0x0a, 0x09, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x70, 0x62, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x34, 0x12, 0x0c, 0xe6, + 0xa3, 0x80, 0xe7, 0xb4, 0xa2, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0x1a, 0x24, 0xe4, 0xbd, 0xbf, + 0xe7, 0x94, 0xa8, 0xe7, 0x94, 0xa8, 0xe6, 0x88, 0xb7, 0xe5, 0x90, 0x8d, 0xe5, 0x85, 0xb3, 0xe9, + 0x94, 0xae, 0xe8, 0xaf, 0x8d, 0xe6, 0xa3, 0x80, 0xe7, 0xb4, 0xa2, 0xe7, 0x94, 0xa8, 0xe6, 0x88, + 0xb7, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x76, 0x31, 0x2f, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x12, 0x99, 0x01, 0x0a, 0x0b, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x59, 0x92, 0x41, 0x3a, + 0x12, 0x13, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66, + 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x23, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, + 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, + 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x9f, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, + 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x59, 0x92, + 0x41, 0x3b, 0x12, 0x0c, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x1a, 0x2b, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x74, + 0x6f, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x20, 0x75, 0x73, 0x65, 0x72, 0x27, 0x73, 0x20, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x75, 0x73, 0x65, + 0x72, 0x5f, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x80, 0x01, 0x0a, 0x08, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x49, 0x92, 0x41, 0x2e, 0x12, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, + 0x75, 0x73, 0x65, 0x72, 0x1a, 0x1d, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, + 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x75, + 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x76, + 0x31, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x12, 0xa2, 0x01, 0x0a, 0x10, + 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, + 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x92, 0x41, 0x2e, + 0x12, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, + 0x1d, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, + 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, + 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0xa6, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, + 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x54, 0x92, 0x41, 0x2e, 0x12, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x61, + 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x1d, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, + 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x6c, + 0x6c, 0x20, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, + 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x74, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x72, 0x92, 0x41, 0x53, 0x12, 0x51, + 0x0a, 0x09, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x70, 0x69, 0x22, 0x3f, 0x0a, 0x0a, 0x7a, + 0x69, 0x7a, 0x64, 0x6c, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, + 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, + 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, 0x7a, 0x69, 0x7a, 0x64, + 0x6c, 0x70, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x32, 0x03, 0x30, 0x2e, + 0x31, 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, + 0x7a, 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_user_proto_goTypes = []interface{}{ + (*rpcs.CreateUserRequest)(nil), // 0: pb.CreateUserRequest + (*rpcs.LoginUserRequest)(nil), // 1: pb.LoginUserRequest + (*rpcs.UpdateUserRequest)(nil), // 2: pb.UpdateUserRequest + (*rpcs.UpdateUserOnBoardingRequest)(nil), // 3: pb.UpdateUserOnBoardingRequest + (*rpcs.QueryUserRequest)(nil), // 4: pb.QueryUserRequest + (*rpcs.GetUserInfoRequest)(nil), // 5: pb.GetUserInfoRequest + (*rpcs.GetUserAvatarRequest)(nil), // 6: pb.GetUserAvatarRequest + (*rpcs.ListUserRequest)(nil), // 7: pb.ListUserRequest + (*rpcs.GetListUserCountRequest)(nil), // 8: pb.GetListUserCountRequest + (*rpcs.GetQueryUserCountRequest)(nil), // 9: pb.GetQueryUserCountRequest + (*rpcs.CreateUserResponse)(nil), // 10: pb.CreateUserResponse + (*rpcs.LoginUserResponse)(nil), // 11: pb.LoginUserResponse + (*rpcs.UpdateUserResponse)(nil), // 12: pb.UpdateUserResponse + (*rpcs.UpdateUserOnBoardingResponse)(nil), // 13: pb.UpdateUserOnBoardingResponse + (*rpcs.QueryUserResponse)(nil), // 14: pb.QueryUserResponse + (*rpcs.GetUserInfoResponse)(nil), // 15: pb.GetUserInfoResponse + (*rpcs.GetUserAvatarResponse)(nil), // 16: pb.GetUserAvatarResponse + (*rpcs.ListUserResponse)(nil), // 17: pb.ListUserResponse + (*rpcs.GetListUserCountResponse)(nil), // 18: pb.GetListUserCountResponse + (*rpcs.GetQueryUserCountResponse)(nil), // 19: pb.GetQueryUserCountResponse +} +var file_service_zbook_user_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookUser.CreateUser:input_type -> pb.CreateUserRequest + 1, // 1: pb.ZBookUser.LoginUser:input_type -> pb.LoginUserRequest + 2, // 2: pb.ZBookUser.UpdateUser:input_type -> pb.UpdateUserRequest + 3, // 3: pb.ZBookUser.UpdateUserOnBoarding:input_type -> pb.UpdateUserOnBoardingRequest + 4, // 4: pb.ZBookUser.QueryUser:input_type -> pb.QueryUserRequest + 5, // 5: pb.ZBookUser.GetUserInfo:input_type -> pb.GetUserInfoRequest + 6, // 6: pb.ZBookUser.GetUserAvatar:input_type -> pb.GetUserAvatarRequest + 7, // 7: pb.ZBookUser.ListUser:input_type -> pb.ListUserRequest + 8, // 8: pb.ZBookUser.GetListUserCount:input_type -> pb.GetListUserCountRequest + 9, // 9: pb.ZBookUser.GetQueryUserCount:input_type -> pb.GetQueryUserCountRequest + 10, // 10: pb.ZBookUser.CreateUser:output_type -> pb.CreateUserResponse + 11, // 11: pb.ZBookUser.LoginUser:output_type -> pb.LoginUserResponse + 12, // 12: pb.ZBookUser.UpdateUser:output_type -> pb.UpdateUserResponse + 13, // 13: pb.ZBookUser.UpdateUserOnBoarding:output_type -> pb.UpdateUserOnBoardingResponse + 14, // 14: pb.ZBookUser.QueryUser:output_type -> pb.QueryUserResponse + 15, // 15: pb.ZBookUser.GetUserInfo:output_type -> pb.GetUserInfoResponse + 16, // 16: pb.ZBookUser.GetUserAvatar:output_type -> pb.GetUserAvatarResponse + 17, // 17: pb.ZBookUser.ListUser:output_type -> pb.ListUserResponse + 18, // 18: pb.ZBookUser.GetListUserCount:output_type -> pb.GetListUserCountResponse + 19, // 19: pb.ZBookUser.GetQueryUserCount:output_type -> pb.GetQueryUserCountResponse + 10, // [10:20] is the sub-list for method output_type + 0, // [0:10] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_user_proto_init() } +func file_service_zbook_user_proto_init() { + if File_service_zbook_user_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_user_proto_goTypes, + DependencyIndexes: file_service_zbook_user_proto_depIdxs, + }.Build() + File_service_zbook_user_proto = out.File + file_service_zbook_user_proto_rawDesc = nil + file_service_zbook_user_proto_goTypes = nil + file_service_zbook_user_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_user.pb.gw.go b/zbook_backend/pb/service_zbook_user.pb.gw.go new file mode 100644 index 0000000..587fbc8 --- /dev/null +++ b/zbook_backend/pb/service_zbook_user.pb.gw.go @@ -0,0 +1,867 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_user.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_ZBookUser_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.CreateUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateUser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookUser_LoginUser_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.LoginUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LoginUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_LoginUser_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.LoginUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LoginUser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookUser_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookUser_UpdateUserOnBoarding_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateUserOnBoardingRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUserOnBoarding(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_UpdateUserOnBoarding_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.UpdateUserOnBoardingRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUserOnBoarding(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookUser_QueryUser_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.QueryUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_QueryUser_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.QueryUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryUser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookUser_GetUserInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetUserInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetUserInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_GetUserInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetUserInfoRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetUserInfo(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_ZBookUser_GetUserAvatar_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_ZBookUser_GetUserAvatar_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetUserAvatarRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ZBookUser_GetUserAvatar_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetUserAvatar(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_GetUserAvatar_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetUserAvatarRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ZBookUser_GetUserAvatar_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetUserAvatar(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookUser_ListUser_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_ListUser_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ListUserRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListUser(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookUser_GetListUserCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListUserCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetListUserCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_GetListUserCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetListUserCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetListUserCount(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookUser_GetQueryUserCount_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookUserClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetQueryUserCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetQueryUserCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookUser_GetQueryUserCount_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookUserServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.GetQueryUserCountRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetQueryUserCount(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookUserHandlerServer registers the http handlers for service ZBookUser to "mux". +// UnaryRPC :call ZBookUserServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookUserHandlerFromEndpoint instead. +func RegisterZBookUserHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookUserServer) error { + + mux.Handle("POST", pattern_ZBookUser_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/CreateUser", runtime.WithHTTPPathPattern("/v1/create_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_CreateUser_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_CreateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_LoginUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/LoginUser", runtime.WithHTTPPathPattern("/v1/login_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_LoginUser_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_LoginUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_UpdateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/UpdateUser", runtime.WithHTTPPathPattern("/v1/update_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_UpdateUser_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_UpdateUserOnBoarding_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/UpdateUserOnBoarding", runtime.WithHTTPPathPattern("/v1/update_user_onboarding")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_UpdateUserOnBoarding_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_UpdateUserOnBoarding_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_QueryUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/QueryUser", runtime.WithHTTPPathPattern("/v1/query_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_QueryUser_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_QueryUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_GetUserInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/GetUserInfo", runtime.WithHTTPPathPattern("/v1/get_user_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_GetUserInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_GetUserInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ZBookUser_GetUserAvatar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/GetUserAvatar", runtime.WithHTTPPathPattern("/v1/get_user_avatar")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_GetUserAvatar_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_GetUserAvatar_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_ListUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/ListUser", runtime.WithHTTPPathPattern("/v1/list_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_ListUser_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_ListUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_GetListUserCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/GetListUserCount", runtime.WithHTTPPathPattern("/v1/get_list_user_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_GetListUserCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_GetListUserCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_GetQueryUserCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookUser/GetQueryUserCount", runtime.WithHTTPPathPattern("/v1/get_query_user_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookUser_GetQueryUserCount_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_GetQueryUserCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookUserHandlerFromEndpoint is same as RegisterZBookUserHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookUserHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookUserHandler(ctx, mux, conn) +} + +// RegisterZBookUserHandler registers the http handlers for service ZBookUser to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookUserHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookUserHandlerClient(ctx, mux, NewZBookUserClient(conn)) +} + +// RegisterZBookUserHandlerClient registers the http handlers for service ZBookUser +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookUserClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookUserClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookUserClient" to call the correct interceptors. +func RegisterZBookUserHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookUserClient) error { + + mux.Handle("POST", pattern_ZBookUser_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/CreateUser", runtime.WithHTTPPathPattern("/v1/create_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_CreateUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_CreateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_LoginUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/LoginUser", runtime.WithHTTPPathPattern("/v1/login_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_LoginUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_LoginUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_UpdateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/UpdateUser", runtime.WithHTTPPathPattern("/v1/update_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_UpdateUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_UpdateUserOnBoarding_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/UpdateUserOnBoarding", runtime.WithHTTPPathPattern("/v1/update_user_onboarding")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_UpdateUserOnBoarding_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_UpdateUserOnBoarding_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_QueryUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/QueryUser", runtime.WithHTTPPathPattern("/v1/query_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_QueryUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_QueryUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_GetUserInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/GetUserInfo", runtime.WithHTTPPathPattern("/v1/get_user_info")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_GetUserInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_GetUserInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ZBookUser_GetUserAvatar_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/GetUserAvatar", runtime.WithHTTPPathPattern("/v1/get_user_avatar")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_GetUserAvatar_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_GetUserAvatar_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_ListUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/ListUser", runtime.WithHTTPPathPattern("/v1/list_user")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_ListUser_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_ListUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_GetListUserCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/GetListUserCount", runtime.WithHTTPPathPattern("/v1/get_list_user_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_GetListUserCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_GetListUserCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookUser_GetQueryUserCount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookUser/GetQueryUserCount", runtime.WithHTTPPathPattern("/v1/get_query_user_count")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookUser_GetQueryUserCount_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookUser_GetQueryUserCount_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookUser_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "create_user"}, "")) + + pattern_ZBookUser_LoginUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "login_user"}, "")) + + pattern_ZBookUser_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_user"}, "")) + + pattern_ZBookUser_UpdateUserOnBoarding_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "update_user_onboarding"}, "")) + + pattern_ZBookUser_QueryUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "query_user"}, "")) + + pattern_ZBookUser_GetUserInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_user_info"}, "")) + + pattern_ZBookUser_GetUserAvatar_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_user_avatar"}, "")) + + pattern_ZBookUser_ListUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "list_user"}, "")) + + pattern_ZBookUser_GetListUserCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_list_user_count"}, "")) + + pattern_ZBookUser_GetQueryUserCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "get_query_user_count"}, "")) +) + +var ( + forward_ZBookUser_CreateUser_0 = runtime.ForwardResponseMessage + + forward_ZBookUser_LoginUser_0 = runtime.ForwardResponseMessage + + forward_ZBookUser_UpdateUser_0 = runtime.ForwardResponseMessage + + forward_ZBookUser_UpdateUserOnBoarding_0 = runtime.ForwardResponseMessage + + forward_ZBookUser_QueryUser_0 = runtime.ForwardResponseMessage + + forward_ZBookUser_GetUserInfo_0 = runtime.ForwardResponseMessage + + forward_ZBookUser_GetUserAvatar_0 = runtime.ForwardResponseMessage + + forward_ZBookUser_ListUser_0 = runtime.ForwardResponseMessage + + forward_ZBookUser_GetListUserCount_0 = runtime.ForwardResponseMessage + + forward_ZBookUser_GetQueryUserCount_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_user_grpc.pb.go b/zbook_backend/pb/service_zbook_user_grpc.pb.go new file mode 100644 index 0000000..5570a66 --- /dev/null +++ b/zbook_backend/pb/service_zbook_user_grpc.pb.go @@ -0,0 +1,463 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_user.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookUser_CreateUser_FullMethodName = "/pb.ZBookUser/CreateUser" + ZBookUser_LoginUser_FullMethodName = "/pb.ZBookUser/LoginUser" + ZBookUser_UpdateUser_FullMethodName = "/pb.ZBookUser/UpdateUser" + ZBookUser_UpdateUserOnBoarding_FullMethodName = "/pb.ZBookUser/UpdateUserOnBoarding" + ZBookUser_QueryUser_FullMethodName = "/pb.ZBookUser/QueryUser" + ZBookUser_GetUserInfo_FullMethodName = "/pb.ZBookUser/GetUserInfo" + ZBookUser_GetUserAvatar_FullMethodName = "/pb.ZBookUser/GetUserAvatar" + ZBookUser_ListUser_FullMethodName = "/pb.ZBookUser/ListUser" + ZBookUser_GetListUserCount_FullMethodName = "/pb.ZBookUser/GetListUserCount" + ZBookUser_GetQueryUserCount_FullMethodName = "/pb.ZBookUser/GetQueryUserCount" +) + +// ZBookUserClient is the client API for ZBookUser service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookUserClient interface { + // 1.CreateUser + CreateUser(ctx context.Context, in *rpcs.CreateUserRequest, opts ...grpc.CallOption) (*rpcs.CreateUserResponse, error) + // 2.LoginUser + LoginUser(ctx context.Context, in *rpcs.LoginUserRequest, opts ...grpc.CallOption) (*rpcs.LoginUserResponse, error) + // 3.UpdateUser + UpdateUser(ctx context.Context, in *rpcs.UpdateUserRequest, opts ...grpc.CallOption) (*rpcs.UpdateUserResponse, error) + // 4.UpdateUserOnBoarding + UpdateUserOnBoarding(ctx context.Context, in *rpcs.UpdateUserOnBoardingRequest, opts ...grpc.CallOption) (*rpcs.UpdateUserOnBoardingResponse, error) + // 5.QueryUser + QueryUser(ctx context.Context, in *rpcs.QueryUserRequest, opts ...grpc.CallOption) (*rpcs.QueryUserResponse, error) + // 6.GetUserInfo + GetUserInfo(ctx context.Context, in *rpcs.GetUserInfoRequest, opts ...grpc.CallOption) (*rpcs.GetUserInfoResponse, error) + // 7.GetUserAvatar + GetUserAvatar(ctx context.Context, in *rpcs.GetUserAvatarRequest, opts ...grpc.CallOption) (*rpcs.GetUserAvatarResponse, error) + // 8.ListUser + ListUser(ctx context.Context, in *rpcs.ListUserRequest, opts ...grpc.CallOption) (*rpcs.ListUserResponse, error) + // 9.GetListUserCount + GetListUserCount(ctx context.Context, in *rpcs.GetListUserCountRequest, opts ...grpc.CallOption) (*rpcs.GetListUserCountResponse, error) + // 10.GetQueryUserCount + GetQueryUserCount(ctx context.Context, in *rpcs.GetQueryUserCountRequest, opts ...grpc.CallOption) (*rpcs.GetQueryUserCountResponse, error) +} + +type zBookUserClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookUserClient(cc grpc.ClientConnInterface) ZBookUserClient { + return &zBookUserClient{cc} +} + +func (c *zBookUserClient) CreateUser(ctx context.Context, in *rpcs.CreateUserRequest, opts ...grpc.CallOption) (*rpcs.CreateUserResponse, error) { + out := new(rpcs.CreateUserResponse) + err := c.cc.Invoke(ctx, ZBookUser_CreateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookUserClient) LoginUser(ctx context.Context, in *rpcs.LoginUserRequest, opts ...grpc.CallOption) (*rpcs.LoginUserResponse, error) { + out := new(rpcs.LoginUserResponse) + err := c.cc.Invoke(ctx, ZBookUser_LoginUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookUserClient) UpdateUser(ctx context.Context, in *rpcs.UpdateUserRequest, opts ...grpc.CallOption) (*rpcs.UpdateUserResponse, error) { + out := new(rpcs.UpdateUserResponse) + err := c.cc.Invoke(ctx, ZBookUser_UpdateUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookUserClient) UpdateUserOnBoarding(ctx context.Context, in *rpcs.UpdateUserOnBoardingRequest, opts ...grpc.CallOption) (*rpcs.UpdateUserOnBoardingResponse, error) { + out := new(rpcs.UpdateUserOnBoardingResponse) + err := c.cc.Invoke(ctx, ZBookUser_UpdateUserOnBoarding_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookUserClient) QueryUser(ctx context.Context, in *rpcs.QueryUserRequest, opts ...grpc.CallOption) (*rpcs.QueryUserResponse, error) { + out := new(rpcs.QueryUserResponse) + err := c.cc.Invoke(ctx, ZBookUser_QueryUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookUserClient) GetUserInfo(ctx context.Context, in *rpcs.GetUserInfoRequest, opts ...grpc.CallOption) (*rpcs.GetUserInfoResponse, error) { + out := new(rpcs.GetUserInfoResponse) + err := c.cc.Invoke(ctx, ZBookUser_GetUserInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookUserClient) GetUserAvatar(ctx context.Context, in *rpcs.GetUserAvatarRequest, opts ...grpc.CallOption) (*rpcs.GetUserAvatarResponse, error) { + out := new(rpcs.GetUserAvatarResponse) + err := c.cc.Invoke(ctx, ZBookUser_GetUserAvatar_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookUserClient) ListUser(ctx context.Context, in *rpcs.ListUserRequest, opts ...grpc.CallOption) (*rpcs.ListUserResponse, error) { + out := new(rpcs.ListUserResponse) + err := c.cc.Invoke(ctx, ZBookUser_ListUser_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookUserClient) GetListUserCount(ctx context.Context, in *rpcs.GetListUserCountRequest, opts ...grpc.CallOption) (*rpcs.GetListUserCountResponse, error) { + out := new(rpcs.GetListUserCountResponse) + err := c.cc.Invoke(ctx, ZBookUser_GetListUserCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookUserClient) GetQueryUserCount(ctx context.Context, in *rpcs.GetQueryUserCountRequest, opts ...grpc.CallOption) (*rpcs.GetQueryUserCountResponse, error) { + out := new(rpcs.GetQueryUserCountResponse) + err := c.cc.Invoke(ctx, ZBookUser_GetQueryUserCount_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookUserServer is the server API for ZBookUser service. +// All implementations must embed UnimplementedZBookUserServer +// for forward compatibility +type ZBookUserServer interface { + // 1.CreateUser + CreateUser(context.Context, *rpcs.CreateUserRequest) (*rpcs.CreateUserResponse, error) + // 2.LoginUser + LoginUser(context.Context, *rpcs.LoginUserRequest) (*rpcs.LoginUserResponse, error) + // 3.UpdateUser + UpdateUser(context.Context, *rpcs.UpdateUserRequest) (*rpcs.UpdateUserResponse, error) + // 4.UpdateUserOnBoarding + UpdateUserOnBoarding(context.Context, *rpcs.UpdateUserOnBoardingRequest) (*rpcs.UpdateUserOnBoardingResponse, error) + // 5.QueryUser + QueryUser(context.Context, *rpcs.QueryUserRequest) (*rpcs.QueryUserResponse, error) + // 6.GetUserInfo + GetUserInfo(context.Context, *rpcs.GetUserInfoRequest) (*rpcs.GetUserInfoResponse, error) + // 7.GetUserAvatar + GetUserAvatar(context.Context, *rpcs.GetUserAvatarRequest) (*rpcs.GetUserAvatarResponse, error) + // 8.ListUser + ListUser(context.Context, *rpcs.ListUserRequest) (*rpcs.ListUserResponse, error) + // 9.GetListUserCount + GetListUserCount(context.Context, *rpcs.GetListUserCountRequest) (*rpcs.GetListUserCountResponse, error) + // 10.GetQueryUserCount + GetQueryUserCount(context.Context, *rpcs.GetQueryUserCountRequest) (*rpcs.GetQueryUserCountResponse, error) + mustEmbedUnimplementedZBookUserServer() +} + +// UnimplementedZBookUserServer must be embedded to have forward compatible implementations. +type UnimplementedZBookUserServer struct { +} + +func (UnimplementedZBookUserServer) CreateUser(context.Context, *rpcs.CreateUserRequest) (*rpcs.CreateUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") +} +func (UnimplementedZBookUserServer) LoginUser(context.Context, *rpcs.LoginUserRequest) (*rpcs.LoginUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoginUser not implemented") +} +func (UnimplementedZBookUserServer) UpdateUser(context.Context, *rpcs.UpdateUserRequest) (*rpcs.UpdateUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") +} +func (UnimplementedZBookUserServer) UpdateUserOnBoarding(context.Context, *rpcs.UpdateUserOnBoardingRequest) (*rpcs.UpdateUserOnBoardingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserOnBoarding not implemented") +} +func (UnimplementedZBookUserServer) QueryUser(context.Context, *rpcs.QueryUserRequest) (*rpcs.QueryUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryUser not implemented") +} +func (UnimplementedZBookUserServer) GetUserInfo(context.Context, *rpcs.GetUserInfoRequest) (*rpcs.GetUserInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserInfo not implemented") +} +func (UnimplementedZBookUserServer) GetUserAvatar(context.Context, *rpcs.GetUserAvatarRequest) (*rpcs.GetUserAvatarResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserAvatar not implemented") +} +func (UnimplementedZBookUserServer) ListUser(context.Context, *rpcs.ListUserRequest) (*rpcs.ListUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListUser not implemented") +} +func (UnimplementedZBookUserServer) GetListUserCount(context.Context, *rpcs.GetListUserCountRequest) (*rpcs.GetListUserCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListUserCount not implemented") +} +func (UnimplementedZBookUserServer) GetQueryUserCount(context.Context, *rpcs.GetQueryUserCountRequest) (*rpcs.GetQueryUserCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetQueryUserCount not implemented") +} +func (UnimplementedZBookUserServer) mustEmbedUnimplementedZBookUserServer() {} + +// UnsafeZBookUserServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookUserServer will +// result in compilation errors. +type UnsafeZBookUserServer interface { + mustEmbedUnimplementedZBookUserServer() +} + +func RegisterZBookUserServer(s grpc.ServiceRegistrar, srv ZBookUserServer) { + s.RegisterService(&ZBookUser_ServiceDesc, srv) +} + +func _ZBookUser_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.CreateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).CreateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_CreateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).CreateUser(ctx, req.(*rpcs.CreateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookUser_LoginUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.LoginUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).LoginUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_LoginUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).LoginUser(ctx, req.(*rpcs.LoginUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookUser_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.UpdateUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).UpdateUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_UpdateUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).UpdateUser(ctx, req.(*rpcs.UpdateUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookUser_UpdateUserOnBoarding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.UpdateUserOnBoardingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).UpdateUserOnBoarding(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_UpdateUserOnBoarding_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).UpdateUserOnBoarding(ctx, req.(*rpcs.UpdateUserOnBoardingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookUser_QueryUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.QueryUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).QueryUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_QueryUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).QueryUser(ctx, req.(*rpcs.QueryUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookUser_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetUserInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).GetUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_GetUserInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).GetUserInfo(ctx, req.(*rpcs.GetUserInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookUser_GetUserAvatar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetUserAvatarRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).GetUserAvatar(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_GetUserAvatar_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).GetUserAvatar(ctx, req.(*rpcs.GetUserAvatarRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookUser_ListUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ListUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).ListUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_ListUser_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).ListUser(ctx, req.(*rpcs.ListUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookUser_GetListUserCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetListUserCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).GetListUserCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_GetListUserCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).GetListUserCount(ctx, req.(*rpcs.GetListUserCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookUser_GetQueryUserCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.GetQueryUserCountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookUserServer).GetQueryUserCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookUser_GetQueryUserCount_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookUserServer).GetQueryUserCount(ctx, req.(*rpcs.GetQueryUserCountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookUser_ServiceDesc is the grpc.ServiceDesc for ZBookUser service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookUser_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookUser", + HandlerType: (*ZBookUserServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateUser", + Handler: _ZBookUser_CreateUser_Handler, + }, + { + MethodName: "LoginUser", + Handler: _ZBookUser_LoginUser_Handler, + }, + { + MethodName: "UpdateUser", + Handler: _ZBookUser_UpdateUser_Handler, + }, + { + MethodName: "UpdateUserOnBoarding", + Handler: _ZBookUser_UpdateUserOnBoarding_Handler, + }, + { + MethodName: "QueryUser", + Handler: _ZBookUser_QueryUser_Handler, + }, + { + MethodName: "GetUserInfo", + Handler: _ZBookUser_GetUserInfo_Handler, + }, + { + MethodName: "GetUserAvatar", + Handler: _ZBookUser_GetUserAvatar_Handler, + }, + { + MethodName: "ListUser", + Handler: _ZBookUser_ListUser_Handler, + }, + { + MethodName: "GetListUserCount", + Handler: _ZBookUser_GetListUserCount_Handler, + }, + { + MethodName: "GetQueryUserCount", + Handler: _ZBookUser_GetQueryUserCount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_user.proto", +} diff --git a/zbook_backend/pb/service_zbook_verification.pb.go b/zbook_backend/pb/service_zbook_verification.pb.go new file mode 100644 index 0000000..b002df7 --- /dev/null +++ b/zbook_backend/pb/service_zbook_verification.pb.go @@ -0,0 +1,162 @@ +// clang-format off + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc v4.25.3 +// source: service_zbook_verification.proto + +package pb + +import ( + _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_service_zbook_verification_proto protoreflect.FileDescriptor + +var file_service_zbook_verification_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x5f, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, + 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x72, 0x70, 0x63, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x32, 0xc4, 0x07, 0x0a, 0x11, 0x5a, 0x42, 0x6f, 0x6f, 0x6b, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x96, 0x01, 0x0a, 0x0b, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x56, 0x92, 0x41, 0x3b, 0x12, 0x0c, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x79, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x1a, 0x2b, 0x55, 0x73, 0x65, + 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x74, 0x6f, 0x20, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x79, 0x20, 0x75, 0x73, 0x65, 0x72, 0x27, 0x73, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, + 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x12, 0x96, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, + 0x62, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x30, 0x12, 0x0e, 0x72, 0x65, + 0x73, 0x65, 0x74, 0x20, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x1a, 0x1e, 0x55, 0x73, + 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, + 0x73, 0x65, 0x74, 0x20, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x74, + 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0xf6, 0x01, 0x0a, 0x18, 0x53, 0x65, + 0x6e, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6e, 0x64, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x62, + 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x65, + 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x8e, 0x01, 0x92, 0x41, 0x60, 0x12, 0x2e, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, + 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x79, 0x6f, 0x75, + 0x72, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x1a, 0x2e, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, + 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x20, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x79, 0x6f, 0x75, + 0x72, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, + 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x5f, 0x74, 0x6f, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x12, 0xf0, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x54, 0x6f, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x21, 0x2e, + 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x6f, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, + 0x6f, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, 0x01, 0x92, 0x41, 0x62, 0x12, 0x2f, 0x55, 0x73, 0x65, 0x20, + 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6e, 0x64, + 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x74, 0x6f, + 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x1a, 0x2f, 0x55, 0x73, 0x65, + 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x6e, + 0x64, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x74, + 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x6e, 0x64, 0x5f, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x6f, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x5f, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x90, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, + 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, + 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x92, 0x41, 0x2e, 0x12, 0x0d, + 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x1d, 0x55, + 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x69, 0x20, 0x74, 0x6f, 0x20, 0x72, + 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, + 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x72, 0x92, 0x41, 0x53, 0x12, 0x51, 0x0a, + 0x09, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x70, 0x69, 0x22, 0x3f, 0x0a, 0x0a, 0x7a, 0x69, + 0x7a, 0x64, 0x6c, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x12, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, + 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, + 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, 0x7a, 0x69, 0x7a, 0x64, 0x6c, + 0x70, 0x40, 0x67, 0x6d, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x32, 0x03, 0x30, 0x2e, 0x31, + 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x69, 0x7a, + 0x64, 0x6c, 0x70, 0x2f, 0x7a, 0x62, 0x6f, 0x6f, 0x6b, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var file_service_zbook_verification_proto_goTypes = []interface{}{ + (*rpcs.VerifyEmailRequest)(nil), // 0: pb.VerifyEmailRequest + (*rpcs.ResetPasswordRequest)(nil), // 1: pb.ResetPasswordRequest + (*rpcs.SendEmailToResetPasswordRequest)(nil), // 2: pb.SendEmailToResetPasswordRequest + (*rpcs.SendEmailToVerifyEmailRequest)(nil), // 3: pb.SendEmailToVerifyEmailRequest + (*rpcs.RefreshTokenRequest)(nil), // 4: pb.RefreshTokenRequest + (*rpcs.VerifyEmailResponse)(nil), // 5: pb.VerifyEmailResponse + (*rpcs.ResetPasswordResponse)(nil), // 6: pb.ResetPasswordResponse + (*rpcs.SendEmailToResetPasswordResponse)(nil), // 7: pb.SendEmailToResetPasswordResponse + (*rpcs.SendEmailToVerifyEmailResponse)(nil), // 8: pb.SendEmailToVerifyEmailResponse + (*rpcs.RefreshTokenResponse)(nil), // 9: pb.RefreshTokenResponse +} +var file_service_zbook_verification_proto_depIdxs = []int32{ + 0, // 0: pb.ZBookVerification.VerifyEmail:input_type -> pb.VerifyEmailRequest + 1, // 1: pb.ZBookVerification.ResetPassword:input_type -> pb.ResetPasswordRequest + 2, // 2: pb.ZBookVerification.SendEmailToResetPassword:input_type -> pb.SendEmailToResetPasswordRequest + 3, // 3: pb.ZBookVerification.SendEmailToVerifyEmail:input_type -> pb.SendEmailToVerifyEmailRequest + 4, // 4: pb.ZBookVerification.RefreshToken:input_type -> pb.RefreshTokenRequest + 5, // 5: pb.ZBookVerification.VerifyEmail:output_type -> pb.VerifyEmailResponse + 6, // 6: pb.ZBookVerification.ResetPassword:output_type -> pb.ResetPasswordResponse + 7, // 7: pb.ZBookVerification.SendEmailToResetPassword:output_type -> pb.SendEmailToResetPasswordResponse + 8, // 8: pb.ZBookVerification.SendEmailToVerifyEmail:output_type -> pb.SendEmailToVerifyEmailResponse + 9, // 9: pb.ZBookVerification.RefreshToken:output_type -> pb.RefreshTokenResponse + 5, // [5:10] is the sub-list for method output_type + 0, // [0:5] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_service_zbook_verification_proto_init() } +func file_service_zbook_verification_proto_init() { + if File_service_zbook_verification_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_zbook_verification_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_zbook_verification_proto_goTypes, + DependencyIndexes: file_service_zbook_verification_proto_depIdxs, + }.Build() + File_service_zbook_verification_proto = out.File + file_service_zbook_verification_proto_rawDesc = nil + file_service_zbook_verification_proto_goTypes = nil + file_service_zbook_verification_proto_depIdxs = nil +} diff --git a/zbook_backend/pb/service_zbook_verification.pb.gw.go b/zbook_backend/pb/service_zbook_verification.pb.gw.go new file mode 100644 index 0000000..19448be --- /dev/null +++ b/zbook_backend/pb/service_zbook_verification.pb.gw.go @@ -0,0 +1,482 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: service_zbook_verification.proto + +/* +Package pb is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pb + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "github.com/zizdlp/zbook/pb/rpcs" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +var ( + filter_ZBookVerification_VerifyEmail_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_ZBookVerification_VerifyEmail_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookVerificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.VerifyEmailRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ZBookVerification_VerifyEmail_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.VerifyEmail(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookVerification_VerifyEmail_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookVerificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.VerifyEmailRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ZBookVerification_VerifyEmail_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.VerifyEmail(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookVerification_ResetPassword_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookVerificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ResetPasswordRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ResetPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookVerification_ResetPassword_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookVerificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.ResetPasswordRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ResetPassword(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookVerification_SendEmailToResetPassword_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookVerificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.SendEmailToResetPasswordRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SendEmailToResetPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookVerification_SendEmailToResetPassword_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookVerificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.SendEmailToResetPasswordRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SendEmailToResetPassword(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookVerification_SendEmailToVerifyEmail_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookVerificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.SendEmailToVerifyEmailRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SendEmailToVerifyEmail(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookVerification_SendEmailToVerifyEmail_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookVerificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.SendEmailToVerifyEmailRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SendEmailToVerifyEmail(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ZBookVerification_RefreshToken_0(ctx context.Context, marshaler runtime.Marshaler, client ZBookVerificationClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.RefreshTokenRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RefreshToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ZBookVerification_RefreshToken_0(ctx context.Context, marshaler runtime.Marshaler, server ZBookVerificationServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq rpcs.RefreshTokenRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RefreshToken(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterZBookVerificationHandlerServer registers the http handlers for service ZBookVerification to "mux". +// UnaryRPC :call ZBookVerificationServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterZBookVerificationHandlerFromEndpoint instead. +func RegisterZBookVerificationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ZBookVerificationServer) error { + + mux.Handle("GET", pattern_ZBookVerification_VerifyEmail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookVerification/VerifyEmail", runtime.WithHTTPPathPattern("/v1/verify_email")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookVerification_VerifyEmail_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_VerifyEmail_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookVerification_ResetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookVerification/ResetPassword", runtime.WithHTTPPathPattern("/v1/reset_password")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookVerification_ResetPassword_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_ResetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookVerification_SendEmailToResetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookVerification/SendEmailToResetPassword", runtime.WithHTTPPathPattern("/v1/send_email_to_reset_password")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookVerification_SendEmailToResetPassword_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_SendEmailToResetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookVerification_SendEmailToVerifyEmail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookVerification/SendEmailToVerifyEmail", runtime.WithHTTPPathPattern("/v1/send_email_to_verify_email")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookVerification_SendEmailToVerifyEmail_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_SendEmailToVerifyEmail_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookVerification_RefreshToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pb.ZBookVerification/RefreshToken", runtime.WithHTTPPathPattern("/v1/refresh_token")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ZBookVerification_RefreshToken_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_RefreshToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterZBookVerificationHandlerFromEndpoint is same as RegisterZBookVerificationHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterZBookVerificationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterZBookVerificationHandler(ctx, mux, conn) +} + +// RegisterZBookVerificationHandler registers the http handlers for service ZBookVerification to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterZBookVerificationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterZBookVerificationHandlerClient(ctx, mux, NewZBookVerificationClient(conn)) +} + +// RegisterZBookVerificationHandlerClient registers the http handlers for service ZBookVerification +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ZBookVerificationClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ZBookVerificationClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ZBookVerificationClient" to call the correct interceptors. +func RegisterZBookVerificationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ZBookVerificationClient) error { + + mux.Handle("GET", pattern_ZBookVerification_VerifyEmail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookVerification/VerifyEmail", runtime.WithHTTPPathPattern("/v1/verify_email")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookVerification_VerifyEmail_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_VerifyEmail_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookVerification_ResetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookVerification/ResetPassword", runtime.WithHTTPPathPattern("/v1/reset_password")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookVerification_ResetPassword_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_ResetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookVerification_SendEmailToResetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookVerification/SendEmailToResetPassword", runtime.WithHTTPPathPattern("/v1/send_email_to_reset_password")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookVerification_SendEmailToResetPassword_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_SendEmailToResetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookVerification_SendEmailToVerifyEmail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookVerification/SendEmailToVerifyEmail", runtime.WithHTTPPathPattern("/v1/send_email_to_verify_email")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookVerification_SendEmailToVerifyEmail_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_SendEmailToVerifyEmail_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_ZBookVerification_RefreshToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pb.ZBookVerification/RefreshToken", runtime.WithHTTPPathPattern("/v1/refresh_token")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ZBookVerification_RefreshToken_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ZBookVerification_RefreshToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ZBookVerification_VerifyEmail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "verify_email"}, "")) + + pattern_ZBookVerification_ResetPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "reset_password"}, "")) + + pattern_ZBookVerification_SendEmailToResetPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "send_email_to_reset_password"}, "")) + + pattern_ZBookVerification_SendEmailToVerifyEmail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "send_email_to_verify_email"}, "")) + + pattern_ZBookVerification_RefreshToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "refresh_token"}, "")) +) + +var ( + forward_ZBookVerification_VerifyEmail_0 = runtime.ForwardResponseMessage + + forward_ZBookVerification_ResetPassword_0 = runtime.ForwardResponseMessage + + forward_ZBookVerification_SendEmailToResetPassword_0 = runtime.ForwardResponseMessage + + forward_ZBookVerification_SendEmailToVerifyEmail_0 = runtime.ForwardResponseMessage + + forward_ZBookVerification_RefreshToken_0 = runtime.ForwardResponseMessage +) diff --git a/zbook_backend/pb/service_zbook_verification_grpc.pb.go b/zbook_backend/pb/service_zbook_verification_grpc.pb.go new file mode 100644 index 0000000..08f7fa3 --- /dev/null +++ b/zbook_backend/pb/service_zbook_verification_grpc.pb.go @@ -0,0 +1,270 @@ +// clang-format off + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.3 +// source: service_zbook_verification.proto + +package pb + +import ( + context "context" + rpcs "github.com/zizdlp/zbook/pb/rpcs" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ZBookVerification_VerifyEmail_FullMethodName = "/pb.ZBookVerification/VerifyEmail" + ZBookVerification_ResetPassword_FullMethodName = "/pb.ZBookVerification/ResetPassword" + ZBookVerification_SendEmailToResetPassword_FullMethodName = "/pb.ZBookVerification/SendEmailToResetPassword" + ZBookVerification_SendEmailToVerifyEmail_FullMethodName = "/pb.ZBookVerification/SendEmailToVerifyEmail" + ZBookVerification_RefreshToken_FullMethodName = "/pb.ZBookVerification/RefreshToken" +) + +// ZBookVerificationClient is the client API for ZBookVerification service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ZBookVerificationClient interface { + // 1.VerifyEmail + VerifyEmail(ctx context.Context, in *rpcs.VerifyEmailRequest, opts ...grpc.CallOption) (*rpcs.VerifyEmailResponse, error) + // 2.ResetPassword + ResetPassword(ctx context.Context, in *rpcs.ResetPasswordRequest, opts ...grpc.CallOption) (*rpcs.ResetPasswordResponse, error) + // 3.SendEmailToResetPassword + SendEmailToResetPassword(ctx context.Context, in *rpcs.SendEmailToResetPasswordRequest, opts ...grpc.CallOption) (*rpcs.SendEmailToResetPasswordResponse, error) + // 4.SendEmailToVerifyEmail + SendEmailToVerifyEmail(ctx context.Context, in *rpcs.SendEmailToVerifyEmailRequest, opts ...grpc.CallOption) (*rpcs.SendEmailToVerifyEmailResponse, error) + // 5.RefreshToken + RefreshToken(ctx context.Context, in *rpcs.RefreshTokenRequest, opts ...grpc.CallOption) (*rpcs.RefreshTokenResponse, error) +} + +type zBookVerificationClient struct { + cc grpc.ClientConnInterface +} + +func NewZBookVerificationClient(cc grpc.ClientConnInterface) ZBookVerificationClient { + return &zBookVerificationClient{cc} +} + +func (c *zBookVerificationClient) VerifyEmail(ctx context.Context, in *rpcs.VerifyEmailRequest, opts ...grpc.CallOption) (*rpcs.VerifyEmailResponse, error) { + out := new(rpcs.VerifyEmailResponse) + err := c.cc.Invoke(ctx, ZBookVerification_VerifyEmail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookVerificationClient) ResetPassword(ctx context.Context, in *rpcs.ResetPasswordRequest, opts ...grpc.CallOption) (*rpcs.ResetPasswordResponse, error) { + out := new(rpcs.ResetPasswordResponse) + err := c.cc.Invoke(ctx, ZBookVerification_ResetPassword_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookVerificationClient) SendEmailToResetPassword(ctx context.Context, in *rpcs.SendEmailToResetPasswordRequest, opts ...grpc.CallOption) (*rpcs.SendEmailToResetPasswordResponse, error) { + out := new(rpcs.SendEmailToResetPasswordResponse) + err := c.cc.Invoke(ctx, ZBookVerification_SendEmailToResetPassword_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookVerificationClient) SendEmailToVerifyEmail(ctx context.Context, in *rpcs.SendEmailToVerifyEmailRequest, opts ...grpc.CallOption) (*rpcs.SendEmailToVerifyEmailResponse, error) { + out := new(rpcs.SendEmailToVerifyEmailResponse) + err := c.cc.Invoke(ctx, ZBookVerification_SendEmailToVerifyEmail_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *zBookVerificationClient) RefreshToken(ctx context.Context, in *rpcs.RefreshTokenRequest, opts ...grpc.CallOption) (*rpcs.RefreshTokenResponse, error) { + out := new(rpcs.RefreshTokenResponse) + err := c.cc.Invoke(ctx, ZBookVerification_RefreshToken_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ZBookVerificationServer is the server API for ZBookVerification service. +// All implementations must embed UnimplementedZBookVerificationServer +// for forward compatibility +type ZBookVerificationServer interface { + // 1.VerifyEmail + VerifyEmail(context.Context, *rpcs.VerifyEmailRequest) (*rpcs.VerifyEmailResponse, error) + // 2.ResetPassword + ResetPassword(context.Context, *rpcs.ResetPasswordRequest) (*rpcs.ResetPasswordResponse, error) + // 3.SendEmailToResetPassword + SendEmailToResetPassword(context.Context, *rpcs.SendEmailToResetPasswordRequest) (*rpcs.SendEmailToResetPasswordResponse, error) + // 4.SendEmailToVerifyEmail + SendEmailToVerifyEmail(context.Context, *rpcs.SendEmailToVerifyEmailRequest) (*rpcs.SendEmailToVerifyEmailResponse, error) + // 5.RefreshToken + RefreshToken(context.Context, *rpcs.RefreshTokenRequest) (*rpcs.RefreshTokenResponse, error) + mustEmbedUnimplementedZBookVerificationServer() +} + +// UnimplementedZBookVerificationServer must be embedded to have forward compatible implementations. +type UnimplementedZBookVerificationServer struct { +} + +func (UnimplementedZBookVerificationServer) VerifyEmail(context.Context, *rpcs.VerifyEmailRequest) (*rpcs.VerifyEmailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyEmail not implemented") +} +func (UnimplementedZBookVerificationServer) ResetPassword(context.Context, *rpcs.ResetPasswordRequest) (*rpcs.ResetPasswordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResetPassword not implemented") +} +func (UnimplementedZBookVerificationServer) SendEmailToResetPassword(context.Context, *rpcs.SendEmailToResetPasswordRequest) (*rpcs.SendEmailToResetPasswordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendEmailToResetPassword not implemented") +} +func (UnimplementedZBookVerificationServer) SendEmailToVerifyEmail(context.Context, *rpcs.SendEmailToVerifyEmailRequest) (*rpcs.SendEmailToVerifyEmailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendEmailToVerifyEmail not implemented") +} +func (UnimplementedZBookVerificationServer) RefreshToken(context.Context, *rpcs.RefreshTokenRequest) (*rpcs.RefreshTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented") +} +func (UnimplementedZBookVerificationServer) mustEmbedUnimplementedZBookVerificationServer() {} + +// UnsafeZBookVerificationServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ZBookVerificationServer will +// result in compilation errors. +type UnsafeZBookVerificationServer interface { + mustEmbedUnimplementedZBookVerificationServer() +} + +func RegisterZBookVerificationServer(s grpc.ServiceRegistrar, srv ZBookVerificationServer) { + s.RegisterService(&ZBookVerification_ServiceDesc, srv) +} + +func _ZBookVerification_VerifyEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.VerifyEmailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookVerificationServer).VerifyEmail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookVerification_VerifyEmail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookVerificationServer).VerifyEmail(ctx, req.(*rpcs.VerifyEmailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookVerification_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.ResetPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookVerificationServer).ResetPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookVerification_ResetPassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookVerificationServer).ResetPassword(ctx, req.(*rpcs.ResetPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookVerification_SendEmailToResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.SendEmailToResetPasswordRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookVerificationServer).SendEmailToResetPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookVerification_SendEmailToResetPassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookVerificationServer).SendEmailToResetPassword(ctx, req.(*rpcs.SendEmailToResetPasswordRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookVerification_SendEmailToVerifyEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.SendEmailToVerifyEmailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookVerificationServer).SendEmailToVerifyEmail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookVerification_SendEmailToVerifyEmail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookVerificationServer).SendEmailToVerifyEmail(ctx, req.(*rpcs.SendEmailToVerifyEmailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ZBookVerification_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(rpcs.RefreshTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ZBookVerificationServer).RefreshToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ZBookVerification_RefreshToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ZBookVerificationServer).RefreshToken(ctx, req.(*rpcs.RefreshTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ZBookVerification_ServiceDesc is the grpc.ServiceDesc for ZBookVerification service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ZBookVerification_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.ZBookVerification", + HandlerType: (*ZBookVerificationServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "VerifyEmail", + Handler: _ZBookVerification_VerifyEmail_Handler, + }, + { + MethodName: "ResetPassword", + Handler: _ZBookVerification_ResetPassword_Handler, + }, + { + MethodName: "SendEmailToResetPassword", + Handler: _ZBookVerification_SendEmailToResetPassword_Handler, + }, + { + MethodName: "SendEmailToVerifyEmail", + Handler: _ZBookVerification_SendEmailToVerifyEmail_Handler, + }, + { + MethodName: "RefreshToken", + Handler: _ZBookVerification_RefreshToken_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_zbook_verification.proto", +} diff --git a/zbook_backend/proto/google/api/annotations.proto b/zbook_backend/proto/google/api/annotations.proto new file mode 100644 index 0000000..efdab3d --- /dev/null +++ b/zbook_backend/proto/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2015 Google LLC +// +// 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. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/zbook_backend/proto/google/api/field_behavior.proto b/zbook_backend/proto/google/api/field_behavior.proto new file mode 100644 index 0000000..c4abe3b --- /dev/null +++ b/zbook_backend/proto/google/api/field_behavior.proto @@ -0,0 +1,90 @@ +// Copyright 2018 Google LLC +// +// 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. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "FieldBehaviorProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.FieldOptions { + // A designation of a specific field behavior (required, output only, etc.) + // in protobuf messages. + // + // Examples: + // + // string name = 1 [(google.api.field_behavior) = REQUIRED]; + // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // google.protobuf.Duration ttl = 1 + // [(google.api.field_behavior) = INPUT_ONLY]; + // google.protobuf.Timestamp expire_time = 1 + // [(google.api.field_behavior) = OUTPUT_ONLY, + // (google.api.field_behavior) = IMMUTABLE]; + repeated google.api.FieldBehavior field_behavior = 1052; +} + +// An indicator of the behavior of a given field (for example, that a field +// is required in requests, or given as output but ignored as input). +// This **does not** change the behavior in protocol buffers itself; it only +// denotes the behavior and may affect how API tooling handles the field. +// +// Note: This enum **may** receive new values in the future. +enum FieldBehavior { + // Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0; + + // Specifically denotes a field as optional. + // While all fields in protocol buffers are optional, this may be specified + // for emphasis if appropriate. + OPTIONAL = 1; + + // Denotes a field as required. + // This indicates that the field **must** be provided as part of the request, + // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2; + + // Denotes a field as output only. + // This indicates that the field is provided in responses, but including the + // field in a request does nothing (the server *must* ignore it and + // *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3; + + // Denotes a field as input only. + // This indicates that the field is provided in requests, and the + // corresponding field is not included in output. + INPUT_ONLY = 4; + + // Denotes a field as immutable. + // This indicates that the field may be set once in a request to create a + // resource, but may not be changed thereafter. + IMMUTABLE = 5; + + // Denotes that a (repeated) field is an unordered list. + // This indicates that the service may provide the elements of the list + // in any arbitrary order, rather than the order the user originally + // provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6; + + // Denotes that this field returns a non-empty default value if not set. + // This indicates that if the user provides the empty value in a request, + // a non-empty value will be returned. The user will not be aware of what + // non-empty value to expect. + NON_EMPTY_DEFAULT = 7; +} diff --git a/zbook_backend/proto/google/api/http.proto b/zbook_backend/proto/google/api/http.proto new file mode 100644 index 0000000..113fa93 --- /dev/null +++ b/zbook_backend/proto/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2015 Google LLC +// +// 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. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/zbook_backend/proto/google/api/httpbody.proto b/zbook_backend/proto/google/api/httpbody.proto new file mode 100644 index 0000000..00c80ab --- /dev/null +++ b/zbook_backend/proto/google/api/httpbody.proto @@ -0,0 +1,81 @@ +// Copyright 2015 Google LLC +// +// 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. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/any.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; +option java_multiple_files = true; +option java_outer_classname = "HttpBodyProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) +// returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) +// returns (google.protobuf.Empty); +// +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +message HttpBody { + // The HTTP Content-Type header value specifying the content type of the body. + string content_type = 1; + + // The HTTP request/response body as raw binary. + bytes data = 2; + + // Application specific response metadata. Must be set in the first response + // for streaming APIs. + repeated google.protobuf.Any extensions = 3; +} diff --git a/zbook_backend/proto/models/comment.proto b/zbook_backend/proto/models/comment.proto new file mode 100644 index 0000000..1d3d915 --- /dev/null +++ b/zbook_backend/proto/models/comment.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/models"; + +message CommentBasicInfo { + int64 comment_id = 1; + int64 markdown_id = 2; + int64 user_id = 3; + int64 parent_id = 4; + int64 root_id = 5; + string comment_content = 6; + google.protobuf.Timestamp created_at = 7; +} +message CommentCountInfo { + int64 comment_id = 1; + int32 like_count = 2; + int32 reply_count = 3; + bool is_liked = 4; + bool is_disliked = 5; + bool is_shared = 6; + bool is_reported = 7; +} + +message ListCommentInfo { + int64 markdown_id = 1; + int64 parent_id = 2; + string username = 3; + string pusername = 4; + string comment_content = 5; + google.protobuf.Timestamp created_at = 6; + int64 like_count = 7; + int64 reply_count = 8; + bool is_liked = 9; + bool is_disliked = 10; + bool is_shared = 11; + bool is_reported = 12; + int64 comment_id = 13; +} + +message ListAdminCommentInfo { + int64 comment_id = 1; + string comment_content = 2; + string username = 3; + string email = 4; + google.protobuf.Timestamp created_at = 5; +} diff --git a/zbook_backend/proto/models/comment_relation.proto b/zbook_backend/proto/models/comment_relation.proto new file mode 100644 index 0000000..f705dbb --- /dev/null +++ b/zbook_backend/proto/models/comment_relation.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/models"; + +message ListCommentReportInfo { + int64 report_id = 1; + int64 comment_id = 2; + string repo_name = 3; + string repo_username = 4; + string relative_path = 5; + string report_content = 6; + string comment_content = 7; + bool processed = 8; + google.protobuf.Timestamp created_at = 9; + string username = 10; +} diff --git a/zbook_backend/proto/models/follow.proto b/zbook_backend/proto/models/follow.proto new file mode 100644 index 0000000..5aed102 --- /dev/null +++ b/zbook_backend/proto/models/follow.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/models"; + +message Follow { + int64 follow_id = 1; + int64 follower_id = 2; + int64 following_id = 3; + google.protobuf.Timestamp created_at = 6; +} + +message ListFollowInfo { + string username = 1; + string email = 2; + bool is_following = 3; + int32 repo_count = 4; + google.protobuf.Timestamp updated_at = 5; + google.protobuf.Timestamp created_at = 6; +} \ No newline at end of file diff --git a/zbook_backend/proto/models/markdown.proto b/zbook_backend/proto/models/markdown.proto new file mode 100644 index 0000000..4f8a83a --- /dev/null +++ b/zbook_backend/proto/models/markdown.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package pb; +import "google/protobuf/timestamp.proto"; +option go_package = "github.com/zizdlp/zbook/pb/models"; + +message Markdown { + int64 markdown_id = 1; + string relative_path = 2; + int64 user_id = 3; + int64 repo_id = 4; + string main_content = 5; + string table_content = 6; + string md5 = 7; + string version_key = 8; + google.protobuf.Timestamp created_at = 9; + string username = 10; + string repo_name = 11; +} + +message FooterSocial { + string name = 1; + string icon = 2; + string url = 3; +} \ No newline at end of file diff --git a/zbook_backend/proto/models/notification.proto b/zbook_backend/proto/models/notification.proto new file mode 100644 index 0000000..d071a11 --- /dev/null +++ b/zbook_backend/proto/models/notification.proto @@ -0,0 +1,42 @@ +syntax = "proto3"; +package pb; +import "google/protobuf/timestamp.proto"; +option go_package = "github.com/zizdlp/zbook/pb/models"; + +message ListFollowerNotificationInfo { + string username = 1; + string email = 2; + bool readed = 3; + int64 noti_id = 4; + google.protobuf.Timestamp created_at = 5; +} +message ListRepoNotificationInfo { + string username = 1; + string email = 2; + bool readed = 3; + int64 noti_id = 4; + google.protobuf.Timestamp created_at = 5; + int64 repo_id = 6; + string repo_name = 7; +} +message ListCommentNotificationInfo { + string username = 1; + string email = 2; + bool readed = 3; + int64 noti_id = 4; + google.protobuf.Timestamp created_at = 5; + string comment_content = 6; + int64 repo_id = 7; + string relative_path = 8; + string repo_name = 9; + string repo_username =10; +} + +message ListSystemNotificationInfo { + bool readed = 1; + int64 noti_id = 2; + google.protobuf.Timestamp created_at = 3; + string title = 4; + string contents = 5; + string redirect_url = 6; +} diff --git a/zbook_backend/proto/models/repo.proto b/zbook_backend/proto/models/repo.proto new file mode 100644 index 0000000..68aa0e0 --- /dev/null +++ b/zbook_backend/proto/models/repo.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/models"; + +message RepoBasicInfo { + int64 repo_id = 1; + string repo_name = 2; + string repo_description = 3; + string visibility_level = 4; + string sync_token = 5; + string git_host = 7; + google.protobuf.Timestamp created_at = 8; + google.protobuf.Timestamp updated_at = 9; +} + +message ListRepoInfo { + int64 repo_id = 1; + string repo_name = 2; + string repo_description = 3; + string visibility_level = 4; + string git_host = 6; + int32 like_count = 7; + bool is_liked = 8; + google.protobuf.Timestamp updated_at = 9; + google.protobuf.Timestamp created_at = 10; + string username = 11; +} + +message RepoCountInfo { + int64 repo_id = 1; + int32 like_count = 2; + int32 dislike_count = 3; + int32 shared_count = 4; + bool is_liked = 5; + bool is_disliked = 6; + bool is_shared = 7; +} diff --git a/zbook_backend/proto/models/repo_relation.proto b/zbook_backend/proto/models/repo_relation.proto new file mode 100644 index 0000000..b2fb716 --- /dev/null +++ b/zbook_backend/proto/models/repo_relation.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/models"; + +message ListRepoReportInfo { + int64 report_id = 1; + int64 user_id = 2; + int64 repo_id = 3; + string report_content = 4; + bool processed = 5; + google.protobuf.Timestamp created_at = 6; +} + +message ListUserRepoVisiblityInfo { + string username = 1; + string email = 2; + bool is_following = 3; + bool is_repo_visible = 4; + google.protobuf.Timestamp updated_at = 5; +} \ No newline at end of file diff --git a/zbook_backend/proto/models/session.proto b/zbook_backend/proto/models/session.proto new file mode 100644 index 0000000..05e9ee9 --- /dev/null +++ b/zbook_backend/proto/models/session.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/models"; + +message Session { + string session_id = 1; + int64 user_id = 2; + string refresh_token = 3; + string user_agent = 4; + string client_ip = 5; + string username = 6; + google.protobuf.Timestamp expires_at = 7; + google.protobuf.Timestamp created_at = 8; +} +message SessionInfo { + string username = 1; + string user_agent = 2; + string client_ip = 3; + string email = 4; + google.protobuf.Timestamp expires_at = 5; + google.protobuf.Timestamp created_at = 6; +} \ No newline at end of file diff --git a/zbook_backend/proto/models/user.proto b/zbook_backend/proto/models/user.proto new file mode 100644 index 0000000..ed9d2dd --- /dev/null +++ b/zbook_backend/proto/models/user.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package pb; + +import "google/protobuf/timestamp.proto"; +option go_package = "github.com/zizdlp/zbook/pb/models"; + +message UserBasicInfo { + int64 user_id = 1; + string username = 2; + string email = 3; + string motto = 4; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; + bool onboarding = 8; +} + +message UserImageInfo { + int64 user_id = 1; + bytes avatar = 2; + google.protobuf.Timestamp update_image_info_at = 3; +} +message DailyCount { + int64 count = 1; + string date = 2; +} + +message UserCount { + string username = 1; + int64 count = 2; +} +message UserCountInfo { + int64 user_id = 1; + int32 count_likes = 2; + int32 count_following = 3; + int32 count_follower = 4; + int32 count_repos = 5; + bool following = 6; +} + +message ListUserInfo { + string username = 1; + string email = 2; + bool blocked = 3; + bool verified = 4; + bool onboarding = 6; + string role = 7; + google.protobuf.Timestamp updated_at = 8; + google.protobuf.Timestamp created_at = 9; +} diff --git a/zbook_backend/proto/protoc-gen-openapiv2/options/annotations.proto b/zbook_backend/proto/protoc-gen-openapiv2/options/annotations.proto new file mode 100644 index 0000000..d63d3c8 --- /dev/null +++ b/zbook_backend/proto/protoc-gen-openapiv2/options/annotations.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package grpc.gateway.protoc_gen_openapiv2.options; + +import "google/protobuf/descriptor.proto"; +import "protoc-gen-openapiv2/options/openapiv2.proto"; + +option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; + +extend google.protobuf.FileOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + Swagger openapiv2_swagger = 1042; +} +extend google.protobuf.MethodOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + Operation openapiv2_operation = 1042; +} +extend google.protobuf.MessageOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + Schema openapiv2_schema = 1042; +} +extend google.protobuf.ServiceOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + Tag openapiv2_tag = 1042; +} +extend google.protobuf.FieldOptions { + // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + // + // All IDs are the same, as assigned. It is okay that they are the same, as they extend + // different descriptor messages. + JSONSchema openapiv2_field = 1042; +} diff --git a/zbook_backend/proto/protoc-gen-openapiv2/options/openapiv2.proto b/zbook_backend/proto/protoc-gen-openapiv2/options/openapiv2.proto new file mode 100644 index 0000000..34ddb52 --- /dev/null +++ b/zbook_backend/proto/protoc-gen-openapiv2/options/openapiv2.proto @@ -0,0 +1,720 @@ +syntax = "proto3"; + +package grpc.gateway.protoc_gen_openapiv2.options; + +import "google/protobuf/struct.proto"; + +option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; + +// Scheme describes the schemes supported by the OpenAPI Swagger +// and Operation objects. +enum Scheme { + UNKNOWN = 0; + HTTP = 1; + HTTPS = 2; + WS = 3; + WSS = 4; +} + +// `Swagger` is a representation of OpenAPI v2 specification's Swagger object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// title: "Echo API"; +// version: "1.0"; +// description: ""; +// contact: { +// name: "gRPC-Gateway project"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// email: "none@example.com"; +// }; +// license: { +// name: "BSD 3-Clause License"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE.txt"; +// }; +// }; +// schemes: HTTPS; +// consumes: "application/json"; +// produces: "application/json"; +// }; +// +message Swagger { + // Specifies the OpenAPI Specification version being used. It can be + // used by the OpenAPI UI and other clients to interpret the API listing. The + // value MUST be "2.0". + string swagger = 1; + // Provides metadata about the API. The metadata can be used by the + // clients if needed. + Info info = 2; + // The host (name or ip) serving the API. This MUST be the host only and does + // not include the scheme nor sub-paths. It MAY include a port. If the host is + // not included, the host serving the documentation is to be used (including + // the port). The host does not support path templating. + string host = 3; + // The base path on which the API is served, which is relative to the host. If + // it is not included, the API is served directly under the host. The value + // MUST start with a leading slash (/). The basePath does not support path + // templating. + // Note that using `base_path` does not change the endpoint paths that are + // generated in the resulting OpenAPI file. If you wish to use `base_path` + // with relatively generated OpenAPI paths, the `base_path` prefix must be + // manually removed from your `google.api.http` paths and your code changed to + // serve the API from the `base_path`. + string base_path = 4; + // The transfer protocol of the API. Values MUST be from the list: "http", + // "https", "ws", "wss". If the schemes is not included, the default scheme to + // be used is the one used to access the OpenAPI definition itself. + repeated Scheme schemes = 5; + // A list of MIME types the APIs can consume. This is global to all APIs but + // can be overridden on specific API calls. Value MUST be as described under + // Mime Types. + repeated string consumes = 6; + // A list of MIME types the APIs can produce. This is global to all APIs but + // can be overridden on specific API calls. Value MUST be as described under + // Mime Types. + repeated string produces = 7; + // field 8 is reserved for 'paths'. + reserved 8; + // field 9 is reserved for 'definitions', which at this time are already + // exposed as and customizable as proto messages. + reserved 9; + // An object to hold responses that can be used across operations. This + // property does not define global responses for all operations. + map responses = 10; + // Security scheme definitions that can be used across the specification. + SecurityDefinitions security_definitions = 11; + // A declaration of which security schemes are applied for the API as a whole. + // The list of values describes alternative security schemes that can be used + // (that is, there is a logical OR between the security requirements). + // Individual operations can override this definition. + repeated SecurityRequirement security = 12; + // A list of tags for API documentation control. Tags can be used for logical + // grouping of operations by resources or any other qualifier. + repeated Tag tags = 13; + // Additional external documentation. + ExternalDocumentation external_docs = 14; + // Custom properties that start with "x-" such as "x-foo" used to describe + // extra functionality that is not covered by the standard OpenAPI Specification. + // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + map extensions = 15; +} + +// `Operation` is a representation of OpenAPI v2 specification's Operation object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject +// +// Example: +// +// service EchoService { +// rpc Echo(SimpleMessage) returns (SimpleMessage) { +// option (google.api.http) = { +// get: "/v1/example/echo/{id}" +// }; +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { +// summary: "Get a message."; +// operation_id: "getMessage"; +// tags: "echo"; +// responses: { +// key: "200" +// value: { +// description: "OK"; +// } +// } +// }; +// } +// } +message Operation { + // A list of tags for API documentation control. Tags can be used for logical + // grouping of operations by resources or any other qualifier. + repeated string tags = 1; + // A short summary of what the operation does. For maximum readability in the + // swagger-ui, this field SHOULD be less than 120 characters. + string summary = 2; + // A verbose explanation of the operation behavior. GFM syntax can be used for + // rich text representation. + string description = 3; + // Additional external documentation for this operation. + ExternalDocumentation external_docs = 4; + // Unique string used to identify the operation. The id MUST be unique among + // all operations described in the API. Tools and libraries MAY use the + // operationId to uniquely identify an operation, therefore, it is recommended + // to follow common programming naming conventions. + string operation_id = 5; + // A list of MIME types the operation can consume. This overrides the consumes + // definition at the OpenAPI Object. An empty value MAY be used to clear the + // global definition. Value MUST be as described under Mime Types. + repeated string consumes = 6; + // A list of MIME types the operation can produce. This overrides the produces + // definition at the OpenAPI Object. An empty value MAY be used to clear the + // global definition. Value MUST be as described under Mime Types. + repeated string produces = 7; + // field 8 is reserved for 'parameters'. + reserved 8; + // The list of possible responses as they are returned from executing this + // operation. + map responses = 9; + // The transfer protocol for the operation. Values MUST be from the list: + // "http", "https", "ws", "wss". The value overrides the OpenAPI Object + // schemes definition. + repeated Scheme schemes = 10; + // Declares this operation to be deprecated. Usage of the declared operation + // should be refrained. Default value is false. + bool deprecated = 11; + // A declaration of which security schemes are applied for this operation. The + // list of values describes alternative security schemes that can be used + // (that is, there is a logical OR between the security requirements). This + // definition overrides any declared top-level security. To remove a top-level + // security declaration, an empty array can be used. + repeated SecurityRequirement security = 12; + // Custom properties that start with "x-" such as "x-foo" used to describe + // extra functionality that is not covered by the standard OpenAPI Specification. + // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + map extensions = 13; + // Custom parameters such as HTTP request headers. + // See: https://swagger.io/docs/specification/2-0/describing-parameters/ + // and https://swagger.io/specification/v2/#parameter-object. + Parameters parameters = 14; +} + +// `Parameters` is a representation of OpenAPI v2 specification's parameters object. +// Note: This technically breaks compatibility with the OpenAPI 2 definition structure as we only +// allow header parameters to be set here since we do not want users specifying custom non-header +// parameters beyond those inferred from the Protobuf schema. +// See: https://swagger.io/specification/v2/#parameter-object +message Parameters { + // `Headers` is one or more HTTP header parameter. + // See: https://swagger.io/docs/specification/2-0/describing-parameters/#header-parameters + repeated HeaderParameter headers = 1; +} + +// `HeaderParameter` a HTTP header parameter. +// See: https://swagger.io/specification/v2/#parameter-object +message HeaderParameter { + // `Type` is a a supported HTTP header type. + // See https://swagger.io/specification/v2/#parameterType. + enum Type { + UNKNOWN = 0; + STRING = 1; + NUMBER = 2; + INTEGER = 3; + BOOLEAN = 4; + } + + // `Name` is the header name. + string name = 1; + // `Description` is a short description of the header. + string description = 2; + // `Type` is the type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. + // See: https://swagger.io/specification/v2/#parameterType. + Type type = 3; + // `Format` The extending format for the previously mentioned type. + string format = 4; + // `Required` indicates if the header is optional + bool required = 5; + // field 6 is reserved for 'items', but in OpenAPI-specific way. + reserved 6; + // field 7 is reserved `Collection Format`. Determines the format of the array if type array is used. + reserved 7; +} + +// `Header` is a representation of OpenAPI v2 specification's Header object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject +// +message Header { + // `Description` is a short description of the header. + string description = 1; + // The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. + string type = 2; + // `Format` The extending format for the previously mentioned type. + string format = 3; + // field 4 is reserved for 'items', but in OpenAPI-specific way. + reserved 4; + // field 5 is reserved `Collection Format` Determines the format of the array if type array is used. + reserved 5; + // `Default` Declares the value of the header that the server will use if none is provided. + // See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. + // Unlike JSON Schema this value MUST conform to the defined type for the header. + string default = 6; + // field 7 is reserved for 'maximum'. + reserved 7; + // field 8 is reserved for 'exclusiveMaximum'. + reserved 8; + // field 9 is reserved for 'minimum'. + reserved 9; + // field 10 is reserved for 'exclusiveMinimum'. + reserved 10; + // field 11 is reserved for 'maxLength'. + reserved 11; + // field 12 is reserved for 'minLength'. + reserved 12; + // 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. + string pattern = 13; + // field 14 is reserved for 'maxItems'. + reserved 14; + // field 15 is reserved for 'minItems'. + reserved 15; + // field 16 is reserved for 'uniqueItems'. + reserved 16; + // field 17 is reserved for 'enum'. + reserved 17; + // field 18 is reserved for 'multipleOf'. + reserved 18; +} + +// `Response` is a representation of OpenAPI v2 specification's Response object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject +// +message Response { + // `Description` is a short description of the response. + // GFM syntax can be used for rich text representation. + string description = 1; + // `Schema` optionally defines the structure of the response. + // If `Schema` is not provided, it means there is no content to the response. + Schema schema = 2; + // `Headers` A list of headers that are sent with the response. + // `Header` name is expected to be a string in the canonical format of the MIME header key + // See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey + map headers = 3; + // `Examples` gives per-mimetype response examples. + // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object + map examples = 4; + // Custom properties that start with "x-" such as "x-foo" used to describe + // extra functionality that is not covered by the standard OpenAPI Specification. + // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + map extensions = 5; +} + +// `Info` is a representation of OpenAPI v2 specification's Info object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// title: "Echo API"; +// version: "1.0"; +// description: ""; +// contact: { +// name: "gRPC-Gateway project"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// email: "none@example.com"; +// }; +// license: { +// name: "BSD 3-Clause License"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE.txt"; +// }; +// }; +// ... +// }; +// +message Info { + // The title of the application. + string title = 1; + // A short description of the application. GFM syntax can be used for rich + // text representation. + string description = 2; + // The Terms of Service for the API. + string terms_of_service = 3; + // The contact information for the exposed API. + Contact contact = 4; + // The license information for the exposed API. + License license = 5; + // Provides the version of the application API (not to be confused + // with the specification version). + string version = 6; + // Custom properties that start with "x-" such as "x-foo" used to describe + // extra functionality that is not covered by the standard OpenAPI Specification. + // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + map extensions = 7; +} + +// `Contact` is a representation of OpenAPI v2 specification's Contact object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// ... +// contact: { +// name: "gRPC-Gateway project"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// email: "none@example.com"; +// }; +// ... +// }; +// ... +// }; +// +message Contact { + // The identifying name of the contact person/organization. + string name = 1; + // The URL pointing to the contact information. MUST be in the format of a + // URL. + string url = 2; + // The email address of the contact person/organization. MUST be in the format + // of an email address. + string email = 3; +} + +// `License` is a representation of OpenAPI v2 specification's License object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// info: { +// ... +// license: { +// name: "BSD 3-Clause License"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE.txt"; +// }; +// ... +// }; +// ... +// }; +// +message License { + // The license name used for the API. + string name = 1; + // A URL to the license used for the API. MUST be in the format of a URL. + string url = 2; +} + +// `ExternalDocumentation` is a representation of OpenAPI v2 specification's +// ExternalDocumentation object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject +// +// Example: +// +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { +// ... +// external_docs: { +// description: "More about gRPC-Gateway"; +// url: "https://github.com/grpc-ecosystem/grpc-gateway"; +// } +// ... +// }; +// +message ExternalDocumentation { + // A short description of the target documentation. GFM syntax can be used for + // rich text representation. + string description = 1; + // The URL for the target documentation. Value MUST be in the format + // of a URL. + string url = 2; +} + +// `Schema` is a representation of OpenAPI v2 specification's Schema object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject +// +message Schema { + JSONSchema json_schema = 1; + // Adds support for polymorphism. The discriminator is the schema property + // name that is used to differentiate between other schema that inherit this + // schema. The property name used MUST be defined at this schema and it MUST + // be in the required property list. When used, the value MUST be the name of + // this schema or any schema that inherits it. + string discriminator = 2; + // Relevant only for Schema "properties" definitions. Declares the property as + // "read only". This means that it MAY be sent as part of a response but MUST + // NOT be sent as part of the request. Properties marked as readOnly being + // true SHOULD NOT be in the required list of the defined schema. Default + // value is false. + bool read_only = 3; + // field 4 is reserved for 'xml'. + reserved 4; + // Additional external documentation for this schema. + ExternalDocumentation external_docs = 5; + // A free-form property to include an example of an instance for this schema in JSON. + // This is copied verbatim to the output. + string example = 6; +} + +// `JSONSchema` represents properties from JSON Schema taken, and as used, in +// the OpenAPI v2 spec. +// +// This includes changes made by OpenAPI v2. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject +// +// See also: https://cswr.github.io/JsonSchema/spec/basic_types/, +// https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json +// +// Example: +// +// message SimpleMessage { +// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { +// json_schema: { +// title: "SimpleMessage" +// description: "A simple message." +// required: ["id"] +// } +// }; +// +// // Id represents the message identifier. +// string id = 1; [ +// (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { +// description: "The unique identifier of the simple message." +// }]; +// } +// +message JSONSchema { + // field 1 is reserved for '$id', omitted from OpenAPI v2. + reserved 1; + // field 2 is reserved for '$schema', omitted from OpenAPI v2. + reserved 2; + // Ref is used to define an external reference to include in the message. + // This could be a fully qualified proto message reference, and that type must + // be imported into the protofile. If no message is identified, the Ref will + // be used verbatim in the output. + // For example: + // `ref: ".google.protobuf.Timestamp"`. + string ref = 3; + // field 4 is reserved for '$comment', omitted from OpenAPI v2. + reserved 4; + // The title of the schema. + string title = 5; + // A short description of the schema. + string description = 6; + string default = 7; + bool read_only = 8; + // A free-form property to include a JSON example of this field. This is copied + // verbatim to the output swagger.json. Quotes must be escaped. + // This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + string example = 9; + double multiple_of = 10; + // Maximum represents an inclusive upper limit for a numeric instance. The + // value of MUST be a number, + double maximum = 11; + bool exclusive_maximum = 12; + // minimum represents an inclusive lower limit for a numeric instance. The + // value of MUST be a number, + double minimum = 13; + bool exclusive_minimum = 14; + uint64 max_length = 15; + uint64 min_length = 16; + string pattern = 17; + // field 18 is reserved for 'additionalItems', omitted from OpenAPI v2. + reserved 18; + // field 19 is reserved for 'items', but in OpenAPI-specific way. + // TODO(ivucica): add 'items'? + reserved 19; + uint64 max_items = 20; + uint64 min_items = 21; + bool unique_items = 22; + // field 23 is reserved for 'contains', omitted from OpenAPI v2. + reserved 23; + uint64 max_properties = 24; + uint64 min_properties = 25; + repeated string required = 26; + // field 27 is reserved for 'additionalProperties', but in OpenAPI-specific + // way. TODO(ivucica): add 'additionalProperties'? + reserved 27; + // field 28 is reserved for 'definitions', omitted from OpenAPI v2. + reserved 28; + // field 29 is reserved for 'properties', but in OpenAPI-specific way. + // TODO(ivucica): add 'additionalProperties'? + reserved 29; + // following fields are reserved, as the properties have been omitted from + // OpenAPI v2: + // patternProperties, dependencies, propertyNames, const + reserved 30 to 33; + // Items in 'array' must be unique. + repeated string array = 34; + + enum JSONSchemaSimpleTypes { + UNKNOWN = 0; + ARRAY = 1; + BOOLEAN = 2; + INTEGER = 3; + NULL = 4; + NUMBER = 5; + OBJECT = 6; + STRING = 7; + } + + repeated JSONSchemaSimpleTypes type = 35; + // `Format` + string format = 36; + // following fields are reserved, as the properties have been omitted from + // OpenAPI v2: contentMediaType, contentEncoding, if, then, else + reserved 37 to 41; + // field 42 is reserved for 'allOf', but in OpenAPI-specific way. + // TODO(ivucica): add 'allOf'? + reserved 42; + // following fields are reserved, as the properties have been omitted from + // OpenAPI v2: + // anyOf, oneOf, not + reserved 43 to 45; + // Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 + repeated string enum = 46; + + // Additional field level properties used when generating the OpenAPI v2 file. + FieldConfiguration field_configuration = 1001; + + // 'FieldConfiguration' provides additional field level properties used when generating the OpenAPI v2 file. + // These properties are not defined by OpenAPIv2, but they are used to control the generation. + message FieldConfiguration { + // Alternative parameter name when used as path parameter. If set, this will + // be used as the complete parameter name when this field is used as a path + // parameter. Use this to avoid having auto generated path parameter names + // for overlapping paths. + string path_param_name = 47; + } + // Custom properties that start with "x-" such as "x-foo" used to describe + // extra functionality that is not covered by the standard OpenAPI Specification. + // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + map extensions = 48; +} + +// `Tag` is a representation of OpenAPI v2 specification's Tag object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject +// +message Tag { + // The name of the tag. Use it to allow override of the name of a + // global Tag object, then use that name to reference the tag throughout the + // OpenAPI file. + string name = 1; + // A short description for the tag. GFM syntax can be used for rich text + // representation. + string description = 2; + // Additional external documentation for this tag. + ExternalDocumentation external_docs = 3; + // Custom properties that start with "x-" such as "x-foo" used to describe + // extra functionality that is not covered by the standard OpenAPI Specification. + // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + map extensions = 4; +} + +// `SecurityDefinitions` is a representation of OpenAPI v2 specification's +// Security Definitions object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject +// +// A declaration of the security schemes available to be used in the +// specification. This does not enforce the security schemes on the operations +// and only serves to provide the relevant details for each scheme. +message SecurityDefinitions { + // A single security scheme definition, mapping a "name" to the scheme it + // defines. + map security = 1; +} + +// `SecurityScheme` is a representation of OpenAPI v2 specification's +// Security Scheme object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject +// +// Allows the definition of a security scheme that can be used by the +// operations. Supported schemes are basic authentication, an API key (either as +// a header or as a query parameter) and OAuth2's common flows (implicit, +// password, application and access code). +message SecurityScheme { + // The type of the security scheme. Valid values are "basic", + // "apiKey" or "oauth2". + enum Type { + TYPE_INVALID = 0; + TYPE_BASIC = 1; + TYPE_API_KEY = 2; + TYPE_OAUTH2 = 3; + } + + // The location of the API key. Valid values are "query" or "header". + enum In { + IN_INVALID = 0; + IN_QUERY = 1; + IN_HEADER = 2; + } + + // The flow used by the OAuth2 security scheme. Valid values are + // "implicit", "password", "application" or "accessCode". + enum Flow { + FLOW_INVALID = 0; + FLOW_IMPLICIT = 1; + FLOW_PASSWORD = 2; + FLOW_APPLICATION = 3; + FLOW_ACCESS_CODE = 4; + } + + // The type of the security scheme. Valid values are "basic", + // "apiKey" or "oauth2". + Type type = 1; + // A short description for security scheme. + string description = 2; + // The name of the header or query parameter to be used. + // Valid for apiKey. + string name = 3; + // The location of the API key. Valid values are "query" or + // "header". + // Valid for apiKey. + In in = 4; + // The flow used by the OAuth2 security scheme. Valid values are + // "implicit", "password", "application" or "accessCode". + // Valid for oauth2. + Flow flow = 5; + // The authorization URL to be used for this flow. This SHOULD be in + // the form of a URL. + // Valid for oauth2/implicit and oauth2/accessCode. + string authorization_url = 6; + // The token URL to be used for this flow. This SHOULD be in the + // form of a URL. + // Valid for oauth2/password, oauth2/application and oauth2/accessCode. + string token_url = 7; + // The available scopes for the OAuth2 security scheme. + // Valid for oauth2. + Scopes scopes = 8; + // Custom properties that start with "x-" such as "x-foo" used to describe + // extra functionality that is not covered by the standard OpenAPI Specification. + // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + map extensions = 9; +} + +// `SecurityRequirement` is a representation of OpenAPI v2 specification's +// Security Requirement object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject +// +// Lists the required security schemes to execute this operation. The object can +// have multiple security schemes declared in it which are all required (that +// is, there is a logical AND between the schemes). +// +// The name used for each property MUST correspond to a security scheme +// declared in the Security Definitions. +message SecurityRequirement { + // If the security scheme is of type "oauth2", then the value is a list of + // scope names required for the execution. For other security scheme types, + // the array MUST be empty. + message SecurityRequirementValue { + repeated string scope = 1; + } + // Each name must correspond to a security scheme which is declared in + // the Security Definitions. If the security scheme is of type "oauth2", + // then the value is a list of scope names required for the execution. + // For other security scheme types, the array MUST be empty. + map security_requirement = 1; +} + +// `Scopes` is a representation of OpenAPI v2 specification's Scopes object. +// +// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject +// +// Lists the available scopes for an OAuth2 security scheme. +message Scopes { + // Maps between a name of a scope to a short description of it (as the value + // of the property). + map scope = 1; +} diff --git a/zbook_backend/proto/rpcs/rpc_admin.proto b/zbook_backend/proto/rpcs/rpc_admin.proto new file mode 100644 index 0000000..13f0fe9 --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_admin.proto @@ -0,0 +1,174 @@ +syntax = "proto3"; + +package pb; +import "models/session.proto"; +import "models/comment_relation.proto"; +import "models/comment.proto"; +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.UpdateUserBlock +message UpdateUserBlockRequest { + string username = 1; + bool blocked = 2; +} +message UpdateUserBlockResponse { + bool blocked = 1; +} + +// 2.DeleteUser +message DeleteUserRequest { + string username = 1; +} +message DeleteUserResponse {} + +// 3.CreateSystemNotification +message CreateSystemNotificationRequest { + string username = 1; + string title = 2; + string contents = 3; + string redirect_url = 4; +} +message CreateSystemNotificationResponse {} + +// 4.UpdateCommentReportStatus +message UpdateCommentReportStatusRequest { + int64 report_id = 1; + bool processed = 2; +} +message UpdateCommentReportStatusResponse {} + +// 5.ListSession +message ListSessionRequest { + int32 page_id = 1; + int32 page_size = 2; + string query = 3; +} +message ListSessionResponse { + repeated SessionInfo elements = 1; +} + +// 6.GetListSessionCount +message GetListSessionCountRequest { + string query = 1; +} +message GetListSessionCountResponse { + int64 count = 1; +} + +// 7.ListComment +message ListCommentRequest { + int32 page_id = 1; + int32 page_size = 2; + string query = 3; +} +message ListCommentResponse { + repeated ListAdminCommentInfo elements = 1; +} + +// 8.GetListCommentCount +message GetListCommentCountRequest { + string query = 1; +} +message GetListCommentCountResponse { + int64 count = 1; +} + +// 9.ListCommentReport +message ListCommentReportRequest { + int32 page_id = 1; + int32 page_size = 2; + string query = 3; +} +message ListCommentReportResponse { + repeated ListCommentReportInfo elements = 1; +} + +// 10.GetListCommentReportCount +message GetListCommentReportCountRequest {} +message GetListCommentReportCountResponse { + int64 count = 1; +} + +// 11.GetDailyVisitorCount +message GetDailyVisitorCountRequest { + string time_zone = 1; + int32 ndays = 2; +} +message GetDailyVisitorCountResponse { + repeated string dates = 1; + repeated int32 counts = 2; +} + +// 12.GetDailyActiveUserCount +message GetDailyActiveUserCountRequest { + string time_zone = 1; + int32 ndays = 2; +} +message GetDailyActiveUserCountResponse { + repeated string dates = 1; + repeated int32 counts = 2; +} +// 13.GetDailyCreateUserCount +message GetDailyCreateUserCountRequest { + string time_zone = 1; + int32 ndays = 2; +} +message GetDailyCreateUserCountResponse { + repeated string dates = 1; + repeated int32 counts = 2; +} + +// 14.LogVisitor +message LogVisitorRequest {} + +message LogVisitorResponse {} + +message ParsedIPData { + string city = 1; + double lat = 2; + double long = 3; +} + +message Visitor { + string IP = 1; + string Agent = 2; + int32 Count = 3; + string city = 4; + double lat = 5; + double long = 6; +} + +// 16.GetDailyVisitors +message GetDailyVisitorsRequest { + int32 ndays = 1; + string lang = 2; +} + +message GetDailyVisitorsResponse { + repeated Visitor visitors = 1; +} + +// 17.GetConfiguration +message GetConfigurationRequest { + string config_name = 1; +} + +message GetConfigurationResponse { + bool config_value = 1; +} + +// 18.UpdateConfiguration +message UpdateConfigurationRequest { + string config_name = 1; + bool config_value = 2; +} + +message UpdateConfigurationResponse {} + +// 19.SendInvitation +message SendInvitationRequest { + string email = 1; +} +message SendInvitationResponse { + bool is_send = 1; +} \ No newline at end of file diff --git a/zbook_backend/proto/rpcs/rpc_comment.proto b/zbook_backend/proto/rpcs/rpc_comment.proto new file mode 100644 index 0000000..536cab8 --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_comment.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; +package pb; +import "models/comment.proto"; +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.CreateComment +message CreateCommentRequest { + int64 markdown_id = 1; + int64 parent_id = 2; + string comment_content = 3; +} + +message CreateCommentResponse { + CommentBasicInfo comment = 1; +} + +// 2.DeleteComment +message DeleteCommentRequest { + int64 comment_id = 1; +} +message DeleteCommentResponse {} + +// 3.ListCommentLevelOne +message ListCommentLevelOneRequest { + int64 markdown_id = 1; + int32 page_id = 2; + int32 page_size = 3; +} + +// 4.ListCommentLevelTwo +message ListCommentLevelTwoRequest { + int64 root_id = 1; + int32 page_id = 2; + int32 page_size = 3; +} + +message ListCommentLevelResponse { + repeated ListCommentInfo comments = 1; +} + +// 5.GetCommentCountInfo +message GetCommentCountInfoRequest { + int64 comment_id = 1; +} +message GetCommentCountInfoResponse { + CommentCountInfo comment_count_info = 1; +} + +// 3.GetListCommentLevelOneCount +message GetListCommentLevelOneCountRequest { + int64 markdown_id = 1; +} + +// 4.GetListCommentLevelTwoCount +message GetListCommentLevelTwoCountRequest { + int64 root_id = 1; +} + +message GetListCommentLevelCountResponse { + int64 count = 1; +} diff --git a/zbook_backend/proto/rpcs/rpc_comment_relation.proto b/zbook_backend/proto/rpcs/rpc_comment_relation.proto new file mode 100644 index 0000000..d04b9d8 --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_comment_relation.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package pb; +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.CreateCommentRelation +message CreateCommentRelationRequest { + int64 comment_id = 1; + string relation_type = 2; +} +message CreateCommentRelationResponse { + int64 like_id = 1; +} + +// 2.CreateCommentReport +message DeleteCommentRelationRequest { + int64 comment_id = 1; + string relation_type = 2; +} +message DeleteCommentRelationResponse {} + +// 3.DeleteCommentRelation +message CreateCommentReportRequest { + int64 comment_id = 1; + string report_content = 2; +} +message CreateCommentReportResponse { + int64 comment_id = 1; +} diff --git a/zbook_backend/proto/rpcs/rpc_follow.proto b/zbook_backend/proto/rpcs/rpc_follow.proto new file mode 100644 index 0000000..97f5237 --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_follow.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; + +package pb; + +import "models/follow.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.CreateFollow +message CreateFollowRequest { + string username = 1; +} +message CreateFollowResponse { + Follow follow = 1; +} + +// 2.GetFollowStatus +message GetFollowStatusRequest { + string username = 1; +} +message GetFollowStatusResponse { + bool is_following = 1; +} + +// 3.DeleteFollow +message DeleteFollowRequest { + string username = 1; +} +message DeleteFollowResponse { + Follow follow = 1; +} + +// 4.ListFollower +message ListFollowerRequest { + string username = 1; + int32 page_id = 2; + int32 page_size = 3; + string query = 4; +} +message ListFollowerResponse { + repeated ListFollowInfo elements = 1; +} + +// 5.GetFollowerCount +message GetFollowerCountRequest { + string username = 1; + string query = 2; +} +message GetFollowerCountResponse { + int64 count = 1; +} + +// 6.ListFollowing +message ListFollowingRequest { + string username = 1; + int32 page_id = 2; + int32 page_size = 3; + string query = 4; +} +message ListFollowingResponse { + repeated ListFollowInfo elements = 1; +} + +// 7.GetFollowingCount +message GetFollowingCountRequest { + string username = 1; + string query = 2; +} +message GetFollowingCountResponse { + int64 count = 1; +} diff --git a/zbook_backend/proto/rpcs/rpc_markdown.proto b/zbook_backend/proto/rpcs/rpc_markdown.proto new file mode 100644 index 0000000..ffe753f --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_markdown.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; + +package pb; +import "models/markdown.proto"; +import "google/protobuf/timestamp.proto"; +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.GetMarkdownContent +message GetMarkdownContentRequest { + string username = 1; + string repo_name = 2; + string relative_path = 3; +} +message GetMarkdownContentResponse { + Markdown markdown = 1; + string prev = 2; + string next = 3; + repeated FooterSocial footers = 4; + google.protobuf.Timestamp updated_at = 5; + string theme_color = 6; +} + +// 2.GetMarkdownImage +message GetMarkdownImageRequest { + string username = 1; + string repo_name = 2; + string file_path = 3; +} + +message GetMarkdownImageResponse { + bytes file = 1; +} + +// 3.QueryRepoMarkdown +message QueryRepoMarkdownRequest { + string username = 1; + string repo_name = 2; + string plain_to_tsquery = 3; + int32 page_id = 4; + int32 page_size = 5; +} +message QueryRepoMarkdownResponse { + repeated Markdown elements = 1; +} + +// 4.QueryUserMarkdown +message QueryUserMarkdownRequest { + string username = 1; + string plain_to_tsquery = 2; + int32 page_id = 3; + int32 page_size = 4; +} + +message QueryUserMarkdownResponse { + repeated Markdown elements = 1; +} +// 4.QueryMarkdown +message QueryMarkdownRequest { + string plain_to_tsquery = 1; + int32 page_id = 2; + int32 page_size = 3; +} + +message QueryMarkdownResponse { + repeated Markdown elements = 1; +} \ No newline at end of file diff --git a/zbook_backend/proto/rpcs/rpc_notification.proto b/zbook_backend/proto/rpcs/rpc_notification.proto new file mode 100644 index 0000000..c30e450 --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_notification.proto @@ -0,0 +1,101 @@ +syntax = "proto3"; + +package pb; +import "models/notification.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.ListFollowerNotification +message ListFollowerNotificationRequest { + int32 page_id = 1; + int32 page_size = 2; +} +message ListFollowerNotificationResponse { + repeated ListFollowerNotificationInfo notifications = 1; +} + +// 2.ListRepoNotification +message ListRepoNotificationRequest { + int32 page_id = 1; + int32 page_size = 2; +} +message ListRepoNotificationResponse { + repeated ListRepoNotificationInfo notifications = 1; +} + +// 3.ListCommentNotification +message ListCommentNotificationRequest { + int32 page_id = 1; + int32 page_size = 2; +} +message ListCommentNotificationResponse { + repeated ListCommentNotificationInfo notifications = 1; +} + +// 4.ListSystemNotification +message ListSystemNotificationRequest { + int32 page_id = 1; + int32 page_size = 2; +} +message ListSystemNotificationResponse { + repeated ListSystemNotificationInfo notifications = 1; +} + +// 5.MarkFollowerNotificationReaded +message MarkFollowerNotificationReadedRequest { + int64 noti_id = 1; +} + +// 6.MarkSystemNotificationReaded +message MarkSystemNotificationReadedRequest { + int64 noti_id = 1; +} + +// 7.MarkCommentNotificationReaded +message MarkCommentNotificationReadedRequest { + int64 noti_id = 1; +} + +// 8.MarkRepoNotificationReaded +message MarkRepoNotificationReadedRequest { + int64 noti_id = 1; +} +message SetNotiReadResponse {} + +// 9.GetUnReadCount +message GetUnReadCountRequest {} +message GetUnReadCountResponse { + int32 unread_count = 1; +} + +// 10.ResetUnreadCount +message ResetUnreadCountRequest {} +message ResetUnreadCountResponse {} + + +// 11.GetListFollowerNotificationUnreadedCount +message GetListFollowerNotificationUnreadedCountRequest { +} +message GetListFollowerNotificationUnreadedCountResponse { + int64 count = 1; +} +// 12.GetListRepoNotificationUnreadedCount +message GetListRepoNotificationUnreadedCountRequest { +} +message GetListRepoNotificationUnreadedCountResponse { + int64 count = 1; +} + +// 13.GetListCommentNotificationUnreadedCount +message GetListCommentNotificationUnreadedCountRequest { +} +message GetListCommentNotificationUnreadedCountResponse { + int64 count = 1; +} + +// 14.GetListSystemNotificationUnreadedCount +message GetListSystemNotificationUnreadedCountRequest { +} +message GetListSystemNotificationUnreadedCountResponse { + int64 count = 1; +} diff --git a/zbook_backend/proto/rpcs/rpc_oauth.proto b/zbook_backend/proto/rpcs/rpc_oauth.proto new file mode 100644 index 0000000..68be45b --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_oauth.proto @@ -0,0 +1,43 @@ + +syntax = "proto3"; + +package pb; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.CreateOAuthLink +message CreateOAuthLinkRequest { + string oauth_type = 1; + string app_id = 2; +} +message CreateOAuthLinkResponse {} + +// 2.CheckOAuthStatus +message CheckOAuthStatusRequest {} +message CheckOAuthStatusResponse { + bool github = 1; + bool google = 2; +} + +// 3.DeleteOAuthLink +message DeleteOAuthLinkRequest { + string oauth_type = 1; +} +message DeleteOAuthLinkResponse {} + +// 4.LoginByOAuth +message LoginByOAuthRequest { + string oauth_type = 1; + string app_id = 2; + string access_token = 3; +} + +message LoginByOAuthResponse { + string access_token = 1; + string refresh_token = 2; + string username = 3; + string role = 4; + google.protobuf.Timestamp access_token_expires_at = 5; + google.protobuf.Timestamp refresh_token_expires_at = 6; +} diff --git a/zbook_backend/proto/rpcs/rpc_repo.proto b/zbook_backend/proto/rpcs/rpc_repo.proto new file mode 100644 index 0000000..42eb5a1 --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_repo.proto @@ -0,0 +1,142 @@ +syntax = "proto3"; + +package pb; +import "models/repo.proto"; +import "google/protobuf/timestamp.proto"; +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.CreateRepo +message CreateRepoRequest { + string repo_name = 1; + string repo_description = 2; + string git_addr = 3; + string git_access_token = 4; + string sync_token = 5; + string visibility_level = 6; + string home_page = 7; + string theme_sidebar = 9; + string theme_color = 10; +} +message CreateRepoResponse {} + +// 2.GetRepoConfig +message GetRepoConfigRequest { + string username = 1; + string repo_name = 2; +} +message GetRepoConfigResponse { + string username = 1; + string config = 2; + string visibility_level = 3; + string theme_sidebar = 4; + string theme_color = 5; +} + +// 3.DeleteRepo +message DeleteRepoRequest { + string username = 1; + string repo_name = 2; +} +message DeleteRepoResponse {} + +// 4.ManualSyncRepo +message ManualSyncRepoRequest { + string username = 1; + string repo_name = 2; +} +message ManualSyncRepoResponse {} + +// 5.AutoSyncRepo +message AutoSyncRepoRequest { + string username = 1; + string repo_name = 2; + string sync_token = 3; +} +message AutoSyncRepoResponse {} + +// 6.UpdateRepoInfo +message UpdateRepoInfoRequest { + string username = 1; + string old_repo_name = 2; + string repo_name = 3; + string git_access_token = 4; + string repo_description = 5; + string visibility_level = 6; + string sync_token = 7; + string home_page = 8; + string theme_sidebar = 9; + string theme_color = 10; +} +message UpdateRepoInfoResponse {} + +// 7.GetRepoBasicInfo +message GetRepoBasicInfoRequest { + string username = 1; + string repo_name = 2; +} +message GetRepoBasicInfoResponse { + string repo_name = 2; + string username = 3; + string email = 4; + bytes avatar = 5; + string repo_description = 6; + google.protobuf.Timestamp updated_at = 7; + string home_page = 8; +} + +// 9.ListUserOwnRepo +message ListUserOwnRepoRequest { + string username = 1; + int32 page_id = 2; + int32 page_size = 3; + string query = 4; +} +message ListUserOwnRepoResponse { + repeated ListRepoInfo elements = 1; +} + +// 10.GetListUserOwnRepoCount +message GetListUserOwnRepoCountRequest { + string username = 1; + string query = 2; +} +message GetListUserOwnRepoCountResponse { + int64 count = 1; +} + +// 11.ListUserLikeRepo +message ListUserLikeRepoRequest { + string username = 1; + int32 page_id = 2; + int32 page_size = 3; + string query = 4; +} +message ListUserLikeRepoResponse { + repeated ListRepoInfo elements = 1; +} + +// 12.GetListUserLikeRepoCount +message GetListUserLikeRepoCountRequest { + string username = 1; + string query = 2; +} +message GetListUserLikeRepoCountResponse { + int64 count = 1; +} + +// 13.ListRepo +message ListRepoRequest { + int32 page_id = 1; + int32 page_size = 2; + string query = 3; +} +message ListRepoResponse { + repeated ListRepoInfo elements = 1; +} +// 14.GetListRepoCount +message GetListRepoCountRequest { + string query = 1; +} +message GetListRepoCountResponse { + int64 count = 1; +} \ No newline at end of file diff --git a/zbook_backend/proto/rpcs/rpc_repo_relation.proto b/zbook_backend/proto/rpcs/rpc_repo_relation.proto new file mode 100644 index 0000000..f18e08c --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_repo_relation.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package pb; +import "models/repo_relation.proto"; +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.CreateRepoRelation +message CreateRepoRelationRequest { + string username = 1; + string repo_name = 2; + string relation_type = 3; +} +message CreateRepoRelationResponse { + int64 like_id = 1; +} + +// 2.DeleteRepoRelation +message DeleteRepoRelationRequest { + string username = 1; + string repo_name = 2; + string relation_type = 3; +} +message DeleteRepoRelationResponse {} + +// 3.CreateRepoVisibility +message CreateRepoVisibilityRequest { + string repo_username = 1; + string repo_name = 2; + string username = 3; +} +message CreateRepoVisibilityResponse {} + +// 4.DeleteRepoVisibility +message DeleteRepoVisibilityRequest { + string repo_username = 1; + string repo_name = 2; + string username = 3; +} +message DeleteRepoVisibilityResponse {} + +// 5.ListRepoVisibility +message ListRepoVisibilityRequest { + int32 page_id = 1; + int32 page_size = 2; + string username = 3; + string repo_name = 4; + string query = 5; +} +message ListRepoVisibilityResponse { + repeated ListUserRepoVisiblityInfo elements = 1; +} + +// 6.GetRepoVisibilityCount +message GetRepoVisibilityCountRequest { + string username = 1; + string repo_name = 2; +} +message GetRepoVisibilityCountResponse { + int64 count = 1; +} diff --git a/zbook_backend/proto/rpcs/rpc_user.proto b/zbook_backend/proto/rpcs/rpc_user.proto new file mode 100644 index 0000000..e6204fb --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_user.proto @@ -0,0 +1,109 @@ +syntax = "proto3"; + +package pb; +import "google/protobuf/timestamp.proto"; +import "models/user.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.CreateUser +message CreateUserRequest { + string username = 1; + string password = 2; + string email = 3; + string invitation_url=4; +} +message CreateUserResponse {} + +// 2.LoginUser +message LoginUserRequest { + string email = 1; + string password = 2; +} + +message LoginUserResponse { + string username = 1; + string role = 2; + string access_token = 3; + string refresh_token = 4; + google.protobuf.Timestamp access_token_expires_at = 5; + google.protobuf.Timestamp refresh_token_expires_at = 6; +} + +// 3.UpdateUser +message UpdateUserRequest { + string motto = 1; + string password = 2; + bytes avatar = 3; +} +message UpdateUserResponse {} + +// 4.UpdateUserOnBoarding +message UpdateUserOnBoardingRequest { + bool onboarding = 1; +} +message UpdateUserOnBoardingResponse { + bool onboarding = 1; +} + +// 5.QueryUser +message QueryUserRequest { + int32 page_id = 1; + int32 page_size = 2; + string query = 3; +} +message QueryUserResponse { + repeated ListUserInfo elements = 1; +} + +// 6.GetUserInfo +message GetUserInfoRequest { + string username = 1; + bool user_count = 2; + bool user_basic = 3; + bool user_image = 4; +} + +message GetUserInfoResponse { + UserCountInfo user_count_info = 1; + UserBasicInfo user_basic_info = 2; + UserImageInfo user_image_info = 3; +} + +// 7.GetUserAvatar +message GetUserAvatarRequest { + string username = 1; +} + +message GetUserAvatarResponse { + bytes avatar = 1; +} + +// 8.ListUser +message ListUserRequest { + int32 page_id = 1; + int32 page_size = 2; + string query = 3; +} + +message ListUserResponse { + repeated ListUserInfo elements = 1; +} + +// 9.GetListUserCount +message GetListUserCountRequest { + string query = 1; +} + +message GetListUserCountResponse { + int64 count = 1; +} + +// 10.GetQueryUserCount +message GetQueryUserCountRequest { + string query = 1; +} + +message GetQueryUserCountResponse { + int64 count = 1; +} diff --git a/zbook_backend/proto/rpcs/rpc_verification.proto b/zbook_backend/proto/rpcs/rpc_verification.proto new file mode 100644 index 0000000..edd7481 --- /dev/null +++ b/zbook_backend/proto/rpcs/rpc_verification.proto @@ -0,0 +1,50 @@ +syntax = "proto3"; + +package pb; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/zizdlp/zbook/pb/rpcs"; + +// 1.VerifyEmail +message VerifyEmailRequest { + string verification_url = 1; +} +message VerifyEmailResponse { + bool is_verified = 1; +} + +// 2.ResetPassword +message ResetPasswordRequest { + string verification_url = 1; + string password = 2; + string email = 3; +} +message ResetPasswordResponse { + bool is_reset = 1; +} + +// 3.SendEmailToResetPassword +message SendEmailToResetPasswordRequest { + string email = 1; +} +message SendEmailToResetPasswordResponse { + bool is_send = 1; +} + +// 4.SendEmailToVerifyEmail +message SendEmailToVerifyEmailRequest { + string email = 1; +} +message SendEmailToVerifyEmailResponse { + bool is_send = 1; +} + +// 5.RefreshToken +message RefreshTokenRequest { + string refresh_token = 1; +} + +message RefreshTokenResponse { + string access_token = 1; + google.protobuf.Timestamp access_token_expires_at = 2; +} diff --git a/zbook_backend/proto/service_zbook_admin.proto b/zbook_backend/proto/service_zbook_admin.proto new file mode 100644 index 0000000..9ce952d --- /dev/null +++ b/zbook_backend/proto/service_zbook_admin.proto @@ -0,0 +1,280 @@ +// clang-format off +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; + +import "rpcs/rpc_admin.proto"; + +import "protoc-gen-openapiv2/options/annotations.proto"; +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { title: "zbook api"; + version: "0.1"; + contact: { + name: + "zizdlp.com"; + url: + "https://github.com/zizdlp/zbook"; + email: + "zizdlp@gmail.com"; + }; + }; +}; +service ZBookAdmin { + // 1.UpdateUserBlock + rpc UpdateUserBlock(UpdateUserBlockRequest) returns (UpdateUserBlockResponse) { + option (google.api.http) = { + post: "/v1/update_user_block", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to ban user"; + summary: "ban user"; + }; + }; + // 2.DeleteUser + rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) { + option (google.api.http) = { + post: "/v1/delete_user", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to ban user"; + summary: "ban user"; + }; + }; + +// 3.CreateSystemNotification +rpc CreateSystemNotification(CreateSystemNotificationRequest) + returns (CreateSystemNotificationResponse) { + option (google.api.http) = { + post: "/v1/create_system_notification", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to create system noti"; +summary: + "create system noti"; +}; +} +; + +// 4.UpdateCommentReportStatus +rpc UpdateCommentReportStatus(UpdateCommentReportStatusRequest) + returns (UpdateCommentReportStatusResponse) { + option (google.api.http) = { + post: "/v1/update_comment_report_status", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to ban user"; +summary: + " list user"; +}; +} +; + +// 5.ListSession +rpc ListSession(ListSessionRequest) + returns (ListSessionResponse) { + option (google.api.http) = { + post: "/v1/list_session", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list active session"; +summary: + "list active session"; +}; +} +; + +// 6.GetListSessionCount +rpc GetListSessionCount(GetListSessionCountRequest) + returns (GetListSessionCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_session_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to GetSessionCountRequest"; +summary: + "GetSessionCountRequest"; +}; +} +; + +// 7.ListComment +rpc ListComment(ListCommentRequest) returns (ListCommentResponse) { + option (google.api.http) = { + post: "/v1/list_comment", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list_repo_report"; +summary: + "list_repo_report"; +}; +} +; + +// 8.GetListCommentCount +rpc GetListCommentCount(GetListCommentCountRequest) + returns (GetListCommentCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_comment_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to GetUserPrivateCountResponse"; +summary: + "GetUserPrivateCountResponse"; +}; +} +; + +// 9.ListCommentReport +rpc ListCommentReport(ListCommentReportRequest) + returns (ListCommentReportResponse) { + option (google.api.http) = { + post: "/v1/list_comment_report", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list_all_comment_report"; +summary: + "list_comment_report"; +}; +} +; + +// 10.GetListCommentReportCount +rpc GetListCommentReportCount(GetListCommentReportCountRequest) + returns (GetListCommentReportCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_comment_report_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to GetListCommentReportCountRequest"; +summary: + "GetListCommentReportCountRequest"; +}; +} +; + +// 11.GetDailyVisitorCount +rpc GetDailyVisitorCount(GetDailyVisitorCountRequest) + returns (GetDailyVisitorCountResponse) { + option (google.api.http) = { + post: "/v1/get_daily_visitor_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get details of user"; +summary: + "get details of user"; +}; +} +; + +// 12.GetDailyActiveUserCount +rpc GetDailyActiveUserCount(GetDailyActiveUserCountRequest) + returns (GetDailyActiveUserCountResponse) { + option (google.api.http) = { + post: "/v1/get_daily_active_user_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get details of user"; +summary: + "get details of user"; +}; +} +; + +// 13.GetDailyCreateUserCount +rpc GetDailyCreateUserCount(GetDailyCreateUserCountRequest) + returns (GetDailyCreateUserCountResponse) { + option (google.api.http) = { + post: "/v1/get_daily_create_user_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get details of user"; +summary: + "get details of user"; +}; +} +; +// 14.LogVisitor +rpc LogVisitor(LogVisitorRequest) returns (LogVisitorResponse) { + option (google.api.http) = { + post: "/v1/log_visitor", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get details of user"; +summary: + "get details of user"; +}; +} +; + +// 16.GetDailyVisitors +rpc GetDailyVisitors(GetDailyVisitorsRequest) returns (GetDailyVisitorsResponse) { + option (google.api.http) = { + post: "/v1/get_daily_visitors", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to parse ip"; +summary: + "parse ip"; +}; +} +; +// 17.GetConfiguration +rpc GetConfiguration(GetConfigurationRequest) returns (GetConfigurationResponse) { + option (google.api.http) = { + post: "/v1/get_configuration", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get configuration"; +summary: + "parse ip"; +}; +} +; +// 18.UpdateConfiguration +rpc UpdateConfiguration(UpdateConfigurationRequest) returns (UpdateConfigurationResponse) { + option (google.api.http) = { + post: "/v1/update_configuration", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to parse ip"; +summary: + "parse ip"; +}; +} +; + +// 19.SendInvitation +rpc SendInvitation(SendInvitationRequest) + returns (SendInvitationResponse) { + option (google.api.http) = { + post: "/v1/create_invitation", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to send invitation"; +summary: + "send invitation"; +}; +} +; +} diff --git a/zbook_backend/proto/service_zbook_comment.proto b/zbook_backend/proto/service_zbook_comment.proto new file mode 100644 index 0000000..6d9b92d --- /dev/null +++ b/zbook_backend/proto/service_zbook_comment.proto @@ -0,0 +1,109 @@ +// clang-format off +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_comment.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { + title: "zbook api"; + version: "0.1"; + contact: { + name: + "zizdlp.com"; + url: + "https://github.com/zizdlp/zbook"; + email: + "zizdlp@gmail.com"; + }; + }; +}; +service ZBookComment { + // 1.CreateComment + rpc CreateComment(CreateCommentRequest) returns (CreateCommentResponse) { + option (google.api.http) = { + post: "/v1/create_comment", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "创建评论"; + summary: "创建一级评论"; + }; + }; + + // 2.DeleteComment + rpc DeleteComment(DeleteCommentRequest) returns (DeleteCommentResponse) { + option (google.api.http) = { + post: "/v1/delete_comment", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to delete comment"; + summary: "delete comment"; + }; + }; + + // 3.ListCommentLevelOne + rpc ListCommentLevelOne(ListCommentLevelOneRequest) returns (ListCommentLevelResponse) { + option (google.api.http) = { + post: "/v1/list_comment_level_one", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list level one comment"; + summary: "list level one comment"; + }; + }; + + // 4.ListCommentLevelTwo + rpc ListCommentLevelTwo(ListCommentLevelTwoRequest) returns (ListCommentLevelResponse) { + option (google.api.http) = { + post: "/v1/list_comment_level_two", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list_comment_level_two"; + summary: "list_comment_level_two"; + }; + }; + + // 5.GetCommentCountInfo + rpc GetCommentCountInfo(GetCommentCountInfoRequest) returns (GetCommentCountInfoResponse) { + option (google.api.http) = { + post: "/v1/get_comment_count_info", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get count info of comment"; + summary: "get details of comment"; + }; + }; + + // 3.GetListCommentLevelOneCount + rpc GetListCommentLevelOneCount(GetListCommentLevelOneCountRequest) returns (GetListCommentLevelCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_comment_level_one_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list level one comment"; + summary: "list level one comment"; + }; + }; + + // 4.GetListCommentLevelTwoCount + rpc GetListCommentLevelTwoCount(GetListCommentLevelTwoCountRequest) returns (GetListCommentLevelCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_comment_level_two_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list_comment_level_two"; + summary: "list_comment_level_two"; + }; + }; +} diff --git a/zbook_backend/proto/service_zbook_comment_relation.proto b/zbook_backend/proto/service_zbook_comment_relation.proto new file mode 100644 index 0000000..837f84c --- /dev/null +++ b/zbook_backend/proto/service_zbook_comment_relation.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_comment_relation.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { title: "zbook api"; +version: "0.1"; +contact: { +name: + "zizdlp.com"; +url: + "https://github.com/zizdlp/zbook"; +email: + "zizdlp@gmail.com"; +}; +} +; +} +; +service ZBookCommentRelation { + // 1.CreateCommentRelation + rpc CreateCommentRelation(CreateCommentRelationRequest) + returns (CreateCommentRelationResponse) { + option (google.api.http) = { + post: "/v1/create_comment_relation", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to create like on comment"; + summary: + "create like on comment"; + }; +}; + +// 2.CreateCommentReport +rpc CreateCommentReport(CreateCommentReportRequest) + returns (CreateCommentReportResponse) { + option (google.api.http) = { + post: "/v1/create_comment_report", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to create report on comment"; +summary: + "create report on comment"; +}; +} +; +// 3.DeleteCommentRelation +rpc DeleteCommentRelation(DeleteCommentRelationRequest) + returns (DeleteCommentRelationResponse) { + option (google.api.http) = { + post: "/v1/delete_comment_relation", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to delete like on comment"; +summary: + "delete like on comment"; +}; +} +; +} diff --git a/zbook_backend/proto/service_zbook_follow.proto b/zbook_backend/proto/service_zbook_follow.proto new file mode 100644 index 0000000..d517592 --- /dev/null +++ b/zbook_backend/proto/service_zbook_follow.proto @@ -0,0 +1,121 @@ +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_follow.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { title: "zbook api"; +version: "0.1"; +contact: { +name: + "zizdlp.com"; +url: + "https://github.com/zizdlp/zbook"; +email: + "zizdlp@gmail.com"; +}; +} +; +} +; +service ZBookFollow { + // 1.CreateFollow + rpc CreateFollow(CreateFollowRequest) returns (CreateFollowResponse) { + option (google.api.http) = { + post: "/v1/create_follow", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to create follow relation between two user"; + summary: + "CreateFollow"; + }; +}; + +// 2.GetFollowStatus +rpc GetFollowStatus(GetFollowStatusRequest) returns (GetFollowStatusResponse) { + option (google.api.http) = { + post: "/v1/get_follow_status", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get details of user"; +summary: + "get details of user"; +}; +} +; + +// 3.DeleteFollow +rpc DeleteFollow(DeleteFollowRequest) returns (DeleteFollowResponse) { + option (google.api.http) = { + post: "/v1/delete_follow", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to delete follow"; +summary: + "delete follow"; +}; +} +; +// 4.ListFollower +rpc ListFollower(ListFollowerRequest) returns (ListFollowerResponse) { + option (google.api.http) = { + post: "/v1/list_follower", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list follower of user"; +summary: + "list follower of user"; +}; +} +; +// 5. +rpc GetFollowerCount(GetFollowerCountRequest) + returns (GetFollowerCountResponse) { + option (google.api.http) = { + post: "/v1/get_follower_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list follower of user"; +summary: + "list follower of user"; +}; +} +; +// 6.ListFollowing +rpc ListFollowing(ListFollowingRequest) returns (ListFollowingResponse) { + option (google.api.http) = { + post: "/v1/list_following", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list following of user"; +summary: + "list following of user"; +}; +} +; + +// 7.GetFollowingCount +rpc GetFollowingCount(GetFollowingCountRequest) + returns (GetFollowingCountResponse) { + option (google.api.http) = { + post: "/v1/get_following_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list follower of user"; +summary: + "list following of user"; +}; +} +; +} diff --git a/zbook_backend/proto/service_zbook_markdown.proto b/zbook_backend/proto/service_zbook_markdown.proto new file mode 100644 index 0000000..915a798 --- /dev/null +++ b/zbook_backend/proto/service_zbook_markdown.proto @@ -0,0 +1,98 @@ + +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_markdown.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { title: "image api"; +version: "0.1"; +contact: { +name: + "zizdlp.com"; +url: + "https://github.com/zizdlp/zbook"; +email: + "zizdlp@gmail.com"; +}; +} +; +} +; +service ZBookMarkdown { + // 1.GetMarkdownContent + rpc GetMarkdownContent(GetMarkdownContentRequest) + returns (GetMarkdownContentResponse) { + option (google.api.http) = { + post: "/v1/get_markdown_content", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get markdown"; + summary: + "get markdown"; + }; +}; + +// 2.GetMarkdownImage +rpc GetMarkdownImage(GetMarkdownImageRequest) + returns (GetMarkdownImageResponse) { + option (google.api.http) = { + post: "/v1/get_markdown_image", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "获取markdown image"; +summary: + "获取markdown image"; +}; +} +; + +// 3.QueryRepoMarkdown +rpc QueryRepoMarkdown(QueryRepoMarkdownRequest) + returns (QueryRepoMarkdownResponse) { + option (google.api.http) = { + post: "/v1/query_repo_markdown", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to query markdown repo"; +summary: + "query markdown repo"; +}; +} +; + +// 4.QueryUserMarkdown +rpc QueryUserMarkdown(QueryUserMarkdownRequest) + returns (QueryUserMarkdownResponse) { + option (google.api.http) = { + post: "/v1/query_user_markdown", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to query markdown user"; +summary: + "query markdown user"; +}; +} +; +// 5.QueryMarkdown +rpc QueryMarkdown(QueryMarkdownRequest) returns (QueryMarkdownResponse) { + option (google.api.http) = { + post: "/v1/query_markdown", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to query markdown"; +summary: + "query markdown"; +}; +} +; +} diff --git a/zbook_backend/proto/service_zbook_notification.proto b/zbook_backend/proto/service_zbook_notification.proto new file mode 100644 index 0000000..2c8596e --- /dev/null +++ b/zbook_backend/proto/service_zbook_notification.proto @@ -0,0 +1,192 @@ +// clang-format off +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_notification.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { + title: "zbook api"; + version: "0.1"; + contact: { + name: + "zizdlp.com"; + url: + "https://github.com/zizdlp/zbook"; + email: + "zizdlp@gmail.com"; + }; + }; +}; +service ZBookNotification { + // 1.ListFollowerNotification + rpc ListFollowerNotification(ListFollowerNotificationRequest) returns (ListFollowerNotificationResponse) { + option (google.api.http) = { + post: "/v1/list_follower_notification", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户的关注者通知归属信息"; + summary: "分页列出指定用户的关注者通知归属信息"; + }; + }; + + // 2.ListRepoNotification + rpc ListRepoNotification(ListRepoNotificationRequest) returns (ListRepoNotificationResponse) { + option (google.api.http) = { + post: "/v1/list_repo_notification", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户的帖子通知归属信息"; + summary: "分页列出指定用户的帖子通知归属信息"; + }; + }; + + // 3.ListCommentNotification + rpc ListCommentNotification(ListCommentNotificationRequest) returns (ListCommentNotificationResponse) { + option (google.api.http) = { + post: "/v1/list_comment_notification", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户的评论通知归属信息"; + summary: "分页列出指定用户的评论通知归属信息"; + }; + }; + + // 4.ListSystemNotification + rpc ListSystemNotification(ListSystemNotificationRequest) returns (ListSystemNotificationResponse) { + option (google.api.http) = { + post: "/v1/list_system_notification", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页获取指定用户的系统通知"; + summary: "分页获取指定用户的系统通知"; + }; + }; + + // 5.MarkFollowerNotificationReaded + rpc MarkFollowerNotificationReaded(MarkFollowerNotificationReadedRequest) returns (SetNotiReadResponse) { + option (google.api.http) = { + post: "/v1/mark_follower_notification_readed", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to set_follower_noti_read"; + summary: "mark_follower_notification_readed"; + }; + }; + + // 6.MarkSystemNotificationReaded + rpc MarkSystemNotificationReaded(MarkSystemNotificationReadedRequest) returns (SetNotiReadResponse) { + option (google.api.http) = { + post: "/v1/mark_system_notification_readed", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to set_system_noti_read"; + summary: "set_system_noti_read"; + }; + }; + + // 7.MarkCommentNotificationReaded + rpc MarkCommentNotificationReaded(MarkCommentNotificationReadedRequest) returns (SetNotiReadResponse) { + option (google.api.http) = { + post: "/v1/mark_comment_notification_readed", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to set_comment_noti_read"; + summary: "set_comment_noti_read"; + }; + }; + + // 8.MarkRepoNotificationReaded + rpc MarkRepoNotificationReaded(MarkRepoNotificationReadedRequest) returns (SetNotiReadResponse) { + option (google.api.http) = { + post: "/v1/mark_repo_notification_readed", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to set_image_noti_read"; + summary: "set_image_noti_read"; + }; + }; + + // 9.GetUnReadCount + rpc GetUnReadCount(GetUnReadCountRequest) returns (GetUnReadCountResponse) { + option (google.api.http) = { + post: "/v1/get_unread_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get_unread_count"; + summary: "get_unread_count"; + }; + }; + + // 10.ResetUnreadCount + rpc ResetUnreadCount(ResetUnreadCountRequest) returns (ResetUnreadCountResponse) { + option (google.api.http) = { + post: "/v1/reset_unread_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to reset_unread_count"; + summary: "reset_unread_count"; + }; + }; + // 11.GetListFollowerNotificationUnreadedCount + rpc GetListFollowerNotificationUnreadedCount(GetListFollowerNotificationUnreadedCountRequest) returns (GetListFollowerNotificationUnreadedCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_follower_notification_unreaded_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户的关注者通知归属信息"; + summary: "分页列出指定用户的关注者通知归属信息"; + }; + }; + + // 12.GetListRepoNotificationUnreadedCount + rpc GetListRepoNotificationUnreadedCount(GetListRepoNotificationUnreadedCountRequest) returns (GetListRepoNotificationUnreadedCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_repo_notification_unreaded_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户的帖子通知归属信息"; + summary: "分页列出指定用户的帖子通知归属信息"; + }; + }; + + // 13.GetListCommentNotificationUnreadedCount + rpc GetListCommentNotificationUnreadedCount(GetListCommentNotificationUnreadedCountRequest) returns (GetListCommentNotificationUnreadedCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_comment_notification_unreaded_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户的评论通知归属信息"; + summary: "分页列出指定用户的评论通知归属信息"; + }; + }; + + // 14.GetListSystemNotificationUnreadedCount + rpc GetListSystemNotificationUnreadedCount(GetListSystemNotificationUnreadedCountRequest) returns (GetListSystemNotificationUnreadedCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_system_notification_unreaded_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页获取指定用户的系统通知"; + summary: "分页获取指定用户的系统通知"; + }; + }; +} diff --git a/zbook_backend/proto/service_zbook_oauth.proto b/zbook_backend/proto/service_zbook_oauth.proto new file mode 100644 index 0000000..8404006 --- /dev/null +++ b/zbook_backend/proto/service_zbook_oauth.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_oauth.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info : {title : "zbook api"; +version : "0.1"; +contact : { +name: + "zizdlp.com"; +url: + "https://github.com/zizdlp/zbook"; +email: + "zizdlp@gmail.com"; +}; +} +; +} +; +service ZBookOAuth { + + // 1.CreateOAuthLink + rpc CreateOAuthLink(CreateOAuthLinkRequest) + returns (CreateOAuthLinkResponse) { + option (google.api.http) = { + post : "/v1/create_oauth_link", + body : "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description : "Use this api to create new oauth user"; + summary: + "create new oauth user"; + }; +}; + +// 2.CheckOAuthStatus +rpc CheckOAuthStatus(CheckOAuthStatusRequest) + returns (CheckOAuthStatusResponse) { + option (google.api.http) = { + post : "/v1/check_oauth_status", + body : "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description : "Use this api to check oauth status"; +summary: + "check oauth status"; +}; +} +; + +// 3.DeleteOAuthLink +rpc DeleteOAuthLink(DeleteOAuthLinkRequest) returns (DeleteOAuthLinkResponse) { + option (google.api.http) = { + post : "/v1/delete_oauth_link", + body : "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description : "Use this api to delete oauth user"; +summary: + "delete oauth user"; +}; +} +; + +// 4.LoginByOAuth +rpc LoginByOAuth(LoginByOAuthRequest) returns (LoginByOAuthResponse) { + option (google.api.http) = { + post : "/v1/login_by_oauth", + body : "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description : "Use this api to login oauth user"; +summary: + "login oauth user"; +}; +} +; +} diff --git a/zbook_backend/proto/service_zbook_repo.proto b/zbook_backend/proto/service_zbook_repo.proto new file mode 100644 index 0000000..186420e --- /dev/null +++ b/zbook_backend/proto/service_zbook_repo.proto @@ -0,0 +1,210 @@ +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_repo.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { title: "zbook api"; +version: "0.1"; +contact: { +name: + "zizdlp.com"; +url: + "https://github.com/zizdlp/zbook"; +email: + "zizdlp@gmail.com"; +}; +} +; +} +; +service ZBookRepo { + // 1.CreateRepo + rpc CreateRepo(CreateRepoRequest) returns (CreateRepoResponse) { + option (google.api.http) = { + post: "/v1/create_repo", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to create repo"; + summary: + "create repo"; + }; +}; + +// 2.GetRepoConfig +rpc GetRepoConfig(GetRepoConfigRequest) returns (GetRepoConfigResponse) { + option (google.api.http) = { + post: "/v1/get_repo_config", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get repo config"; +summary: + "get repo config"; +}; +} +; + +// 3.DeleteRepo +rpc DeleteRepo(DeleteRepoRequest) returns (DeleteRepoResponse) { + option (google.api.http) = { + post: "/v1/delete_repo", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to delete repo"; +summary: + "delete repo"; +}; +} +; + +// 4.ManualSyncRepo +rpc ManualSyncRepo(ManualSyncRepoRequest) returns (ManualSyncRepoResponse) { + option (google.api.http) = { + post: "/v1/manual_sync_repo", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "手动与远端同步仓库"; +summary: + "手动与远端同步仓库"; +}; +} +; + +// 5.AutoSyncRepo +rpc AutoSyncRepo(AutoSyncRepoRequest) returns (AutoSyncRepoResponse) { + option (google.api.http) = { + post: "/v1/auto_sync_repo", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "自动远端同步仓库"; +summary: + "自动远端同步仓库"; +}; +} +; + +// 6.UpdateRepoInfo +rpc UpdateRepoInfo(UpdateRepoInfoRequest) returns (UpdateRepoInfoResponse) { + option (google.api.http) = { + post: "/v1/update_repo_info", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to update repo"; +summary: + "update repo"; +}; +} +; + +// 7.GetRepoBasicInfo +rpc GetRepoBasicInfo(GetRepoBasicInfoRequest) + returns (GetRepoBasicInfoResponse) { + option (google.api.http) = { + post: "/v1/get_repo_basic_info", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get repo info"; +summary: + "get repo info"; +}; +} +; + +// 9.ListUserOwnRepo +rpc ListUserOwnRepo(ListUserOwnRepoRequest) returns (ListUserOwnRepoResponse) { + option (google.api.http) = { + post: "/v1/list_user_own_repo", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户创建帖子的归属信息"; +summary: + "列出用户创建帖子的归属信息"; +}; +} +; + +// 10.GetListUserOwnRepoCount +rpc GetListUserOwnRepoCount(GetListUserOwnRepoCountRequest) + returns (GetListUserOwnRepoCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_user_own_repo_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户创建帖子的归属信息"; +summary: + "列出用户创建帖子的归属信息"; +}; +} +; + +// 11.ListUserLikeRepo +rpc ListUserLikeRepo(ListUserLikeRepoRequest) + returns (ListUserLikeRepoResponse) { + option (google.api.http) = { + post: "/v1/list_user_like_repo", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户喜欢可见帖子的归属信息"; +summary: + "列出用户可见喜欢帖子归属信息"; +}; +} +; + +// 12.GetListUserLikeRepoCount +rpc GetListUserLikeRepoCount(GetListUserLikeRepoCountRequest) + returns (GetListUserLikeRepoCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_user_like_repo_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户创建帖子的归属信息"; +summary: + "列出用户创建帖子的归属信息"; +}; +} +; + +// 13.ListRepo +rpc ListRepo(ListRepoRequest) returns (ListRepoResponse) { + option (google.api.http) = { + post: "/v1/list_repo", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list_repo_private"; +summary: + "list_repo"; +}; +} +; +// 14.GetListRepoCount +rpc GetListRepoCount(GetListRepoCountRequest) + returns (GetListRepoCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_repo_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list_repo_private"; +summary: + "get_repo_count"; +}; +} +; +} diff --git a/zbook_backend/proto/service_zbook_repo_relation.proto b/zbook_backend/proto/service_zbook_repo_relation.proto new file mode 100644 index 0000000..29ab1b9 --- /dev/null +++ b/zbook_backend/proto/service_zbook_repo_relation.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_repo_relation.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { title: "image repo relation api"; +version: "0.1"; +contact: { +name: + "zizdlp.com"; +url: + "https://github.com/zizdlp/zbook"; +email: + "zizdlp@gmail.com"; +}; +} +; +} +; + +service ZBookRepoRelation { + // 1.CreateRepoRelation + rpc CreateRepoRelation(CreateRepoRelationRequest) + returns (CreateRepoRelationResponse) { + option (google.api.http) = { + post: "/v1/create_repo_relation", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to create like on repo"; + summary: + "create like on repo"; + }; +}; +// 2.DeleteRepoRelation +rpc DeleteRepoRelation(DeleteRepoRelationRequest) + returns (DeleteRepoRelationResponse) { + option (google.api.http) = { + post: "/v1/delete_repo_relation", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to delete like on repo"; +summary: + "delete like on repo"; +}; +} +; + + +// 3.CreateRepoVisibility +rpc CreateRepoVisibility(CreateRepoVisibilityRequest) + returns (CreateRepoVisibilityResponse) { + option (google.api.http) = { + post: "/v1/create_repo_visibility", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户创建帖子的归属信息"; +summary: + "列出用户创建帖子的归属信息"; +}; +} +; + +// 4.DeleteRepoVisibility +rpc DeleteRepoVisibility(DeleteRepoVisibilityRequest) + returns (DeleteRepoVisibilityResponse) { + option (google.api.http) = { + post: "/v1/delete_repo_visibility", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户创建帖子的归属信息"; +summary: + "列出用户创建帖子的归属信息"; +}; +} +; + +// 5.ListRepoVisibility +rpc ListRepoVisibility(ListRepoVisibilityRequest) + returns (ListRepoVisibilityResponse) { + option (google.api.http) = { + post: "/v1/list_repo_visibility", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户创建帖子的归属信息"; +summary: + "列出用户创建帖子的归属信息"; +}; +} +; + +// 6.GetRepoVisibilityCount +rpc GetRepoVisibilityCount(GetRepoVisibilityCountRequest) + returns (GetRepoVisibilityCountResponse) { + option (google.api.http) = { + post: "/v1/get_repo_visibility_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "分页列出指定用户创建帖子的归属信息"; +summary: + "列出用户创建帖子的归属信息"; +}; +} +; +} diff --git a/zbook_backend/proto/service_zbook_user.proto b/zbook_backend/proto/service_zbook_user.proto new file mode 100644 index 0000000..c288188 --- /dev/null +++ b/zbook_backend/proto/service_zbook_user.proto @@ -0,0 +1,165 @@ +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_user.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { title: "zbook api"; +version: "0.1"; +contact: { +name: + "zizdlp.com"; +url: + "https://github.com/zizdlp/zbook"; +email: + "zizdlp@gmail.com"; +}; +} +; +} +; +service ZBookUser { + // 1.CreateUser + rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) { + option (google.api.http) = { + post: "/v1/create_user", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to create new user"; + summary: + "create new user"; + }; +}; + +// 2.LoginUser +rpc LoginUser(LoginUserRequest) returns (LoginUserResponse) { + option (google.api.http) = { + post: "/v1/login_user", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to login user"; +summary: + "login user"; +}; +} +; + +// 3.UpdateUser +rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) { + option (google.api.http) = { + post: "/v1/update_user", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to update user"; +summary: + " update user"; +}; +} +; + +// 4.UpdateUserOnBoarding +rpc UpdateUserOnBoarding(UpdateUserOnBoardingRequest) + returns (UpdateUserOnBoardingResponse) { + option (google.api.http) = { + post: "/v1/update_user_onboarding", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to update user"; +summary: + " update user"; +}; +} +; + +// 5.QueryUser +rpc QueryUser(QueryUserRequest) returns (QueryUserResponse) { + option (google.api.http) = { + post: "/v1/query_user", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "使用用户名关键词检索用户"; +summary: + "检索用户"; +}; +} +; + +// 6.GetUserInfo +rpc GetUserInfo(GetUserInfoRequest) returns (GetUserInfoResponse) { + option (google.api.http) = { + post: "/v1/get_user_info", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to get details of user"; +summary: + "get details of user"; +}; +} +; + +// 7.GetUserAvatar +rpc GetUserAvatar(GetUserAvatarRequest) returns (GetUserAvatarResponse) { + option (google.api.http) = { + get: "/v1/get_user_avatar" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this API to verify user's email address"; +summary: + "Verify email"; +}; +} +; + +// 8.ListUser +rpc ListUser(ListUserRequest) returns (ListUserResponse) { + option (google.api.http) = { + post: "/v1/list_user", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list all user"; +summary: + "list all user"; +}; +} +; + +// 9.GetListUserCount +rpc GetListUserCount(GetListUserCountRequest) + returns (GetListUserCountResponse) { + option (google.api.http) = { + post: "/v1/get_list_user_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list all user"; +summary: + "list all user"; +}; +} +; +// 10.GetQueryUserCount +rpc GetQueryUserCount(GetQueryUserCountRequest) + returns (GetQueryUserCountResponse) { + option (google.api.http) = { + post: "/v1/get_query_user_count", + body: "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this api to list all user"; +summary: + "list all user"; +}; +} +; +} diff --git a/zbook_backend/proto/service_zbook_verification.proto b/zbook_backend/proto/service_zbook_verification.proto new file mode 100644 index 0000000..3c425f8 --- /dev/null +++ b/zbook_backend/proto/service_zbook_verification.proto @@ -0,0 +1,95 @@ +// clang-format off +syntax = "proto3"; + +package pb; + +import "google/api/annotations.proto"; +import "protoc-gen-openapiv2/options/annotations.proto"; +import "rpcs/rpc_verification.proto"; + +option go_package = "github.com/zizdlp/zbook/pb"; +option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + info: { + title: "zbook api"; + version: "0.1"; + contact: { + name: + "zizdlp.com"; + url: + "https://github.com/zizdlp/zbook"; + email: + "zizdlp@gmail.com"; + }; + }; +}; +service ZBookVerification { + + // 1.VerifyEmail + rpc VerifyEmail(VerifyEmailRequest) returns (VerifyEmailResponse) { + option (google.api.http) = { + get : "/v1/verify_email" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description: "Use this API to verify user's email address"; + summary: "Verify email"; + }; + }; + +// 2.ResetPassword +rpc ResetPassword(ResetPasswordRequest) returns (ResetPasswordResponse) { + option (google.api.http) = { + post : "/v1/reset_password", + body : "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description : "Use this API to reset password"; +summary: + "reset password"; +}; +} +; + +// 3.SendEmailToResetPassword +rpc SendEmailToResetPassword(SendEmailToResetPasswordRequest) + returns (SendEmailToResetPasswordResponse) { + option (google.api.http) = { + post : "/v1/send_email_to_reset_password", + body : "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description : "Use this api to send verify code to your email"; +summary: + "Use this api to send verify code to your email"; +}; +} +; + +// 4.SendEmailToVerifyEmail +rpc SendEmailToVerifyEmail(SendEmailToVerifyEmailRequest) + returns (SendEmailToVerifyEmailResponse) { + option (google.api.http) = { + post : "/v1/send_email_to_verify_email", + body : "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description : "Use this api to send verify email to your email"; +summary: + "Use this api to send verify email to your email"; +}; +} +; + +// 5.RefreshToken +rpc RefreshToken(RefreshTokenRequest) returns (RefreshTokenResponse) { + option (google.api.http) = { + post : "/v1/refresh_token", + body : "*", + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + description : "Use this api to refresh token"; +summary: + "refresh token"; +}; +} +; +} diff --git a/zbook_backend/sqlc.yaml b/zbook_backend/sqlc.yaml new file mode 100644 index 0000000..4d747d1 --- /dev/null +++ b/zbook_backend/sqlc.yaml @@ -0,0 +1,40 @@ +version: "2" +sql: + - schema: "db/migration" + queries: "db/query" + engine: "postgresql" + gen: + go: + package: "db" + out: "db/sqlc" + sql_package: "pgx/v5" + emit_json_tags: true #### set true allow sqlc generate json tag + emit_prepared_queries: false + emit_interface: true + emit_exact_table_names: false ### 提取table名,而不是生成合适的(单数) + emit_empty_slices: true ### if true: null->[] + overrides: + - db_type: "timestamptz" + go_type: "time.Time" + - db_type: "interval" + go_type: "string" # 修改这里,将 interval 映射为 string + - db_type: "uuid" + go_type: "github.com/google/uuid.UUID" + - column: "users.fts_username" + go_type: "string" + - column: "markdowns.fts_zh" + go_type: "string" + - column: "markdowns.fts_en" + go_type: "string" + - column: "comments.fts_comment_zh" + go_type: "string" + - column: "comments.fts_comment_en" + go_type: "string" + - column: "repos.fts_repo_en" + go_type: "string" + - column: "repos.fts_repo_zh" + go_type: "string" + - column: "comment_reports.fts_report_zh" + go_type: "string" + - column: "comment_reports.fts_report_en" + go_type: "string" diff --git a/zbook_backend/start.sh b/zbook_backend/start.sh new file mode 100755 index 0000000..fa19d33 --- /dev/null +++ b/zbook_backend/start.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e +# echo 'run db migration' +# /usr/bin/migrate -path /app/migration -database "$DB_SOURCE" -verbose up +echo "start the app" +exec "$@" \ No newline at end of file diff --git a/zbook_backend/statik/statik.go b/zbook_backend/statik/statik.go new file mode 100644 index 0000000..7de3994 --- /dev/null +++ b/zbook_backend/statik/statik.go @@ -0,0 +1,14 @@ +// Code generated by statik. DO NOT EDIT. + +package statik + +import ( + "github.com/rakyll/statik/fs" +) + + +func init() { + data := "PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00#\x00 \x00swagger/models/comment.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xc30\x0c\x86\xefy\n\xe1\xedX\x9a\xd1\xddz\xda\xde`\xb0\xe3\xd8\xc1\xb5\x95\xcc%\xb6\x8c\xa5l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v F\xff'\xf9\xff\xad\x1c\x1b\x00\xc5_\xba\xef1\xa9-\xa8\xcd\xfaA\xadr\xcd\x85\x8e\xd4\x16\xb2\x0e\xa0\xc4\xc9\x80Y\xf7dq\xe0\xd6\x90\xf7\x18d\x1d\x13 \xcd\x0d\x00\xea\x13\x13;\n\x19+G\x08$\xc0(\xaa\x01\x98\xe6\xb1\x86\x02\x8f\x1eYm\xe1m\xe9\xd21\x0e\xcehq\x14\xda=S\xc8\xec\xfb\xcc\xc6Dv47\xb2Z>2x\\\xae\xb1\xd8\xb9\xe02\xc7\xe7\x10\xb3\xd9\xdd\xd8=\x87\xc3\xa9\x98\xb3\x1d\xe2\x1c\x8dv{4R\xc2,x\xc4$\x0e\xb9\xa2\x01\xd4Si8\x97\xaa!,\xc9\x85^\x9d\xa4\xa9\x9c\xa6\xd3Xm\xedlL\x0f/\x17\x17,d\xe1T\x8a\xe6U\xb4\x8c\xfc\x1f\xa7\x86\xecU\xa3.\x08\xe6\x9d\xafj\xb1\xa3\xe4\xb5\x14\xf9qS\xc58c\xca#\xb3\xeeo\x7f\x81\xaa\xd5\xa2h7\xf0\xb5V\x9d\x92>\\:r\x82\xfe7\x7f\xfd%\x8az\x9f\xb0\xcb\xea][\xfd\x07m\xbd\xfe\x8a\x9f\xfe\xee\xaa\xf9\xf9N\xcd\xd4|\x07\x00\x00\xff\xffPK\x07\x08\x8cg\xf6\xeb(\x01\x00\x00\"\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00,\x00 \x00swagger/models/comment_relation.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xfb0\x0c\xc6\xefy\n\xe1\xff\xffX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc3\x8d\x95\xcc%\xb6\x8c\xa5l\x94\x92w\x1fv\xbc\xd6\xdd(\x14v F\xdfO\xf2\xf7Y96\x00\x8a?\xf50`T[P\x9b\xf5\x9dZ\xa5\x9a\xf5=\xa9-$\x1d@\x89\x95\x11\x93\xee\xc8\xe0\xc8mG\xce\xa1\x97\xb7\x88\xa3\x16K~\x1d\" \xe5N\x00\xf5\x81\x91-\xf9\xc4\x97#x\x12`\x14\xd5\x00\xccy~G\x9e'\x87\xac\xb6\xf0\xb2t\xe9\x10F\xdb\xe5q\xed\x9e\xc9'\xf65\xb3!\x92\x99\xba\x1bY-\xef <.\xd7\x18\xec\xad\xb7\x89\xe3s\x9alv7\xf5\x8f\xfep*\xa6\x90\x87\x903\xd2n\x8f\x9d\x940\x0b\x1e0\x8aE\xaeh\x00\xf5P\x1a\xce\xa5j\x08K\xb4~P'i.\xa7\xf94V\x1b\x93\x8d\xe9\xf1\xe9\xe2\x82\x85,\x9c\x8a\xa1{\x16-\x13\xff\xc5iG\xe6\xaaQ\xeb\x05\xd3\xf2W\xb5\xd8StZ\x8a|\xbf\xa9b\x9c1\xe5\x90Y\x0f\xb7\xbf@\xd5jP\xb4\x1d\xf9Z\xab\x8eQ\x1f.\x1dYA\xf7\x93\xbf\xfe\x12E\xfd\x1f\xb1O\xea\xbf\xb6\xfa\x0f\xdaz\xfd\x15?\xff\xdeU\xf3\xfd\x9d\x9b\xb9\xf9\n\x00\x00\xff\xffPK\x07\x08\x90\xf7\x87\xb3.\x01\x00\x00+\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\"\x00 \x00swagger/models/follow.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xfb0\x0c\xc6\xefy\n\xa1\xff\xffX\x9a\xd1\xddz\xda\xde`\xb0\xe3\xd8\xc1M\x94\xcc\xc5\xb1\x8c\xa5\xac\x94\x92w\x1fN\xbc\xd6\xdd(\x14v F\xdfO\xf2\xf7Y9U\x00(\x07\xd3\xf7\x14q\x0b\xb8Y?\xe0*\xd5\xac\xef\x18\xb7\x90t\x00T\xab\x8e\x92>pKN\xea\x8e\x9d\xe3\xc3:DV\x9ey\x00\xfc\xa4(\x96}\xa2\xf2\x11<+\x08)V\x00\xd3<\xb5a/\xe3@\x82[x[\xbaL\x08\xce6F-\xfbz/\xec\x13\xfb>\xb3!r;6w\xb2F?\x12xZ\xaei\xa9\xb3\xde&N.\x19f\xb3\xbb\xb1{\xf6\xc7s1E;\x869\x19\xef\xf6\xd4h\x0e\xb3\xe0\x81\xa2Z\x92\x82\x06\xc0\xa7\xdcp)\x15CD\xa3\xf5=\x9e\xa5)\x9f\xa6\xf3X\xd3\xb6\xb31\xe3^\xae.X\xc8\xcca\x0c\xcd\xab\x1a\x1d\xe5/N\x1bno\x1a\xb5^)\xad|U\x8a\x1d\xc7\xc1h\x96\x1f7E\x8c\x0b\x86\x03\x89\x98\xfe\xfe\x17(Z[Rc\x9d\xdcj51\x9a\xe3\xb5#\xab4\xfc\xe4o\xbfDV\xffG\xea\x92\xfa\xaf.\xfe\x83\xba\\\x7f\xc1O\xbfwU}\x7f\xa7j\xaa\xbe\x02\x00\x00\xff\xffPK\x07\x08\xd32u\xd7)\x01\x00\x00!\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00$\x00 \x00swagger/models/markdown.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xe30\x10\x86\xef~\x8aA\xbb\xc7\x10/\xd9[N\xed\x1b\x14z,=L\xac\xb1\xab\xd4\xd6\x08\xcd\xb8!\x04\xbf{\x91\xad&JK \xd0\x8b\x11\xf3\x7f3\xfa\x7f\x8dO\x15\x80\x91\x03v\x1dE\xb3\x05\xb3Y\xff3\xabTs\xbee\xb3\x85\xa4\x03\x18u\xdaS\xd2\x07\xb6\xd4K=`|\xb7|\xf0\xeb\x10Yy\xee\x000\x1f\x14\xc5\xb1O\\>\x82g\x05!5\x15\xc04\xcfm\xd8\xcb8\x90\x98-\xbc,]\x18B\xef\x1aT\xc7\xbe\xde\x0b\xfb\xc4\xbe\xcel\x88l\xc7\xe6N\x16\xf5-\x81\xa7\xe5\x1aK\xad\xf3.qrI1\x9b\xdd\x8d\xed\xa3?\x9e\x8b)\xdc1\xcc\xd9x\xb7\xa7Fs\x98\x05\x0f\x14\xd5\x91\x144\x80y\xc8\x0d\x97R1D4:\xdf\x99\xb34\xe5\xd3t\x1e\x8b\xd6\xce\xc6\xb0\x7f\xba\xba`!3gbh\x9e\x15u\x94\xdf8m\xd8\xde4\xea\xbcRZ\xfa\xaa\x14[\x8e\x03j\x96\xffo\x8a\x18\x17\xcc\x0c$\x82\xdd\xfd/P\xb4ZRt\xbd\xdcj\xc5\x18\xf1x\xed\xc8)\x0d\xdf\xf9\xdb/\x91\xd5\xbf\x91\xda\xa4\xfe\xa9\x8b\xff\xa0.\xd7_\xf0\xd3\xcf]U_\xdf\xa9\x9a\xaa\xcf\x00\x00\x00\xff\xffPK\x07\x08R\xebSc,\x01\x00\x00#\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x00 \x00swagger/models/notification.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xc30\x0c\x86\xefy\n\xe1\xedX\x9a\xd1\xddz\xda\xde`\xb0\xe3\xd8\xc1\x8d\x95L%\xb1\x8c\xa5l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v F\xff'\xf9\xff\xad\x1c+\x00#_\xb6\xeb0\x9a-\x98\xcd\xfa\xc1\xacR\x8d|\xcbf\x0bI\x070J\xdac\xd2\x07v\xd8K\xedY\xa9\xa5\xc6*\xb1_\x87\xc8\xcas\x17\x80\xf9\xc4(\xc4>\xb1\xf9\x08\x9e\x15\x04\xd5T\x00\xd3<\xbba/\xe3\x80b\xb6\xf0\xb6t\xd9\x10\xfa<\xae\xde\x0b\xfb\xc4\xbe\xcfl\x88\xec\xc6\xe6F\xd6\xeaG\x02\x8f\xcb5\x0e[\xf2\x9489'\x99\xcd\xee\xc6\xf6\xd9\x1fN\xc5\x14\xf0\x10\xe6|\xbc\xdbc\xa39\xcc\x82\x07\x8cJ(\x05\x0d`\x9er\xc3\xb9T\x0c\x11\x8d\xe4;s\x92\xa6|\x9aNc\xads\xb31\xdb\xbf\\\\\xb0\x90\x99314\xafju\x94\xff8m\xd8]5J^1-~U\x8a-\xc7\xc1j\x96\x1f7E\x8c3f\x06\x14\xb1\xdd\xed/P\xb4:TK\xbd\\k\xb51\xda\xc3\xa5#R\x1c~\xf3\xd7_\"\xab\xf7\x11\xdb\xa4\xde\xd5\xc5\x7fP\x97\xeb/\xf8\xe9\xef\xae\xaa\x9f\xefTM\xd5w\x00\x00\x00\xff\xffPK\x07\x08\xdeb\xe7\xe9)\x01\x00\x00'\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00 \x00swagger/models/repo.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xc30\x0c\x86\xefy\n\xa1\xedX\x9a\xd1\xddz\xda\xde`\xb0\xe3\xd8\xc1\x8d\x95\xcc%\xb1\x8c\xa5l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v F\xff'\xf9\xff\xad\x1c+\x00\x94/\xd3u\x14q\x0b\xb8Y?\xe0*\xd5\x9co\x19\xb7\x90t\x00T\xa7=%}`K\xbd\xd4\x91\x02\xafCd\xe5\x99\x06\xc0O\x8a\xe2\xd8'&\x1f\xc1\xb3\x82\x90b\x050\xcd3\x1b\xf62\x0e$\xb8\x85\xb7\xa5\xcb\x84\xd0\xbb\xc6\xa8c_\xef\x85}b\xdfg6D\xb6cs#k\xf4#\x81\xc7\xe5\x1aK\xad\xf3.qrN0\x9b\xdd\x8d\xed\xb3?\x9c\x8a)\xd8!\xcc\xb9x\xb7\xa7Fs\x98\x05\x0f\x14\xd5\x91\x144\x00>\xe5\x86s\xa9\x18\"\x1a\x9d\xef\xf0$M\xf94\x9d\xc6\x1akgc\xa6\x7f\xb9\xb8`!3\x8714\xafjt\x94\xff8m\xd8^5\xea\xbcRZ\xf8\xaa\x14[\x8e\x83\xd1,?n\x8a\x18g\x0c\x07\x121\xdd\xed/P\xb4ZR\xe3z\xb9\xd6jb4\x87KGNi\xf8\xcd_\x7f\x89\xac\xdeGj\x93zW\x17\xffA]\xae\xbf\xe0\xa7\xbf\xbb\xaa~\xbeS5U\xdf\x01\x00\x00\xff\xffPK\x07\x08\xcb\x8b\xb6J&\x01\x00\x00\x1f\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00)\x00 \x00swagger/models/repo_relation.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xfb0\x0c\xc6\xefy\n\xe1\xff\xffX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc3M\x94\xcc%\xb1\x8c\xa4l\x94\x92w\x1fv\xbc\xd6\xdd(\x14v F\xdfO\xf2\xf7Y9V\x00F>m\xdf#\x9b-\x98\xcd\xfa\xce\xacb\xcd\xf9\x8e\xcc\x16\xa2\x0e`\xd4\xe9\x80Q\x1f\xa9\xc5Aj\xc6@o\x8c\x83UG~\x1d\x98\x94R\x1b\x80\xf9@\x16G>\xc2\xf9\x08\x9e\x14\x04\xd5T\x00s\x1a\xde\x90\x97iD1[xY\xbal\x08\x83k\xd2\xb8z/\xe4#\xfb\x9a\xd8\xc0\xd4N\xcd\x8d\xac\xd5\xf7\x08\x1e\x97kZ\xec\x9cw\x91\x93s\x94dv7u\x8f\xfep*\xc6\x84\x87\x90\x02\xd2n\x8f\x8d\xe60\x0b\x1e\x90\xd5\xa1\x144\x80y\xc8\x0d\xe7R1D\x94\x9d\xef\xcdI\x9a\xf3i>\x8d\xb5m\x9b\x8c\xd9\xe1\xe9\xe2\x82\x85\xcc\x9c\xe1\xd0<\xab\xd5I\xfe\xe2\xb4\xa1\xf6\xaaQ\xe7\x15\xe3\xe6W\xa5\xd8\x11\x8fV\xb3|\xbf)b\x9c13\xa2\x88\xedo\x7f\x81\xa2\xb5E\xb5n\x90k\xad\x96\xd9\x1e.\x1d9\xc5\xf1'\x7f\xfd%\xb2\xfa\x9f\xb1\x8b\xea\xbf\xba\xf8\x0f\xear\xfd\x05?\xff\xdeU\xf5\xfd\x9d\xab\xb9\xfa\n\x00\x00\xff\xffPK\x07\x08B\x1e@K,\x01\x00\x00(\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00#\x00 \x00swagger/models/session.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xc30\x0c\x86\xefy\n\xa1\xedX\x9a\xd1\xddz\xda\xde`\xb0\xe3\xd8\xc1\x8d\x95\xcc%\xb1\x8c\xa5l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v F\xff'\xf9\xff\xad\x1c+\x00\x94/\xd3u\x14q\x0b\xb8Y?\xe0*\xd5\x9co\x19\xb7\x90t\x00T\xa7=%}`K\xbd\xd4B\"\x8e\xfd:DV\x9e\x1b\x00\xf0\x93b*&,\x1f\xc1\xb3\x82\x90b\x050\xcdc\x1b\xf62\x0e$\xb8\x85\xb7\xa5\xcb\x84\xd0\xbb\xc6\xa8c_\xef\x85}b\xdfg6D\xb6cs#k\xf4#\x81\xc7\xe5\x1aK\xad\xf3.qr\x0e1\x9b\xdd\x8d\xed\xb3?\x9c\x8a)\xdb!\xcc\xd1x\xb7\xa7Fs\x98\x05\x0f\x14\xd5\x91\x144\x00>\xe5\x86s\xa9\x18\"\x1a\x9d\xef\xf0$M\xf94\x9d\xc6\x1akgc\xa6\x7f\xb9\xb8`!3\x8714\xafjt\x94\xff8m\xd8^5\xea\xbcR\xda\xf9\xaa\x14[\x8e\x83\xd1,?n\x8a\x18g\x0c\x07\x121\xdd\xed/P\xb4ZR\xe3z\xb9\xd6jb4\x87KGNi\xf8\xcd_\x7f\x89\xac\xdeGj\x93zW\x17\xffA]\xae\xbf\xe0\xa7\xbf\xbb\xaa~\xbeS5U\xdf\x01\x00\x00\xff\xffPK\x07\x08\x06\x8b\x97b'\x01\x00\x00\"\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00 \x00swagger/models/user.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xc30\x0c\x86\xefy\n\xa1\xedX\x9a\xd1\xddz\xda\xde`\xb0\xe3\xd8\xc1\x8d\x95\xcc%\xb1\x8c\xa5l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v F\xff'\xf9\xff\xad\x1c+\x00\x94/\xd3u\x14q\x0b\xb8Y?\xe0*\xd5\x9co\x19\xb7\x90t\x00T\xa7=%}`K\xbd\xd4\xa3P\\\x87\xc8\xca3\x0d\x80\x9f\x14\xc5\xb1OL>\x82g\x05!\xc5\n`\x9ag6\xece\x1cHp\x0boK\x97 \xa1w\x8dQ\xc7\xbe\xde\x0b\xfb\xc4\xbe\xcfl\x88l\xc7\xe6F\xd6\xe8G\x02\x8f\xcb5\x96Z\xe7]\xe2\xe4\x9c`6\xbb\x1b\xdbg\x7f8\x15S\xb0C\x98s\xf1nO\x8d\xe60\x0b\x1e(\xaa#)h\x00|\xca\x0d\xe7R1D4:\xdf\xe1I\x9a\xf2i:\x8d5\xd6\xce\xc6L\xffrq\xc1Bf\x0ech^\xd5\xe8(\xffq\xda\xb0\xbdj\xd4y\xa5\xb4\xf0U)\xb6\x1c\x07\xa3Y~\xdc\x141\xce\x18\x0e$b\xba\xdb_\xa0h\xb5\xa4\xc6\xf5r\xad\xd5\xc4h\x0e\x97\x8e\x9c\xd2\xf0\x9b\xbf\xfe\x12Y\xbd\x8f\xd4&\xf5\xae.\xfe\x83\xba\\\x7f\xc1O\x7fwU\xfd|\xa7j\xaa\xbe\x03\x00\x00\xff\xffPK\x07\x08\x94\x1e\xdb\xf1&\x01\x00\x00\x1f\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00#\x00 \x00swagger/rpcs/rpc_admin.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xfb0\x0c\xc6\xefy\n\xe1\xff\xffX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18C\x8d\x95L%\xb1\x8d\xa5l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v \xc6\xdfO\xf2\xf7I9V\x00F>\xb1\xeb(\x9a-\x98\xcd\xfa\xce\xac\xd2\x1d\xbb\xd6\x9b-$\x1d\xc0(kOI\x8f\xa1\x91:\x86\xe6\x0d\xed\xc0n\x1d\xa2W?\x17\x00\x98\x0f\x8a\xc2\xde%,\x1f\xc1y\x05!5\x15\xc04\xb7m\xbc\x93q 1[xY\xaa0\x84\x9e\x1bT\xf6\xae\xde\x8bw\x89}\x9d\xd9\x10\xbd\x1d\x9b\x1bY\xd4\xf7\x04\x1e\x97g,\xb5\xec8qr\x0e1\x9b\xdd\x8d\xed\xa3;\x9c.S\xb6C\x98\xa3\xf9\xdd\x9e\x1a\xcda\x16\x81\xa2\xd4\x92\"\xf7r\xad\x14c\xc4\xc3\xa5#V\x1a~\xf2\xd7'\x91\xd5\xff\x91\xda\xa4\xfe\xab\x8b\xff\xa0.\xd7_\xf0\xd3\xef]U\xdf\xdf\xa9\x9a\xaa\xaf\x00\x00\x00\xff\xffPK\x07\x08\xda\x04\x18\xdd*\x01\x00\x00\"\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00%\x00 \x00swagger/rpcs/rpc_comment.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xfb0\x0c\xc6\xefy\n\xe1\xff\xffX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc3u\x94\xcc%\xb1\x8c\xa4l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v \xc6\xdfO\xf2\xf7I9V\x00F>m\xd7!\x9b-\x98\xcd\xfa\xce\xac\xd2\x9d\x0f-\x99-$\x1d\xc0\xa8\xd7\x1e\x93\xce\xd1I\xcd\xd1\xbd9\x1a\x06\x0c\xba\x8eLJs \x80\xf9@\x16O!\x81\xf9\x08\x81\x14\x04\xd5T\x00\xd3\xdc\xd8Q\x90q@1[xY\xaal\x8c\xbdwV=\x85z/\x14\x12\xfb:\xb3\x91\xa9\x19\xdd\x8d\xac\xd5\xf7\x04\x1e\x97g\x1al}\xf0\x89\x93s\x8c\xd9\xecnl\x1f\xc3\xe1t\x99\xd2\x1d\xe2\x1c\x8ev{t\x9a\xc3,xDV\x8fR\xd0\x00\xe6!\x17\x9c\xaf\x8a&\xa2\xecCgN\xd2\x94O\xd3\xa9\xadm\x9a\xd9\x98\xed\x9f.\x1eX\xc8\xcc\xa5I?\xab\xd5Q\xfe\xe2\xd4Qs\xd5\xa8\x0f\x8ai\xeb\xabRl\x89\x07\xabY\xbe\xdf\x141\xce\x98\x19P\xc4v\xb7O\xa0(mP\xad\xef\xe5Z\xa9e\xb6\x87KG^q\xf8\xc9_\x9fDV\xff3\xb6I\xfdW\x17\xffA]\xae\xbf\xe0\xa7\xdf\xbb\xaa\xbe\xbfS5U_\x01\x00\x00\xff\xffPK\x07\x08\xd4\x87\xed\x1d+\x01\x00\x00$\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00.\x00 \x00swagger/rpcs/rpc_comment_relation.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xcfj\xc30\x0c\xc6\xefy\n\xe1\xedX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc5u\x94\xcc%\xb1\x8d\xa4l\x94\x92w\x1fv\xbc\xd6\xdd\x08\x14v F\xdf\xef\xd3\xdf\x9c*\x00\xc5_\xba\xeb\x90\xd4\x16\xd4f\xfd\xa0V1f]\xeb\xd5\x16\xa2\x0e\xa0\xc4J\x8fQ\xa7`\xb8\xa6`v\xc6\x0f\x03:\xd9\x11\xf6Z\xacw\xeb@^|\xf2\x02\xa8O$\xb6\xdeEG~\x82\xf3\x02\x8c\xa2*\x80)U0\xde\xf18 \xab-\xbc\xcd.\x1dBoMJW\x1f\xd8\xbb\xc8\xbe'6\x90oFs#\xab\xe5#\x82\xa7\xb9L\x83\xadu6r|\x99'5\xbb\x1f\xdbgw<\x07\xe3\x98\xc7\x90\xa6\xf4\xfb\x03\x1a\xc9\xc3\xccx@\x12\x8b\\\xd0\x00\xea)\x1b.\xa1\" \x0bY\xd7\xa9\xb34\xe5\xd7tN\xab\x9b&5\xa6\xfb\x97\xab\x023\x99\xb9\xb8\xf2W\xd12\xf2\x7f:5\xbeYl\xd4:\xc1x\xfeU)\xb6\x9e\x06-Y~\xdc\x14c\\05 \xb3\xeen\xdf@amP\xb4\xedy\xc9\xaa\x89\xf4\xf1\xba#+8\xfc\xe6\x977\x91\xd5{\xc26\xaawu\xf1\x1f\xd4\xe5\xf9\x0b~\xfa{\xab\xea\xe7;US\xf5\x1d\x00\x00\xff\xffPK\x07\x08\xaf\x03\xcf_-\x01\x00\x00-\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00$\x00 \x00swagger/rpcs/rpc_follow.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xc30\x0c\x86\xefy\n\xe1\xedX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc3u\x94\xcc%\xb1\x8c\xa5\xac\x94\x92w\x1fv\xbc\xd6\xdd\x08\x14v \xc6\xff'\xf9\xff\xa5\x9c*\x00\xc5\x07\xddu\x18\xd4\x16\xd4f\xfd\xa0V\xf1\xce\xba\x96\xd4\x16\xa2\x0e\xa0\xc4J\x8fQ\x0f\xdep\x1d\xbc\xf9h\xa9\xef\xe9\xb0\xf6\x81\x84R\x05\x80\xfa\xc2\xc0\x96\\\xe4\xf2\x11\x1c 0\x8a\xaa\x00\xa6\xd4\xd7\x90\xe3q@V[x\x9b\xab\xb4\xf7\xbd5Z,\xb9z\xcf\xe4\"\xfb\x9eX\x1f\xa8\x19\xcd\x8d\xac\x96\xcf\x08\x9e\xe6g\x1al\xad\xb3\x91\xe3K\x8adv7\xb6\xcf\xeex\xbe\x8c\xe1\x8e>e\xa3\xdd\x1e\x8d\xe403\xee1\x88E.h\x00\xf5\x94\x0b.WE\x13\x96`]\xa7\xce\xd2\x94O\xd3\xb9\xadn\x9adL\xf7/W\x0f\xccd\xe6\xe2\xa0_E\xcb\xc8\xffqj\xa8Y4j\x9d`\\\xfa\xaa\x14[\n\x83\x96,?n\x8a\x18\x17L\x0d\xc8\xac\xbb\xdb'P\x946(\xda\xf6\xbcT\xaaC\xd0\xc7kGVp\xf8\xcd/O\"\xab\xf7\x01\xdb\xa8\xde\xd5\xc5\x7fP\x97\xeb/\xf8\xe9\xef\xae\xaa\x9f\xefTM\xd5w\x00\x00\x00\xff\xffPK\x07\x08\x061\xb3u*\x01\x00\x00#\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00&\x00 \x00swagger/rpcs/rpc_markdown.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xfb0\x0c\xc6\xefy\n\xe1\xff\xffX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc3\xb5\x95\xcc]b\x1bIY)%\xef>\x9cx\xad\xbb\x11(\xec\x12\x8c\xbf\x9f\xe4\xef\x93r\xaa\x00\x14\x1ft\xdb\"\xa9-\xa8\xcd\xfaN\xad\xd2\x9d\xf3MP[H:\x80\x12'\x1d&\x9d\xa2\xe1\x9a\xa2y\xeb5}\xd8p\xf0\xebHA\xc2T\x03\xa0>\x91\xd8\x05\x9f\xc8|\x04\x1f\x04\x18EU\x00\xe3\xd4\xd9\x04\xcfC\x8f\xac\xb6\xf02W\xe9\x18;g\xb4\xb8\xe0\xeb=\x07\x9f\xd8\xd7\x89\x8d\x14\xec`nd\xb5\xbc'\xf04?c\xb1q\xde%\x8e/9&\xb3\xbb\xa1y\xf4\xc7\xf3e\x8aw\x8cS\xba\xb0\xdb\xa3\x91\x1cf\xc6#\x928\xe4\x82\x06P\x0f\xb9\xe0rU4a!\xe7[u\x96\xc6|\x1a\xcfm\xb5\xb5\x931\xdd=]=0\x93\x99K\xa3~\x16-\x03\xff\xc5\xa9 v\xd1\xa8\xf3\x82i\xed\xabRl\x02\xf5Z\xb2|\xbf)b\\0\xd5#\xb3no\x9f@QjQ\xb4\xebx\xa9T\x13\xe9\xe3\xb5#'\xd8\xff\xe4\x97'\x91\xd5\xff\x84MR\xff\xd5\xc5\x7fP\x97\xeb/\xf8\xf1\xf7\xae\xaa\xef\xefX\x8d\xd5W\x00\x00\x00\xff\xffPK\x07\x08t)\x15\x06-\x01\x00\x00%\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00*\x00 \x00swagger/rpcs/rpc_notification.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xfb0\x0c\xc6\xefy\n\xe1\xff\xffX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc3u\x94L%\xb1\x8c\xa5l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v \xc6\xdfO\xf2\xf7I9V\x00F>m\xd7a4[0\x9b\xf5\x9dY\xa5;\xf2-\x9b-$\x1d\xc0(i\x8fI\x8f\xc1I\x1d\x83{\xf3\xac\xd4\x92\xb3J\xec\xd7!\xb2\xf2\\\x07`>0\n\xb1Ot>\x82g\x05A5\x15\xc04ww\xece\x1cP\xcc\x16^\x96*\x1bB\x9f\xdb\xd5{a\x9f\xd8\xd7\x99\x0d\x91\x9b\xd1\xdd\xc8Z}O\xe0qy\xa6\xc1\x96<%N\xceYf\xb3\xbb\xb1}\xf4\x87\xd3e\x8ax\x08sB\xde\xed\xd1i\x0e\xb3\xe0\x01\xa3\x12JA\x03\x98\x87\\p\xbe*\x9a\x88F\xf2\x9d9IS>M\xa7\xb6\xb6ifc\xb6\x7f\xbax`!3\x97\xc6\xfd\xacVG\xf9\x8bS\xc7\xcdU\xa3\xe4\x15\xd3\xeaW\xa5\xd8r\x1c\xacf\xf9~S\xc48cf@\x11\xdb\xdd>\x81\xa2\xb4A\xb5\xd4\xcb\xb5R\x1b\xa3=\\:\"\xc5\xe1'\x7f}\x12Y\xfd\x1f\xb1M\xea\xbf\xba\xf8\x0f\xear\xfd\x05?\xfd\xdeU\xf5\xfd\x9d\xaa\xa9\xfa\n\x00\x00\xff\xffPK\x07\x08F\xadne+\x01\x00\x00)\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00#\x00 \x00swagger/rpcs/rpc_oauth.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xd1j\xeb0\x0c\x86\xef\xf3\x14\xc2\xe7\\\x96\xe6\xd0s\xd7\xab\xed\x0d\x06\xbb\x1cc\xa8\x8e\x92\xba$\x96\xb1\x94\x8dR\xf2\xee\xc3\x89\xd7\xba\x1b\x85\xc2n\x82\xf1\xffI\xfe\x7f)\xa7\n\xc0\xc8\x07v\x1dE\xb3\x05\xb3Y\xff3\xabt\xe7|\xcbf\x0bI\x070\xea\xb4\xa7\xa4\xc7`\xa5\x8e\xc1\xbe1\x8e\xba_\x87\xc8\xcas\x01\x80y\xa7(\x8e}\xc2\xf2\x11<+\x08\xa9\xa9\x00\xa6\xb9\xade/\xe3@b\xb6\xf0\xb2Ta\x08\xbd\xb3\xa8\x8e}}\x10\xf6\x89}\x9d\xd9\x10\xb9\x19\xed\x9d,\xea>\x81\xa7\xe5\x99\x86Z\xe7]\xe2\xe4\x12b6\xbb\x1b\xdbG\x7f<_\xa6l\xc70G\xe3\xdd\x81\xac\xe60\x0b\x1e(\xaa#)h\x00\xf3\x90\x0b.WE\x13\xd1\xe8|g\xce\xd2\x94O\xd3\xb9-6\xcdl\x0c\xfb\xa7\xab\x07\x162si\xce\xcf\x8a:\xcao\x9cZnn\x1au^)\xed|U\x8a-\xc7\x015\xcb\xff7E\x8c\x0bf\x06\x12\xc1\xee\xfe \x14\xa5\x0d)\xba^n\x95b\x8cx\xbcv\xe4\x94\x86\xef\xfc\xedId\xf5o\xa46\xa9\x7f\xea\xe2?\xa8\xcb\xf5\x17\xfc\xf4sW\xd5\xd7w\xaa\xa6\xea3\x00\x00\xff\xffPK\x07\x08\xda9\x94\xba*\x01\x00\x00\"\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\"\x00 \x00swagger/rpcs/rpc_repo.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xfb0\x0c\xc6\xefy\n\xe1\xff\xffX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc3u\x94\xcc%\xb1\x8c\xa4l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v \xc6\xdfO\xf2\xf7I9V\x00F>m\xd7!\x9b-\x98\xcd\xfa\xce\xac\xd2\x9d\x0f-\x99-$\x1d\xc0\xa8\xd7\x1e\x93\xce\xd1I\xcd\xd1\xbd1FZG&\xa5\x99\x070\x1f\xc8\xe2)$*\x1f!\x90\x82\xa0\x9a\n`\x9a\xbb:\n2\x0e(f\x0b/K\x95\x8d\xb1\xf7\xce\xaa\xa7P\xef\x85Bb_g625\xa3\xbb\x91\xb5\xfa\x9e\xc0\xe3\xf2L\x83\xad\x0f>qr\xce0\x9b\xdd\x8d\xedc8\x9c.S\xb4C\x9c\x93\xd1n\x8fNs\x98\x05\x8f\xc8\xeaQ\n\x1a\xc0<\xe4\x82\xf3U\xd1D\x94}\xe8\xccI\x9a\xf2i:\xb5\xb5M3\x1b\xb3\xfd\xd3\xc5\x03\x0b\x99\xb94\xe6g\xb5:\xca_\x9c:j\xae\x1a\xf5A1\xad|U\x8a-\xf1`5\xcb\xf7\x9b\"\xc6\x193\x03\x8a\xd8\xee\xf6 \x14\xa5\x0d\xaa\xf5\xbd\\+\xb5\xcc\xf6p\xe9\xc8+\x0e?\xf9\xeb\x93\xc8\xea\x7f\xc66\xa9\xff\xea\xe2?\xa8\xcb\xf5\x17\xfc\xf4{W\xd5\xf7w\xaa\xa6\xea+\x00\x00\xff\xffPK\x07\x08j\xd6\x82\xe9(\x01\x00\x00!\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00+\x00 \x00swagger/rpcs/rpc_repo_relation.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xc30\x0c\x86\xefy\n\xe1\xedX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc5u\x94\xcc%\xb1\x8d\xa4l\x94\x92w\x1fv\xbc\xd6\xdd\x08\x14v \xc6\xff'\xf9\xff\xa5\x9c*\x00\xc5_\xba\xeb\x90\xd4\x16\xd4f\xfd\xa0V\xf1\xce\xba\xd6\xab-D\x1d@\x89\x95\x1e\xa3N\xc1pM\xc1\xec\x08\x83\xdf\x11\xf6Z\xacw\xeb@^|*\x04P\x9fHl\xbd\x8bx>\x82\xf3\x02\x8c\xa2*\x80)\xb57\xde\xf18 \xab-\xbc\xcdU:\x84\xde\x9a\xd4\xae>\xb0w\x91}Ol \xdf\x8c\xe6FV\xcbG\x04O\xf33\x0d\xb6\xd6\xd9\xc8\xf1%L2\xbb\x1f\xdbgw<_\xc6\x8c\xc7\x90\"\xfa\xfd\x01\x8d\xe403\x1e\x90\xc4\"\x174\x80z\xca\x05\x97\xab\xa2 \x0bY\xd7\xa9\xb34\xe5\xd3tn\xab\x9b&\x19\xd3\xfd\xcb\xd5\x033\x99\xb98\xefW\xd12\xf2\x7f\x9c\x1a\xdf,\x1a\xb5N0\xee~U\x8a\xad\xa7AK\x96\x1f7E\x8c\x0b\xa6\x06d\xd6\xdd\xed\x13(J\x1b\x14m{^*\xd5D\xfax\xed\xc8\n\x0e\xbf\xf9\xe5Id\xf5\x9e\xb0\x8d\xea]]\xfc\x07u\xb9\xfe\x82\x9f\xfe\xee\xaa\xfa\xf9N\xd5T}\x07\x00\x00\xff\xffPK\x07\x08\xfb\x8c\x18\xb5,\x01\x00\x00*\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\"\x00 \x00swagger/rpcs/rpc_user.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xc1j\xfb0\x0c\xc6\xefy\n\xe1\xff\xffX\x9a\xd1\xddz\xda\xde`\xb0\xe3\x18\xc3u\x94\xcc%\xb1\x8c\xa4l\x94\x92w\x1fN\xbc\xd6\xdd(\x14v \xc6\xdfO\xf2\xf7I9V\x00F>m\xd7!\x9b-\x98\xcd\xfa\xce\xac\xd2\x9d\x0f-\x99-$\x1d\xc0\xa8\xd7\x1e\x93\xce\xd1I\xcd\xd1\xbd\x8d\x82\xbc\x8eLJ3\x0f`>\x90\xc5SHT>B \x05A5\x15\xc04wu\x14d\x1cP\xcc\x16^\x96*\x1bc\xef\x9dUO\xa1\xde\x0b\x85\xc4\xbe\xceldjFw#k\xf5=\x81\xc7\xe5\x99\x06[\x1f|\xe2\xe4\x9ca6\xbb\x1b\xdb\xc7p8]\xa6h\x878'\xa3\xdd\x1e\x9d\xe60\x0b\x1e\x91\xd5\xa3\x144\x80y\xc8\x05\xe7\xab\xa2\x89(\xfb\xd0\x99\x934\xe5\xd3tjk\x9bf6f\xfb\xa7\x8b\x07\x162si\xcc\xcfju\x94\xbf8u\xd4\\5\xea\x83bZ\xf9\xaa\x14[\xe2\xc1j\x96\xef7E\x8c3f\x06\x14\xb1\xdd\xed\x13(J\x1bT\xeb{\xb9Vj\x99\xed\xe1\xd2\x91W\x1c~\xf2\xd7'\x91\xd5\xff\x8cmR\xff\xd5\xc5\x7fP\x97\xeb/\xf8\xe9\xf7\xae\xaa\xef\xefTM\xd5W\x00\x00\x00\xff\xffPK\x07\x085C\xefR)\x01\x00\x00!\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00*\x00 \x00swagger/rpcs/rpc_verification.swagger.jsonUT\x05\x00\x01^F\xb8f\xa4\x92\xd1j\xeb0\x0c\x86\xef\xf3\x14\xc2\xe7\\\x96\xe6\xd0s\xd7\xab\xed\x0d\x06\xbb\x1cc\xb8\x8e\x92\xa9$\xb6\x91\x94\x8eR\xf2\xee\xc3\x89\xd7\xba\x1b\x85\xc2n\x82\xf1\xffI\xfe\x7f)\xa7\n\xc0\xc8\x87\xed:d\xb3\x05\xb3Y\xff3\xabtG\xbe\x0df\x0bI\x070J\xdac\xd29:\xa99\xba\xb7\x032\xb5\xe4\xacR\xf0\xeb\xc8A\xc3\\\x07`\x0e\xc8B\xc1':\x1f\xc1\x07\x05A5\x15\xc04ww\xc1\xcb8\xa0\x98-\xbc,U6\xc6>\xb7\xab\xf7\x12|b_g6rhFw'k\xf5=\x81\xa7\xe5\x99\x06[\xf2\x948\xb9d\x99\xcd\xee\xc6\xf6\xd1\x1f\xcf\x97)\xe21\xce \xc3n\x8fNs\x98\x05\x8f\xc8J(\x05\x0d`\x1er\xc1\xe5\xaah\"\xca\xe4;s\x96\xa6|\x9a\xcemm\xd3\xcc\xc6l\xfft\xf5\xc0Bf.\x8d\xfbY\xad\x8e\xf2\x1b\xa7.47\x8d\x92WL\xab_\x95b\x1bx\xb0\x9a\xe5\xff\x9b\"\xc6\x053\x03\x8a\xd8\xee\xfe \x14\xa5\x0d\xaa\xa5^n\x95Zf{\xbcvD\x8a\xc3w\xfe\xf6$\xb2\xfa\x97\xb1M\xea\x9f\xba\xf8\x0f\xear\xfd\x05?\xfd\xdcU\xf5\xf5\x9d\xaa\xa9\xfa\x0c\x00\x00\xff\xffPK\x07\x08\x0bd\xbe\xff,\x01\x00\x00)\x03\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00(\x00 \x00swagger/service_zbook_admin.swagger.jsonUT\x05\x00\x01^F\xb8f\xec\x9d_o\xa4\xb6\x16\xc0\xdf\xe7SX\xdc\xfb\x98\xcb$\xd9\xbd\xdb6OMS\xa9\x8aTU\xd1F\xd9\x87\xbdZ\x8d\xac\xcb\xa7\x8b\xa5\xc7\x00\x0bX\x91\xf8\x89\x08%\xa2\x07-\xa1\\\x0f\xa2\xccU\x1aE\x98=K\xf39\xc4>\xd2\xe4\xce\xf6G\xf9\xc0=F\x92\\\x9d\xf3\xc0\x01\x89G\xc2e\xe2\x90\xa0\xa8A\x92&\xc0\xd4\x87\xb7~1D\xab{\x88\xfd\xdbZ\x19\x06<\xa11\x07^0\x15!\xe7\xf2\xfc\xbc\xf4Q\xd5\xb6k\xc4S\xcf\x03\xce7i\x88\xb6\x9a\\M\xbd\x12\xe2\xde#D\xb8\xa2\x0c!\xe7\x9f\x0c6R\xcf?\x96>lHL\xa4^\xbeL\xd6Es\xdf\xe7\x8a\x9d\x82\xf8\x8b\xf6\xd7\x8b\xfe\x8b\x8e\x0f\x1b\x9c\x86\xa2\xdd\xfa\x18\xa51|K\xc0\x13\xe0#`\x8c\xb2\xc39\xc1\x12\xef^`\x91\xf2\x06\xabw\xff\xad\xd9\xef$\x98\xe1\x08\x04\xb0}Qf\xa3\xe4\xcc\x16\x845\xf5\x9f\xcb\xc6\x92\xd8\xf4\x0d\x83\xaf)a \xebC\xb0\x14\x06:Y\xcd\xd4\xd7\x14\xb8\xb0q\xf9\x93\xe6r\x81\xf4\xfc\xb32\xdfJf\xa1k\xc9\x83\xa6\x83\xc8\x9f\xb9\x80h\x15SA69\xc4\xd6Df*P\xa6\x02I\x15\x1d\xa0l\x166sy\xa3\xe4\xee\x95\xd8_\xba\xd5c'\xd4d\xf8\xcc\xaa\x1a\xa3d\xd5\x9c\xb3\x13Q\xebC\x08\x02V)W\xeb\x17;L\xd78FJ\xc0\x1eN$e*Bf(\x7fWf=\x94\x8e\x1f%\x86{Sg\xf0\xd4\x18%xz\x96N\x84Z\x00b\xe5\xd1xC\x82\x94u\x9b\x17\x13\xcc8 \x92t\x00.\x00\x81\x8a?f\xc5\xdd\x1f nLR\xa3\xa4\xafl\xf0\xcc\xa0\x1a\xa3d\xb0\x9a\xab\x13\x92\xe8c\x12>\xaf\xb0'\xc8S6\xfd\xad<\x9a\xc6\xc2\x9aI \x98\x0f\x02\x93\x90#\xba\xe9:\x1f\xb6H7\x02\xfa\xbb\xb4\xfcZ\x19.\xcfg7\xca\xec pZg\xf7\x8c\xab\x1ac\xc5\xb5>e'\xa76\xbf\xd4\x9c\x1e\xb5\xd9\xf2\x7fz\xd4\x96\xec\x9e\xa9Uc\xd4\xd4VRvrj\x9f\x08'\x82N\x8c\xd8\x0f\x99\xd1\xd3\xc2U7zfU\x8dQ\xb3Z\xcc\xd7X@\xe5\xd6\x8c\xf6\xb8>\xad\x13\xb1\xa6\x91O\x8dD>S\xa8\xc6\x14(\xe4'%0$\\\xac<\x1aE\x10\x8b\x8e3\xe5\x1f \xe4t\x7f\xc7\xc8\x13\x16P<\xf9\xdb\x83i\xa9\xa5\x91\xd5? \x177\x99\x0f\x93\x998\xcb6\xcf\xc4\xaa1Vb\xab\xe9\x1a\x0b\xb4\x0c\x12\xcaz\xb0\xaby\xf4^\xa9(\xf8\xd5 `kU\xb6\x14kZ&\xc6r\xc1\xff\x99\xe8i\x10]S\xb4\x16\xde\x1f\x89k\x0e\x9c\x13\x1aw\x07\xfa>\x13\xec\x8fq\x8b\x82Vxu\xf9\xa9`[\xf4y\x06v\xe4\xc0\xd6\x95\xa8\x85\xdf\x87EU\x9f~\xad\x01UBr\xae\xce'\xec\x0eh6\x89\x9a\xa1\xd4\xceo\xa3\x87\xb1p.\x9e!\x1c+\x84\x854\x8d\x00\xbe-\x0f\x9d\x18,\xc9v\xc4\x10\x87a\x83\x06+\x1a\xdfW\xc4\xc6\xcf\xa4\xb4x&S\x8d\xf1\x93\x99%\xeb\x94|\xe6k\xd8N`\xa2\xac7\x02me\xed\xc1D-\xe2\xcdT\xdeW\x05F\xcbcn\xebL\xa2\x1a\xa3%q\x97\xa6S1H\x83\xedC\x15k\x04O\xf4\xdc\xf3O\x1a\xe4\xf7\xc1\xc7\x0f\xe0\xce\xd4\x99?5\xc6\xc9\x9f\x96\xa5\x13\xe1\x97&>\x16P\xbeA\xcb\xb3\xe0\xdb\xf2\x98Mj\x1d1\xec\xda\xf6\xfe\xa0,-,\x1c\xf2\x1a\x19;\x8cF\xcbg6\xd5\x18%\x9b\x0dI;5\xaa\xaf\xd4&\xdf\xad\x0da\x1b\xaf)5\xc8\xd7\xd8<#\xa9\xc6\xa8\x91\x1cC\x9b|\x0e\xa3j\xb3]\x87\xd4\xfbbM\xe2+\xec\x10\xcb\x02\xf5\xc0\x81\xfd\xa6L\x9b\x06\x87;{g\x06\xd5\x181\x83Z\xaa^\x93\xbf\xdd\xbb\x174\x9bv\xc6;\xed;H5D\xc5s\xa2\xa2I\xd7\x9f\xc1\xdb\xdf\xe0t\x12&\xb1\x12\xa4\x04\x88#\xe1\xcb3P\xc0f\xab\x87\x0bF\xe2\xc0\xa9\xcd\xf0\xf6\x0d\x17\x9d\x05=\x1a\x0b\x88E\x85U\x1bY\x06>a\xe0\x89\x07\xf5\xfe\x0b;\xf1EI\xcd\xfe\xdd\x1co\\\xe3V\xf0\x85&\xd2\x98\x83\x1cjs\x12J\x9a\xaa\xdb\x12_3\x7f\xe6X\\\xba\xda\x0e\xdc\x06\x9b\xbb\xfak\xda\x026\xc0\xebl\xad\xf8\xd7a\xfc\xbe\xf8\xc9\xadl\x81lu\xa15\x08\x96>|\xc0ajtbMi\x088\xae\xf1\xa2j_\xd3\xb6\x9d\x01V\n\x12\xc1G\x1a\xdb\xc7YC5\xf6\xf1\xb3\x91q\x12\x0b\x08\n\x13?B\xce\x86\xb2\x08\x8b\xfc\xeb7\x97v\xe9\xbbtM\x1b\xe4l\xa34<\x99r\xf20\xba\x8a\x19\xc3\xc5 \xcc!\x02\xa2\xf2\xf1\x0dQ5\xcd\xb1\xaa?\xe5\x80\xbf[\x97\x94\xa6\xb4\x14\xecj\xa9M\xc3\xe6\x94\x01A\x9f@m\xbeqM\xdb\xc0l\xa34\xd7\xe6+\xd4f\xddf\x8c\x01\x11\x9f@a^\xb8\xb5\xbb\x9d\xac\xe23\x97\xe4\xeb\x95$?@9\x1e\xb2\xa4\xb4h\x868\x0e\xac+\xbc\xa1\x14\xdf\x95K\x91\xb7\x94!?D \xd6lxB\xc3\xaa\xa1\xf4\xcb\xf9\xb7\xa6\x0b\xce\xed\x13\xb7\xae\xc5aj\x82\x1f\x10\x8a\xaf)\xa8[8C3\xf9\xb3[\xb7\x0f\xc4\xc6\x85\xe1\xe9,w\xea\xd6\xf9`.\xf1wo\xad\xd6\xd8\xcd\xed\xca\x16\xd6\xef\x8b\xfe\xdc5w\xdb\xdb\xff\xf0\x84\xe2V\xd75:\xc0\xeeC\xd5\xec;\xb7\xaeq\xda\xc6\x85)\xc4^Z\xadn=\xe5\xc5s\xab\xbf\xa1\xb4\x97\xc5\x99\x1a\xff0V\x9fU4\xdfdw\x86\xac\x13\xabi\xe8|'D\x93\xdd\xbe\x1c\xb5\xb3`\xf6V\n\xff\xba\xcdbC@\xe4:\xe8_r\xb5h\x97\xca\xc2)`h.\xb3G\xe2\xc7K\xe5\x114K\x93;\xdd\xf4)\xc9>\x0c(\x11\x06!\x16\xe4 \xee\xb0x\xec'\x9f\x9d\xb7{\xd7\xf7pB\x12F=\xe0\x1c\x8c\x89\xa9\xdeo:n\xa9\x0f\xa1w\xa1\xff\xbb\x01\x93\x03\xcc5 \x0e\xc0\\\xcd\xfd\x17\xd0R\xef=\xf9n\xf4\xb9\xbf\xe6C\xcd\x8e\xbf\xb8\xd5\x9e\xe9\xf6\x80\x0f\x9f\x19!\x84\xa8\xe9\x01\xc1\xb1\x17\xe7\xf5'[M\xb6}\xa9^\xd3\xa7? ?n \xfe\xa4\x97`c\xf1\xfd=\xca\xae\xb2\\\xeb\\u\xa5\xce\xd7\x01\xf1\xf8q\xab\xee\xdf\xae\xde\x96\xde\x14\xe4\xe9W]\xeeJ\x8fb\xab\xb4yZDa\x7f \xfc\xd6\xd5\x1a\x8f\x1bT\xb7F\xb8$[\xffnt\x0b\xd3\x8c \xeatu`.\xaa\x8b_\xdc\xd2\xff\x10\xa0\xc5\xf2V\xcf[M'\\\xea4\xd9n\xfd|Q/\x91\x01\xd6t^\xe4\x9d\x15e\xaf\x83\x9e+_/$\xf2t\x9a\xf4\x91\xed\x96}]\xf0[B\x18\xf0#-\x98\x8f\xb0\x1c7$\xbf\xb5ct@E\x1c\xed\"\xb4\xc7\xb5\xce\xa2\xa4e\x0f\xee[\xd7\xdc\xa4m\x1f\xacV\x9a\x0d\xaaN\xde:qV\x96\xee\xd9\xb4PsF\xfc\xd9\xad\xeb\xaf\xb5 D\xbfhV\x1a\xbc\x06Dr\xc8\xd9L\xb5V\x1e\xa68/\xdcr[d\x9b\xe7\xad\xa1ku\xbd\xb7\xf9%\xd3>T7Hu5\xe5\xf6\xaeO\xfc{\xcf$7M\xf7l\xfb\xaf[=\"\xec\x97\xad\x9a\\\x88\x8d\xc6\xc4i\xb46\xdb\xe2\xd3t\x1d\x1a\xa6\x96\x90\x9a\x1f\xecu\xd4Z\x9fwF\x05]\xa7\x9b\xeb\xf8yH\xe6\x7f\xcd\x05\xec\x82\xb6\xb5d\xa7\x16\xfb\xbeZ\x02\xe3\xf0\xae\xf0\x03E[\xf7\xed\xaf\x03,\xf5\xa8o4\xb4\x7f\xcdD\xc09\x0e\xec#\xa0\x89\xe6\xdb\x04M\xa2G\xbe\xe2\xd0\xd2\xaf\x1do\xbc\xdeX\xc8\x7f^\x16\xff\x0f\x00\x00\xff\xffPK\x07\x08\x8f\xf8\xb0a\xfd\x07\x00\x00wm\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00*\x00 \x00swagger/service_zbook_comment.swagger.jsonUT\x05\x00\x01^F\xb8f\xecZOn\xe36\x17\xdf\xfb\x14\x04\xbfo9\xb5\x93L\xdaEV\x93\xc9\x00E\x80\x00-&\xe9\xa6\xc5 \xa0\xa5g\x99\x13\x89\xd4\x90T\\\xa70\xd0E\x17\xbdC\x0f\xd0]\xbb-\xd2\xebt\xd09FAZ\xb6(J\xb2d\xc9\x8e\x9d\xd6\x02\x82\xd8\x12\xdf\x8f\xef\xdf\x8f\x8fz\xf4\x0f=\x84\xb0\x9c\x90 \x00\x81\xcf\x10>\xe9\x1f\xe1\x17\xfa\x1ee#\x8e\xcf\x90~\x8e\x10VT\x85\xa0\x9f?\x0c9\xbfC$\xa6f\x14B\xf8\x1e\x84\xa4\x9c\xe9gG\xfd\xe3\xc5]\x8f3E<\xb5\x04@\x083\x12\xcd\x11\xe8\x83\x1f\xc6}\x8fG\xe9`\x84p\"B\xfdh\xacT,\xcf\x06\x83\x80\xaaq2\xd4C\x06\xf3\xd1\x033m6\x1e\"B\xc3\x0c\xecU\xa0\xbf\x1bH3b\xd6Chf\xacP$\x90\xf8\x0c}gn\x17T\xf9\xf65\xe7w\x17<\x8a\x80\xa9L\xf2\x9d\x91\xf48\x93I\x04\x994&q\x1cR\x8f(\xca\xd9\xe0\xbd\xe4\x0c/\xc7\xc6\x82\xfb\x89\xd7p,Qc\x999vp\x7f<\xf0\x04\x10\x05\xb7^\xaa\x88\xe5\xb3\x98K\xfb\xbb\x0eU\x12EDL\xb5\xf6\x1f\x7f\xfe\xe5\xe3\x9f\x8f\x7f\xfd\xf1\xe3\xdf\x8f\xbf~\xfa\xfd\xa7O\xbf=.\x1d\x84\x10\xf6Az\x82\xc6*\x8d\xcd|pq\x18\x8fA\x185/}\xd7#\xb7\x17F\xaf\x85\x7f,!\x012\xe6L\x82\xcc\xe9\x86\x10>9:rn\x1559G2\xf1<\x90r\x94\x84h\x81\xd4\xb7\xe0\x8d\x90\xf4\xc6\x10\x91\x02\x18B\xf8\xff\x02F\x1a\xe7\x7f\x03\x1fF\x94Q\x8d+\x07\xf10\xa7\xed\xdb\x14\x17\xe7\xa4g\xd6\xb7\x99=!\xf6aD\x92P\xd5+\xcfP\xc2\xe0\xfb\x18<\x05>\x02!\xb8\xd8\x9c\x0d\"\xf6\xae\x15Q\x89\\\xa1\xf5\xf2\xb3\xa5?\x8e\x89 \x11(\x10Y\x06\xce/\xc7\x98E\xde\x0f\xb9?u\x95\xa5\xac\xea\x89\x80\x0f \x15\xa0\xf3C\x89\x04:\x1aY\x08\xd4\x87\x04\xa4jb\xf1;\xcb\xe2\x1c\xaf\xd3{E6\x1b\xa9\x9e\x8d\x93z\xcd\xd0\xce\x87\x10Z\xd0n.\x86\xbc\"-\x9c\\\xf9F\x02Rc*\xf5j\x89\x14G\xd5\x82\xabH\xf8\xc6H=\x17\x12\xe6\xb4=\x90\xd0\\{IB'P;#a\x00j\xc1\xc0[\x8f'L\xdd\xe66\x1eud\x0c@!\x1f\x14\xa1\xa1D|\xd4\x82\x94\x1a\xc0\xcc\x8b\xf4\xbc\x15\x18\xab\xf8\xf9%\xa8\xf4\xe3\x85\x86\xb9\xd4\xda\xef;KKt>p\xd5\\{\xc9\xd5\xd2p\xed\x94\xb1!\x95\x19mC\xb8\x87\xf0\x963\x98\x13\xb81w5\x082\xc2\x88\xb36\x05\x15\xd5#\xd40\xf7\x8a\xca\x85k\xaf4\xccW\x0c\x8c\x8b\x9f\x03\x83]\xdd\x8d\xe2\x07\x1a\x9bk_i\\\x95o\xfbGg5\xe1-\xe8\\\x04Y\x83\xce\xf5\x00k\xb2\xf9f\xc2\x0flF\x076\xa3'b\xf3\"\xdfv\xc8\xe6\xf2\xc2\xbc\x16\x87wY\x92K\xd6\xc7\xbd'\xaf\xab\xf3\x81\xb4\xe6\xdaK\xd2\x96\xe4\xd7~\x91U\x17\xbcu\xc8\xba\xc3\x82[\xb2\xfa\x1d\xb8z\xe0\xea\xd6\xb8z3y\xf2\xb7\xde\xe51\x92\xa5\xd9\xd2\x04\x1c\x0fS\xf9\xd7DR\xef\xd2i[\xa9il\x9c\xc8\x87\xef\xc1\xcb\n \x8e\x85&\x95\xa2\x0e1p\xcaCC\xb4\x1c_\x16@R \xca\x82\x9c\xd7\xf1\x88\x8b\x88\xe8t\xc4\x94\xa9/Nqi\xd8#\"\xee|>a[\x80N$\x88-\xc0\xc6Dl\xc7\x15\x82\xf3m\xc0\xa6\xb1\xbb\xe0L\xe5O\x12\xca\xe0\xcb\x11\xcc\x99\x88\x7f^'\\\xa1\x9bO\x14|\xa6hd-d\xb3|*\xbfpr6kV\xeee\xce\x86\xf4.\xed\xc4T S\xa6 \x00\xb1\x02\xfa\xe5IE\x0e@\x1cN\xb7\x84M\xe5\x15\xbd\x83Jw\x0c9\x0f\x81\xb0*\xd97T\x86\x1d\xc4\xaf\xc7D\xb4\x16~\x0b1\x17j\x1d\xf1\xaa\xfc*;\xdd\xeb\x90c[\\\xbd\xb6\xb6\xcc\xb4\\\x0fz\x0eR\xf6\xab\x8b\xe3~\xfe,~\xb5\xcf\xd3=M\x07\xa7\x17\xcfD\xcd\xed\xca\x13]\xb7\x0e\xd6fI\xe9\xf1Sw\x857\x15\xcb\xeaH\x9c\xf4\xf3\x07\xb2\xab\xed\xaa\x8d\x84#\xbe\xa2\xd3\xff\x1c\x9c\xf3y\xbf\xec4\xac\x89\x8d\xb5\x8ejjdY]C\x0dr\xd7Q\x17\xad\xc8\xdd\xdan]'+V\xd4\xa5va\xaa\xd7\xde\xedBw\xd0\x7f\xd3\xabuu\xae\xbd\xec\xaf:\xbf\xa97\xdam\xd6u0z\x93\xbb\xcaj\x83O\xcb\x0c^\xb6\xb8\x1d\x83\xadq]7y\x9b\x0e\xe9S\x14`\xfd^\x92\xbe\xc56+\xbd\xb6R]\x84[V~\x1ba\xf3o\x02\x16z\xed\xbe\xba\xb5\xcb\xeb\xb7\xd5\xad\xa1\xffK\xbb\xeab.m\x8a\x1e=\xfb\x7f\xe9J\xe1\xb6D\xf7u\xd1\x08\xa0\x1a\xb6\xfd\xbb\x9b\xc6\xbd\xa6\x0f\x95\xb4_\x13\xb9\xe7\xcc`W\xae\xb2c\x8e\x9a\xb0lfsa\xf0\n\x1d\xd9\x05\x0e\x11\x82\xe4\xdbz\x98*\x88\xdc\xf1\xd53\xa7O\x1bt\xf4\xf2;\xad\\\xc3\xb2a\x9eZ\xed\xc0\x0e.\xd9d\xe9\xfe7\xe5\xe8i!Go&\xeeN^p\xc5\x87\xc9\xe8\x9cM\xbbD\xe0U*\xd0\xacP\x164&\xbeo\xf2\x8b\x84_\xe7&\xc8\xa7O\xd62\xef\xa0\xa9\xc7\xfdM9\xde\ni\x04R\x92\xa0\xb9\x07,\xd1\xf4\x87\x8f;\xa2\xb3\x15~k|%\x91{\xfao\xd6\xfb'\x00\x00\xff\xffPK\x07\x08\x0bE\xa8\xd1\x0f\x05\x00\x00p2\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x003\x00 \x00swagger/service_zbook_comment_relation.swagger.jsonUT\x05\x00\x01^F\xb8f\xecW\xc1n\xe36\x10\xbd\xeb+\x06l\x8f\x85\xe5x\x8b\x1e|\xdamz\xe9\xad\xd8\xb6\x97\x16A@Sc\x99\x89D2\xe4(\xadS\xf8\xdf\x0bR\x92E\xc9\x96\xedV \x92\x00\xd1!\x88\xc8\x99\xa77o\xf8H\xfa\x9f\x04\x80\xb9\xbfx\x9e\xa3eK`\x8b\xd9\x9c}\xe7\xc7\xa4Zk\xb6\x04?\x0f\xc0HR\x81~\xfei\xa5\xf5=p#C\x14\x00{D\xeb\xa4V~n>\xbbjG\x85V\xc4\x05\xed\x01\x00\x98\xe2e\x8d \x9f\xb2\xc2\xcc\x84.\x9b`\x00V\xd9\xc2Om\x88\x8c[\xa6i.iS\xad|HZG\xa7\xe1\xb3]<\x96\\\x16\x1d\xd8\xe7\xdc\xbf\x07\xc8\x10\xb1K\x00v\xa1\n\xe2\xb9cK\xf83\x0c\x1fP\xf9\xe3G\xad\xef\xafuY\xa2\xa2\xafXp\xf2\x85\xec\x11n\x02\x82\xd0\xcaU%v(\x8c\x1bSH\x11\x82\xd3;Wg\xd4\xb1\xc6\xea\xac\x12\x17\xc6r\xda\xb8N\xe0\xf4\xf1*\x15\x169\xe1\xad\xa8 \xdd\xda\x96Q$\xa2\xd1.\x16\xd5\xf7\xae*Kn\xb7\xbe\x9c:\x1f\ny\x8f\xa0\x1548{\xd5\x00X\x86NXi\x1aT\xf6\xbbC\xa0\x8dt\xbe\x9f@\x1a\xce\x03h\x836\x90\xfa9\x1b\x13\xf0\xf6:\xa0\x0ce\x8d@,:\xa3\x95C\xd7\xab\x04\x80-\xe6\xf3\xc1\xd0!\xe7/\xe0*!\xd0\xb9uU@\x8b4\x8b\xe0C\x92\x13\x1b,\xf9\x01\x18\x00\xfb\xd6\xe2\xda\xe3|\x93f\xb8\x96Jz\\\x97\x9a\xd5Q\xd6_\x1b|\xd6C\xd9Eo\xbb\xf8\xc3,\xc35\xaf\n:_\x84\x82J\xe1\xdf\x06\x05a\x06h\xad\xb6\xcfW\x8b5\xe2W\xe2T\xb9\x13\xac\xf7\xffG\xfc\x99\xe1\x96\x97Hh\xbb\x05\\?\x83bZ\xfb\xact\xb6\x1d\x92\x95jl\xc6\xe2C%-\xfauC\xb6\xc2\x89E\x8e6\xec\xa1BG\x97T~\x13U\xde\xdb&\x9a\xb1\xf1\xcd!d'1^\xa3\xe2q\x17\x1bm\xe9\xbfz\xb8\xce\x9a\xe4\xe2\x93\x10\xff\xc3\xc7\xa1\x8cw\xe6b\xcf\xf9\xc3\xc3\xe1y\x0f\x1e\xae\xdb\xf5\xea\x0e\xce\xb0\xc0)\xe7p\x9d?\xe1\x1c>\x0fp\x89\x7f\x7f\n(\xef\xed\x1c>\xca\xfa\xc3\xc3\xe1y\x93\x1e\x1ei\xd8\xeb\xb8x\x7f\xf1\x8f8v\x97\xec3\x97\x86\xc8\xdf\xb45AZ\xbd\xbaC\xd19\xcf\xdf\xf0\x0dZ\x92\x03\xcf\xb0\xc6\xa2\xc1\x8d=+\xb5@\x8e\xacTy\xaf\x17l\xadm\xc9\xfdg\x99T\xf4\xc3\xf7\xec\xe8bhw\x9f\xdfj\xa0S\xe0]~2\xc0\xe9~\xbf]\xcd\x8e_\xcf\x93(~\\\xa7\xc6\x85\x13\x84\xf2{\xdas\xa9\xd4o\xfd\x18\xf7\xf8P\x99@\xfc%;\xec)^kE~\x93\x9f\xde\xe2O\xb3\xe3;\xff%2Mo\xf03\xeb4\xd2\xe3\x93\x9b\xce\xdba\xffr>^\x0c}\x1c\xae\xe7\x97\xa9t\xb6\xc9}\x18\xabI\xaf\xaa\xf5\x17\xb5\x9d\xa2\xecg\x9aT8\xcf\xb2\xb0\x9b\xf3\xe2\x97\xde\x07\xfa\x0b\xa3;r'0\x15:\x1b%*\x15a\x8e\xf6D\xff?-\x8e\xf7\xbfD\xe7x~\xb9\x02Qj\x86\xc4eqpKkS\xb9\xb5\xbc\x7f\xca3IX\x0e\xe3\xc7\x95hfG\x0e\xf8\xa8\xfdQ\xfc\xee\xb0WI\xfbw\x97\xec\x92\x7f\x03\x00\x00\xff\xffPK\x07\x08\xcc\xaa\x93V\x13\x03\x00\x00X\x14\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00)\x00 \x00swagger/service_zbook_follow.swagger.jsonUT\x05\x00\x01^F\xb8f\xec\x9aQo\xdb6\x10\xc7\xdf\xfd)\x08n\x8f\x99\x9c\xa4]\x07\xe4\xa9Y\x86\x0c\x05\xf60\xac\xd8\xcb\x86\"\xa0\xa5\xb3\xc2V\"\x19\xf2\xd4,\x19\xfc\xdd\x07R\xb2DI\xb6,KI-c&\x10 \x96x\xa7?\xef\xee'Jg\xff;#\x84\x9aG\x16\xc7\xa0\xe9\x15\xa1\x97\xc19=\xb3\xc7\xb8XJzE\xecyB(rL\xc0\x9e\x7f^H\xf9\x850\xc5\xdd,B\xe8W\xd0\x86Ka\xcf\x9d\x07\x17\xeb\xa3\xa1\x14\xc8B,\x1d\x10B\x05Ks\x0f\xfc9JT\x10\xca\xb4\x98L\x08\xcdtbO\xdd#*s5\x9f\xc7\x1c\xef\xb3\x85\x9d2\xcfg\xcf\xdde\xab\xf9\x902\x9eT\xce\xde\xc7\xf6\xb3s\xe9f\xacf\x84\xac\xdc*\x90\xc5\x86^\x91\xbf\xdd\xe1\x96\x94\xbf~\x96\xf2\xcb\xadL\x12\xf9X\x19~r\x86\xa1\x14&K\xa12\xa6L\xa9\x84\x87\x0c\xb9\x14\xf3\xcfF\nZ\xceUZFY\xd8s.\xc3{S\xc5u\xfe\xf5b\x1ej`\x08w\xcb\\\x87\x171%\x8d\x1fA\x9b\xa8,M\x99~\xb2\xdao\x9cU!\xfe\xac\x9a\x12\x81 5WX\xe4\xe4O\x03\x04\xef\xb9\xb1)#(I~1\x92_\x8chH\x9cH\xb2\x00|\x04\x10\x04\x1f%\xc9\x0ch\xdf\xa3T\xa0\xdd\xac\x0fQ#hw\xdbDh0J\n\x03\xa6&\x9f\x10zy~\xde8\xd4\x96|ML\x16\x86`\xcc2K\xc8\xdaS\xe0\xb9wF&\xbc\x87\x94\xb5\x9c\x11B\xbf\xd7\xb0\xb4~\xbe\x9bG\xb0\xe4\x82[\xbff\xae\x16\xbe\xd8?\n\xb7\xb4f\xbc\xf2>\xad\xfc\xeb\xd1\x08\x96,Kp\xb7vA2\x01\xff(\x08\x11\"\x02ZK\xfdrK\xd0*\xfc\x88\x0c3\xd3\xa1\xba\xfc\xdf\xd3O\x15\xd3,\x05\x04]\x95h>\x1a\x8bYs\xb1\x90\xd1SS,\x17\xdb\xcehx\xc8\xb8\x06[\x1c\xa83\x18\xb9\xc8f\x9e\x1e20\xd8g\xc1\x9f\xbc\x05\xd7\xb0/\x8e\xb5`wF3\xdfM\x113Ge\x04 \xecOenU\xe0\xb5\x07\x96[\xed:\xe0\xfb\xc5\xd9\x1c |\xbe\xd8\x13|nL\x12\xbez\x9e\x0e\x05_\x0cX\x90wg\xf2\xa0\xf7\x050\x06$\x11 \xe3\x89!r\xd9\xda\xcbv`\xb8\xc3\xba\x03\xc6_\x01\xf3\xff\x8a\"\x99:\x8f\x0d\xbd'$\xdd\x98$\x92\xadT\x1d\x9eJ\xd0w\xa1\xcc\x04\xf6\xc62\xe1\x06 Y\x1b\x0f \xd39\xe8\xb2\xef\xc3&\xe8\x1b\xa7\xfah\xe0,\x04\x9f\xe8tc\xdat\x96\xb9:<\x9e\\\xc4#\xf8\xe4\">\x14\xa0\\\xc4GF\xe8Z\xf1 Q7\xa6\x8dh\x95\xacC1j))\xf7\xd0At~\xf3\xdd\xf37n\xca;\xdc\xe4\xb9\xf4\xc5\x9e\x90tc\x92H\xd6\xf34\x01\x1a\xb9\x88\x07\xe18z\xb3\xdc\xe2\xa0\x17\x90V\xf4\xf1\x10\xc9E|B\xd2\x8d\x89#\xe9\x12\xf5M\x99,\xbf\xaf\xf1$\x95\xda\xe9\xe6\x96\xb0G+>)\x17@\xb9\xf8\x0ca\xf5\xf0H\x95\xb6\x18!o\x10A-lE\xd0k\x9c\xac\xfd\x18\xd4\x16\xad*\xa9k\xb5\xa5\xe7\xf2\xfb\xb0\x8b\xa0\xf6\x1d\xc8\xcc\x9b\xd6\xd2]\xd4\xfe\x08\xe1\xadn4\xe9\xcah3\xe8\xabz\xd0K\x95\x9bz~#D\xbe`t\xdf\x04\xb5&w\xa7\xee\xa9F\xf7\xb6\xe9u\xa0.\xb7\x11t\x05\xb4v\xe7\\J\x9d2\x9bF\xca\x05\xbe{\xeb\xc9>1\xcdv\xcf&\xf5=I\xdb\x95\xae\xe6[\xf4\x08\xd5S\xc8\xd7OA\xbb\xfd\xb4{\xe9\xc7\x90\xb1\xea\x89\xee\x83\xffc\x9e\x01Z\xc7\xe4i\xfd[\x9d\xbd\x0d\x07\xddk<{\x0dJ\xdet\x05\x99\x0b\x84\xb8\xf6\xda\xd5\x8c\xf2\x9b\xcb\xcd\xae3\x15\xbd\xf4\x0et\x90\xfdm\xd3k\xf8\x81\xcaD\xb1\x18\xb6?+\x0cO\x95\xf5\xfb\x91?o\xd54\xdc\xf3K\xdd\x80\xde\x06\xb5\x16[g\x8a\xc6\xdfv \x81\x14\x04\xb6z\x04k?LkV\x7f\xd7\xa4\x1c!m\xce\xdf~\xe5\xe2\xec\xee\xd7LwS\xf2\x8cV{\x94\xab\xf7\x8a:\"\x16\xa7z\x1dR\xaf\xef\x82z\x07\xaa;I\xff\xeb\x8a\xd5\x12\xe5\"[^\x8b\xa71\x01x_\x18\x0cL\x1c\x8b\"\xb7\x16\x96\xfc^\xbb@]k\xd5\xe5\x1a\xa14\x94\xd1+\x14n\n\xc6\xb0\xb8\x7f\x04<\xd3\xe2\xc7<\x07*\x1d/\xfd}\xaaff\xffV\xb3\xff\x02\x00\x00\xff\xffPK\x07\x08\xb1K\x0c\x0by\x04\x00\x00\x93-\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00+\x00 \x00swagger/service_zbook_markdown.swagger.jsonUT\x05\x00\x01^F\xb8f\xecZ\xdfn\xdb\xb6\x17\xbe\xf7S\x10\xfc\xfd.3;I\xbb]\xe4\xaaY\x81\x0d\xc5\x90\xa1k\xda\x9b\x0dE@K\xc72\x1b\x89d\xc8\xa3\xb4\xce\x90W\xd8\xee\xf6*{\xa2\x01{\x8c\x81\x8cd\x91\xfa\x13\xabR\x12\xbb\xa8\x05\x14\xb6E~\xc7\xe7|\xe7|\xc7\xd4i~\x9f\x10B\xcdG\x96$\xa0\xe9 \xa1\xc7\xd3Cz`\xefq\xb1\x90\xf4\x84\xd8uB(rL\xc1\xae\xf3\x8c%@\x98\xe2n\x17!\xf4\x1a\xb4\xe1R\xd8\xb5\xc3\xe9Qy7\x92\x02Y\x84k\x03\x84P\xc12g\xe1\x86\xdf\xc4\xa9\x9aF2+6\x13Bs\x9d\xda\xa5%\xa22'\xb3Y\xc2q\x99\xcf\xed\x96\xd9\xdd\xee\xd9\xcd\\\xca\xcbj?d\x8c\xa7\x95\xb1\x17\x89\xfd\xecL\xba\x1d\xb7\x13Bn]\x14\xc8\x12CO\xc8o\xeev\xc3\x95_\xbf\x97\xf2\xf2\x8c\xe9\xcbX~\x14\x15\xf4\xbd\x83FR\x98<\x83\nN\x99R)\x8f\x18r)f\x1f\x8ct\x88\xbb\xbdJ\xcb8\x8fz\xeee\xb84\x15\xb3\xb3\xeb\xa3Y\x02x\x91\x15n\\X\xea@\x04\xd4)i\xfc\xcf6cy\x961\xbd\xb2A$\x80\xa4\x04\xaf\x19\"\x84\xc6`\"\xcd\x15\x16\xc9yg\x80\xe0\x92\x1b\x9b;\x82\x92\x90.\x9cT\xa0\x9d\xdf\xaf\xe2\x06G\x17?\x02\x96\xef_\x16~zP\x0dFIa\xc0\x04\xce\x12B\x8f\x0f\x0fk\xb7\x9a\x0e\x9e\x12\x93G\x11\x18\xb3\xc8SRZ\x9az\xe6\x1d\xc8DK\xc8X\xc3\x18!\xf4\xff\x1a\x16\xd6\xce\xfff1,\xb8\xe0\xd6\xae\x99\xa9y\xd3\xe57\x85q\x1a\x98\xb8\xf5>\xdd\xfa\xdfJcX\xb0<\xc5\xcd\x11\x08\x92\x0b\xf8\xa4 B\x88 h-\xf5\xc3\x05\xa2Ut\x8e\x0css\x8f\xd7\xeb\xf7\x9e\xffT1\xcd2@\xd0Uu\xde]\xb5`JQ\xcce\xbc\xaa;\xcbE\xd7\x8a\x86\xab\x9ck\xb0\xa5\x82:\x87\x91A\xb6g\xeb*\x07\x83}\xc2~\xef\x85\x1d(\xbf\xb8\xd7\xa2w\x07\x9b\xf8\x86\n\xee\x9a\xc2t\xad\xaf\xb7,\xff\xfd\xe3\xef\x7f\xfe\xfc\xab\x04\x93;p\xb7<7m\xef\xab\xcaWu\xe0\xaek\xd29\xbcW\xa4\xbbv]\x91E\xae\xb6\xa7\xc7\xab\x1c\xf4j\xad\xc8\xdeZt\xb0A?\x92\xdd\xc8{\x05\xf9\x8b\x85\x9d\xb5\xa0vR\x8d\x81\xb7{)\xbak'\xa5XK\xd4\xb6u\xa8A\xc9\xb1b$\xd6\xc8pE6\xe0\x9be\xf9\x06\x94\xfc\xb2\xa4\xe9{\xbc\x97\xa7\xbbvW\x9ea\xb2\xb6-\xd1\xdc\x80\x1e-Qkd\x84D\xeb\xf0\xcd\x12}g@\x7fY\x12\xf5=\xdeK\xd4]\xbb+\xd10YO,\xd1\xf5h\xcasl\x1d\x01U\xf3\x1f\xa4D\xd0\xe72\xe2,\xf5\x05\x8b+\xe5\xf8\x93\xf3\x0f\x10US\x17\xaa\xb4\xd5\x13\xf2\x9a(J\xbe\x03\x99\x946\x0cj.\x12\xda\x9aO\x1eI1\x04w7\xc2\xeb\x07\x0b\x199(C\xef~\xf6\x1f\xc1\x83\xed>C\xb9\xb0\x87\x8b\x9f\x07cS\x86\xfc\x1a^3\\\xf6\xc6Ojv\xaa\xb9\xeb\xd1\xb4e\xf4\xd6\x83\xbf\xa2\x15\x8d \xb0\xe5\xd7\x83\xdc'\xb1\xa6\x02\x82v\xa1\xe1\xba7\x1d\x1eN\xc0\xa7z\x87\xec\x85[895~0J(\xd3\x9a\x85M\x87r\x84\xac\xbe\xbf\x9b\xb6b\xb5\x8b\x8c@\xcd\x1e\xa4\xbd\x97\xe6*f\x08\xf1\xe9\xa6H\x03\x7f\x17Rg\xcc\"\xa8\x05\x7f\x83<\x83v*p \x19\xbc\x94\xa9\xd4\xbd\x89\x9c\xf8\xaf\xad\x85\x16\x8c\x04FT\xd9\xb6d\xba\xe0\xe9CI\xf4x\xda\x98\xc3m\xe4m\xbc\x82\xd9\x8c\xf1u\xf3\x1f\x10,\xb2y\n#\xf0Y\xfc\xed\x10X\xf1_\x84?\xc1j\x08:\xd2\xf0\x88M\xf1I\xfb\xce\xc4\x7f\xad$\xd6:\xd6\x19!7\x952.\xde\xca\xb7\xc6=\x88\xf5\xf6\xce\x8bL\xb1\x04\xba\xcb\x97\x0b\x84$x\xa6\xab\xd7\xef\xb3\xe3n\xbb\xe7\xfc\xa6\x93\xb1\xcf\xb4<\xa9}C\xd5\x8b\x9fO\xc3\x11\xec\xfd\x8c\x8f\xef\xc2\x90B\x06\x02\xb7v\xceh\x1e\xba\x823\xc6}\x85\xd76\xb0\x18\xc1\xc4\x93\n\xca/\xad}\xd1?\x9b6\x07\x9c\x9b3\xfeU\x17\x7f\xdb(`\x04\x13c\x8a\x7f_\xc0e\xd7\x0e\xc6\x7f\x9b\xb3\xf6\x95\x16\xb0\x96(\xe7\xf9\xe2T\xac\xc6\x84\xfe\xa2\x00\xf4+\xb6F\xeaX\x1c\xbb(X\xfa:\xf8\x82\xd0\xd7j\xb88\xc2\xd3H\xc6\x0fU\x81^mg`L\xf8g\x1d\xa4\xaf\xdcb@\xc6\xd3m\x15\x8d\x97\xfe>U3\xb1\xffn'\xff\x05\x00\x00\xff\xffPK\x07\x08\xbe\xa3\xca\xaai\x04\x00\x00\xef'\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/\x00 \x00swagger/service_zbook_notification.swagger.jsonUT\x05\x00\x01^F\xb8f\xec\x9b]o\xd4F\x17\xc7\xef\xf3)F~\x9eK\x1eo\x12xh\x9b+(R+\xa4\x16\xa1D\xb9i\x85\xa2Y\xfb\xecf\x88\xed13ch\xa8V\xa2\x12\x14.\xaa\xb6\xaa**qQ\xc4E%n\n\xaaPE\x05\xaa\xfae\xbaI\xf8\x16\x95g_<~\x19{\xbc\xbba\xbd\xd4\x96\x10\xec\xda\xe7\xf8\x9c3\xf3\xfb{g8\xfer\x0d!\x8b\xdf\xc2\xfd>0k\x0bY\x9b\xf6\xbau&\xfe\x8e\x04=jm\xa1\xf8\xa4\xf4\xe0\n\x15\xa4G\x1c,\xe2,\xa6\xe6\xd7\xa4\xb9C\x03\x1e\xf9\x90\xb8\xb0p\x18z\xe3\x8b;\xd7\xf9\xc8btm\xc8\xa8\x1b9\x86\xd7b\xb1\xcf\x93\xeavnnt\xfa \xf6<\xc2\xc5\x9eC}\x1f\x02\xb1\x17(q\xedE\x01\x03\xec\x82\xbb\xe7\xd0(H\x955\xa4\\\xfd\x1c\x8ff\xe4\xfb\x98\x1d\xc6 \x0e\x1f|\xfd\xe6\xc9\xef\xc3\x07?\x0d\xef\xbf:\xfa\xe6\xfe\xf0\xd9\xa3\xe3\x1f\x9f\x1e=xy\xfc\xe8\xee\xc9\xf3\xbb'\xcf^\xbd\xb9\xf3\xe8\xf8\xf1/\xc3?\x7f\x18\xfe\xf6\xf3\xdf\x7f=9\xfa\xea\xf9\xb4\xc8\x08Y.p\x87\x91P\x8c\xc7wNo4\x04&\xb3\xb9\xec\x16\x16\x7f\xefc\x10\x9f\x10..\x8d\n\xa0\x9e\xda\x1d\xa7\x7fIf\xaf\xf8d\xc0C\x1ap\xe0\xa9\x12 dm\xae\xafg\xbe\xca\xe7s\x11\xf1\xc8q\x80\xf3^\xe4\xa1\x89'[q/\x8d\xb8\xb3\x0f>\xce9C\xc8\xfa/\x83^\xec\xe7?\x1d\x17z$ \xb1_\xde \xbb\x86yl\x8f\xefh\xa5\xfc\x0e\x94O\x035\x14\xcb\x85\x1e\x8e\xf3_\xf2&\xde*\xb1\xd6l\xd64\x9eoM\xdc-\xe8\xf2h$\xe8\xda!k\x00\xf1\x85\xdb\x80\x8b@\xdep\x9b\xce\x9czC\x87F\xe0\x17\xed\xb3\xac\x04\xf9E\x81\xb7\xe8\xcb\xa3\xb1\xe8\x17\x8fY\x03\xd8\xcf\xed\xe1-\x84{\x83m\xb6\x1a\xd0\x1bx3\">\xbbY\xb2\x12\xb4g\x83nI\x97GcI\xcf\x8fW\x03(/\xd8\x80\xab\xc9y\xad\xfd\xb2\xb7\xb0\xe3V\xbc\xcb\xb1\x12D\xe7\xc3n\x99\x96Gc\x99.\x1a\xb1\xe5R\xedcvP\xdc\xf33\xda\xe63\xa6\x9bCz\xc5/\xedKX\xcen\xabU\xdaW\x92\xfc)f\x07\x85+#\x99G\xd3\x81\xde\x01\x19u\x1cmK\xb1<\x1aIq\xe9$k\x04\xcc\xc5\xbd85i\xae\xf6T\x8f\xec\x94\xab\xd9\xd0.^\xf9\xb4l\xb7l/\x92m\xfd,k\x04\xdc\xf9N\x99\x9a`\xc70\x12\x1f\xf7a\xe6\x87t\x89\xb5\x11\xc7\xf9uM\xcbp\xcb\xf0\"\x19.\x9ea\x8d\xe0\xb7\xa8\x81e\x06\x82\x157\xb3 \\fn\xc4p\xd1:\xa6\xa5\xb8\xa5x\x91\x14\xeb\xe6\xd8\xb29f\xc0g\xed:)05\x07\xb7\xdc\xb8\x12\xdb\xed\xd8|\xd4\xbc\xb3\x1a\xbd'\xd9\x80[^\xe5\xd1H^\xf3c\xb5\x04F\xa7o\xdd)\xb1M\x93\xb0j\xbfT\xa3@-\x0eCYd\xda\xbd\x0eNBN\xf2Z\xe2\xc6Y\xdb\xd0\xfb(\xfa\x89\x9e\xd4\x08j<\xf9\x0d\xa2\nY,\x06\x82dp\xb6\xb2Z\x95r\xc2\x05#A?5O\xac\x1ee>\x8e-,\x12\x88\xf3\xe7\x92\xc2\x0f\xd2\x85\xcf&c\xfc\xe2\x81A2I\x897lS\xf7\x9a\x1aW\xda\xadT\x91\x8d\x1a\xb6\x0d\x12I\n\xbci\x9b\xb8\xd6\x14\xd7\xac\xff\xdf \x9e\xa5\x17\xd6\xb0\xe5\xd5 \x95\xa4\xb4\xe7l3\xe7\x9a\xe2V\x86\xb4\"\xe5-\xe8P4\x08yZ\xc6\x0f\xecL\xfbl\xc5\x1d\xe6\xafJ\xa4\xfc^\xd2\xd4\x86\x04\x02\xfa\xc0J\x8asv\xb3\xba8\x9ag\xc0e\xf5-\xf8Y\xe2\xe7\xc0\xc6\xbf\x10\xca\x066 Oy\x18O^r\xafm\x98[\xcf\xa6,\xbb\x94z\x80\x83b\xd3xEzYkZo\x1a*n\x1d\x06X\x80{q\xc6 \xeeb\x01\xff\x13\xc4\x07\x8d\xf7\xd1\xb8]\xa2\x81\x80J\x864\x15\x0b\xe9)\xa4\xcd\xc0\xc3\x82\xdc\x84\xabX\xec\xcf\x1a\xd6\x95\x19gOl\xbb[w\xf6\xad\xa9\x7fW\xc2QCBt|\x84\xb8\x0f\xfa\xc2\xd7D\xfbL\xda\xef\x0e\xb9\xad\xcd\xbc\xa6\xe7\xb5\xcc\x1d\x12IXd\xe8l\x9c5\xadl\x9cE_,W\xd7\xcc\xac=\xff\x00%\x01JZ\xe8Ug\x98\x83\xe5Fhl\xab\xf3\x87\x05\x82\xa5\xb0\xbex\x04\x15y\x1c\xac4\x98\x10\xc0\xcfy?S\x0f?x\\x\xfd}\x0fe\xc0j%-\xd8\x1eeB\xe8\xed\xf5u2\xb4O\xf0\x9eX\xc79X\xbbt\x15\xd9z\x9aG\xee\x03\xc8\xf2\x12j\xb6\xe7\x8c\x10\xfa\xad\x81\xa5\xf7\xf3M\x96\xc3RH\xe1\xfd\xdaL/R\xc2\xbf\xb5\xaei\xcf\xc1&\xfa\xb7\x89\xd7\xa49,\x99\xabp\x9c\xbf$N\xc2\x17\x0d\x1c!'`\x8c2\xff^\x18F\xf36\xdd\xc3\xacw\xef\x11\x7f\xaa\x99a5 \x98n\x7f6O\x12\xccV\x13\x0b\x95\xafS\xb2B\x0e\xcd\x18\xf8\xe8\x84\x01\xbfG\xd0883\xc8C\xb5\xfa\xe8\xc0\xe2\x94\xa0\xdfGA\xf7d\xdf\x8e\xa5b\x0f\x98Y\xec\xa5M[\xa3J\x03\x0c\xa1\x95e%\xe4j\xba(\x03\x92H\xf8\xdc\x8a\xcbY0G\xe8\x92\x8c:xD\x9b\x01\x1a\xde\xdfz\xce\x17/\xcd>\xdf\x17e\x86\xe72\x95\x99\x96\xea\x99\x84\x99C\x05\xa7 \xb3A\x9e(\xcaG\xc1\xc3\x82\xfc1\xc0\xfe?\x82L\xf8\xbe\x082<\x17)\xc8\xbdR=\x93 +U\x08\xf9\xb0X7\x92\x9c\xac\xc6\x00;M\x8c\x0d\xf4h-\xbe\xf5\xb07\xeb&\xb0K\x17bL\xf6E\x85\xe1\xb9H\x15\xf6\xeb\xf4\x94\x12\xdc\xddq#B;\xe6t\xb8\x95\x8e\x04\x8ak\x1dR\xa8\x16\x1f\x80cw\xbd\xde\xdd\xf6o\xe7{\xb7\xbdf\xf1\xab\xe1U\xda\xbd:a\x19m\xbcXQ$\xca\xa3\xcd\xf5?U\xe3\xd6\xcbB\xa9\n\x98\xa4\x077O\xa1TQ\xc1th?\xa5]T\x87\x9b\x9d3b\n\x1f\xabw\x0d\xe8 7\x8bF\xc8\xe2pTL\xeb\xf05\x9b\x06\x9c%\x0e\xbar\xde\xcc\xd3\x0b\xc2X\xdc\xa3\xc5L\x1c\x0c\x1cJO\x9a\xb8\xe1\xf8_\xcd\xd3~l\x8c\xfe\xb1\xf1\x1f\xfa\x1c=\xfbS?\xbdva\xa9L\xcd<\x82\xe6\x0c\xe1;\x145\x8c'\xe7?Xi\x16\xff\xeev\x88Q\xa8\x16ny/\xd7\xe7l\x8b\xd7x\x8c\x88\xb6LvnY\x9e\x87\x03\x96U\xbf\xf6\x16\xe8s\xedZ\x9e3\x98r\x95\x0f\x12\x15\x12\xa1\xe8\xb5\xbb\xbd\xa4\n\x89\xafn\x0f\x97\xae\x06kY1=\x03\x114\x07d\xa2\xdak\x8e\xb7Pf\x0c\xebwYT \xd4\xa9\xfdp&\xda\xd9\x81\x06+*\x7fd\xbf\x19\xda5\xbe)\x9amf\xff\x04\x00\x00\xff\xffPK\x07\x08YXk\x98\x97\x03\x00\x00\xd6\x18\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\x00 \x00swagger/service_zbook_repo.swagger.jsonUT\x05\x00\x01^F\xb8f\xec\x9b_o\xdc\xc4\x16\xc0\xdf\xf7S\x8c|\xefc\xaf7I{\x8b\xc8S\xd3T\x82J\x05\xaa\x84\xbe\x80\xaah\xd6>\xbb\x99\xc6\xf6\xb83\xe3\x94-\xcaC%DC\xa9\xa0\xa2\xa8H\xa5B*\x12\xa2\x02J\xc5\x03\xa2j\x85\xfae\xbai\xf9\x16hf\xff\xd8\x1e\xafw\xfdg[{\xc1#E\xbb\xb1\xe7\x1c\x9f9\xe7\xfc\xec\x99\xf1\xd9\x8f[\x08\x19\xfc\n\xee\xf5\x80\x19\xeb\xc8X3W\x8cc\xf2\x18\xf1\xba\xd4XG\xf2jQO`KL\x14 dx\xd8\x1dj Wm\xc77-\xea\x8e:#d\x04\xcc\x91\xa7v\x85\xf0\xf9z\xbb\xdd#b7\xe8\xc8.\xeda\xef\xb6\xbal\xd8\x1f\\L\x9cP\xd9\xa9\x9e\xfc_\xa9T=\x0eZ\x08\x1d\xa8Q\x08\xdc\xe3\xc6:\xfaP\x1dN\x98\xf2\xc1iJ\xf7\xb6\xc0\xa7\xa1\xd8E%fQ\x8f\x07.\x84\xa2\x06\xf6}\x87XX\x10\xea\xb5/q\xea\x19\x93\xbe>\xa3v`e\xec\x8b\xc5.\x0f\xbd\xda\xde_m\xe3@\xd0\x1d\xde\xf7\xac\x1d&\x0d\x898\xcc\xa7<\xea@\x19\xa7\xc0u1\xebK\xd3_^\xffip\xe3\xc1\xcbg\xf7^\xfc\xfchp\xeb\xe6\xd1\xc3\x1f\x9e?\xbd=xr{\xe2#\x84\x0c\x1b\xb8\xc5\x88/F\xe1\xc9\"B}`\xca\xf0\xb3v\xccA;\x1b\x81\xa0\xdb}\xcfR\xde\x8a\x080\xe0>\xf58\xf0\x98\xa5\x08\x19k++\xda\xa1\xa4E\x1b\x88\x07\x96\x05\x9cw\x03\x07\x8d5\x99\x11\xf5J\x88[\xbb\xe0\xe2\x842\x84\x8c\xff2\xe8J=\xffi\xdb\xd0%\x1e\x91zy\xdb\xefD\x8d\xdd\x1a\xa95b\xc2\x07\x91\xff\x0e\xa2\xd73l\xe8\xe2\xc0\x11\xf3m\xf7P\xe0\xc1G>X\x02l\x04\x8cQ\xb6\xb8!0\xdf\xda\x16X\x04|\x86\xd5\x93\xef\x11\xfb\x0d\x1f3\xec\x82\x00\x16\xa6\xe3\xb0i\x83\x19\x13\xd0\xa1v_7\x96xig\x18\\\x0e\x08\x03\x99\x1a\x82\x05Pr\x90z\x9c.\x07\xc0E\x96\x01_\x8c\x0c8\x06\xf8\xe8\x98\x86\xb5\x12iE\x95\x8c<\xa6\xf8\xb3\x18`\x01\xf9\xe0\x1b\xca \xa6\xb1\xa0e\xc8\x05\x0eH\xec\x12.\xef\x96HP\x94\"\x95\x8a\xdc\xa6\xea\xbf\x14\xc0\x85\xa66\xb8\xa9VK\xdc\xa2Q\xaa\x066\x1b\x1c\xc8\x0b\xdbP&/l)R\xa9\xb0\x9dQ\xfd\x97\x02\xb6\xd0\xd4\x066\xd5j [4J\xd5\xc0\xd6\x03\xb1\xe3\x10.\x14n;\x16\x0d<\x91\x19:)\x1b\x11\xcb\xce]xA\x9f\x91}, \x13}o\x818G\xb8\x90\xdf7\xf5\x0b\xd6\x92A\xdd\xe0\x86D\xd5jIb2V\x15\xf3\x18p`;\x0e\xd9\x83\"d\x0e\x0e\xbf\x19\\\x7f\xf2\xe2\xeb\x07G\x87\x7f\x0c\x0e\xbf\x1d<}2x|g\xf0\xf0\xd6\x8b\xbb\x9f\x0c\xfe\xfcj\xf0\xdbw\xcf\x9f\xdd?\xba\xf6h\x06\xb2\x83\xc3O\xff\xba\xff\xfbP\xcf\xd1\xcd\xeb\x83_\xef\xe6\xd26\x0f\xe2\x0b\x1c\xd89\xb2\x07K\x07s\xc2\xf0\x06j\xd5\xea\x0c\xf5\x94\x98\xd5\x01nz\xc5\xfb\xc7\xb2\xfd\xde\x15o)\xd1\x8e\xda\xdd\x90\xadZ\xdd\xc9\x8e\x87\xac:\xb0\x15\xca\x1d\xcc\x89\xb5\x13\xdb\x16\x9f\xc7s\x0f\x84Z\x81\"%\x95N\xad>\x89N\x95\x9b\xc5\xa7\xfc<-m<\xab \xd5\x15\xcc\x98\xc1\x0d\x91\xaa\xd5\x95H-V\x15\xa3hQ\xafKz\xf91\x1c\xc9e\x07\x11\xcd\x10\x9d\xc7\xe2fB\xa2\xce \x0e\xadm(T\xad\xce\x14\x8e\x03U\x0d\x82\x93\xed\x9d\xcc\xf0\x85\x12\xd9\xb1+\xb6\x894^\xe4\xd7\x1e\xb9\xb1\xa1\x0dm\xaa\xd5\x92\xb60F\x15\x82\x16\xdf(\xca\x8c\\l\x19\xf9\xe5\xa3\x97?^\x1b\xdc\xb9w\xf4\xcb\xf7\xc3\xe5_\xd9\x95\xe4P\xd5Pm\xe1\xf5\xa4\xbev_\nf\xa3\x067\xec\xaaV[v\xe3\xb1\xaa\x9a\xe1\xf1~P1\x84\xb3\xed\xddd\xe57\x9b\xb6\xb9\xe4\x8e\xd6\xe6K\x03\xee\xc8\xde\x86[\xd5j\xcd\xed$T\xd5`\xebb/\xc0N\x81\x9a\xbc\xa3\xcf>\x1f\xdcx\xf0\xfc\xf1\x17\xb9\xca\xf22J\xa5\x02\xf9\x8e2wij\xf3\xe2\xe668\xaaVK\x1c\xf5HUCc\xe0\xdb\xe3\xfa\xbc|\x9b\xafC\xc1\xbcuC)R\xa9\xf4]P\xfd\xe5\xd7\xa5\xd8v\x8d\x9b\xdb\xd0\xa7Z-\xe9\xd3#\xf5\x1a\xe9\x9bT\xcfG,\x9a\x98nL/\xdb\x8dP)\xfa\xbe\xf2\x1f\xed\\\x02+|Eh\xf8LR$\x88F\x84!g\xc8#\x9f\xc78\x19\xeb\xe1\x82\x11\xafgL\x8d\xa9\xe4\xf4\xdd\x82\xb2\xf2\x01\xff>\xdd\x03/\xb3pKS\x12\xfe,\xe2\xfff\xac@\xbe\x15\xe9\x96p\xd8\x88\xb9t\x8fi\xd2\xc9\xb2\xcd\x12\xce.\xe30){&Fzn\x15=\"6l\x9b\x15\x15U\xb7\xc4|1+\x15\xf0\x88\xf0>\xe1\xa4C\x1c\"\xfa\xe7`\x1f\x9c\"*v\xa9\x0b\xe7q\xaf\x90\xef\xc5.\xb8\xb0Ml\xe8\xe0B\xdeS\xf2\x9b\xd4\xa1\xd9\xa5[\x9a\x960\xdbW\xcdHmz\x0b\xa5fk\xdeLO\xd6L\x96\xc8\xf4\xd7z[I\xf7\xd5q3RZ\x16s'C)9\xd6\xe9\x0bxe\x93\xdc\xe1\x1e\x82\xbdQ0\xff\xa5\xf0\xff\x04qS\x0c\xcc=\x8blE?\x139\x14\xaf'(\x91?er w\xee\xb54\x1d!\xa7\x11 \x01)\x90\x02)`\xc4P\xc1\x11\x91\xd4\xe5 \x84OAi*\xb8\x8d\xdc\xf1v\xa7w}\xc1\x0d\xf1\xcd\x0c\x0e!\xccI\xe4\xf0\xce\xe8Y\xc0\xa4\xe7\x8bh\x12\x8c\x10\x8e\x15\xb3\x8f\x06\xc6H\xbd\xdf\xed\x86\xd4\x0c\xe2\x9e\x0d\xe9\x8e\xa3\xbbg=!\x8e\xd3x\x88\x08e)\xd8\xdd\xd0\xfev\x90.b\xd4Ah\xe4z2$\xd4x\x1f}\xecn\x17J\xf9\xe8M!\x8e\x0fA\x8a\xc3Ici\xfa#\x97\xee\x0b\xae\xe3\x08R\x08L\xa4d\xd4w\xc1\xdd\xc7z\x9c1\x8e\x95J\x04\xb1\xdf0\x96\x98\x81N\xb9\xee\x9e\xeev}\x05\xc4\xc0\x91\xe5\xf9h\xcas\x96>)t\x96N\xaba\x1cED\x0dm#\xe3d\xc4\xe81 \xc1\x9dX3\xb2\x10\xc2\x01h_Q9\x81\xc4\x0f5 3\xa0\xda\xca\x88\x8c@\x0b\xb2\x85\x04\xe5\xca\xb9\x1f\x94\x92vt\xcf\xe5\xe7x\xcc\xa4+\xd0Rp\x0d:W=Bxogg\xeeV\xb1\xd4\x03\xa4c\xdf\x07\xad\xfb1CS$/\x03\xef\x92\xb4?\x80\x88\x14\xc0\x10\xc2\xaf*\xe8[\x9cW\xba\x01\xf4)\xa7\x16Wwe\xafX\xf2\xe1\x04\x1c\xe7 F\x99_\xa3\xec[q\x00}\x123\xb3\xb8\x03\x8eb\x0e\x9fH\xf0\x0d\x04\x08\x94\x12\xea\xea\x1aQ\xd2\x7f`\x88\x89uM\xd5\xb3\x7fg\xea\xc7\x92(\x12\x81\x01\x95\x0e\xd7\xf15\xd7\xcc\xd4)=\x11\x0c\xe7\x8b\xa5\xbc\xea\x89\x82\x93\x98*\xb0\xc3\xc5\xa8\x18Z6Y\xae\xd6I\x0c\xda4i\xfbQ\xa6\xed\xdct0\xb9W1 \xb8\xd4N\x16l\xc2_\xc1\xad\xa7T\xd3\x1ee\xd4\x0c\x1b\xfb59\xff.y\xfa\xe2\xf2\x9b\x1f/\xce\x7fO\xce\xbfO\xfe|\x91\xfc\xf1m\xf2\xd3W\x97\xcf>O\xfe\xfa:\xf9\xf5\x87\x7f\xfe~~\xf1\xd9/5\x1eN\xce\xbf\xf8\xf7\xf9oc\x9c\x8b/\x9f&??[\nm O\x7f\x98\xb6w}\\\x9d\x16\xbd\xf5\xb5\xbb6\xdc\xd7Y\xbd\xd6\xeb\xec\x00\x18\xac\xbc\x0e\x8f\x93W]\x87\x17d/\xf4\xec[.\xffZ\xad\xc3\xc5\x92\xb7~u\xd7F\xfa\xb5L\xad\xcdq\xeb\x8d\\\x87S\xca\xaf\xd1:\\V\xf4\xd6\xd7\xee\xdap_o\xce:\x1c\x82\x99\xb7\xf5\x91/bnn\x90\xb9\xdf\x01\x93'\xfd\x9ekp\xd3\xed]^\xf6\xd6\xe0\xee\xdaH\x83W)\xb6^\x8b3\xaa\x0b\x1e\xbfA\xee~\x97js\xcd\x16\xeeb\xc9[W\xbbk#]]\xa6\xd6\x1a\x1c=;l\xcfT7k\x03\xd7\x9d\xdee\xbcn\x86\xd21*z\x8f\xc1O\x97@,\x95\xf5\x99\xa1s>\xc1\xb1\x065Q!\xe7\x9e)\x8e6\x8a\xf2\x10\x97\xaal\xa7\x9c\xf7V\xce\x1d\xb7\xf0\xc18\xb6Y~g\x0e'\xfd\xcf\x95]\xaf\xe4\xf0\xbc\x93 \xae\xe0ob\xca\x16\x042z\x0cn\xe6\xaak!g\xed\xbeP\x11\xb1\xa2a\xca\xcd\x9d\xdb%\xfdU\x16^\x1c\xa1-*\xb7\xf2=\\\x93\xfcK\x0f\xbbj\xe9oy\xa5g\xac\x8d8\\(\xff\x1cJ\xf5\xc6\xbd\x85\x0eKsqE\x1a\\\xb1\x05\xf7\xbc\x92s\xb3\x06\xfc\xad\xae\xc1\xd6\x0dE\x15n{\xa5'\x1d\x8d8\\V\x89\xfa\xaf\xe1\x16Z,\xcdG\x1b\x1d\xaa\xb9\xbc\xe3Ul,\x1b\xf2\xb0\x90\xcf\x85D\xcco\xd4\xcb:i\xb7\xb6T\x7f\xfb\xb4([\x92\xb0fM\xa4\xdc@\x08\xaa\xa6\xf0[{\xe5\xdaZ\xdc\x07\xf4\xacR\xdb\xd5\x91_\xea\x88\xcb\xe4\x9e\xc4\xa0\x86\x8d\x13\xab\x87\xea\x1b^\xc9.\xa9\x81\xd4\xed\x87(0\x88\x80\x9b\xc2\xf6k\x8aC\x94\"\xf9/xL\x0dD\xf3\xf1\xd5o\x9e<\xad\xfbx\xb7\xf3\xf6\xac3\xdb\xd8}\xde\x17\xd9\x8f\xf7Q\x91\xc3\x12r\xcaaZp\xd3fTM\xff4g\xe9D\xaa\xdf\x16\x8c\x89'6\xa0\"\xbd'\x04\x03\xc2\xab\xf2S\x0e*+\xafE\x88e@\x0c\x04\x07+\xce\\6\xf9uC#X8{)aD/\xee\x1f\xf0a\x1b\x95\xee\x9aV\x1f@$\x08\xdc`$\xec\xfd\xdc\x0b\xf2\xb5\xa6[\xe9\x16\x95\xfa\"\xf8\x1f\xe6\xbe\x08\xb4&as\x062\xa9\x01\x18B\xd9\xba\xbc\x9f\x91?\x13_\xe9u\xbb\xbf\xee\x8c:\xff\x05\x00\x00\xff\xffPK\x07\x08\x92-\xebs}\x04\x00\x00\xb8'\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\x00 \x00swagger/service_zbook_user.swagger.jsonUT\x05\x00\x01^F\xb8f\xec[\xcb\x8e\xdcD\x17\xde\xf7S\x94\xfc\xff\x12\x9b\xd0=3 \x11\xcc*\x93\x08\xd0H\x91\x08 \xc3\x02\x14\x8d\xaa\xed\xd3\x9e\xca\xd8UNUy&\x1d4\x12\x1b$6\x91X\xe4 `\x93\x15,@b\x85x\x19\x92\xc0[\xa0*\xb7]\xbet\xb5o=i\xb7hK\xd1\xcc\xd8\xf5\x1d\x7fu\xce\xf9N\xdd\x9coF\x089\xe2\x12\xfb>p\xe7\x109\x07\xe3=\xe7\x86\xbaG\xe8\x8c9\x87H=G\xc8\x91D\x06\xa0\x9e?\x9f2v\x8epDt+\x84\x9c\x0b\xe0\x820\xaa\x9e\xed\x8d\xf7\xd3\xbb.\xa3\x12\xbb23\x80\x90Cq\x98X \xcf\xbd \x1a\xbb,\\4F\xc8\x89y\xa0\x1e\x9dI\x19\x89\xc3\xc9\xc4'\xf2,\x9e\xaa&\x93\xa4\xf5D\xbf\xd6\xb4\x87\x10\x93\xc0\x18\xbb\xe3\xab\xbf\xb5I\xdd\xe2j\x84\xd0\x95\xee\x85\xc4\xbep\x0e\xd1\xd7\xfav\x85\xcaWw\x19;?\x11\xc0\x0d\xec\xb1\x86\xb9\x8c\x8a8\x04\x03up\x14\x05\xc4\xc5\x920:y\"\x18u\xb2\xb6\x11g^\xec6l\x8b\xe5\x990^\x9d\\\xecO\\\x0eX\xc2i,\xb4\xff3\x8a\x11\x13y\xef\xa9 \xc5a\x88\xf9\\\xf1N0\x88\xc2%\xd2\xb8\x1b\xa6\x95\x07\xc2\xe5$\x92\x8b\x90\x9c\x08@\xf2\x8c\x08\x151$\x19B+\xa0,\x02\xaeI\x1f{\x05\xe7\x9c\xde\xd3\x98\x93Rs\x0e\"bT\x80(\xd0D\xc89\xd8\xdb+\xdd\xaa\xf2:B\"v]\x10b\x16\x07(\xb54\xce\x99\xd7 \xe1\x9eA\x88+\xc6\x10r\xfe\xcfa\xa6\xec\xfco\xe2\xc1\x8cP\xa2\xec\x8aI45T\x1f.\x8c:\x05\xe8U\xee\xaf\xab\xfc\xdb\x1c\x0ff8\x0ed=s\x8ab\n\xcf\"p%x\x088g|}\x1d\xe0\x91\xfbHb\x19\x8b\x15\xac\xb3\xdfs\xfc\x9d\x08s\x1c\x82\x04n\xd20\xb9J\x9dI3\x7f\xca\xbcy\x99,\xa1\xb6'\x1c\x9e\xc6\x84\x83J\x0b\xc9c\xe8\xd9\xc9b\x94\x9e\xc6 d\x93\xee>\xceu\xb7 \xeb\xc5\xbd\x92\x985d\x947\xb2\xf0\x97V\x9d\x0f\xf24 Bj\xdd\x9d\xba,\xa6\xb2\xb1\xfa\x14\x0e\xe1 h\xab=+\xce*\xbcOA\xde'B\xaa\xdf\xefi\x8aC\x97_\x99\xf0N\x84\xfa\x1a\xa4\x08\xab\xb1\xda\x9c\x14\x9f\xc6\xc0\xe7\x83\xd7\xe2\xe7\x8a\xe5V\x89\xb1\xc8x\xa7F}\x0dU\x8d\xe5`mN\x8eZ\x88\xf8\x02K\\\x98\x93\xfa`\x17\xe2\x97\xc0\xc9l\x8e\x92\x89y\x03\x1d\x1e=8V:\xbcH`\xea\x85\xef\x89\x04\x8d\xb0\xe7q\x10\xa2\xa9*\xd5\xcf\xa3\x84\xeb\x16(\xd2\xb0\xdd\xa9Q_\x165\xaa\x8c\xd0\xbf/U\xa4\x1e/VHr\x86\x03Q\xd6\xa4\x9cG\xda\xb2\x90\x9cP\xdfy\x87J*,\xa5\xebF4\x1f$\xf2@b\x12\x08\xc4fm\xc7\xb5\x1at\x9d\x8e\x8e\x15\xd3-Q\x91\xe2\xba\xd3\x90\xbe\x86:\xa2\x990mf,\xcbVx\x8d\xd5\xf7\xee\xe6\x93\xe9\xdc{\xf0rK\x89\xee\xb4\xa6\xafAj\xcd\xc4hCBc>\xa1-\x95\xa6 \xade\xa6A-D\xa6\xdao\x87\xcaR\xa6;\x99\xe9k\x9823A\xda\x8c\xce\xcc>Ic\x9d\xbd\xf9\xe9\xdb\xb7\xbf\xfd\xf8\xf6\xe5\xab7\xdf\xff\xbeBi\x7f\xfd\xf1\xe7\xdb\x97\xaf\x92f\xaf\x7fx\xf1\xfa\xbb_\xffy\xf9\xf3\xdf\xbf\xbc\xb0\xc1\xad\x92\xcbV\xb1\x83\x97\\\xc6t'9}\x0dRr\xb9 mFrq\xe4\xb5>\x9fC \xa8\xed\xe8\x96\xc2\x9a\x8fo'\x1a\xb0\x15j3Twr\xd3\xd7 \xe5\x96\x8f\xd2\xc6\xf5v\xca\xe8\x94a\xee\x11\xea\x0fYz\x9f\xd1\xbb)\xcb\xed\x11\xa1!\xbd\x93\xa3\xbe\x06.\xc7|\xbc\xde\xa10\xb3\x0fir\xbc\xb2\x0e8\xcbN\xf2sBMw\\\xd9\xf4 \xb8\xe6\xbc\xcc\x89\xb8R\x95$%m\x98=\xdf\x92bl;\xb7\xc5\xb8\nq\xc9\xb8\xd7\x05\x9b~M\xd4\x1aH\xe8\x05\x91\xba:\x9c\xf0\xe6\x06F%C\xe6\xe3\xaa\xfdq\xeeS\x9bQ\xae\x91\xb3\xf4\xcb\x16\xbb\xabKX\xdbQo\x8fX%;\xf0\xfd\xbb\xfc\xd1\xb8\xf2\x91C-\xf9\xda\xee\xd7\xb2/\x1f2/c_(z3\xc6C\xac\x10\x0e\xa1\xf2\xf6\xad%]\xab\xb2^~\x9e\xd7\x83\xf5\xba|\xbe\xbf7\xae\x9ef\xd7\xf3\xdf\x12\xb7\x9fTO\xd8zP\xae\x9c\x82\xa2\xe6\x9c\xa7s \x8d)\xe7\xf7\xc9{\xf0\xedSC\xe3,\x19,\xe0)c\x01`jG\xdf\xc5\x82\xb8\x9d\xd1\xc7!\xf6\xad\xc4\xab\xe8Q\xc9\x8aI\xf0\xdb\xe3\xfcy\xd6*\x7f\xf7O\x90\xcci\xc7\xc5S>\xfd\xd0:\xae\x17@\xab\xdd\xd9\xd6\xae\x01\xadvt[\xbb\x06T\x9b\xd2i\xbd.\xbd\xa2\x93o\xbb&s\xe7A}\x1a0\xf7\x1c\xac\x13\x89\x95Y\xac?g \x1d\xc1KW;\xcd\xe1\x9c\x05\x9d\x1c\x95\xac|\xbc\xa3\x8e\x85Y\x81\xdf\x97$\x84\xe5\xd6\x93\xef\x8d\xd7j\xbd&\xe9\xd6PD#\x95\xe9\xd6 \x12*\xc1/\xac\x12\xcb#\xd5\xcd\x03\xdb$\xd5\x87G\xe4\xb95L\xdd-\xafkj\xf0\xe18;\x97\xb4\xba\xb7\x7f\xcd\x84\x00B\xa0\xb2\xb24N\xed`\xceqqm\xe5\x10 a\xb9\xbd\xfd\xcd\x8b\xa7u\xc7e\xc5jVX2\xda\x92\xac|\x02\xd0\xc7\x0b]+T\xeb\xb5\x8e=\xde\x07csDf\xefj\xff\x88\xf7\xa9\xe4]\x0b\x1b\xd6;(_\xb0s\xa0]\xe0\x1cf\x1c\xc4Yg|\xee\xf5\x1f?\x8b\x08\x07\xb1\xce\"h!z\x0do\x1a\xe5\x7f\x9a\xf4\xa8l\xcc\xf7\xc8\x8e\xffn\xbd\xfd`l\xce\xcb\xec\x0e\xee\xaf\xbf\xed\xad\xb8\xab\xb6\xc0z8\xa4\xcbd\xcb\x1e\xc6[\xe3\xa5\xdb\xc1\x8d\xba\xd2?\xb8}\xfab\xa5\xb8\x06\x1f\x87L\xca\xca\x12\xa3I\xe9l=\xc0\xe5\xcb\xee\xfa\x17\xec\xd5x\xdf\xcc\xc5\xdb\x1e\xe5\x06\xb1-c-\x8b\xbe\xd6\xae\xd7\xab\xbc:\xff\xd9\xcb^a\xab\xe5F\xd1l\xd7a\xbc\xf3t\xa7s\x1a]\xc3\xda#\xef\x8bk]7\xadS\xd3\x96\x1d\x8a\xa1$\x95\xde\x15\xbcO\xce\xabGe\xfd\xc7im\xfb\x13\x16\x04\xecr\x85+\xd7b\x1f\xacE\xa7\xa7\xf9\x87\x10\xb1kp\xcd\xac\xce+\xad\x12l\xd9\x96\xd2P\x12l\x8dCBE\xffY\xbf\xd7Y\x07\x96\xfb\x993\xc9\xa6\xf1\xec\x88\xce\xfb\xf8\xf8\xce\x02\xd0\xac\x9a\xa6L2\xb3\xd8\xf3\xf4\xa4\x0e\x07\x0f\n/(r5\xc7\xb3=\x98\xba\xcc\xb3\x12\xed\x9e\xf6!\x08\xb1b\x9by\xd5x\xb2\xf8\x8f\x156\xe85\xcf\xa1s\xe1\xcf\xb5\xb7N\xa0G\xea\xdf\xd5\xe8\xdf\x00\x00\x00\xff\xffPK\x07\x08\x8af\x9c\xa3<\x06\x00\x00\xe0A\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/\x00 \x00swagger/service_zbook_verification.swagger.jsonUT\x05\x00\x01^F\xb8f\xec\x98Qo\xdb6\x10\xc7\xdf\xfd)\x08n\xc0^2;M\xb7\x97<5\x03\xf2\xd0\xb7\xa0M\xfb\xb0\xa10h\xf1d\xb3\x91H\x86wJ\xeb\x0e\xfe\xee\x03)\xd9\xa6d\xc9\x96#\x0fu\x80\xe8)!\xefN\xff\xbb\xe3\xcf:\xe9\xdf\x11c\x1c\xbf\x89\xf9\x1c\x1c\xbff\xfcj|\xc9/\xfc\x9a\xd2\xa9\xe1\xd7\xcc\xef3\xc6IQ\x06~\xff\xc7\xcc\x98\x07&\xac\nV\x8c\xf1'p\xa8\x8c\xf6{\x97\xe37\xeb\xd5\xc4h\x12 m\x020\xc6\xb5\xc8\xcb\x08\xea\x87\xcc\xec81ye\xcc\x18/\\\xe6\xb7\x16D\x16\xaf'\x93\xb9\xa2E1\xf3&\x93\xd2z\x12n\xbb\xb5\x87\\\xa8l\x1b\xec\xdd\xdc\xff\x1fB\x06\x8b\xd5\x88\xb1U\xc8\x82\xc4\x1c\xf95\xfb',\xefH\xf9\xfb/c\x1e>\x83S\xa9J\x04\xf9,6\xee_\x82{b4\x169lCpamV\x19O\xbeb\xe9Q\xdaZgd\x91\xf4\xb4\x15\xb4\xc0mu'Oo&\x0eR\x07\xb8\x98\x92y\x00\x1d\xd7\xcd\x1a\x8c\xeb\xe8\xdbU\xe4\xb9pK\x9fA\xe5\xc5J\xaf\x8b\xad\x8d\x04L\x9c\xb2T\xb5\xe6\x13\x02\xa3\x85B\xdf9F\x86u\xfa\x19\x0b.(~/[+4\xfdPz\xde7\x1d\x1d\xa05\x1a\x01kZ\x19\xe3W\x97\x97\x8d\xa5]y7\x0c\x8b$\x01\xc4\xb4\xc8\xd8:\xd28\n\x1f\x9c0Y@.v\x821\xc6\x7fu\x90\xfa8\xbfL$\xa4J+\x1f\x17'v\x16\x8b\xfdP\x85\xe55\xe7U\xf4\xdf*\xbe\x1f\x97\x90\x8a\"\xa3\xc3\xda5+4|\xb7\x90\x10H\x06\xce\x19w\xba\x14\x9cM>\x92\xa0\x02\xf7\xa8\xde\xfc\x1d\xe9\xe7V8\x91\x03\x81\xdb\x9e\xc7\xf2j$\xb3Faf\xe4\xb2)V\xe9\xae\x1d\x07\x8f\x85r\xe0\x8f\x08\xb9\x02\x06&\xd9\xec\xd3c\x01H}\x12\xfe\x12%\\#\xbdZ\xeb\xe0;\xb8\x8e\xe2`U\xe5*\x10\x11hj\x05\xe27\xe3\xe4\x11$\"\x10\xdb\xb8\xf5@\xf1\xe6\xee}\x89b\x97c\x0f\x16\x11\xe8\xae\xc5\xf3La\x8c\xd4\xbe\xd2\x18\xae3\xa5\xb1\xd6\xa8\x9f\x8b#\x82\x96\xd3\xf0\xbc\x9f\x92\x99>\x13\xce\xe6\xe3\xcf\x07eO^\xc9\x92%F\x82_[\x9a\xc2\xb1r\xb0\xe8\x01\xef\xd1\x81\x0e\xc2\xfc\x11\xb4\xbc\xf5^\xf7\xe6eq\xdd%\xfc\x15\xf1p\x9d%\xe2\xdd=;'\xdaK\xb0\xa6\xebi\x7f8\xeb!\xd2I`?\x10\xe9\x18\xda\xc3\xfa\xf2\xb6\x19\xe2\xdcY\x8fd\xbf\x92\x1e\xaes'\xbd\xd6\xb1\x9f\xcby\x17\xd9s\xe8\x06\xfbsD^\x1fj\xab\xf9\xba\x02\xb6@p\xbfa\xc5\xad\x90\xd2\x01\xe2Q\xc4\xbe$L_\xd9\xec\xc9\xe6S\xd4\xe1O.k\xc7\xf4\xb1\x00\xb7\x8f\xd3Td\xd8\x04\x95\x966\xdc\x00\xc9)=\xe7\xff3Y\x9b\xef]Q\x117\xd5\xe6\xed\xef\xd7\x11uk\xb1f\xf6\x15\x12\xdad\xca\xad\xf3T\x90j\x1c\xee\xf5W\xa7\xfb\xc6\xa7*\xb6/\xf1u\xda\x9bnm\xbf)\xfe9\xae}T\x1aEf;\xda\xab\xc3<@\xbc\x08\xc0\x1d\xa7\xfd\xa2\xd5\xfd\xf6\xbbU\x0e\xf0\xa6 K3N\x8d\xaf\xd4\xb8\\x\x0f.\x05\xc1\xef\xa4rh)\xd2N\x0dZf\xb4\x015h\x1e\xfbg\xd4\xa1\xe5\x1d\xac\xb7o\xf3g\x7f\xbfc\xf7\xc1\xb9\x1a\xd7\xdf\x94\xf6Wm\xf8\xd1Q\x18Bv)\x9f\x19\x93\x81\xd0\x87\xdbyh\xfa\x1e \xf1T\xa5};\xee|\x1f\xed\x9d\xcc)\n\xee\xa3\x9f\xb2\xde-3\xd0\x00}\xa7\xaa\xf6\x1f\xe3\x8e\xf7\x81\x9e\x89\x9cM\xa5O\xae\xaa|\xfc\xc1`e\xce\x90\x99\x15\xe9\x8d^\x0e\xd1\xf3\xaerxf\xbf\x85\x94\xe1\xd9,\xb2\xbb\xda\x0d\xeaZ\xb7\xc3\xcf\x00\xa5\x89\x91\x9dB\x95&\x98\x83\xebz.)Mo\xaf\xda\x7f\xb8s@\x14\xf3\xfe\x15\x88\\%\x90P\xd9\xce\x94\xbcv\x15\xce\x89\xfa\x8c\xc5\x15A\xde\xb4\xef\xaeD\xb5\xdb1\x11G\xed\x8f\xecW]\xa7\xc6\xcfS\xa3\xd5\xe8\xbf\x00\x00\x00\xff\xffPK\x07\x083tD\x10\xca\x03\x00\x00\x1d\x1d\x00\x00PK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x8cg\xf6\xeb(\x01\x00\x00\"\x03\x00\x00#\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x00\x00\x00\x00swagger/models/comment.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x90\xf7\x87\xb3.\x01\x00\x00+\x03\x00\x00,\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x82\x01\x00\x00swagger/models/comment_relation.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xd32u\xd7)\x01\x00\x00!\x03\x00\x00\"\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x13\x03\x00\x00swagger/models/follow.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bYR\xebSc,\x01\x00\x00#\x03\x00\x00$\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x95\x04\x00\x00swagger/models/markdown.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xdeb\xe7\xe9)\x01\x00\x00'\x03\x00\x00(\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x1c\x06\x00\x00swagger/models/notification.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xcb\x8b\xb6J&\x01\x00\x00\x1f\x03\x00\x00 \x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xa4\x07\x00\x00swagger/models/repo.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bYB\x1e@K,\x01\x00\x00(\x03\x00\x00)\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81! \x00\x00swagger/models/repo_relation.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x06\x8b\x97b'\x01\x00\x00\"\x03\x00\x00#\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xad\n\x00\x00swagger/models/session.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x94\x1e\xdb\xf1&\x01\x00\x00\x1f\x03\x00\x00 \x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81.\x0c\x00\x00swagger/models/user.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xda\x04\x18\xdd*\x01\x00\x00\"\x03\x00\x00#\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xab\x0d\x00\x00swagger/rpcs/rpc_admin.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xd4\x87\xed\x1d+\x01\x00\x00$\x03\x00\x00%\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81/\x0f\x00\x00swagger/rpcs/rpc_comment.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xaf\x03\xcf_-\x01\x00\x00-\x03\x00\x00.\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xb6\x10\x00\x00swagger/rpcs/rpc_comment_relation.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x061\xb3u*\x01\x00\x00#\x03\x00\x00$\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81H\x12\x00\x00swagger/rpcs/rpc_follow.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bYt)\x15\x06-\x01\x00\x00%\x03\x00\x00&\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xcd\x13\x00\x00swagger/rpcs/rpc_markdown.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bYF\xadne+\x01\x00\x00)\x03\x00\x00*\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81W\x15\x00\x00swagger/rpcs/rpc_notification.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xda9\x94\xba*\x01\x00\x00\"\x03\x00\x00#\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xe3\x16\x00\x00swagger/rpcs/rpc_oauth.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bYj\xd6\x82\xe9(\x01\x00\x00!\x03\x00\x00\"\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81g\x18\x00\x00swagger/rpcs/rpc_repo.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xfb\x8c\x18\xb5,\x01\x00\x00*\x03\x00\x00+\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xe8\x19\x00\x00swagger/rpcs/rpc_repo_relation.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY5C\xefR)\x01\x00\x00!\x03\x00\x00\"\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81v\x1b\x00\x00swagger/rpcs/rpc_user.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x0bd\xbe\xff,\x01\x00\x00)\x03\x00\x00*\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xf8\x1c\x00\x00swagger/rpcs/rpc_verification.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x8f\xf8\xb0a\xfd\x07\x00\x00wm\x00\x00(\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x85\x1e\x00\x00swagger/service_zbook_admin.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x0bE\xa8\xd1\x0f\x05\x00\x00p2\x00\x00*\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xe1&\x00\x00swagger/service_zbook_comment.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xcc\xaa\x93V\x13\x03\x00\x00X\x14\x00\x003\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81Q,\x00\x00swagger/service_zbook_comment_relation.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xb1K\x0c\x0by\x04\x00\x00\x93-\x00\x00)\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xce/\x00\x00swagger/service_zbook_follow.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xbe\xa3\xca\xaai\x04\x00\x00\xef'\x00\x00+\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xa74\x00\x00swagger/service_zbook_markdown.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bYT}\x93C\xc2\x06\x00\x00\xdcX\x00\x00/\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81r9\x00\x00swagger/service_zbook_notification.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bYYXk\x98\x97\x03\x00\x00\xd6\x18\x00\x00(\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x9a@\x00\x00swagger/service_zbook_oauth.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\xec\n\xa7\x9f\x05\x07\x00\x003R\x00\x00'\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x90D\x00\x00swagger/service_zbook_repo.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x92-\xebs}\x04\x00\x00\xb8'\x00\x000\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xf3K\x00\x00swagger/service_zbook_repo_relation.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY\x8af\x9c\xa3<\x06\x00\x00\xe0A\x00\x00'\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\xd7P\x00\x00swagger/service_zbook_user.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x01\x02\x14\x03\x14\x00\x08\x00\x08\x00\x8f(\x0bY3tD\x10\xca\x03\x00\x00\x1d\x1d\x00\x00/\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81qW\x00\x00swagger/service_zbook_verification.swagger.jsonUT\x05\x00\x01^F\xb8fPK\x05\x06\x00\x00\x00\x00\x1f\x00\x1f\x00u\x0b\x00\x00\xa1[\x00\x00\x00\x00" + fs.Register(data) + } + \ No newline at end of file diff --git a/zbook_backend/storage/minio_storage.go b/zbook_backend/storage/minio_storage.go new file mode 100644 index 0000000..6ded908 --- /dev/null +++ b/zbook_backend/storage/minio_storage.go @@ -0,0 +1,256 @@ +package storage + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "os" + "strconv" + "strings" + "time" + + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" + "github.com/rs/zerolog/log" + "github.com/zizdlp/zbook/util" +) + +func GetMinioClient() (*minio.Client, error) { + + config, err := util.LoadConfig("../") + if err != nil { + return nil, err + } + + useSSL := false + + // Initialize minio client object. + minioClient, err := minio.New(config.MINIOADDR, &minio.Options{ + Creds: credentials.NewStaticV4(config.MINIOROOTUSER, config.MINIOROOTPASSWORD, ""), + Secure: useSSL, + }) + if err != nil { + return nil, err + } + err = CreateBucket(minioClient, context.Background(), "avatar") + if err != nil { + return nil, err + } + err = CreateBucket(minioClient, context.Background(), "git-files") + if err != nil { + return nil, err + } + return minioClient, nil +} +func UploadFileToStorage(client *minio.Client, ctx context.Context, objectName string, bucketName string, data []byte) error { + contentType := http.DetectContentType(data) + + reader := bytes.NewReader(data) + + _, err := client.PutObject(ctx, bucketName, strings.ToLower(objectName), reader, int64(len(data)), minio.PutObjectOptions{ContentType: contentType}) + if err != nil { + log.Error().Msgf("Upload object:%s failed: %s", strings.ToLower(objectName), err) + return err + } + return nil +} +func DownloadFileFromStorage(client *minio.Client, ctx context.Context, objectName string, bucketName string) ([]byte, error) { + + // Get object from MinIO + object, err := client.GetObject(ctx, bucketName, strings.ToLower(objectName), minio.GetObjectOptions{}) + if err != nil { + log.Error().Msgf("Download object:%s failed: %s", strings.ToLower(objectName), err) + return nil, err + } + defer object.Close() + + // Read object content into a byte slice + data, err := io.ReadAll(object) + if err != nil { + log.Error().Msgf("Read object:%s failed: %s", objectName, err) + return nil, err + } + return data, nil +} +func DeleteFileFromStorage(client *minio.Client, ctx context.Context, objectName string, bucketName string) error { + //删除一个文件 + err := client.RemoveObject(ctx, bucketName, strings.ToLower(objectName), minio.RemoveObjectOptions{GovernanceBypass: true}) + if err != nil { + log.Error().Msgf("Delete object: %s failed: %s", strings.ToLower(objectName), err) + return err + } + return nil +} +func CreateBucket(client *minio.Client, ctx context.Context, bucketName string) error { + err := client.MakeBucket(ctx, bucketName, minio.MakeBucketOptions{Region: "cn-south-1", ObjectLocking: false}) + if err != nil { + exists, errBucketExists := client.BucketExists(ctx, bucketName) + if errBucketExists == nil && exists { + log.Info().Msgf("Bucket %s already exists", bucketName) + return nil // Bucket already exists, not an error condition + } else { + return err // Some other error, return it + } + } else { + log.Info().Msgf("Bucket created successfully: %s", bucketName) + return nil + } +} + +func ConvertFile2Storage(client *minio.Client, cloneDir string, repoID int64, userID int64, addedFiles []string, modifiedFiles []string, deletedFiles []string) error { + startTime := time.Now() + + allowedGitFileExtensions := map[string]bool{ + ".png": true, + ".jpg": true, + ".jpeg": true, + ".svg": true, + ".gif": true, + ".webp": true, + } + + // Helper function to process files (upload or delete) + processFiles := func(files []string, action func(string) error) error { + for _, file := range files { + if err := action(file); err != nil { + return err + } + } + return nil + } + + // Upload added and modified files + uploadFiles := func(file string) error { + return uploadGitFile(client, context.Background(), cloneDir, file, repoID, userID) + } + + filteredAddedFiles := util.FilterDiffFilesByExtensions(addedFiles, allowedGitFileExtensions) + filteredModifiedFiles := util.FilterDiffFilesByExtensions(modifiedFiles, allowedGitFileExtensions) + + if err := processFiles(filteredAddedFiles, uploadFiles); err != nil { + return fmt.Errorf("failed to upload added files: %w", err) + } + if err := processFiles(filteredModifiedFiles, uploadFiles); err != nil { + return fmt.Errorf("failed to upload modified files: %w", err) + } + + // Delete files + deleteFiles := func(file string) error { + repoIDStr := strconv.FormatInt(repoID, 10) + name := repoIDStr + "/" + file + return DeleteFileFromStorage(client, context.Background(), name, "git-files") + } + + filteredDeletedFiles := util.FilterDiffFilesByExtensions(deletedFiles, allowedGitFileExtensions) + + if err := processFiles(filteredDeletedFiles, deleteFiles); err != nil { + return fmt.Errorf("failed to delete files: %w", err) + } + + endTime := time.Now() + log.Info().Msgf("upload git file to storage: total execution time: %s", endTime.Sub(startTime)) + + if _, err := os.Stat(cloneDir); err == nil { + os.RemoveAll(cloneDir) + } + + return nil +} +func uploadGitFile(minioClient *minio.Client, ctx context.Context, cloneDir string, filePath string, repoID int64, userID int64) error { + + data, err := os.ReadFile(cloneDir + "/" + filePath) + if err != nil { + return err + } + ext := strings.ToLower(filePath) + if strings.HasSuffix(ext, ".png") || strings.HasSuffix(ext, ".jpg") || strings.HasSuffix(ext, ".jpeg") || strings.HasSuffix(ext, ".webp") { + base64, err := util.ReadImageBytes(cloneDir + "/" + filePath) + if err != nil { + return err + } + data, err = util.CompressImage(base64) + if err != nil { + return err + } + } + + userIDStr := strconv.FormatInt(userID, 10) + repoIDStr := strconv.FormatInt(repoID, 10) + name := userIDStr + "/" + repoIDStr + "/" + filePath + err = UploadFileToStorage(minioClient, ctx, name, "git-files", data) + if err != nil { + return err + } + + return nil +} + +// DeleteFilesByUserID 删除指定用户 ID 的所有文件 +func DeleteAvatarByUsername(client *minio.Client, ctx context.Context, username string) error { + err := DeleteFileFromStorage(client, ctx, username, "avatar") + if err != nil { + log.Error().Msgf("Failed to delete object %s: %s", username, err) + return err + } + log.Info().Msgf("Deleted object %s", username) + + return nil +} + +// DeleteFilesByUserID 删除指定用户 ID 的所有文件 +func DeleteFilesByUserID(client *minio.Client, ctx context.Context, userID int64, bucketName string) error { + userIDStr := strconv.FormatInt(userID, 10) + + // 列出用户的所有文件 + objectCh := client.ListObjects(ctx, bucketName, minio.ListObjectsOptions{Prefix: userIDStr + "/", Recursive: true}) + + // 处理文件删除 + for obj := range objectCh { + if obj.Err != nil { + log.Error().Msgf("Failed to list objects: %s", obj.Err) + return obj.Err + } + + objectName := obj.Key + err := DeleteFileFromStorage(client, ctx, objectName, bucketName) + if err != nil { + log.Error().Msgf("Failed to delete object %s: %s", objectName, err) + return err + } + log.Info().Msgf("Deleted object %s", objectName) + } + + return nil +} + +// DeleteFilesByUserIDAndRepoID 删除指定 userID 和 repoID 下的所有文件 +func DeleteFilesByUserIDAndRepoID(client *minio.Client, ctx context.Context, userID int64, repoID int64, bucketName string) error { + userIDStr := strconv.FormatInt(userID, 10) + repoIDStr := strconv.FormatInt(repoID, 10) + + // 构建删除前缀 + prefix := userIDStr + "/" + repoIDStr + "/" + + // 列出指定前缀下的所有文件 + objectCh := client.ListObjects(ctx, bucketName, minio.ListObjectsOptions{Prefix: prefix, Recursive: true}) + + // 处理文件删除 + for obj := range objectCh { + if obj.Err != nil { + log.Error().Msgf("Failed to list objects: %s", obj.Err) + return obj.Err + } + + objectName := obj.Key + err := DeleteFileFromStorage(client, ctx, objectName, bucketName) + if err != nil { + log.Error().Msgf("Failed to delete object %s: %s", objectName, err) + return err + } + log.Info().Msgf("Deleted object %s", objectName) + } + + return nil +} diff --git a/zbook_backend/storage/minio_stroage_test.go b/zbook_backend/storage/minio_stroage_test.go new file mode 100644 index 0000000..0bbdc37 --- /dev/null +++ b/zbook_backend/storage/minio_stroage_test.go @@ -0,0 +1,43 @@ +package storage + +import ( + "context" + "crypto/rand" + "fmt" + "testing" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func TestMinio(t *testing.T) { + if testing.Short() { + fmt.Println("***** TestMinio is ignored *****") + t.Skip() + } + minioClient, err := GetMinioClient() + require.NoError(t, err) + require.NoError(t, err) + bucketName := util.RandomString(32) + err = CreateBucket(minioClient, context.Background(), bucketName) + require.NoError(t, err) + username := util.RandomUsername() + avatarData, err := GenerateRandomBytes(32) + require.NoError(t, err) + err = UploadFileToStorage(minioClient, context.Background(), username, bucketName, avatarData) + require.NoError(t, err) + resData, err := DownloadFileFromStorage(minioClient, context.Background(), username, bucketName) + require.NoError(t, err) + require.Equal(t, avatarData, resData) + + err = DeleteFileFromStorage(minioClient, context.Background(), username, bucketName) + require.NoError(t, err) +} +func GenerateRandomBytes(length int) ([]byte, error) { + randomBytes := make([]byte, length) + _, err := rand.Read(randomBytes) + if err != nil { + return nil, err + } + return randomBytes, nil +} diff --git a/zbook_backend/token/maker.go b/zbook_backend/token/maker.go new file mode 100644 index 0000000..a2f46e2 --- /dev/null +++ b/zbook_backend/token/maker.go @@ -0,0 +1,14 @@ +package token + +import ( + "time" +) + +// Maker is an interface for managing tokens +type Maker interface { + // CreateToken creates a new token for a specific user_id and duration + CreateToken(username string, role string, duration time.Duration) (string, *Payload, error) + + // VerifyToken checks if the token is valid or not + VerifyToken(token string) (*Payload, error) +} diff --git a/zbook_backend/token/paseto_maker.go b/zbook_backend/token/paseto_maker.go new file mode 100644 index 0000000..346758b --- /dev/null +++ b/zbook_backend/token/paseto_maker.go @@ -0,0 +1,57 @@ +package token + +import ( + "fmt" + "time" + + "github.com/aead/chacha20poly1305" + "github.com/o1egl/paseto" +) + +// PasetoMaker is a PASETO token maker +type PasetoMaker struct { + paseto *paseto.V2 + symmetricKey []byte +} + +// NewPasetoMaker creates a new PasetoMaker +func NewPasetoMaker(symmetricKey string) (Maker, error) { + if len(symmetricKey) != chacha20poly1305.KeySize { + return nil, fmt.Errorf("invalid key size: must be exactly %d characters", chacha20poly1305.KeySize) + } + + maker := &PasetoMaker{ + paseto: paseto.NewV2(), + symmetricKey: []byte(symmetricKey), + } + + return maker, nil +} + +// CreateToken creates a new token for a specific user_id and duration +func (maker *PasetoMaker) CreateToken(username string, role string, duration time.Duration) (string, *Payload, error) { + payload, err := NewPayload(username, role, duration) + if err != nil { + return "", payload, err + } + + token, err := maker.paseto.Encrypt(maker.symmetricKey, payload, nil) + return token, payload, err +} + +// VerifyToken checks if the token is valid or not +func (maker *PasetoMaker) VerifyToken(token string) (*Payload, error) { + payload := &Payload{} + + err := maker.paseto.Decrypt(token, maker.symmetricKey, payload, nil) + if err != nil { + return nil, ErrInvalidToken + } + + err = payload.Valid() + if err != nil { + return nil, err + } + + return payload, nil +} diff --git a/zbook_backend/token/paseto_maker_test.go b/zbook_backend/token/paseto_maker_test.go new file mode 100644 index 0000000..19d754e --- /dev/null +++ b/zbook_backend/token/paseto_maker_test.go @@ -0,0 +1,49 @@ +package token + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/zizdlp/zbook/util" +) + +func TestPasetoMaker(t *testing.T) { + maker, err := NewPasetoMaker(util.RandomString(32)) + require.NoError(t, err) + + username := util.RandomString(16) + duration := time.Minute + + issuedAt := time.Now() + expiredAt := issuedAt.Add(duration) + role := util.UserRole + token, payload, err := maker.CreateToken(username, role, duration) + require.NoError(t, err) + require.NotEmpty(t, token) + require.NotEmpty(t, payload) + + payload, err = maker.VerifyToken(token) + require.NoError(t, err) + require.NotEmpty(t, token) + require.Equal(t, role, payload.Role) + require.NotZero(t, payload.ID) + require.Equal(t, username, payload.Username) + require.WithinDuration(t, issuedAt, payload.IssuedAt, time.Second) + require.WithinDuration(t, expiredAt, payload.ExpiredAt, time.Second) +} + +func TestExpiredPasetoToken(t *testing.T) { + maker, err := NewPasetoMaker(util.RandomString(32)) + require.NoError(t, err) + + token, payload, err := maker.CreateToken(util.RandomString(16), util.UserRole, -time.Minute) + require.NoError(t, err) + require.NotEmpty(t, token) + require.NotEmpty(t, payload) + + payload, err = maker.VerifyToken(token) + require.Error(t, err) + require.EqualError(t, err, ErrExpiredToken.Error()) + require.Nil(t, payload) +} diff --git a/zbook_backend/token/payload.go b/zbook_backend/token/payload.go new file mode 100644 index 0000000..c1d111c --- /dev/null +++ b/zbook_backend/token/payload.go @@ -0,0 +1,48 @@ +package token + +import ( + "errors" + "time" + + "github.com/google/uuid" +) + +// Different types of error returned by the VerifyToken function +var ( + ErrInvalidToken = errors.New("token is invalid") + ErrExpiredToken = errors.New("token has expired") +) + +// Payload contains the payload data of the token +type Payload struct { + ID uuid.UUID `json:"id"` + Username string `json:"username"` + Role string `json:"role"` + IssuedAt time.Time `json:"issued_at"` + ExpiredAt time.Time `json:"expired_at"` +} + +// NewPayload creates a new token payload with a specific user_id and duration +func NewPayload(username string, role string, duration time.Duration) (*Payload, error) { + tokenID, err := uuid.NewRandom() + if err != nil { + return nil, err + } + + payload := &Payload{ + ID: tokenID, + Username: username, + Role: role, + IssuedAt: time.Now(), + ExpiredAt: time.Now().Add(duration), + } + return payload, nil +} + +// Valid checks if the token payload is valid or not +func (payload *Payload) Valid() error { + if time.Now().After(payload.ExpiredAt) { + return ErrExpiredToken + } + return nil +} diff --git a/zbook_backend/util/FindAdjacentPaths.go b/zbook_backend/util/FindAdjacentPaths.go new file mode 100644 index 0000000..b8b8668 --- /dev/null +++ b/zbook_backend/util/FindAdjacentPaths.go @@ -0,0 +1,41 @@ +package util + +import ( + "fmt" +) + +// FindAdjacentPaths 查找指定 relative_path 的上一个和下一个路径 +func (config *RepoConfig) FindAdjacentPaths(relativePath string) (string, string, error) { + // 将所有 relative_path 扁平化为一个列表 + paths := flattenLayoutPaths(config.Layout) + + for i, path := range paths { + if path == relativePath { + prevPath := "" + nextPath := "" + if i > 0 { + prevPath = paths[i-1] + } + if i < len(paths)-1 { + nextPath = paths[i+1] + } + return prevPath, nextPath, nil + } + } + + return "", "", fmt.Errorf("relative_path not found: %s", relativePath) +} + +// flattenLayoutPaths 将所有 Layout 的 relative_path 扁平化为一个列表,仅包括 isdir 为 false 的路径 +func flattenLayoutPaths(layouts []Layout) []string { + var paths []string + for _, layout := range layouts { + if !layout.Isdir { + paths = append(paths, layout.RelativePath) + } + if layout.Sublayouts != nil { + paths = append(paths, flattenLayoutPaths(layout.Sublayouts)...) + } + } + return paths +} diff --git a/zbook_backend/util/FindAdjacentPaths_test.go b/zbook_backend/util/FindAdjacentPaths_test.go new file mode 100644 index 0000000..9e81e3f --- /dev/null +++ b/zbook_backend/util/FindAdjacentPaths_test.go @@ -0,0 +1,63 @@ +package util + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestFindAdjacentPaths(t *testing.T) { + // 创建测试配置 + config := &RepoConfig{ + Layout: []Layout{ + { + Title: "b", + RelativePath: "b", + Isdir: true, + Sublayouts: []Layout{ + { + Title: "c", + RelativePath: "b/c", + Isdir: false, + Sublayouts: nil, + }, + { + Title: "e", + RelativePath: "b/e", + Isdir: false, + Sublayouts: nil, + }, + }, + }, + { + Title: "a", + RelativePath: "a", + Isdir: false, + Sublayouts: nil, + }, + }, + } + + tests := []struct { + relativePath string + expectedPrev string + expectedNext string + expectedError bool + }{ + {"b/c", "", "b/e", false}, + {"b/e", "b/c", "a", false}, + {"a", "b/e", "", false}, + {"nonexistent", "", "", true}, + } + + for _, tt := range tests { + prev, next, err := config.FindAdjacentPaths(tt.relativePath) + if tt.expectedError { + require.Error(t, err) + } else { + require.NoError(t, err) + } + require.Equal(t, tt.expectedPrev, prev) + require.Equal(t, tt.expectedNext, next) + } +} diff --git a/zbook_backend/util/batch.go b/zbook_backend/util/batch.go new file mode 100644 index 0000000..435b3f4 --- /dev/null +++ b/zbook_backend/util/batch.go @@ -0,0 +1,95 @@ +package util + +import ( + "net/url" + "path/filepath" + "strings" +) + +type CreateParams struct { + RelativePath []string + UserID []int64 + RepoID []int64 + MainContent []string + TableContent []string +} + +func (params *CreateParams) Append(relativePath string, userID int64, repoID int64, mainContent string, tableContent string) { + params.RelativePath = append(params.RelativePath, relativePath) + params.UserID = append(params.UserID, userID) + params.RepoID = append(params.RepoID, repoID) + params.MainContent = append(params.MainContent, mainContent) + params.TableContent = append(params.TableContent, tableContent) +} + +type UpdateParams struct { + RelativePath []string + NewRelativePath []string + RepoID []int64 + MainContent []string + TableContent []string +} + +func (params *UpdateParams) Append(RelativePath string, NewRelativePath string, RepoID int64, MainContent string, TableContent string) { + params.RelativePath = append(params.RelativePath, RelativePath) + params.NewRelativePath = append(params.NewRelativePath, NewRelativePath) + params.RepoID = append(params.RepoID, RepoID) + params.MainContent = append(params.MainContent, MainContent) + params.TableContent = append(params.TableContent, TableContent) +} + +type DeleteParams struct { + RelativePath []string + RepoID []int64 +} + +func (params *DeleteParams) Append(RelativePath string, RepoID int64) { + params.RelativePath = append(params.RelativePath, RelativePath) + params.RepoID = append(params.RepoID, RepoID) +} +func GetGitURL(GitProtocol string, GitHost string, GitUsername string, GitRepo string) string { + gitURL := GitProtocol + "://" + GitHost + "/" + GitUsername + "/" + GitRepo + ".git" + return gitURL +} + +// ParseGitURL 解析Git地址并返回协议、主机、用户名和仓库 +func ParseGitURL(gitURL string) (string, string, string, string, error) { + u, err := url.Parse(gitURL) + if err != nil { + return "", "", "", "", err + } + + var protocol, host, username, repo string + + protocol = u.Scheme + host = u.Host + + // 去除路径前后的斜杠 + path := strings.Trim(u.Path, "/") + + // 按照斜杠进行分割 + parts := strings.Split(path, "/") + if len(parts) >= 2 { + username = parts[0] + repo = strings.TrimSuffix(parts[len(parts)-1], ".git") + } + return protocol, host, username, repo, nil +} +func NormalizePath(path string) string { + return filepath.Clean(path) +} + +func ParserGitCloneError(message string) string { + // Convert output to a string + + // Find the start of the error message (e.g., "fatal: ") + fatalPrefix := "fatal: " + startIndex := strings.Index(message, fatalPrefix) + if startIndex != -1 { + // Extract the error message part + errorMessage := message[startIndex+7:] + return errorMessage + } else { + return message + } +} diff --git a/zbook_backend/util/compress.go b/zbook_backend/util/compress.go new file mode 100644 index 0000000..94c3020 --- /dev/null +++ b/zbook_backend/util/compress.go @@ -0,0 +1,59 @@ +package util + +import ( + "bytes" + "image" + "image/png" + "os/exec" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func CompressBytes(input []byte) ([]byte, error) { + cmd := exec.Command("pngquant", "-", "--quality", "60-80", "--speed", "11") + cmd.Stdin = bytes.NewReader(input) + var stdout, stderr bytes.Buffer + cmd.Stdout = &stdout + cmd.Stderr = &stderr + + err := cmd.Run() + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to run pngquant: %s, %s", err, stderr.String()) + } + + return stdout.Bytes(), nil +} + +func Compress(input image.Image) ([]byte, error) { + var buf bytes.Buffer + err := png.Encode(&buf, input) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to encode image to PNG: %s", err) + } + + compressed, err := CompressBytes(buf.Bytes()) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to compress image: %s", err) + } + + return compressed, nil +} + +func CompressImage(inputImageBase64 []byte) ([]byte, error) { + img, _, err := image.Decode(bytes.NewReader(inputImageBase64)) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to decode image: %s", err) + } + + compressed, err := Compress(img) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to compress image: %s", err) + } + + // Compare sizes to determine whether to return compressed or original data + if len(compressed) < len(inputImageBase64) { + return compressed, nil + } + return inputImageBase64, nil +} diff --git a/zbook_backend/util/config.go b/zbook_backend/util/config.go new file mode 100644 index 0000000..cf6983e --- /dev/null +++ b/zbook_backend/util/config.go @@ -0,0 +1,50 @@ +package util + +import ( + "time" + + "github.com/spf13/viper" +) + +// Config stores all configuration of the application. +// The values are read by viper from a config file or environment variable. +type Config struct { + Environment string `mapstructure:"ENVIRONMENT"` + DBSource string `mapstructure:"DB_SOURCE"` + MigrationURL string `mapstructure:"MIGRATION_URL"` + HTTPServerAddress string `mapstructure:"HTTP_SERVER_ADDRESS"` + HOMEADDRESS string `mapstructure:"HOME_ADDRESS"` + GRPCServerAddress string `mapstructure:"GRPC_SERVER_ADDRESS"` + WEBSOCKETServerAddress string `mapstructure:"WEBSOCKET_SERVER_ADDRESS"` + RedisAddress string `mapstructure:"REDIS_ADDRESS"` + TokenSymmetricKey string `mapstructure:"TOKEN_SYMMETRIC_KEY"` + AccessTokenDuration time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"` + RefreshTokenDuration time.Duration `mapstructure:"REFRESH_TOKEN_DURATION"` + REQUIRE_EMAIL_VERIFY bool `mapstructure:"REQUIRE_EMAIL_VERIFY"` + EmailSenderName string `mapstructure:"EMAIL_SENDER_NAME"` + EmailSenderAddress string `mapstructure:"EMAIL_SENDER_ADDRESS"` + EmailSenderPassword string `mapstructure:"EMAIL_SENDER_PASSWORD"` + SmtpAuthAddress string `mapstructure:"SMTP_AUTH_ADDR"` + SmtpServerAddress string `mapstructure:"SMTP_SERVER_ADDR"` + MINIOADDR string `mapstructure:"MINIO_ADDR"` + MINIOROOTPASSWORD string `mapstructure:"MINIO_ROOT_PASSWORD"` + MINIOROOTUSER string `mapstructure:"MINIO_ROOT_USER"` + TIMEZONE string `mapstructure:"TIME_ZONE"` +} + +// LoadConfig reads configuration from file or environment variables. +func LoadConfig(path string) (config Config, err error) { + viper.AddConfigPath(path) + viper.SetConfigName("app") + viper.SetConfigType("env") + + viper.AutomaticEnv() + + err = viper.ReadInConfig() + if err != nil { + return + } + + err = viper.Unmarshal(&config) + return +} diff --git a/zbook_backend/util/convert.go b/zbook_backend/util/convert.go new file mode 100644 index 0000000..d8192ba --- /dev/null +++ b/zbook_backend/util/convert.go @@ -0,0 +1,38 @@ +package util + +import ( + "fmt" + "regexp" + + "github.com/google/uuid" +) + +// UUIDToString 将UUID编码为只包含数字和小写字母的字符串 +func UUIDToString(id uuid.UUID) string { + // 将UUID转换为字符串 + uuidStr := id.String() + // 将UUID字符串中的"-"去除 + uuidStr = uuidStr[0:8] + uuidStr[9:13] + uuidStr[14:18] + uuidStr[19:23] + uuidStr[24:] + return uuidStr + +} + +// StringToUUID 将只包含数字和小写字母的字符串解码为UUID +func StringToUUID(s string) (uuid.UUID, error) { + // 使用正则表达式检查字符串是否只包含小写字母和数字 + match, err := regexp.MatchString("^[a-z0-9]+$", s) + if err != nil { + return uuid.UUID{}, err + } + if !match { + return uuid.UUID{}, fmt.Errorf("invalid characters in string: %s", s) + } + // 添加"-"符号,恢复原始的UUID字符串格式 + uuidStr := s[:8] + "-" + s[8:12] + "-" + s[12:16] + "-" + s[16:20] + "-" + s[20:] + // 解析UUID字符串 + parsedUUID, err := uuid.Parse(uuidStr) + if err != nil { + return uuid.UUID{}, err + } + return parsedUUID, nil +} diff --git a/zbook_backend/util/convert_test.go b/zbook_backend/util/convert_test.go new file mode 100644 index 0000000..c041bc9 --- /dev/null +++ b/zbook_backend/util/convert_test.go @@ -0,0 +1,29 @@ +package util + +import ( + "regexp" + "testing" + + "github.com/google/uuid" + "github.com/stretchr/testify/require" +) + +func TestUUIDConvert(t *testing.T) { + uuid := uuid.New() + uuid_str := UUIDToString(uuid) + uuid_recover, err := StringToUUID(uuid_str) + require.NoError(t, err) + require.Equal(t, uuid, uuid_recover) + valid := isValidUUIDString(uuid_str) + require.True(t, valid, "UUID string contains invalid characters") +} + +// isValidUUIDString 检查字符串是否只包含小写字母和数字 +func isValidUUIDString(s string) bool { + // 使用正则表达式匹配小写字母和数字 + match, err := regexp.MatchString("^[a-z0-9]+$", s) + if err != nil { + return false + } + return match +} diff --git a/zbook_backend/util/create_layout.go b/zbook_backend/util/create_layout.go new file mode 100644 index 0000000..e2174e6 --- /dev/null +++ b/zbook_backend/util/create_layout.go @@ -0,0 +1,91 @@ +package util + +import ( + "sort" + "strings" +) + +type Layout struct { + Title string `json:"title"` + RelativePath string `json:"relative_path"` + Isdir bool `json:"isdir"` + Sublayouts []Layout `json:"sublayouts"` +} + +// findOrCreateSubLayout 查找或创建子布局 +func findOrCreateSubLayout(layout *Layout, title string) *Layout { + for i := range layout.Sublayouts { + if layout.Sublayouts[i].Title == title { + return &layout.Sublayouts[i] + } + } + relativePath := title + if layout.RelativePath != "" { + relativePath = layout.RelativePath + "/" + title + } + newLayout := Layout{ + Title: title, + RelativePath: relativePath, + Isdir: true, + Sublayouts: []Layout{}, + } + layout.Sublayouts = append(layout.Sublayouts, newLayout) + return &layout.Sublayouts[len(layout.Sublayouts)-1] +} +func CreateLayout(files []string) []Layout { + root := Layout{ + Title: "root", + RelativePath: "", + Isdir: true, + Sublayouts: []Layout{}, + } + + for _, file := range files { + if !strings.HasSuffix(file, ".md") { + continue + } + parts := strings.Split(file, "/") + current := &root + for i, part := range parts { + if i == len(parts)-1 { + // 这是一个文件 + relativePath := part + if current.RelativePath != "" { + relativePath = current.RelativePath + "/" + part + } + relativePath = strings.ToLower(strings.TrimSuffix(relativePath, ".md")) + title := strings.TrimSuffix(part, ".md") + current.Sublayouts = append(current.Sublayouts, Layout{ + Title: title, + RelativePath: relativePath, + Isdir: false, + Sublayouts: nil, + }) + } else { + // 这是一个目录 + current = findOrCreateSubLayout(current, part) + } + } + } + + // 对 Sublayouts 进行排序,使得目录在前,文件在后 + sortLayouts(&root) + + return root.Sublayouts +} + +// sortLayouts 对 Sublayouts 进行排序,使得目录在前,文件在后 +func sortLayouts(layout *Layout) { + sort.Slice(layout.Sublayouts, func(i, j int) bool { + if layout.Sublayouts[i].Isdir != layout.Sublayouts[j].Isdir { + return layout.Sublayouts[i].Isdir + } + return layout.Sublayouts[i].Title < layout.Sublayouts[j].Title + }) + + for i := range layout.Sublayouts { + if layout.Sublayouts[i].Isdir { + sortLayouts(&layout.Sublayouts[i]) + } + } +} diff --git a/zbook_backend/util/create_layout_test.go b/zbook_backend/util/create_layout_test.go new file mode 100644 index 0000000..b145150 --- /dev/null +++ b/zbook_backend/util/create_layout_test.go @@ -0,0 +1,51 @@ +package util + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestCreateLayout(t *testing.T) { + files := []string{ + "a.md", + "b/c.md", + "b/e.md", + } + + expectedJSON := `[ + { + "title": "b", + "relative_path": "b", + "isdir": true, + "sublayouts": [ + { + "title": "c", + "relative_path": "b/c", + "isdir": false, + "sublayouts": null + }, + { + "title": "e", + "relative_path": "b/e", + "isdir": false, + "sublayouts": null + } + ] + }, + { + "title": "a", + "relative_path": "a", + "isdir": false, + "sublayouts": null + } + ]` + + layout := CreateLayout(files) + + layoutJSON, err := json.MarshalIndent(layout, "", " ") + require.NoError(t, err) + + require.JSONEq(t, expectedJSON, string(layoutJSON)) +} diff --git a/zbook_backend/util/email_template.go b/zbook_backend/util/email_template.go new file mode 100644 index 0000000..c0cd783 --- /dev/null +++ b/zbook_backend/util/email_template.go @@ -0,0 +1,124 @@ +package util + +const EmailTemplate = ` + + +
+
+

+ %s +

+
+
+

Hello, %s

+

+ %s +

+ + %s + +

+ %s +

+

+ Thanks,
The ZBook Team +

+
+
+ + + + + +
+ LOGO + +
ZBook
+
+ +

+ © 2024 zizdlp.com. All rights reserved. +

+
+
+ +` diff --git a/zbook_backend/util/email_template_test.go b/zbook_backend/util/email_template_test.go new file mode 100644 index 0000000..a25615d --- /dev/null +++ b/zbook_backend/util/email_template_test.go @@ -0,0 +1,30 @@ +package util + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestEmailTemplate(t *testing.T) { + Title := "Reset ZBook Password" + recipientName := "John Doe" + verificationLink := "https://example.com/verify" + emailSubject := "Verify Your Email Address" + buttonText := "Verify Email" + additionalText := "Please verify your email address by clicking the button below." + base64Image, err := ReadImageBytesToBase64("../icons/logo.png") + require.NoError(t, err) + // Use fmt.Sprintf to generate the email body + emailBody := fmt.Sprintf(EmailTemplate, Title, recipientName, emailSubject, verificationLink, buttonText, additionalText, base64Image) + + // Check if the generated email body contains the expected text + require.Contains(t, emailBody, emailSubject) + require.Contains(t, emailBody, recipientName) + require.Contains(t, emailBody, additionalText) + require.Contains(t, emailBody, verificationLink) + require.Contains(t, emailBody, buttonText) + require.Contains(t, emailBody, base64Image) + +} diff --git a/zbook_backend/util/fetch.go b/zbook_backend/util/fetch.go new file mode 100644 index 0000000..e4b4c72 --- /dev/null +++ b/zbook_backend/util/fetch.go @@ -0,0 +1,28 @@ +package util + +import ( + "fmt" + "net/http" +) + +func FetchGithub(access_token string) (*http.Response, error) { + // 创建新的请求 + req, err := http.NewRequest("GET", "https://api.github.com/user", nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + + // 设置 Authorization 头部 + req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", access_token)) + + // 创建 HTTP 客户端 + client := &http.Client{} + + // 发送请求 + resp, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error making request: %w", err) + } + + return resp, nil +} diff --git a/zbook_backend/util/filter.go b/zbook_backend/util/filter.go new file mode 100644 index 0000000..3f5f1f8 --- /dev/null +++ b/zbook_backend/util/filter.go @@ -0,0 +1,28 @@ +package util + +import ( + "regexp" +) + +// FilterDiffFilesByExtensions 过滤指定后缀名的文件 +func FilterDiffFilesByExtensions(files []string, allowedExtensions map[string]bool) []string { + var filteredFiles []string + + for _, file := range files { + ext := getFileExtension(file) + if allowedExtensions[ext] { + filteredFiles = append(filteredFiles, file) + } + } + return filteredFiles +} + +// getFileExtension 使用正则表达式获取文件的后缀名 +func getFileExtension(fileName string) string { + re := regexp.MustCompile(`\.[^\.]+$`) + match := re.FindString(fileName) + if match != "" { + return match + } + return "" +} diff --git a/zbook_backend/util/filter_test.go b/zbook_backend/util/filter_test.go new file mode 100644 index 0000000..209b7b2 --- /dev/null +++ b/zbook_backend/util/filter_test.go @@ -0,0 +1,44 @@ +package util + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestFilterDiffFilesByExtensions(t *testing.T) { + files := []string{ + "README.md", + "image.png", + "photo.jpg", + "document.txt", + "script.js", + "style.css", + "diagram.svg", + "animation.gif", + "vector.webp", + "archive.zip", + } + + allowedExtensions := map[string]bool{ + ".md": true, + ".png": true, + ".jpg": true, + ".jpeg": true, + ".svg": true, + ".gif": true, + ".webp": true, + } + + expectedFilteredFiles := []string{ + "README.md", + "image.png", + "photo.jpg", + "diagram.svg", + "animation.gif", + "vector.webp", + } + + filteredFiles := FilterDiffFilesByExtensions(files, allowedExtensions) + require.Equal(t, expectedFilteredFiles, filteredFiles, "Filtered files do not match expected output") +} diff --git a/zbook_backend/util/load_repo_config.go b/zbook_backend/util/load_repo_config.go new file mode 100644 index 0000000..fc42c5d --- /dev/null +++ b/zbook_backend/util/load_repo_config.go @@ -0,0 +1,50 @@ +package util + +import ( + "encoding/json" + "fmt" + "io" + "os" +) + +// 定义结构体来表示 JSON 对象的结构 +type Anchor struct { + Name string `json:"name"` + Icon string `json:"icon"` + URL string `json:"url"` +} +type FooterSocial struct { + Name string `json:"name"` + Icon string `json:"icon"` + URL string `json:"url"` +} + +type RepoConfig struct { + Anchors []Anchor `json:"anchors"` + Layout []Layout `json:"layout"` + FooterSocials []FooterSocial `json:"footerSocials"` +} + +func ReadRepoConfig(filePath string) (*RepoConfig, error) { + // 打开文件 + file, err := os.Open(filePath) + if err != nil { + return nil, fmt.Errorf("failed to open file: %s, error: %v", filePath, err) + } + defer file.Close() + + // 读取文件内容 + bytes, err := io.ReadAll(file) + if err != nil { + return nil, fmt.Errorf("failed to read file: %s, error: %v", filePath, err) + } + + // 解析 JSON 数据 + var jsonObject RepoConfig + err = json.Unmarshal(bytes, &jsonObject) + if err != nil { + return nil, fmt.Errorf("failed to parse json: %v", err) + } + + return &jsonObject, nil +} diff --git a/zbook_backend/util/load_repo_config_test.go b/zbook_backend/util/load_repo_config_test.go new file mode 100644 index 0000000..06b528e --- /dev/null +++ b/zbook_backend/util/load_repo_config_test.go @@ -0,0 +1,115 @@ +package util + +import ( + "os" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestReadRepoConfig(t *testing.T) { + // 创建一个临时文件并写入测试 JSON 数据 + testJSON := `{ + "anchors": [ + { + "name": "Google", + "icon": "google-icon", + "url": "https://google.com" + } + ], + "layout": [ + { + "title": "b", + "relative_path": "b", + "isdir": true, + "sublayouts": [ + { + "title": "c", + "relative_path": "b/c", + "isdir": false, + "sublayouts": null + }, + { + "title": "e", + "relative_path": "b/e", + "isdir": false, + "sublayouts": null + } + ] + }, + { + "title": "a", + "relative_path": "a", + "isdir": false, + "sublayouts": null + } + ], + "footerSocials": [ + { + "name": "Discord", + "icon": "discord", + "url": "https://discord.com" + } + ] + }` + + tmpFile, err := os.CreateTemp("", "test*.json") + require.NoError(t, err) + defer os.Remove(tmpFile.Name()) + + _, err = tmpFile.Write([]byte(testJSON)) + require.NoError(t, err) + + err = tmpFile.Close() + require.NoError(t, err) + + // 读取 JSON 文件并进行断言 + config, err := ReadRepoConfig(tmpFile.Name()) + require.NoError(t, err) + + expectedConfig := &RepoConfig{ + Anchors: []Anchor{ + { + Name: "Google", + Icon: "google-icon", + URL: "https://google.com", + }, + }, + Layout: []Layout{ + { + Title: "b", + RelativePath: "b", + Isdir: true, + Sublayouts: []Layout{ + { + Title: "c", + RelativePath: "b/c", + Isdir: false, + Sublayouts: nil, + }, + { + Title: "e", + RelativePath: "b/e", + Isdir: false, + Sublayouts: nil, + }, + }, + }, + { + Title: "a", + RelativePath: "a", + Isdir: false, + Sublayouts: nil, + }, + }, + FooterSocials: []FooterSocial{ + { + Name: "Discord", + Icon: "discord", + URL: "https://discord.com", + }, + }, + } + + require.Equal(t, expectedConfig, config) +} diff --git a/zbook_backend/util/oauth_type.go b/zbook_backend/util/oauth_type.go new file mode 100644 index 0000000..8203bed --- /dev/null +++ b/zbook_backend/util/oauth_type.go @@ -0,0 +1,7 @@ +package util + +const ( + OAuthTypeGithub = "github" + OAuthTypeGoogle = "google" + OAuthTypeWechat = "wechat" +) diff --git a/zbook_backend/util/parse_repo_config.go b/zbook_backend/util/parse_repo_config.go new file mode 100644 index 0000000..39c9db3 --- /dev/null +++ b/zbook_backend/util/parse_repo_config.go @@ -0,0 +1,16 @@ +package util + +import ( + "encoding/json" + "fmt" +) + +// ParseRepoConfigFromString 解析 JSON 格式的字符串并返回 RepoConfig 结构体 +func ParseRepoConfigFromString(jsonStr string) (*RepoConfig, error) { + var config RepoConfig + err := json.Unmarshal([]byte(jsonStr), &config) + if err != nil { + return nil, fmt.Errorf("failed to parse json: %v", err) + } + return &config, nil +} diff --git a/zbook_backend/util/parse_repo_config_test.go b/zbook_backend/util/parse_repo_config_test.go new file mode 100644 index 0000000..0854771 --- /dev/null +++ b/zbook_backend/util/parse_repo_config_test.go @@ -0,0 +1,101 @@ +package util + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestParseRepoConfigFromString(t *testing.T) { + jsonStr := `{ + "anchors": [ + { + "name": "Google", + "icon": "google-icon", + "url": "https://google.com" + } + ], + "layout": [ + { + "title": "b", + "relative_path": "b", + "isdir": true, + "sublayouts": [ + { + "title": "c", + "relative_path": "b/c", + "isdir": false, + "sublayouts": null + }, + { + "title": "e", + "relative_path": "b/e", + "isdir": false, + "sublayouts": null + } + ] + }, + { + "title": "a", + "relative_path": "a", + "isdir": false, + "sublayouts": null + } + ], + "footerSocials": [ + { + "name": "Discord", + "icon": "discord", + "url": "https://discord.com" + } + ] + }` + + expectedConfig := &RepoConfig{ + Anchors: []Anchor{ + { + Name: "Google", + Icon: "google-icon", + URL: "https://google.com", + }, + }, + Layout: []Layout{ + { + Title: "b", + RelativePath: "b", + Isdir: true, + Sublayouts: []Layout{ + { + Title: "c", + RelativePath: "b/c", + Isdir: false, + Sublayouts: nil, + }, + { + Title: "e", + RelativePath: "b/e", + Isdir: false, + Sublayouts: nil, + }, + }, + }, + { + Title: "a", + RelativePath: "a", + Isdir: false, + Sublayouts: nil, + }, + }, + FooterSocials: []FooterSocial{ + { + Name: "Discord", + Icon: "discord", + URL: "https://discord.com", + }, + }, + } + + config, err := ParseRepoConfigFromString(jsonStr) + require.NoError(t, err) + require.Equal(t, expectedConfig, config) +} diff --git a/zbook_backend/util/password.go b/zbook_backend/util/password.go new file mode 100644 index 0000000..8237e44 --- /dev/null +++ b/zbook_backend/util/password.go @@ -0,0 +1,21 @@ +package util + +import ( + "fmt" + + "golang.org/x/crypto/bcrypt" +) + +// HashPassword returns the bcrypt hash of the password +func HashPassword(password string) (string, error) { + hashedPassword, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) + if err != nil { + return "", fmt.Errorf("failed to hash password: %w", err) + } + return string(hashedPassword), nil +} + +// CheckPassword checks if the provided password is correct or not +func CheckPassword(password string, hashedPassword string) error { + return bcrypt.CompareHashAndPassword([]byte(hashedPassword), []byte(password)) +} diff --git a/zbook_backend/util/password_test.go b/zbook_backend/util/password_test.go new file mode 100644 index 0000000..1e87e9f --- /dev/null +++ b/zbook_backend/util/password_test.go @@ -0,0 +1,28 @@ +package util + +import ( + "testing" + + "github.com/stretchr/testify/require" + "golang.org/x/crypto/bcrypt" +) + +func TestPassword(t *testing.T) { + password := RandomString(6) + + hashedPassword1, err := HashPassword(password) + require.NoError(t, err) + require.NotEmpty(t, hashedPassword1) + + err = CheckPassword(password, hashedPassword1) + require.NoError(t, err) + + wrongPassword := RandomString(6) + err = CheckPassword(wrongPassword, hashedPassword1) + require.EqualError(t, err, bcrypt.ErrMismatchedHashAndPassword.Error()) + + hashedPassword2, err := HashPassword(password) + require.NoError(t, err) + require.NotEmpty(t, hashedPassword2) + require.NotEqual(t, hashedPassword1, hashedPassword2) +} diff --git a/zbook_backend/util/random.go b/zbook_backend/util/random.go new file mode 100644 index 0000000..7ebd2c6 --- /dev/null +++ b/zbook_backend/util/random.go @@ -0,0 +1,161 @@ +package util + +import ( + "fmt" + "math/rand" + "strings" + "time" + + "github.com/jackc/pgx/v5/pgtype" +) + +const alphabet = "abcdefghijklmnopqrstuvwxyz" + +// NewRandomStringGenerator creates a new RandomStringGenerator +func NewRandomStringGenerator() *RandomStringGenerator { + src := rand.NewSource(time.Now().UnixNano()) + rng := rand.New(src) + return &RandomStringGenerator{rng: rng} +} + +// RandomStringGenerator struct to hold the random generator +type RandomStringGenerator struct { + rng *rand.Rand +} + +// RandomString generates a random string of length n +func (rsg *RandomStringGenerator) RandomString(n int) string { + var sb strings.Builder + k := len(alphabet) + + for i := 0; i < n; i++ { + c := alphabet[rsg.rng.Intn(k)] + sb.WriteByte(c) + } + + return sb.String() +} + +// RandomInt generates a random integer between min and max +func RandomInt(min, max int64) int64 { + return min + rand.Int63n(max-min+1) +} + +// RandomInt generates a random integer between min and max +func RandomInt32(min, max int32) int32 { + return min + rand.Int31n(max-min+1) +} + +// RandomInt generates a random integer between min and max +func RandomInts(min, max int32) int32 { + return min + rand.Int31n(max-min+1) +} + +// RandomString generates a random string of length n +func RandomString(n int) string { + var sb strings.Builder + k := len(alphabet) + + for i := 0; i < n; i++ { + c := alphabet[rand.Intn(k)] + sb.WriteByte(c) + } + + return sb.String() +} + +// RandomOwner generates a random username +func RandomUsername() string { + return RandomString(6) +} + +// RandomEmail generates a random email +func RandomEmail() string { + return fmt.Sprintf("%s@email.com", RandomString(6)) +} +func RandomPGBool() pgtype.Bool { + // 创建一个新的本地随机生成器 + randGen := rand.New(rand.NewSource(time.Now().UnixNano())) + // 生成一个随机的0或1 + value := randGen.Intn(2) + // 将随机数转换为布尔值 + return pgtype.Bool{Bool: value == 1, Valid: true} +} + +func RandomBool() bool { + // 创建一个新的本地随机生成器 + randGen := rand.New(rand.NewSource(time.Now().UnixNano())) + // 生成一个随机的0或1 + value := randGen.Intn(2) + // 将随机数转换为布尔值 + return value == 1 +} + +func RandomUserRole() string { + // 创建一个新的本地随机生成器 + randGen := rand.New(rand.NewSource(time.Now().UnixNano())) + // 生成一个随机的索引值,0或1 + index := randGen.Intn(2) + // 根据索引值选择用户角色 + var role string + switch index { + case 0: + role = AdminRole + case 1: + role = UserRole + } + return role +} + +func RandomOAuth() string { + // 创建一个新的本地随机生成器 + randGen := rand.New(rand.NewSource(time.Now().UnixNano())) + // 生成一个随机的索引值,0或1 + index := randGen.Intn(3) + // 根据索引值选择用户角色 + var role string + switch index { + case 0: + role = OAuthTypeGithub + case 1: + role = OAuthTypeGoogle + case 2: + role = OAuthTypeWechat + } + return role +} + +func RandomVerificationType() string { + // 创建一个新的本地随机生成器 + randGen := rand.New(rand.NewSource(time.Now().UnixNano())) + // 生成一个随机的索引值,0或1 + index := randGen.Intn(2) + // 根据索引值选择用户角色 + var role string + switch index { + case 0: + role = VerifyTypeResetPassword + case 1: + role = VerifyTypeVerifyEmail + } + return role +} +func RandomRepoVisibility() string { + // 创建一个新的本地随机生成器 + randGen := rand.New(rand.NewSource(time.Now().UnixNano())) + // 生成一个随机的索引值,0或1 + index := randGen.Intn(4) + // 根据索引值选择用户角色 + var role string + switch index { + case 0: + role = VisibilityChosed + case 1: + role = VisibilityPrivate + case 2: + role = VisibilityPublic + case 3: + role = VisibilityPublic + } + return role +} diff --git a/zbook_backend/util/read_head.go b/zbook_backend/util/read_head.go new file mode 100644 index 0000000..d3b95b7 --- /dev/null +++ b/zbook_backend/util/read_head.go @@ -0,0 +1,73 @@ +package util + +import ( + "bytes" + "encoding/base64" + "image" + _ "image/gif" + _ "image/jpeg" + "image/png" + "io/ioutil" + "os" + "path/filepath" + + "golang.org/x/image/webp" + // 导入 svgo 包,支持 SVG 格式 +) + +// ReadImageBytes 读取图片文件并返回其字节数据,支持的格式统一编码为 PNG,不支持的格式直接返回文件的字节数据 +func ReadImageBytes(path string) ([]byte, error) { + // 打开图片文件 + file, err := os.Open(path) + if err != nil { + return nil, err + } + defer file.Close() + + // 解码图片文件 + var img image.Image + switch filepath.Ext(path) { + case ".png", ".jpg", ".jpeg", ".gif": + img, _, err = image.Decode(file) + case ".webp": + img, err = webp.Decode(file) + default: + // 如果格式不支持,直接返回文件的字节数据 + fileBytes, readErr := os.ReadFile(path) + if readErr != nil { + return nil, readErr + } + return fileBytes, nil + } + + if err != nil { + return nil, err + } + + // 创建字节缓冲区 + buffer := new(bytes.Buffer) + + // 将图像编码为 PNG + err = png.Encode(buffer, img) + if err != nil { + return nil, err + } + + // 返回编码后的字节数据 + return buffer.Bytes(), nil +} +func ReadImageBytesToBase64(imagePath string) (string, error) { + file, err := os.Open(imagePath) + if err != nil { + return "", err + } + defer file.Close() + + imageBytes, err := ioutil.ReadAll(file) + if err != nil { + return "", err + } + + base64Image := base64.StdEncoding.EncodeToString(imageBytes) + return base64Image, nil +} diff --git a/zbook_backend/util/relation_type.go b/zbook_backend/util/relation_type.go new file mode 100644 index 0000000..7bf8463 --- /dev/null +++ b/zbook_backend/util/relation_type.go @@ -0,0 +1,8 @@ +package util + +const ( + RelationTypeLike = "like" + RelationTypeDislike = "dislike" + RelationTypeShare = "share" + RelationTypeVisi = "visi" +) diff --git a/zbook_backend/util/role.go b/zbook_backend/util/role.go new file mode 100644 index 0000000..120aaaf --- /dev/null +++ b/zbook_backend/util/role.go @@ -0,0 +1,6 @@ +package util + +const ( + AdminRole = "admin" + UserRole = "user" +) diff --git a/zbook_backend/util/theme.go b/zbook_backend/util/theme.go new file mode 100644 index 0000000..54ccde4 --- /dev/null +++ b/zbook_backend/util/theme.go @@ -0,0 +1,15 @@ +package util + +const ( + ThemeSideBarFold = "theme_sidebar_fold" + ThemeSideBarUnfold = "theme_sidebar_unfold" + ThemeColorViolet = "violet" + ThemeColorGreen = "green" + ThemeColorRed = "red" + ThemeColorYellow = "yellow" + ThemeColorTeal = "teal" + ThemeColorSky = "sky" + ThemeColorCyan = "cyan" + ThemeColorPink = "pink" + ThemeColorIndigo = "indigo" +) diff --git a/zbook_backend/util/verify_type.go b/zbook_backend/util/verify_type.go new file mode 100644 index 0000000..749f897 --- /dev/null +++ b/zbook_backend/util/verify_type.go @@ -0,0 +1,6 @@ +package util + +const ( + VerifyTypeVerifyEmail = "verify_email" + VerifyTypeResetPassword = "reset_password" +) diff --git a/zbook_backend/util/visibility.go b/zbook_backend/util/visibility.go new file mode 100644 index 0000000..fbef3bb --- /dev/null +++ b/zbook_backend/util/visibility.go @@ -0,0 +1,8 @@ +package util + +const ( + VisibilityPublic = "public" + VisibilityPrivate = "private" + VisibilityChosed = "chosen" + VisibilitySigned = "signed" +) diff --git a/zbook_backend/val/validator.go b/zbook_backend/val/validator.go new file mode 100644 index 0000000..644fbb6 --- /dev/null +++ b/zbook_backend/val/validator.go @@ -0,0 +1,132 @@ +package val + +import ( + "errors" + "fmt" + "net/mail" + "regexp" + "strings" + "time" + + "github.com/zizdlp/zbook/util" +) + +var ( + isValidateUsername = regexp.MustCompile(`^[a-z0-9_]+$`).MatchString +) + +// 判断是否为有效的时区 +func ValidTimeZone(timezone string) error { + if timezone == "" { + return fmt.Errorf("timezone cannot be empty") + } + _, err := time.LoadLocation(timezone) + if err != nil { + fmt.Println("timezone is:", timezone) + return fmt.Errorf("invalide timezone:%s", timezone) + } + return nil +} + +func ValidateString(value string, minLength int, maxLength int) error { + n := len(value) + if n < minLength || n > maxLength { + return fmt.Errorf("must contain from %d-%d characters", minLength, maxLength) + } + return nil +} +func ValidateRepoVisibility(value string) error { + if value != util.VisibilityChosed && value != util.VisibilityPrivate && value != util.VisibilityPublic && value != util.VisibilitySigned { + return fmt.Errorf("not valid visibility level") + } + return nil +} +func ValidateRepoSideBarTheme(value string) error { + if value != util.ThemeSideBarFold && value != util.ThemeSideBarUnfold { + return fmt.Errorf("invalid sidebar theme") + } + return nil +} +func ValidateRepoThemeColor(value string) error { + if value != util.ThemeColorViolet && value != util.ThemeColorGreen && value != util.ThemeColorRed && value != util.ThemeColorYellow && value != util.ThemeColorTeal && value != util.ThemeColorSky && value != util.ThemeColorCyan && value != util.ThemeColorPink && value != util.ThemeColorIndigo { + return fmt.Errorf("invalid theme color") + } + return nil +} +func ValidateTitle(value string) error { + return ValidateString(value, 1, 100) +} +func ValidateID(value int64) error { + if value <= 0 { + return fmt.Errorf("ID must greater than 0") + } + return nil +} +func ValidatePageSize(value int32) error { + if value <= 0 { + return fmt.Errorf("page_size must greater than 0") + } + if value > 10 { + return fmt.Errorf("page_szie must not greater than 10") + } + return nil +} +func ValidateInt32ID(value int32) error { + if value <= 0 { + return fmt.Errorf("ID must greater than 0") + } + return nil +} +func ValidateListUserType(value int64) error { + if value <= 0 { + return fmt.Errorf("ID must greater than 0") + } + return nil +} + +func ValidateUsername(value string) error { + if err := ValidateString(value, 3, 100); err != nil { + return err + } + if !isValidateUsername(value) { + return fmt.Errorf("must contain only lower letters,digits, or underscore") + } + return nil +} +func ValidateRepoName(repoName string) error { + if len(repoName) < 2 || len(repoName) > 64 { + return fmt.Errorf("repository name length is not within the valid range:[2,64]") + } + + // Characters not allowed in URLs, typically include: '/', '?', ':', '@', '&', '=', '+', '$', ',', '#' + illegalChars := `/?:@&=+$,#~%` + if strings.ContainsAny(repoName, illegalChars) { + return errors.New("repository name contains illegal characters") + } + + return nil +} +func ValidatePassword(value string) error { + return ValidateString(value, 6, 100) +} + +func ValidateEmail(value string) error { + if err := ValidateString(value, 3, 200); err != nil { + return err + } + if _, err := mail.ParseAddress(value); err != nil { + return fmt.Errorf("is not a valid email address") + } + return nil +} + +func ValidateEmailId(value int64) error { + if value <= 0 { + return fmt.Errorf("must be a positive integer") + } + return nil +} + +func ValidateSecretCode(value string) error { + return ValidateString(value, 32, 128) +} diff --git a/zbook_backend/val/validator_test.go b/zbook_backend/val/validator_test.go new file mode 100644 index 0000000..02cb241 --- /dev/null +++ b/zbook_backend/val/validator_test.go @@ -0,0 +1,43 @@ +package val + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestValidateRepoName(t *testing.T) { + reponame := "文档" + err := ValidateRepoName(reponame) + require.NoError(t, err) + + reponame = "document" + err = ValidateRepoName(reponame) + require.NoError(t, err) + + reponame = "wiki docs" + err = ValidateRepoName(reponame) + require.NoError(t, err) + + reponame = "wiki documents this is a good job,well done,wiki documents this is a good job,well donewiki documents this is a good job,well done,wiki documents this is a good job,well done" + err = ValidateRepoName(reponame) + require.EqualError(t, err, "repository name length is not within the valid range:[2,64]") + + reponame = "@" + err = ValidateRepoName(reponame) + require.Error(t, err) + + reponame = "/" + err = ValidateRepoName(reponame) + require.Error(t, err) + +} + +func TestValidateTimeZone(t *testing.T) { + time_zone := "" + err := ValidTimeZone(time_zone) + require.EqualError(t, err, "timezone cannot be empty") + time_zone = "Asia/Shanghai" + err = ValidTimeZone(time_zone) + require.NoError(t, err) +} diff --git a/zbook_backend/wait-for.sh b/zbook_backend/wait-for.sh new file mode 100755 index 0000000..df09aad --- /dev/null +++ b/zbook_backend/wait-for.sh @@ -0,0 +1,184 @@ +#!/bin/sh + +# The MIT License (MIT) +# +# Copyright (c) 2017 Eficode Oy +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +set -- "$@" -- "$TIMEOUT" "$QUIET" "$PROTOCOL" "$HOST" "$PORT" "$result" +TIMEOUT=15 +QUIET=0 +# The protocol to make the request with, either "tcp" or "http" +PROTOCOL="tcp" + +echoerr() { + if [ "$QUIET" -ne 1 ]; then printf "%s\n" "$*" 1>&2; fi +} + +usage() { + exitcode="$1" + cat << USAGE >&2 +Usage: + $0 host:port|url [-t timeout] [-- command args] + -q | --quiet Do not output any status messages + -t TIMEOUT | --timeout=timeout Timeout in seconds, zero for no timeout + -- COMMAND ARGS Execute command with args after the test finishes +USAGE + exit "$exitcode" +} + +wait_for() { + case "$PROTOCOL" in + tcp) + if ! command -v nc >/dev/null; then + echoerr 'nc command is missing!' + exit 1 + fi + ;; + wget) + if ! command -v wget >/dev/null; then + echoerr 'nc command is missing!' + exit 1 + fi + ;; + esac + + while :; do + case "$PROTOCOL" in + tcp) + nc -z "$HOST" "$PORT" > /dev/null 2>&1 + ;; + http) + wget --timeout=1 -q "$HOST" -O /dev/null > /dev/null 2>&1 + ;; + *) + echoerr "Unknown protocol '$PROTOCOL'" + exit 1 + ;; + esac + + result=$? + + if [ $result -eq 0 ] ; then + if [ $# -gt 7 ] ; then + for result in $(seq $(($# - 7))); do + result=$1 + shift + set -- "$@" "$result" + done + + TIMEOUT=$2 QUIET=$3 PROTOCOL=$4 HOST=$5 PORT=$6 result=$7 + shift 7 + exec "$@" + fi + exit 0 + fi + + if [ "$TIMEOUT" -le 0 ]; then + break + fi + TIMEOUT=$((TIMEOUT - 1)) + + sleep 1 + done + echo "Operation timed out" >&2 + exit 1 +} + +while :; do + case "$1" in + http://*|https://*) + HOST="$1" + PROTOCOL="http" + shift 1 + ;; + *:* ) + HOST=$(printf "%s\n" "$1"| cut -d : -f 1) + PORT=$(printf "%s\n" "$1"| cut -d : -f 2) + shift 1 + ;; + -q | --quiet) + QUIET=1 + shift 1 + ;; + -q-*) + QUIET=0 + echoerr "Unknown option: $1" + usage 1 + ;; + -q*) + QUIET=1 + result=$1 + shift 1 + set -- -"${result#-q}" "$@" + ;; + -t | --timeout) + TIMEOUT="$2" + shift 2 + ;; + -t*) + TIMEOUT="${1#-t}" + shift 1 + ;; + --timeout=*) + TIMEOUT="${1#*=}" + shift 1 + ;; + --) + shift + break + ;; + --help) + usage 0 + ;; + -*) + QUIET=0 + echoerr "Unknown option: $1" + usage 1 + ;; + *) + QUIET=0 + echoerr "Unknown argument: $1" + usage 1 + ;; + esac +done + +if ! [ "$TIMEOUT" -ge 0 ] 2>/dev/null; then + echoerr "Error: invalid timeout '$TIMEOUT'" + usage 3 +fi + +case "$PROTOCOL" in + tcp) + if [ "$HOST" = "" ] || [ "$PORT" = "" ]; then + echoerr "Error: you need to provide a host and port to test." + usage 2 + fi + ;; + http) + if [ "$HOST" = "" ]; then + echoerr "Error: you need to provide a host to test." + usage 2 + fi + ;; +esac + +wait_for "$@" \ No newline at end of file diff --git a/zbook_backend/worker/distributor.go b/zbook_backend/worker/distributor.go new file mode 100644 index 0000000..d64dd6b --- /dev/null +++ b/zbook_backend/worker/distributor.go @@ -0,0 +1,36 @@ +package worker + +import ( + "context" + + "github.com/hibiken/asynq" +) + +type TaskDistributor interface { + DistributeTaskVerifyEmail( + ctx context.Context, + payload *PayloadVerifyEmail, + opts ...asynq.Option, + ) error + DistributeTaskInviteUser( + ctx context.Context, + payload *PayloadInviteUser, + opts ...asynq.Option, + ) error + DistributeTaskResetPassword( + ctx context.Context, + payload *PayloadResetPassword, + opts ...asynq.Option, + ) error +} + +type RedisTaskDistributor struct { + client *asynq.Client +} + +func NewRedisTaskDistributor(redisOpt asynq.RedisClientOpt) TaskDistributor { + client := asynq.NewClient(redisOpt) + return &RedisTaskDistributor{ + client: client, + } +} diff --git a/zbook_backend/worker/logger.go b/zbook_backend/worker/logger.go new file mode 100644 index 0000000..68cdd84 --- /dev/null +++ b/zbook_backend/worker/logger.go @@ -0,0 +1,43 @@ +package worker + +import ( + "context" + "fmt" + + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" +) + +type Logger struct{} + +func NewLogger() *Logger { + return &Logger{} +} + +func (logger *Logger) Print(level zerolog.Level, args ...interface{}) { + log.WithLevel(level).Msg(fmt.Sprint(args...)) +} + +func (logger *Logger) Printf(ctx context.Context, format string, v ...interface{}) { + log.WithLevel(zerolog.DebugLevel).Msgf(format, v...) +} + +func (logger *Logger) Debug(args ...interface{}) { + logger.Print(zerolog.DebugLevel, args...) +} + +func (logger *Logger) Info(args ...interface{}) { + logger.Print(zerolog.InfoLevel, args...) +} + +func (logger *Logger) Warn(args ...interface{}) { + logger.Print(zerolog.WarnLevel, args...) +} + +func (logger *Logger) Error(args ...interface{}) { + logger.Print(zerolog.ErrorLevel, args...) +} + +func (logger *Logger) Fatal(args ...interface{}) { + logger.Print(zerolog.FatalLevel, args...) +} diff --git a/zbook_backend/worker/mock/distributor.go b/zbook_backend/worker/mock/distributor.go new file mode 100644 index 0000000..ff36d9f --- /dev/null +++ b/zbook_backend/worker/mock/distributor.go @@ -0,0 +1,94 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/zizdlp/zbook/worker (interfaces: TaskDistributor) + +// Package mockwk is a generated GoMock package. +package mockwk + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + asynq "github.com/hibiken/asynq" + worker "github.com/zizdlp/zbook/worker" +) + +// MockTaskDistributor is a mock of TaskDistributor interface. +type MockTaskDistributor struct { + ctrl *gomock.Controller + recorder *MockTaskDistributorMockRecorder +} + +// MockTaskDistributorMockRecorder is the mock recorder for MockTaskDistributor. +type MockTaskDistributorMockRecorder struct { + mock *MockTaskDistributor +} + +// NewMockTaskDistributor creates a new mock instance. +func NewMockTaskDistributor(ctrl *gomock.Controller) *MockTaskDistributor { + mock := &MockTaskDistributor{ctrl: ctrl} + mock.recorder = &MockTaskDistributorMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockTaskDistributor) EXPECT() *MockTaskDistributorMockRecorder { + return m.recorder +} + +// DistributeTaskInviteUser mocks base method. +func (m *MockTaskDistributor) DistributeTaskInviteUser(arg0 context.Context, arg1 *worker.PayloadInviteUser, arg2 ...asynq.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DistributeTaskInviteUser", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DistributeTaskInviteUser indicates an expected call of DistributeTaskInviteUser. +func (mr *MockTaskDistributorMockRecorder) DistributeTaskInviteUser(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DistributeTaskInviteUser", reflect.TypeOf((*MockTaskDistributor)(nil).DistributeTaskInviteUser), varargs...) +} + +// DistributeTaskResetPassword mocks base method. +func (m *MockTaskDistributor) DistributeTaskResetPassword(arg0 context.Context, arg1 *worker.PayloadResetPassword, arg2 ...asynq.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DistributeTaskResetPassword", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DistributeTaskResetPassword indicates an expected call of DistributeTaskResetPassword. +func (mr *MockTaskDistributorMockRecorder) DistributeTaskResetPassword(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DistributeTaskResetPassword", reflect.TypeOf((*MockTaskDistributor)(nil).DistributeTaskResetPassword), varargs...) +} + +// DistributeTaskVerifyEmail mocks base method. +func (m *MockTaskDistributor) DistributeTaskVerifyEmail(arg0 context.Context, arg1 *worker.PayloadVerifyEmail, arg2 ...asynq.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DistributeTaskVerifyEmail", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DistributeTaskVerifyEmail indicates an expected call of DistributeTaskVerifyEmail. +func (mr *MockTaskDistributorMockRecorder) DistributeTaskVerifyEmail(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DistributeTaskVerifyEmail", reflect.TypeOf((*MockTaskDistributor)(nil).DistributeTaskVerifyEmail), varargs...) +} diff --git a/zbook_backend/worker/processor.go b/zbook_backend/worker/processor.go new file mode 100644 index 0000000..2f30e07 --- /dev/null +++ b/zbook_backend/worker/processor.go @@ -0,0 +1,68 @@ +package worker + +import ( + "context" + + "github.com/go-redis/redis/v8" + "github.com/hibiken/asynq" + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/mail" +) + +const ( + QueueCritical = "critical" + QueueDefault = "default" +) + +type TaskProcessor interface { + Start() error + Shutdown() + ProcessTaskVerifyEmail(ctx context.Context, task *asynq.Task) error + ProcessTaskInviteUser(ctx context.Context, task *asynq.Task) error + ProcessTaskResetPassword(ctx context.Context, task *asynq.Task) error +} + +type RedisTaskProcessor struct { + server *asynq.Server + store db.Store + mailer mail.EmailSender +} + +func NewRedisTaskProcessor(redisOpt asynq.RedisClientOpt, store db.Store, mailer mail.EmailSender) TaskProcessor { + logger := NewLogger() + redis.SetLogger(logger) + + server := asynq.NewServer( + redisOpt, + asynq.Config{ + Queues: map[string]int{ + QueueCritical: 10, + QueueDefault: 5, + }, + ErrorHandler: asynq.ErrorHandlerFunc(func(ctx context.Context, task *asynq.Task, err error) { + log.Error().Err(err).Str("type", task.Type()). + Bytes("payload", task.Payload()).Msg("process task failed") + }), + Logger: logger, + }, + ) + + return &RedisTaskProcessor{ + server: server, + store: store, + mailer: mailer, + } +} + +func (processor *RedisTaskProcessor) Start() error { + mux := asynq.NewServeMux() + mux.HandleFunc(TaskVerifyEmail, processor.ProcessTaskVerifyEmail) + mux.HandleFunc(TaskInviteUser, processor.ProcessTaskInviteUser) + mux.HandleFunc(TaskResetPassword, processor.ProcessTaskResetPassword) + return processor.server.Start(mux) +} + +func (processor *RedisTaskProcessor) Shutdown() { + processor.server.Shutdown() +} diff --git a/zbook_backend/worker/task_send_email_to_invite_user.go b/zbook_backend/worker/task_send_email_to_invite_user.go new file mode 100644 index 0000000..85fd5cb --- /dev/null +++ b/zbook_backend/worker/task_send_email_to_invite_user.go @@ -0,0 +1,86 @@ +package worker + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/hibiken/asynq" + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/util" +) + +const TaskInviteUser = "task:invite_user" + +type PayloadInviteUser struct { + Email string `json:"email"` +} + +func (distributor *RedisTaskDistributor) DistributeTaskInviteUser( + ctx context.Context, + payload *PayloadInviteUser, + opts ...asynq.Option, +) error { + jsonPayload, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal task payload: %w", err) + } + + task := asynq.NewTask(TaskInviteUser, jsonPayload, opts...) + info, err := distributor.client.EnqueueContext(ctx, task) + if err != nil { + return fmt.Errorf("failed to enqueue task: %w", err) + } + + log.Info().Str("type", task.Type()).Bytes("payload", task.Payload()). + Str("queue", info.Queue).Int("max_retry", info.MaxRetry).Msg("enqueued task") + return nil +} + +func (processor *RedisTaskProcessor) ProcessTaskInviteUser(ctx context.Context, task *asynq.Task) error { + config, err := util.LoadConfig(".") + if err != nil { + log.Fatal().Msgf("cannot load config: %s", err) + } + var payload PayloadInviteUser + if err := json.Unmarshal(task.Payload(), &payload); err != nil { + return fmt.Errorf("failed to unmarshal payload: %w", asynq.SkipRetry) + } + + user, err := processor.store.GetUserByEmail(ctx, payload.Email) + if err == nil { + return fmt.Errorf("use already exist for this email: %s", user.Email) + } + + invitation, err := processor.store.CreateInvitation(ctx, db.CreateInvitationParams{ + Email: payload.Email, + InvitationUrl: util.RandomString(32), + }) + if err != nil { + return fmt.Errorf("failed to create verify code:%w", err) + } + + subject := "Invitation to Join ZBook" + + title := "Register to ZBook" + emailSubject := "Thank you for your interest in ZBook! Please complete your registration by clicking the button below:" + verifyUrl := fmt.Sprintf("%s/auth/register?invitation_url=%s", config.HOMEADDRESS, invitation.InvitationUrl) + buttonText := "Complete Registration" + additionalText := "If you did not request an invitation, please ignore this email or contact support if you have any questions." + base64Image, err := util.ReadImageBytesToBase64("icons/logo.png") + if err != nil { + return fmt.Errorf("failed to read logo file: %w", err) + } + emailBody := fmt.Sprintf(util.EmailTemplate, title, user.Username, emailSubject, verifyUrl, buttonText, additionalText, base64Image) + to := []string{payload.Email} + + err = processor.mailer.SendEmail(subject, emailBody, to, nil, nil, nil, config.SmtpAuthAddress, config.SmtpServerAddress) + if err != nil { + return fmt.Errorf("failed to send email to verify: %w", err) + } + // TODO: send email to user + log.Info().Str("type", task.Type()).Bytes("payload", task.Payload()). + Str(" email ", user.Email).Msg("processed task") + return nil +} diff --git a/zbook_backend/worker/task_send_email_to_reset_password.go b/zbook_backend/worker/task_send_email_to_reset_password.go new file mode 100644 index 0000000..c3e7e86 --- /dev/null +++ b/zbook_backend/worker/task_send_email_to_reset_password.go @@ -0,0 +1,87 @@ +package worker + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/hibiken/asynq" + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/util" +) + +const TaskResetPassword = "task:reset_password" + +type PayloadResetPassword struct { + Email string `json:"email"` +} + +func (distributor *RedisTaskDistributor) DistributeTaskResetPassword( + ctx context.Context, + payload *PayloadResetPassword, + opts ...asynq.Option, +) error { + jsonPayload, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal task payload: %w", err) + } + + task := asynq.NewTask(TaskResetPassword, jsonPayload, opts...) + info, err := distributor.client.EnqueueContext(ctx, task) + if err != nil { + return fmt.Errorf("failed to enqueue task: %w", err) + } + + log.Info().Str("type", task.Type()).Bytes("payload", task.Payload()). + Str("queue", info.Queue).Int("max_retry", info.MaxRetry).Msg("enqueued task") + return nil +} + +func (processor *RedisTaskProcessor) ProcessTaskResetPassword(ctx context.Context, task *asynq.Task) error { + var payload PayloadResetPassword + if err := json.Unmarshal(task.Payload(), &payload); err != nil { + return fmt.Errorf("failed to unmarshal payload: %w", asynq.SkipRetry) + } + + user, err := processor.store.GetUserByEmail(ctx, payload.Email) + if err != nil { + return fmt.Errorf("failed to get user: %w", err) + } + + verification, err := processor.store.CreateVerification(ctx, db.CreateVerificationParams{ + VerificationUrl: util.RandomString(32), + UserID: user.UserID, + VerificationType: util.VerifyTypeResetPassword, + }) + if err != nil { + return fmt.Errorf("failed to create verify code:%w", err) + } + subject := "Reset ZBook Password" + config, err := util.LoadConfig(".") + if err != nil { + log.Fatal().Msgf("cannot load config: %s", err) + } + verifyUrl := fmt.Sprintf("%s/reset_password?verification_url=%s", config.HOMEADDRESS, verification.VerificationUrl) + + Title := "Reset Your Password" + emailSubject := "We received a request to reset your password. Please click the button below to reset your password:" + buttonText := "Reset Password" + additionalText := "If you did not request a password reset, please ignore this email or contact support if you have questions." + base64Image, err := util.ReadImageBytesToBase64("icons/logo.png") + if err != nil { + return fmt.Errorf("failed to read logo file: %w", err) + } + emailBody := fmt.Sprintf(util.EmailTemplate, Title, user.Username, emailSubject, verifyUrl, buttonText, additionalText, base64Image) + + to := []string{user.Email} + + err = processor.mailer.SendEmail(subject, emailBody, to, nil, nil, nil, config.SmtpAuthAddress, config.SmtpServerAddress) + if err != nil { + return fmt.Errorf("failed to send Email to reset password: %w", err) + } + // TODO: send email to user + log.Info().Str("type", task.Type()).Bytes("payload", task.Payload()). + Str(" email ", user.Email).Msg("processed task") + return nil +} diff --git a/zbook_backend/worker/task_send_email_to_verify_email.go b/zbook_backend/worker/task_send_email_to_verify_email.go new file mode 100644 index 0000000..8e29c97 --- /dev/null +++ b/zbook_backend/worker/task_send_email_to_verify_email.go @@ -0,0 +1,87 @@ +package worker + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/hibiken/asynq" + "github.com/rs/zerolog/log" + db "github.com/zizdlp/zbook/db/sqlc" + "github.com/zizdlp/zbook/util" +) + +const TaskVerifyEmail = "task:verify_email" + +type PayloadVerifyEmail struct { + Email string `json:"email"` +} + +func (distributor *RedisTaskDistributor) DistributeTaskVerifyEmail( + ctx context.Context, + payload *PayloadVerifyEmail, + opts ...asynq.Option, +) error { + jsonPayload, err := json.Marshal(payload) + if err != nil { + return fmt.Errorf("failed to marshal task payload: %w", err) + } + + task := asynq.NewTask(TaskVerifyEmail, jsonPayload, opts...) + info, err := distributor.client.EnqueueContext(ctx, task) + if err != nil { + return fmt.Errorf("failed to enqueue task: %w", err) + } + + log.Info().Str("type", task.Type()).Bytes("payload", task.Payload()). + Str("queue", info.Queue).Int("max_retry", info.MaxRetry).Msg("enqueued task") + return nil +} + +func (processor *RedisTaskProcessor) ProcessTaskVerifyEmail(ctx context.Context, task *asynq.Task) error { + config, err := util.LoadConfig(".") + if err != nil { + log.Fatal().Msgf("cannot load config: %s", err) + } + var payload PayloadVerifyEmail + if err := json.Unmarshal(task.Payload(), &payload); err != nil { + return fmt.Errorf("failed to unmarshal payload: %w", asynq.SkipRetry) + } + + user, err := processor.store.GetUserByEmail(ctx, payload.Email) + if err != nil { + return fmt.Errorf("failed to get user: %w", err) + } + + verification, err := processor.store.CreateVerification(ctx, db.CreateVerificationParams{ + VerificationUrl: util.RandomString(32), + UserID: user.UserID, + VerificationType: util.VerifyTypeVerifyEmail, + }) + if err != nil { + return fmt.Errorf("failed to create verify code:%w", err) + } + + subject := "Welcome to ZBook!" + + Title := "Verify Your Email Address" + emailSubject := "Thank you for registering with us! Please verify your email address by clicking the button below:" + verifyUrl := fmt.Sprintf("%s/verify_email?verification_url=%s", config.HOMEADDRESS, verification.VerificationUrl) + buttonText := "Verify Email" + additionalText := "If you did not register for an account, please ignore this email or contact support if you have any questions." + base64Image, err := util.ReadImageBytesToBase64("icons/logo.png") + if err != nil { + return fmt.Errorf("failed to read logo file: %w", err) + } + emailBody := fmt.Sprintf(util.EmailTemplate, Title, user.Username, emailSubject, verifyUrl, buttonText, additionalText, base64Image) + to := []string{user.Email} + + err = processor.mailer.SendEmail(subject, emailBody, to, nil, nil, nil, config.SmtpAuthAddress, config.SmtpServerAddress) + if err != nil { + return fmt.Errorf("failed to send email to verify: %w", err) + } + // TODO: send email to user + log.Info().Str("type", task.Type()).Bytes("payload", task.Payload()). + Str(" email ", user.Email).Msg("processed task") + return nil +} diff --git a/zbook_backend/wsserver/wsserver.go b/zbook_backend/wsserver/wsserver.go new file mode 100644 index 0000000..1793dd3 --- /dev/null +++ b/zbook_backend/wsserver/wsserver.go @@ -0,0 +1,289 @@ +package wsserver + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "os" + "sync" + + "github.com/gorilla/websocket" + "github.com/jackc/pgx/v5/pgxpool" + "github.com/rs/zerolog/log" + "github.com/zizdlp/zbook/token" + "github.com/zizdlp/zbook/util" + "golang.org/x/sync/errgroup" +) + +type message struct { + Username string `json:"username"` + UnreadMessageCount int `json:"unread_count"` +} + +var ( + websocketMap sync.Map // map[string][]*websocket.Conn +) + +func WebSocketServer(ctx context.Context, waitGroup *errgroup.Group, config util.Config) { + // Start a goroutine to handle incoming notifications. + tokenMaker, err := token.NewPasetoMaker(config.TokenSymmetricKey) + if err != nil { + log.Error().Err(err).Msg("failed to create token maker") + return + } + + httpServer := &http.Server{ + Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case "/ws": + handleWebSocket(w, r, tokenMaker) + case "/ws/connections": + ListWebSocketConnections(w, r, tokenMaker) + default: + http.NotFound(w, r) + } + }), + Addr: config.WEBSOCKETServerAddress, + } + + waitGroup.Go(func() error { + log.Info().Msgf("start WebSocket server at %s", httpServer.Addr) + err = httpServer.ListenAndServe() + if err != nil { + if errors.Is(err, http.ErrServerClosed) { + return nil + } + log.Error().Err(err).Msg("WebSocket server failed to serve") + return err + } + return nil + }) + + waitGroup.Go(func() error { + <-ctx.Done() + log.Info().Msg("graceful shutdown WebSocket server") + + err := httpServer.Shutdown(context.Background()) + if err != nil { + log.Error().Err(err).Msg("failed to shutdown WebSocket server") + return err + } + + log.Info().Msg("WebSocket server is stopped") + return nil + }) +} + +func ListenWebSocket(pool *pgxpool.Pool) { + conn, err := pool.Acquire(context.Background()) + if err != nil { + log.Error().Err(err).Msg("Error acquiring connection") + os.Exit(1) + } + defer conn.Release() + + _, err = conn.Exec(context.Background(), "LISTEN unread_count_change") + if err != nil { + log.Error().Err(err).Msg("Error listening to chat channel") + os.Exit(1) + } + + for { + notification, err := conn.Conn().WaitForNotification(context.Background()) + if err != nil { + if err.Error() == "unexpected EOF" { + // Handle the error by reconnecting to the server. + log.Warn().Msg("Reconnecting to the websocket server...") + conn.Release() + conn, err = pool.Acquire(context.Background()) + if err != nil { + log.Error().Err(err).Msg("Error acquiring connection") + os.Exit(1) + } + _, err = conn.Exec(context.Background(), "LISTEN unread_count_change") + if err != nil { + log.Error().Err(err).Msg("Error listening to chat channel") + os.Exit(1) + } + continue + } else { + log.Error().Msgf("Error waiting for notification: %s", err) + os.Exit(1) + } + } + var msg message + err = json.Unmarshal([]byte(notification.Payload), &msg) + if err != nil { + log.Error().Err(err).Msg("failed to unmarshal json payload") + continue + } + // Send the notification to the appropriate WebSocket connection. + sendWebSocketMessage(msg.Username, msg.UnreadMessageCount) + } +} + +func sendWebSocketMessage(username string, unreadMessageCount int) { + // Get the WebSocket connections for the specified user. + conns, ok := websocketMap.Load(username) + if !ok { + return + } + + // Construct the message payload. + payload := fmt.Sprintf(`{"username":"%s","unread_count":%d}`, username, unreadMessageCount) + + // Send the message over all WebSocket connections. + for _, conn := range conns.([]*websocket.Conn) { + err := conn.WriteMessage(websocket.TextMessage, []byte(payload)) + if err != nil { + log.Error().Err(err).Msgf("failed to write websocket message for user: %s", username) + // If there is an error, close the connection and remove it from the map + conn.Close() + removeWebSocketConnection(username, conn) + } + } +} +func removeWebSocketConnection(username string, conn *websocket.Conn) { + // Retrieve the existing connections for the user. + conns, ok := websocketMap.Load(username) + if !ok { + return + } + + // Create a new slice excluding the specified connection. + var updatedConns []*websocket.Conn + for _, existingConn := range conns.([]*websocket.Conn) { + if existingConn != conn { + updatedConns = append(updatedConns, existingConn) + } + } + + // Update the map or delete the entry if no connections remain. + if len(updatedConns) > 0 { + websocketMap.Store(username, updatedConns) + } else { + websocketMap.Delete(username) + } +} + +var upgrader = websocket.Upgrader{ + ReadBufferSize: 1024, + WriteBufferSize: 1024, + CheckOrigin: func(r *http.Request) bool { + return true + }, +} + +func handleWebSocket(w http.ResponseWriter, r *http.Request, tokenMaker token.Maker) { + // Get the user ID from the request. + username := r.URL.Query().Get("username") + if username == "" { + http.Error(w, "Invalid username", http.StatusBadRequest) + return + } + + // Upgrade the HTTP connection to a WebSocket connection. + conn, err := upgrader.Upgrade(w, r, nil) + if err != nil { + log.Error().Err(err).Msg("failed to upgrade http to WebSocket") + return + } + + _, accessToken, err := conn.ReadMessage() + if err != nil { + log.Error().Err(err).Msg("failed to read access token message") + conn.Close() + return + } + + payload, err := tokenMaker.VerifyToken(string(accessToken)) + if err != nil { + log.Error().Err(err).Msgf("websocket:failed to verify token for user:%s", username) + conn.Close() + return + } + + if payload.Username != username { + log.Error().Err(err).Msg("websocket:permission denied account not match") + conn.Close() + return + } + + // Retrieve the existing connections for the user, or create a new slice if none exist. + var conns []*websocket.Conn + if existingConns, ok := websocketMap.Load(username); ok { + conns = existingConns.([]*websocket.Conn) + } + conns = append(conns, conn) + + // Store the updated slice of connections. + websocketMap.Store(username, conns) + + log.Info().Msgf("websocket:connect to user: %s", username) + + // Start a new goroutine for each WebSocket connection. + go func() { + defer conn.Close() + + // Loop to handle incoming WebSocket messages. + for { + _, _, err := conn.ReadMessage() + if err != nil { + // Log the reason for the connection closure + if websocket.IsCloseError(err, websocket.CloseGoingAway, websocket.CloseNormalClosure) { + log.Info().Msgf("WebSocket connection closed for user: %s, reason: %v", username, err) + } else { + log.Warn().Msgf("WebSocket connection error for user: %s, error: %v", username, err) + } + removeWebSocketConnection(username, conn) + break + } + } + }() +} + +func ListWebSocketConnections(w http.ResponseWriter, r *http.Request, tokenMaker token.Maker) { + connections := make(map[string]int) // count of connections per user + accessToken := r.URL.Query().Get("access_token") + if accessToken == "" { + http.Error(w, "Invalid access_token", http.StatusBadRequest) + return + } + + // Verify the access token. + payload, err := tokenMaker.VerifyToken(accessToken) + if err != nil { + log.Error().Err(err).Msg("websocket: failed to verify token") + http.Error(w, "Invalid access_token", http.StatusUnauthorized) + return + } + + // Check if the user has admin privileges. + if payload.Role != util.AdminRole { + log.Error().Msg("websocket: permission denied, only admin account can use this API") + http.Error(w, "Permission denied", http.StatusForbidden) + return + } + + // Iterate over the websocketMap to collect all active connections. + websocketMap.Range(func(key, value interface{}) bool { + username, ok := key.(string) + if ok { + connections[username] = len(value.([]*websocket.Conn)) + } + return true + }) + + // Convert the map to JSON. + response, err := json.Marshal(connections) + if err != nil { + http.Error(w, "Failed to marshal response", http.StatusInternalServerError) + return + } + + // Set the Content-Type and write the response. + w.Header().Set("Content-Type", "application/json") + w.Write(response) +} diff --git a/zbook_backend/zbook_backend.Dockerfile b/zbook_backend/zbook_backend.Dockerfile new file mode 100644 index 0000000..5f0bbc6 --- /dev/null +++ b/zbook_backend/zbook_backend.Dockerfile @@ -0,0 +1,29 @@ +# Build stage +FROM golang:1.21.5-alpine3.19 AS builder +WORKDIR /app +COPY . . +RUN apk add --no-cache build-base +RUN go build -o ./main ./cmd/server/main.go + +# Run stage +FROM alpine:3.19 +WORKDIR /app +COPY --from=builder /app/main . + +# Install necessary packages +RUN apk add --no-cache pngquant git tzdata + +# Copy other necessary files +COPY icons /app/icons +COPY app.env . +COPY start.sh . +COPY wait-for.sh . +COPY db/migration ./db/migration +COPY cert.pem ./cert.pem + +# Set timezone data +ENV TZ=Etc/UTC + +EXPOSE 8080 +CMD ["/app/main"] +ENTRYPOINT ["/app/start.sh"] \ No newline at end of file diff --git a/zbook_database/convert.py b/zbook_database/convert.py new file mode 100644 index 0000000..e5bbf66 --- /dev/null +++ b/zbook_database/convert.py @@ -0,0 +1,42 @@ +import maxminddb +import psycopg2 +from ipaddress import ip_network + +# 连接到 PostgreSQL 数据库 +conn = psycopg2.connect( + dbname="zbook", user="root", password="secret", host="localhost" +) +cur = conn.cursor() + +# 打开 MMDB 文件 +with maxminddb.open_database('GeoLite2-City.mmdb') as reader: + # 遍历所有 IP 地址段 + for ip_range, data in reader: + # 将 IP 范围转换为字符串(CIDR 格式) + ip_range_cidr = str(ip_network(ip_range)) + + # 提取各语言的城市名称 + city_names = data.get('city', {}).get('names', {}) + city_name_en = city_names.get('en', None) + city_name_zh_cn = city_names.get('zh-CN', None) + + # 提取地理位置信息 + latitude = data.get('location', {}).get('latitude', None) + longitude = data.get('location', {}).get('longitude', None) + + # 将数据插入 PostgreSQL + cur.execute(""" + INSERT INTO geoip ( + ip_range_cidr, city_name_en, city_name_zh_cn, + latitude, longitude + ) + VALUES (%s, %s, %s, %s, %s) + ON CONFLICT (ip_range_cidr) DO NOTHING; + """, ( + ip_range_cidr, city_name_en, city_name_zh_cn,latitude, longitude + )) + +# 提交并关闭数据库连接 +conn.commit() +cur.close() +conn.close() diff --git a/zbook_database/convert.sh b/zbook_database/convert.sh new file mode 100644 index 0000000..1d6bdba --- /dev/null +++ b/zbook_database/convert.sh @@ -0,0 +1,5 @@ +python convert.py +# pg_dump -U root -d zbook -t geoip --data-only > geoip_data.sql # in database docker container +# gzip geoip_data.sql # in database docker container +# docker cp zbook-local-database:/geoip_data.sql.gz . +# psql -U root -d zbook -f geoip_data.sql diff --git a/zbook_database/deps_postgres.sh b/zbook_database/deps_postgres.sh new file mode 100644 index 0000000..ba78fdc --- /dev/null +++ b/zbook_database/deps_postgres.sh @@ -0,0 +1,6 @@ +sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories +apk update +apk add g++ +apk add cmake +apk add build-base +apk add git \ No newline at end of file diff --git a/zbook_database/zbook_database.Dockerfile b/zbook_database/zbook_database.Dockerfile new file mode 100644 index 0000000..041586f --- /dev/null +++ b/zbook_database/zbook_database.Dockerfile @@ -0,0 +1,24 @@ +# Build stage +FROM postgres:16.2-alpine3.19 as builder +WORKDIR /app + +COPY deps_postgres.sh . +RUN chmod +x deps_postgres.sh \ + && sh deps_postgres.sh +RUN git clone --recurse-submodules https://github.com/jaiminpan/pg_jieba +WORKDIR /app/pg_jieba +RUN mkdir build && \ + cd build && \ + cmake .. && \ + make && \ + make install +WORKDIR /app + +# Run stage +FROM postgres:16.2-alpine3.19 + +# Copy built extension from builder stage +COPY --from=builder /usr/local /usr/local + +# Set the shared_preload_libraries configuration +CMD ["postgres", "-c", "shared_preload_libraries=/usr/local/lib/postgresql/pg_jieba.so"] \ No newline at end of file diff --git a/zbook_frontend/.dockerignore b/zbook_frontend/.dockerignore new file mode 100644 index 0000000..b0d80cb --- /dev/null +++ b/zbook_frontend/.dockerignore @@ -0,0 +1,3 @@ +.next +node_modules +.env*.local \ No newline at end of file diff --git a/zbook_frontend/.env.production b/zbook_frontend/.env.production new file mode 100644 index 0000000..9f4e498 --- /dev/null +++ b/zbook_frontend/.env.production @@ -0,0 +1,13 @@ +WEBSOCKET_URL=replace-with-your-websocket-url +BACKEND_URL=replace-with-your-backend-url + +AUTH_URL=replace-with-your-url +AUTH_SECRET=abcadsfasfsdafawefwaefa2 +AUTH_TRUST_HOST=true +DOC_REPONAME=replace-with-your-doc +DOC_USERNAME=replace-with-your-username + +GITHUB_ID=replace-with-your-github-id +GITHUB_SECRET=replace-with-your-github-secret +GOOGLE_CLIENT_ID=replace-with-your-google-id +GOOGLE_CLIENT_SECRET=replace-with-your-google-secret \ No newline at end of file diff --git a/zbook_frontend/.eslintrc.json b/zbook_frontend/.eslintrc.json new file mode 100644 index 0000000..f629333 --- /dev/null +++ b/zbook_frontend/.eslintrc.json @@ -0,0 +1,26 @@ +{ + "extends": "next/core-web-vitals", + // ... + + "rules": { + "react/jsx-no-literals": "error", + // Consistently import navigation APIs from `@/navigation` + "no-restricted-imports": [ + "error", + { + "name": "next/link", + "message": "Please import from `@/navigation` instead." + }, + { + "name": "next/navigation", + "importNames": [ + "redirect", + "permanentRedirect", + "useRouter", + "usePathname" + ], + "message": "Please import from `@/navigation` instead." + } + ] + } +} diff --git a/zbook_frontend/.gitignore b/zbook_frontend/.gitignore new file mode 100644 index 0000000..fd3dbb5 --- /dev/null +++ b/zbook_frontend/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/zbook_frontend/__tests__/TimeElement.test.tsx b/zbook_frontend/__tests__/TimeElement.test.tsx new file mode 100644 index 0000000..6509ee2 --- /dev/null +++ b/zbook_frontend/__tests__/TimeElement.test.tsx @@ -0,0 +1,90 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; +import "@testing-library/jest-dom"; +import TimeElement from "@/components/TimeElement"; + +// Mock the useTranslations hook +jest.mock("next-intl", () => ({ + useTranslations: + () => (key: keyof typeof translations, values?: { duration: number }) => { + const translations = { + JustNow: "Just now", + MinuteAgo: `${values?.duration} minute(s) ago`, + MinuteAfter: `In ${values?.duration} minute(s)`, + HourAgo: `${values?.duration} hour(s) ago`, + HourAfter: `In ${values?.duration} hour(s)`, + DayAgo: `${values?.duration} day(s) ago`, + DayAfter: `In ${values?.duration} day(s)`, + }; + return translations[key]; + }, +})); + +describe("TimeElement", () => { + it("renders the correct translation for time just now", () => { + const now = new Date().toISOString(); + const { container } = render(); + expect(screen.getByText("Just now")).toBeInTheDocument(); + expect(container).toMatchSnapshot(); + }); + + it("renders the correct translation for minutes ago", () => { + const now = new Date(); + const minutesAgo = new Date( + now.getTime() - 5 * 60 * 1000 - 10 + ).toISOString(); + const { container } = render(); + expect(screen.getByText("5 minute(s) ago")).toBeInTheDocument(); + expect(container).toMatchSnapshot(); + }); + + it("renders the correct translation for minutes after", () => { + const now = new Date(); + const minutesAfter = new Date( + now.getTime() + 5 * 60 * 1000 + 10 + ).toISOString(); + const { container } = render(); + expect(screen.getByText("In 5 minute(s)")).toBeInTheDocument(); + expect(container).toMatchSnapshot(); + }); + + it("renders the correct translation for hours ago", () => { + const now = new Date(); + const hoursAgo = new Date( + now.getTime() - 2 * 60 * 60 * 1000 - 10 + ).toISOString(); + const { container } = render(); + expect(screen.getByText("2 hour(s) ago")).toBeInTheDocument(); + expect(container).toMatchSnapshot(); + }); + + it("renders the correct translation for hours after", () => { + const now = new Date(); + const hoursAfter = new Date( + now.getTime() + 2 * 60 * 60 * 1000 + 10 + ).toISOString(); + const { container } = render(); + expect(screen.getByText("In 2 hour(s)")).toBeInTheDocument(); + expect(container).toMatchSnapshot(); + }); + + it("renders the correct translation for days ago", () => { + const now = new Date(); + const daysAgo = new Date( + now.getTime() - 3 * 24 * 60 * 60 * 1000 - 10 + ).toISOString(); + const { container } = render(); + expect(screen.getByText("3 day(s) ago")).toBeInTheDocument(); + expect(container).toMatchSnapshot(); + }); + + it("renders the correct translation for days after", () => { + const now = new Date(); + const daysAfter = new Date( + now.getTime() + 3 * 24 * 60 * 60 * 1000 + 10 + ).toISOString(); + const { container } = render(); + expect(screen.getByText("In 3 day(s)")).toBeInTheDocument(); + expect(container).toMatchSnapshot(); + }); +}); diff --git a/zbook_frontend/global.d.ts b/zbook_frontend/global.d.ts new file mode 100644 index 0000000..6493a90 --- /dev/null +++ b/zbook_frontend/global.d.ts @@ -0,0 +1,11 @@ +import en from "./messages/en.json"; +import zh from "./messages/zh.json"; + +// Ensure all language files conform to the Messages type +type EnMessages = typeof en; +type ZhMessages = typeof zh; + +declare global { + // Use type safe message keys with `next-intl` + interface IntlMessages extends ZhMessages, EnMessages {} +} diff --git a/zbook_frontend/jest.config.ts b/zbook_frontend/jest.config.ts new file mode 100644 index 0000000..0c55ed3 --- /dev/null +++ b/zbook_frontend/jest.config.ts @@ -0,0 +1,18 @@ +import type { Config } from "jest"; +import nextJest from "next/jest.js"; + +const createJestConfig = nextJest({ + // Provide the path to your Next.js app to load next.config.js and .env files in your test environment + dir: "./", +}); + +// Add any custom config to be passed to Jest +const config: Config = { + testEnvironment: "jsdom", + setupFilesAfterEnv: ["/jest.setup.ts"], + // Add more setup options before each test is run + // setupFilesAfterEnv: ['/jest.setup.ts'], +}; + +// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async +export default createJestConfig(config); diff --git a/zbook_frontend/jest.setup.ts b/zbook_frontend/jest.setup.ts new file mode 100644 index 0000000..d0de870 --- /dev/null +++ b/zbook_frontend/jest.setup.ts @@ -0,0 +1 @@ +import "@testing-library/jest-dom"; diff --git a/zbook_frontend/messages/en.json b/zbook_frontend/messages/en.json new file mode 100644 index 0000000..c6f4194 --- /dev/null +++ b/zbook_frontend/messages/en.json @@ -0,0 +1,479 @@ +{ + "Pagination": { + "Previous": "Previous", + "Next": "Next", + "TotalPage": "{duration, plural, =0 {Total 0 page} =1 {Total # page} other {Total # Pages} }", + "Ellipsis": "..." + }, + "Footer": { + "UpdatedAt": "Updated At ", + "PowerBy": "Power By ZBook", + "NextPage": "Next Page", + "PrevPage": "Prev Page" + }, + "SomeThingWrong": { + "SomeThingWrong": "SomeThing Wrong!" + }, + "VerifyEmail": { + "BackToHome": "Back to home page", + "VerifiedFailed": "Verified failed:", + "VerifiedSuccess": "Verified successfully" + }, + "RightSideBar": { + "OnThisPage": "On this page" + }, + + "NotFoundPage": { + "404": "404", + "BackToHome": "Back to home page", + "title": "Not Found", + "PageNotFound": "Page Not Found", + "UserNotLinked": "User Not Linked" + }, + "LoginPage": { + "AppName": "ZBook", + "Login": "Log In", + "SignInMessage": "sign in if you own an account", + "Register": "Register", + "ForgetPassword": "Forget Password?", + "NeedAnAccount": "need an account?" + }, + "Toast": { + "WhyReport": "why report?", + "Submit": "submit", + "CopiedClipboard": "Copied to clipboard", + "CopyClipboardFailed": "Copy to clipboard failed", + "CopyEmpty": "Copy content is empty", + "CreatingCommentReport": "Creating a report for the comment...", + "ReportSuccessfully": "Report created successfully", + "FailedCreateReport": "Failed to create report" + }, + "AdminOverView": { + "Bot": "Bot", + "TipLogin": "enable Login?", + "TipRegister": "enable registration?", + "TipInviation": "enable invitation?", + "allow_login": "login", + "allow_registration": "registration", + "allow_invitation": "invitation", + "DailyUsers": "daily users", + "newUserLabel": "daily new users", + "activeUserLabel": "daily active users", + "Computer": "Computer", + "Phone": "Phone", + "Tablet": "Tablet", + "Unknown": "Unknown", + "TopVisitors": "Top Visitors", + "VisitorRegion": "Visitor Region", + "VisitorAnalysis": "Visitor Analysis", + "VisitorDistribution": "Visitor Distribution", + "LastDay": "Last day", + "LastWeek": "Last week", + "LastMonth": "Last month", + "ActiveVisitors": "active visitors", + "VisitedCount": "visit frequency", + "DailyVisitors": "daily visitors", + "NewVisitor": "new visitor", + "DailyNewUsers": "daily new users", + "NewUser": "new user", + "DailyActiveUsers": "daily active users", + "ActiveUser": "active user", + "Repositories": "Repositories", + "Comments": "Comments", + "Users": "Users", + "CommentReports": "Comment Reports", + "ResourceDistribution": "resource distribution" + }, + "DataList": { + "Comment": "comment", + "SearchPublicRepoTip": "search public repo by repo name...", + "NoPublicRepoTip": "No Public Repository", + "NoListUserRepoTip": "No Repository", + "NoListUserFavoriteTip": "No Favorite", + "NoListUserFollowerTip": "No Follower", + "NoListUserFollowingTip": "No Following", + "NoListAdminCommentTip": "No Comment", + "NoListAdminCommentReportTip": "No Report", + "NoListAdminSessionTip": "No Session", + "NoListAdminRepoTip": "No Repository", + "NoListAdminUserTip": "No User", + "NoListRepoUserTip": "No User", + "SearchListUserRepoTip": "search repo...", + "SearchListUserFavoriteTip": "search favorite repo by repo name...", + "SearchListUserFollowerTip": "search follower by username...", + "SearchListUserFollowingTip": "search following by username...", + "SearchListAdminCommentTip": "search comment...", + "SearchListAdminCommentReportTip": "search comment report...", + "SearchListAdminSessionTip": "search session by username...", + "SearchListAdminRepoTip": "search repo by username...", + "SearchListAdminUserTip": "search user by username...", + "SearchListRepoUserTip": "search user by username...", + "AccountVerification": "Account Verification", + "Verified": "Verified", + "UnVerified": "Unverified", + "UpdatedAt": "Updated At", + "CreatedAt": "Created At", + "ExpiredAt": "Expired At", + "VisibilityLevel": "Visibility Level", + "FavoriteCount": "Favorite Count", + "FollowStatus": "Follow Status", + "Followed": "Followed", + "UnFollowed": "UnFollowed", + "PublicRepoCount": "Public Repo Count", + "Resolved": "Resolved", + "Unresolved": "Unresolved" + }, + "Repo": { + "ThemeColor": "Content Theme", + "ChooseThemeColor": "Choose Content Theme", + "ThemeColorviolet": "violet", + "ThemeColorgreen": "green", + "ThemeColorred": "red", + "ThemeColoryellow": "yellow", + "ThemeColorteal": "teal", + "ThemeColorsky": "sky", + "ThemeColorcyan": "cyan", + "ThemeColorpink": "pink", + "ThemeColorindigo": "indigo", + + "SideBarTheme": "SideBar Theme", + "ChooseSideBarTheme": "Choose SideBar Theme", + "ThemeSideBarFold": "Fold", + "ThemeSideBarUnFold": "ThemeSideBarUnFold", + "GitProtocol": "https://", + "InvalidRepoName": "Repository name is invalid", + "Required": "Required", + "InValidGitUrl": "Invalid Git URL", + "CreatingRepository": "Creating repository...", + "EditingRepository": "Editing repository...", + "RepositoryCreatedSucc": "Repository created successfully", + "FailedCreateRepository": "Failed to create repository", + "CreateRepository": "Create repository", + + "RepositoryEditSucc": "Repository Edited successfully", + "FailedEditRepository": "Failed to edit repository", + "EditRepository": "Edit repository", + "RepositoryName": "Repository name", + "RepositoryNameTip": "Please enter the desired repository name", + "Home": "Home", + "HomeTip": "Repository homepage", + "TokenPassword": "Token/Password", + "TokenPasswordTip": "Only private repositories required", + "GitUrl": "Git URL", + "GitUrlTip": "Please fill in the remote repository git URL", + "DescribeRepo": "Describe what the repository is for", + "DescribeRepoTip": "A brief description of the repository for easy tagging and searching", + "VisibleToWho": "Visible to whom", + "ChooseVisibleToWho": "Choose who can see it", + "VisibleOnlyCreator": "Visible only to the creator", + "VisibleOnlySelected": "Visible only to selected users", + "VisibleOnlyLogin": "Visible only to logged-in users", + "VisibleEveryone": "Visible to everyone", + "GitHubSyncToken": "GitHub synchronization token", + "GitHubSyncTokenTip": "For GitHub Actions automatic synchronization" + }, + "SystemNotification": { + "Required": "Required", + "CreateSystemNotifications": "Create system notifications", + "CreateSystemNotificationsSucc": "System notification created successfully.", + "FailedCreateSystemNotifications": "Failed to create system notification.", + "Creatingnotification": "Creating system notification...", + "Title": "Title", + "Username": "Username", + "Content": "Content", + "TitleTip": "Please enter the notification title.", + "UsernameTip": "Please enter the username of the notified user.", + "LinkOptional": "Link (optional)", + "LinkOptionalTip": "Please enter the document link", + "ContentTip": "Please enter the specific content of the notification." + }, + "Invitation": { + "Required": "Required", + "CreateInvitation": "Create Invitation", + "CreateInvitationSucc": "Invitation created successfully.", + "FailedCreateInvitation": "Failed to create Invitation.", + "CreatingInvitation": "Creating Invitation...", + "Email": "Email", + "EmailTip": "Please enter the Invitation Email." + }, + "Dialog": { + "At": "@", + "UploadFile": "Upload File", + "SelectedFile": "Selected File:", + "CharacterCount": "8 to 20 characters", + "SignatureLength": "Signature must be fewer than 128 characters", + "InvalidPassword": "Invalid password", + "Block": "Block", + "UnBlock": "UnBlock", + "Cancel": "Cancel", + "Confirm": "Confirm", + "Delete": "Delete", + "DeleteComment": "Are you sure you want to delete this comment?", + "FailedDeleteComment": "Failed to delete the comment", + "FailedCreateComment": "Failed to create the comment", + "Publish": "Publish", + "RespectComments": "Respect is the ticket that moves people through comments", + "Report": "Report", + "AlreadyReported": "You have already reported", + "Reply": "Reply", + "EditUser": "Edit user", + "Bio": "Bio", + "BioTip": "self-introduction or signature", + "Password": "Password", + "PasswordTip": "Please enter a new password", + "UpdateAvatar": "Update Avatar", + "UploadPNGWarning": "Please upload an image in PNG format", + "AvatarTip": "Please select an image that is not larger than 500KB.", + "AvatarWarning": "Please select an image that is not larger than 500KB. Only PNG,JPEG format is supported", + "UpdateUserInfo": "Updating user information...", + "FailedEditUser": "Failed to edit user information", + "EditUserSucc": "User information edited successfully.", + "DeleteUser": "Are you sure you want to delete this user?", + "FailedDeleteUser": "Failed to delete the user", + "DeleteRepo": "Are you sure you want to delete this repo?", + "FailedDeleteRepo": "Failed to delete the repo" + }, + "SideBar": { + "SearchShortcuts": "⌘K", + "FailedUnLinkAccount": "Failed to unlink account", + "UpdatingFollowStatus": "Updating follow status...", + "UpdateSuccessful": "Update successful", + "UpdateFailed": "Update failed", + "SynchronizingRepository": "Synchronizing repository", + "RepositorySynchronizedSuccessfully": "Repository synchronized successfully", + "RepositorySynchronizationFiled": "Repository synchronization failed", + "Bio": "Bio:", + "Social": "Social", + "Repositories": "Repositories", + "Favorite": "Favorite", + "Follower": "Follower", + "Following": "Following", + "Settings": "Settings", + "Admin": "Admin", + "LinkedAccount": "Linked Account", + "Search": "Search...", + "Edit": "Edit", + "NewRepo": "Create Repo", + "NewNotification": "Create Notification", + "NewInvitation": "Create Invitation", + "OverView": "OverView", + "Users": "Users", + "Sessions": "Sessions", + "Comments": "Comments", + "CommentReports": "Comment Reports", + "Link": "Link", + "UnLink": "UnLink", + "Follow": "Follow", + "UnFollow": "UnFollow", + "RepoHome": "Documentation", + "SyncRepo": "Synchronization", + "DeleteRepo": "Delete Repo", + "EditRepo": "Edit Repo", + "VisibleTo": "Visible To" + }, + "Time": { + "JustNow": "just now", + "MinuteAgo": "{duration, plural, =0 {just now} =1 {# minute ago} other {# minutes ago} }", + "MinuteAfter": "{duration, plural, =0 {just now} =1 {in # minute} other {in # minutes} }", + "HourAgo": "{duration, plural, =0 {just now} =1 {# hour ago} other {# hours ago} }", + "HourAfter": "{duration, plural, =0 {just now} =1 {in # hour} other {in # hours} }", + "DayAgo": "{duration, plural, =0 {just now} =1 {# day ago} other {# days ago} }", + "DayAfter": "{duration, plural, =0 {just now} =1 {in # day} other {in # days} }" + }, + "GenerateMetaData": { + "User": "User", + "Session": "Session", + "Repo": "Repo", + "Report": "Report", + "Following": "Following", + "Follower": "Follower", + "Favorite": "Favorite", + "OverView": "OverView", + "Comments": "Comments", + "Cases": "Cases", + "DashBoard": "DashBoard", + "WhoCanSee": "Who Can See", + "Register": "Register", + "Login": "Login", + "ForgetPassword": "Forget Password", + "Slogan": "An alternative solution for team-level GitBook" + }, + "Searchs": { + "NoMarkdown": "No Markdowns", + "NoUser": "No Users", + "SearchMarkdown": "search markdown...", + "SearchUser": "search user by username..." + }, + "Notifications": { + "Notifications": "Notifications", + "NoNotifications": "No Notifications", + "SystemNotifications": "System", + "RepoNotifications": "Repo", + "FollowerNotifications": "Follower", + "CommentNotifications": "Comment", + "NewRepoCreated": " created a new repository. Come take a look!", + "NewCommented": " posted a comment:", + "NewFollower": " has followed you" + }, + "LoginForm": { + "Github": "Github", + "Google": "Google", + "LoggingIn": "Logging in...", + "LoginFailedEmailVerify": "Login failed. Please verify your email first", + "LoginFailedIncorrect": "Login failed. Incorrect username or password", + "LoginFailedExist": "Login failed. User does not exist", + "LoginSuccessful": "Login successful", + "ResendEmail": "Resending verification email to your inbox...", + "ResendSuccessful": "Resending verification email successful. Please proceed to your inbox to verify", + "ResendFailed": "Resending verification email failed", + "Login": "Log In", + "Email": "email", + "Password": "password", + "LoginType": "or", + "Required": "Required", + "InvalidEmailFormat": "Invalid email format", + "InvaliPassword": "Invalid password", + "CharacterCount": "8 to 20 characters", + "LoginFailed": "Login Failed", + "ReSendEmail": "resend verify email" + }, + "RepoProfile": { + "username": "Username", + "email": "Email", + "repoDescirbe": "Repo Describe" + }, + "ForgetForm": { + "AppName": "ZBook", + "ResettingPassword": "Resetting password...", + "PasswordResetSuccessful": "Password reset successful", + "PasswordResetFailed": "Password reset failed", + "Login": "Log In", + "Email": "email", + "Password": "password", + "SendEmail": "Send Email", + "NotReceiveEmail": "not receive email?", + "NeedAnAccount": "need an account?", + "Register": "Register", + "Required": "Required", + "InvalidEmailFormat": "Invalid email format", + "VerifyID": "VerifyID", + "secret_code": "secret_code", + "NewPassword": "NewPassword", + "Reset": "Reset", + "InvaliPassword": "Invalid password", + "CharacterCount": "8 to 20 characters", + "CPassword": "confirm password", + "PasswordNotMatch": "Password Not Match...!" + }, + "RegisterForm": { + "Registering": "Registering...", + "RegistrationSuccessful": "Registration successful. An email has been sent to your inbox. Please proceed to verify your email", + "RegistrationFailed": "Registration failed. Username or email is already in use", + "Username": "Username", + "Register": "Register", + "Login": "Log In", + "Email": "email", + "Password": "password", + "CPassword": "confirm password", + "Required": "Required", + "InvalidEmailFormat": "Invalid email format", + "InvaliPassword": "Invalid password", + "CharacterCount": "8 to 20 characters", + "LoginFailed": "Login Failed", + "PasswordNotMatch": "Password Not Match...!", + "InvalidUsername": "Invalid username", + "OnlyLower": "Only lowercase letters, numbers, and underscores", + "UsernameCount": "4 to 20 characters" + }, + "RegisterPage": { + "AppName": "ZBook", + "Login": "Log In", + "SignInMessage": "sign in if you own an account", + "Register": "Register", + "ForgetPassword": "Forget Password?", + "OwnAnAccount": "already own an account?" + }, + "Search": { + "AppName": "ZBook" + }, + "HomePage": { + "AppName": "ZBook", + "ManageUsers": "Manage visitors", + "NewRepo": "Add documentation", + "MarkdownSuperset": "Markdown superset", + "VisuallyAppealing": "Visually Appealing", + "SimpleDocumentation": "Simple Documentation Style", + "DocumentationForTeam": "Documentation For Team", + "MultiLevelPermissions": "Multi-level Permissions", + "ZBookPermissions": "ZBook supports multi-level permissions, allowing you to choose whether to make your documents public or private.", + "SelfHost": "Self-Host", + "ZBookSupports": "ZBook supports multiple users, team collaboration, access control, comments, and notifications.", + "ZBookIsOpenSource": "ZBook is fully open-source and can be deployed using containers. With just a few commands, you can easily set it up.", + "LinChatWeb": "LinChat Official WebSite", + "LinChatApp": "LinChat On AppStore", + "SourceCode": "Source Code", + "Login": "Login", + "Register": "Register", + "Documentation": "Documentation", + "CreateRepoSection": "Create Repository", + "DashboardSection": "DashBoard", + "FeatureSection": "Features", + "MultiUserSection": "Multi-User Support", + "DashBoardDemo": "Demo", + "DashBoardDemoVideo": "Video", + "HomeSloganA": "The documentation", + "HomeSloganB": "you want, effortlessly", + "HomeSubTitle": "Team-level documentation. Visually appealing, open-source, multi-user, publicly accessible or requiring authentication, optimized for user engagement.", + "RepoHome": "Doc", + "DashBoard": "Dashboard", + "SearchDoc": "Search", + "Notification": "Notification", + "Slogan": "An alternative solution for team-level GitBook", + "MarkdownRepoRender": "Render Markdown Repo", + "RenderAccess": "ZBook synchronizes your Markdown Git repository and renders it into web pages, providing public or private access.", + "featuresYouNeed": "features you may need. Try it for yourself.", + "featureDetail": "ZBook not only supports basic Markdown syntax but also seamlessly integrates with advanced features such as formulas, Mermaid charts, code blocks, and more.", + "Cases": "Cases", + "Docs": "Documentation", + "Math": "Math", + "MathDetail": "ZBook uses KaTeX to render mathematical formulas, supporting both inline formulas and multi-line formulas.", + "Code": "Code", + "CodeDetail": "ZBook supports syntax highlighting for popular programming languages such as Python, C++, and more. Additionally, it also supports Mermaid diagrams.", + "Figure": "Figure", + "FigureDetail": "ZBook supports various popular image formats such as PNG, SVG, WebP, and more.", + "Search": "Fast Search", + "SearchDetail": "ZBook supports fast full-text search for both Chinese and English content, allowing users to easily search for specific information.", + "OtherFeature": "Other features", + "OFDetail": "ZBook supports other features such as multi-user login. For more details, please refer to the documentation or the video below.", + "LightDarkMode": "Light/Night mode", + "Seamlessly": "Seamlessly", + "ResponsiveDesignSmall": "responsive design", + "MobileFirst": "Mobile-first", + "OnlineHosting": "Online Hosting and Rendering of Markdown Git Repositories", + "PersonalRepoHosting": "Personal knowledge repository hosting", + "RegisterNow": "Register Now", + "SignIn": "Sign In", + "Full": "full", + "TextSearch": "text search", + "AllRightsReserved": "All rights reserved.", + "BeiAn": "", + "Links": "Links", + "Privacy": "Privacy", + "Terms": "Terms", + "Community": "Community", + "CoreConcepts": "Core Concepts", + "GettingStarted": "Getting Started", + "ResponsiveDesign": "Responsive Design", + "QuickResponse": "Quick response", + "DarkMode": "Dark Mode", + "Prerequisite": "Prerequisite", + "HowToUse": "How To Use", + "SupportSearch": "Supports Chinese and English full-text search, quickly find the documents you want.", + "FullTextSearch": "Full-Text Search", + "MobileDevices": "Mobile Devices", + "LearnMore": "Learn More", + "Tailwindcss": "With the support of tailwindcss, all pages are designed in a responsive manner, and your markdown can be viewed beautifully on mobile devices.", + "PostgreSQL": "We utilize the full-text search feature of PostgreSQL to provide you with fast and efficient searching.", + "switchLocale": "Switch Lang" + } +} diff --git a/zbook_frontend/messages/zh.json b/zbook_frontend/messages/zh.json new file mode 100644 index 0000000..ff4f522 --- /dev/null +++ b/zbook_frontend/messages/zh.json @@ -0,0 +1,476 @@ +{ + "Pagination": { + "Previous": "上一页", + "Next": "下一页", + "TotalPage": "{duration, plural, =0 {共 0 页} =1 {共 # 页} other {共 # 页} }", + "Ellipsis": "..." + }, + "Footer": { + "UpdatedAt": "编辑于 ", + "PowerBy": "ZBook 提供支持", + "NextPage": "下一页", + "PrevPage": "上一页" + }, + "SomeThingWrong": { + "SomeThingWrong": "哪里出错了!" + }, + "VerifyEmail": { + "BackToHome": "返回首页", + "VerifiedFailed": "验证失败:", + "VerifiedSuccess": "验证成功" + }, + "RightSideBar": { + "OnThisPage": "当前页面" + }, + "NotFoundPage": { + "title": "页面不存在", + "PageNotFound": "出错了,页面不存在", + "UserNotLinked": "用户未关联", + "404": "404", + "BackToHome": "返回首页" + }, + "LoginPage": { + "AppName": "ZBook", + "Login": "登录", + "SignInMessage": "已有账号,请登录", + "Register": "注册", + "ForgetPassword": "忘记密码?", + "NeedAnAccount": "需要一个账号?" + }, + "Toast": { + "WhyReport": "举报原因?", + "Submit": "提交", + "CopiedClipboard": "拷贝到粘贴板", + "CopyClipboardFailed": "拷贝到粘贴板失败", + "CopyEmpty": "拷贝内容为空", + "CreatingCommentReport": "正在创建评论举报...", + "ReportSuccessfully": "创建举报成功", + "FailedCreateReport": "创建举报失败" + }, + "AdminOverView": { + "Bot": "爬虫", + "TipLogin": "开放登录?", + "TipRegister": "开放注册?", + "TipInviation": "开放邀请?", + "allow_login": "登陆", + "allow_registration": "注册", + "allow_invitation": "邀请", + "DailyUsers": "每日用户", + "newUserLabel": "日增用户", + "activeUserLabel": "日活用户", + "Computer": "电脑", + "Phone": "手机", + "Tablet": "平板", + "Unknown": "未知设备", + "TopVisitors": "活跃访客", + "VisitorRegion": "访客来源地", + "VisitorAnalysis": "访客分析", + "VisitorDistribution": "访客分布", + "LastDay": "一天内", + "LastWeek": "一周内", + "LastMonth": "一月内", + "ActiveVisitors": "活跃访客", + "VisitedCount": "访问频次", + "DailyVisitors": "每日访客", + "NewVisitor": "新访客", + "DailyNewUsers": "每日新增用户", + "NewUser": "新用户", + "DailyActiveUsers": "每日活跃用户", + "ActiveUser": "活跃用户", + "Repositories": "仓库", + "Comments": "评论", + "Users": "用户", + "CommentReports": "评论举报", + "ResourceDistribution": "资源分布" + }, + "Searchs": { + "NoMarkdown": "无相关文档", + "NoUser": "无相关用户", + "SearchMarkdown": "搜索文档...", + "SearchUser": "根据用户名搜索用户..." + }, + "DataList": { + "Comment": "评论", + "SearchPublicRepoTip": "根据仓库名搜索公开仓库...", + "NoPublicRepoTip": "无公开仓库", + "NoListUserRepoTip": "无相关仓库", + "NoListUserFavoriteTip": "无相关收藏", + "NoListUserFollowerTip": "无粉丝", + "NoListUserFollowingTip": "无关注", + "NoListAdminCommentTip": "无评论", + "NoListAdminCommentReportTip": "无举报", + "NoListAdminSessionTip": "无会话", + "NoListAdminRepoTip": "无仓库", + "NoListAdminUserTip": "无用户", + "NoListRepoUserTip": "无用户", + "SearchListUserRepoTip": "搜索仓库...", + "SearchListUserFavoriteTip": "根据仓库名搜索收藏...", + "SearchListUserFollowerTip": "根据用户名搜索粉丝...", + "SearchListUserFollowingTip": "根据用户名搜索关注...", + "SearchListAdminCommentTip": "搜索评论...", + "SearchListAdminCommentReportTip": "搜索举报...", + "SearchListAdminSessionTip": "根据用户名搜索会话...", + "SearchListAdminRepoTip": "根据用户名搜索仓库...", + "SearchListAdminUserTip": "根据用户名搜索用户...", + "SearchListRepoUserTip": "根据用户名搜索用户...", + "AccountVerification": "账号验证", + "Verified": "已验证", + "UnVerified": "未验证", + "UpdatedAt": "更新时间", + "CreatedAt": "创建时间", + "ExpiredAt": "过期时间", + "VisibilityLevel": "可见层级", + "FavoriteCount": "收藏数", + "FollowStatus": "关注状态", + "Followed": "已关注", + "UnFollowed": "未关注", + "PublicRepoCount": "公开仓库数量", + "Resolved": "已解决", + "Unresolved": "未解决" + }, + "SystemNotification": { + "Required": "必填", + "CreateSystemNotifications": "创建系统通知", + "CreateSystemNotificationsSucc": "系统通知创建成功", + "FailedCreateSystemNotifications": "系统通知创建失败", + "Creatingnotification": "正在创建系统通知...", + "Title": "题目", + "Username": "用户名", + "Content": "内容", + "TitleTip": "请输入通知题目", + "UsernameTip": "请输入需要通知的用户名", + "LinkOptional": "链接(可选)", + "LinkOptionalTip": "请输入通知对应的文档链接", + "ContentTip": "请输入通知具体内容" + }, + "Invitation": { + "Required": "必填", + "CreateInvitation": "创建邀请", + "CreateInvitationSucc": "邀请创建成功", + "FailedCreateInvitation": "邀请创建失败", + "CreatingInvitation": "正在创建邀请...", + "Email": "邮箱", + "EmailTip": "请输入邮箱" + }, + "Repo": { + "ThemeColor": "内容风格", + "ChooseThemeColor": "选择内容风格", + "ThemeColorviolet": "紫罗兰色", + "ThemeColorgreen": "绿色", + "ThemeColorred": "红色", + "ThemeColoryellow": "黄色", + "ThemeColorteal": "鸭绿色", + "ThemeColorsky": "天蓝色", + "ThemeColorcyan": "青色", + "ThemeColorpink": "粉色", + "ThemeColorindigo": "靛蓝色", + "SideBarTheme": "侧边栏风格", + "ChooseSideBarTheme": "选择侧边栏风格", + "ThemeSideBarFold": "折叠", + "ThemeSideBarUnFold": "展开", + "GitProtocol": "https://", + "InvalidRepoName": "存储库名称无效", + "Required": "必填", + "InValidGitUrl": "无效的Git URL", + "RepositoryEditSucc": "更新仓库成功", + "FailedEditRepository": "更新仓库失败", + "EditRepository": "编辑仓库", + "EditingRepository": "正在更新仓库...", + "CreatingRepository": "创建仓库...", + "RepositoryCreatedSucc": "仓库创建成功", + "FailedCreateRepository": "仓库创建失败", + "CreateRepository": "创建仓库", + "RepositoryName": "仓库名", + "RepositoryNameTip": "请输入仓库名称", + "Home": "首页", + "HomeTip": "仓库首页", + "TokenPassword": "令牌/密码", + "TokenPasswordTip": "对于私有仓库,需要给出令牌或者密码", + "GitUrl": "Git URL", + "GitUrlTip": "请填入远端Git地址", + "DescribeRepo": "仓库简介", + "DescribeRepoTip": "描述简介,以便标记查找", + "VisibleToWho": "对谁可见", + "ChooseVisibleToWho": "选择对谁可见", + "VisibleOnlyCreator": "仅创建者可见", + "VisibleOnlySelected": "仅选中用户可见", + "VisibleOnlyLogin": "仅登录用户可见", + "VisibleEveryone": "所有人可见", + "GitHubSyncToken": "GitHub 同步令牌", + "GitHubSyncTokenTip": "用于Github Action 自动同步" + }, + "Dialog": { + "At": "@", + "UploadFile": "上传文件", + "SelectedFile": "选中文件:", + "CharacterCount": "仅支持8至20字符", + "SignatureLength": "个性签名必须小于128个字符", + "InvalidPassword": "密码无效", + "Block": "封禁", + "UnBlock": "解禁", + "Cancel": "取消", + "Confirm": "确认", + "Delete": "删除", + "DeleteComment": "确定删除此评论?", + "FailedDeleteComment": "删除评论失败", + "FailedCreateComment": "创建评论失败", + "Publish": "发布", + "RespectComments": "尊重是评论打动人心的入场卷", + "Report": "举报", + "AlreadyReported": "您已经举报过了", + "Reply": "回复", + "EditUser": "编辑用户信息", + "Bio": "个性签名", + "BioTip": "个性签名或者简介", + "Password": "密码", + "PasswordTip": "请输入新密码", + "UpdateAvatar": "更新头像", + "UploadPNGWarning": "请上传 PNG 格式图片", + "AvatarTip": "请选择一张不超过500KB的图片", + "AvatarWarning": "请选择一张不超过500KB的图片,仅支持 PNG,JPEG 格式", + "UpdateUserInfo": "更新用户信息...", + "FailedEditUser": "更新用户信息失败", + "EditUserSucc": "更新用户信息成功", + "DeleteUser": "确定删除此用户?", + "FailedDeleteUser": "删除用户失败", + "DeleteRepo": "确定删除此仓库?", + "FailedDeleteRepo": "删除仓库失败" + }, + "SideBar": { + "SearchShortcuts": "⌘K", + "FailedUnLinkAccount": "取消账号关联失败", + "UpdatingFollowStatus": "更新关注状态...", + "UpdateSuccessful": "更新成功", + "UpdateFailed": "更新失败", + "SynchronizingRepository": "同步仓库...", + "RepositorySynchronizedSuccessfully": "同步仓库成功", + "RepositorySynchronizationFiled": "同步仓库失败", + "Bio": "个性签名:", + "Social": "社交", + "Repositories": "仓库", + "Favorite": "收藏", + "Follower": "粉丝", + "Following": "关注", + "Settings": "设置", + "Admin": "管理", + "LinkedAccount": "关联账号", + "Search": "搜索...", + "Edit": "编辑", + "NewRepo": "新建仓库", + "NewNotification": "新建通知", + "NewInvitation": "新建邀请", + "OverView": "概览", + "Users": "用户", + "Sessions": "会话", + "Comments": "评论", + "CommentReports": "评论举报", + "Link": "关联", + "UnLink": "解除关联", + "Follow": "关注", + "UnFollow": "取关", + "RepoHome": "仓库主页", + "SyncRepo": "同步仓库", + "DeleteRepo": "删除仓库", + "EditRepo": "编辑仓库", + "VisibleTo": "对谁可见" + }, + "Time": { + "JustNow": "刚刚", + "MinuteAgo": "{duration} 分钟前", + "MinuteAfter": "{duration} 分钟后", + "HourAgo": "{duration} 小时前", + "HourAfter": "{duration} 小时后", + "DayAgo": "{duration} 天前", + "DayAfter": "{duration} 天后" + }, + "GenerateMetaData": { + "User": "用户", + "Session": "会话", + "Repo": "仓库", + "Report": "举报", + "Following": "关注", + "Follower": "粉丝", + "Favorite": "收藏", + "OverView": "概览", + "Comments": "评论", + "Cases": "案例", + "DashBoard": "仪表盘", + "WhoCanSee": "对谁可见", + "Register": "注册", + "Login": "登录", + "ForgetPassword": "忘记密码", + "Slogan": "一个团队级别的GitBook替代方案" + }, + "Notifications": { + "Notifications": "通知", + "NoNotifications": "无通知", + "SystemNotifications": "系统", + "RepoNotifications": "仓库", + "FollowerNotifications": "粉丝", + "CommentNotifications": "评论", + "NewRepoCreated": " 新建了一个仓库,快去看看吧!", + "NewCommented": " 发表了评论:", + "NewFollower": " 关注了您" + }, + "LoginForm": { + "Github": "Github", + "Google": "Google", + "LoggingIn": "正在登陆...", + "LoginFailedEmailVerify": "登陆失败,请先验证邮箱", + "LoginFailedIncorrect": "登陆失败,用户名或者密码错误", + "LoginFailedExist": "登陆失败,用户不存在", + "LoginSuccessful": "登陆成功", + "ResendEmail": "重新发送验证邮件到您邮箱...", + "ResendSuccessful": "重新发送验证邮件成功,请前往邮箱验证", + "ResendFailed": "重新发送验证邮件失败", + "Login": "登录", + "Email": "邮箱", + "Password": "密码", + "LoginType": "或", + "Required": "必需", + "InvalidEmailFormat": "邮箱格式错误", + "InvaliPassword": "密码不能包含空格", + "CharacterCount": "密码要求8-20位", + "LoginFailed": "登录失败", + "ReSendEmail": "重新发送验证邮件" + }, + "RepoProfile": { + "username": "用户名", + "email": "邮箱", + "repoDescirbe": "仓库介绍" + }, + "ForgetForm": { + "AppName": "ZBook", + "ResettingPassword": "正在重置密码...", + "PasswordResetSuccessful": "密码重置成功", + "PasswordResetFailed": "密码重置失败", + "Login": "登录", + "Email": "邮箱", + "Password": "密码", + "SendEmail": "发送邮件", + "NotReceiveEmail": "未收到邮件?", + "NeedAnAccount": "需要一个账号?", + "Register": "注册", + "Required": "必需", + "InvalidEmailFormat": "邮箱格式错误", + "VerifyID": "VerifyID", + "secret_code": "secret_code", + "NewPassword": "新密码", + "Reset": "重置密码", + "InvaliPassword": "密码不能包含空格", + "CharacterCount": "密码要求8-20位", + "CPassword": "再次输入密码确认", + "PasswordNotMatch": "重复密码不匹配" + }, + "RegisterForm": { + "Registering": "注册中...", + "RegistrationSuccessful": "注册成功,邮件已发送至您邮箱,请前往邮箱验证", + "RegistrationFailed": "注册失败,可能用户名或者邮箱重复", + "Username": "用户名", + "Register": "注册", + "Login": "登录", + "Email": "邮箱", + "Password": "密码", + "CPassword": "再次输入密码确认", + "Required": "必需", + "InvalidEmailFormat": "邮箱格式错误", + "InvaliPassword": "密码不能包含空格", + "CharacterCount": "密码要求8-20位", + "LoginFailed": "登录失败", + "PasswordNotMatch": "重复密码不匹配", + "InvalidUsername": "不能包含空格", + "OnlyLower": "仅支持小写字母、数字、下划线", + "UsernameCount": "只接受4至20个字符" + }, + "RegisterPage": { + "AppName": "ZBook", + "Login": "登录", + "SignInMessage": "已有账号,请登录", + "Register": "注册", + "ForgetPassword": "忘记密码?", + "OwnAnAccount": "已经有账号了?" + }, + "Search": { + "AppName": "ZBook" + }, + "HomePage": { + "AppName": "ZBook", + "ManageUsers": "管理访客或用户", + "NewRepo": "新建仓库", + "MarkdownSuperset": "Markdown超集支持", + "VisuallyAppealing": "审美不疲劳", + "SimpleDocumentation": "简洁的文档风格", + "DocumentationForTeam": "多用户文档支持", + "MultiLevelPermissions": "多级别权限", + "ZBookPermissions": "zbook 支持多级别权限,您可以选择开放或者私有化您的文档", + "SelfHost": "自托管", + "ZBookSupports": "ZBook 支持多用户、团队协同、权限管理、评论、通知等", + "ZBookIsOpenSource": "ZBook完全开源,容器化部署,仅需几行指令,便可以轻松搭建起来", + "LinChatApp": "邻信应用", + "LinChatWeb": "邻信官网", + "SourceCode": "开源代码", + "Login": "登录", + "Register": "注册", + "Documentation": "文档", + "CreateRepoSection": "创建仓库", + "DashboardSection": "仪表盘", + "FeatureSection": "功能", + "MultiUserSection": "多用户支持", + "DashBoardDemo": "展示", + "DashBoardDemoVideo": "演示", + "HomeSloganA": "您想要的文档,", + "HomeSloganB": "毫不费力", + "HomeSubTitle": "团队级别的文档。外观精美,开源,多用户,公开抑或是需要权限认证,针对用户参与度进行了优化。", + "RepoHome": "仓库", + "DashBoard": "仪表板", + "SearchDoc": "搜索", + "Notification": "通知", + "BeiAn": "豫ICP备2022029046号-1", + "Slogan": "一个团队级别的GitBook替代方案", + "MarkdownRepoRender": "Markdown仓库渲染", + "RenderAccess": "ZBook通过同步您的markdown git仓库,然后渲染成网页,以提供公开或私密访问。", + "featuresYouNeed": "你可能需要的特性,尝试一下.", + "featureDetail": "ZBook除了支持基础的markdown语法之外,也完美的支持诸如公式、mermaid图表、代码等", + "Math": "公式", + "MathDetail": "ZBook使用katex渲染公式,同时支持行内公式和多行公式", + "Code": "代码", + "CodeDetail": "ZBook支持python、c++等主流编程语言高亮,此外还支持mermaid表格", + "Figure": "图表", + "FigureDetail": "MDIWKI支持png、svg、webp等多种主流格式图片", + "Cases": "案例", + "Docs": "文档", + "Search": "快速检索", + "SearchDetail": "ZBook 支持中英文进行快速全文检索,以及用户搜索", + "OtherFeature": "其他特性", + "OFDetail": "ZBook支持诸如多用户登录等其他特性,具体请参考文档或者下面视频", + "LightDarkMode": "日/夜 模式", + "Seamlessly": "无缝切换", + "ResponsiveDesignSmall": "响应式设计", + "MobileFirst": "移动端优先", + "OnlineHosting": "在线寄存、渲染Markdown Git仓库", + "PersonalRepoHosting": "个人知识库寄存,在线渲染", + "RegisterNow": "立即注册", + "SignIn": "登录", + "Full": "全文", + "TextSearch": "检索", + "AllRightsReserved": "保留所有权利", + "Links": "链接", + "Privacy": "隐私政策", + "Terms": "服务条款", + "Community": "社交媒体", + "CoreConcepts": "特性", + "GettingStarted": "开始使用", + "ResponsiveDesign": "响应式设计", + "QuickResponse": "快速响应", + "DarkMode": "夜间模式", + "Prerequisite": "先决条件", + "HowToUse": "如何使用", + "SupportSearch": "支持中文、英文全文检索、快速找出您想要的文档", + "FullTextSearch": "全文检索", + "MobileDevices": "移动设备", + "LearnMore": "了解更多", + "Tailwindcss": "在TailwindCss加持下,我们对移动端设计进行的优化,使得您可以获得更舒适的阅读体验", + "PostgreSQL": "我们使用postgres 全文检索功能,为您提供高速、高效的搜索", + "switchLocale": "切换语言" + } +} diff --git a/zbook_frontend/next.config.mjs b/zbook_frontend/next.config.mjs new file mode 100644 index 0000000..f839215 --- /dev/null +++ b/zbook_frontend/next.config.mjs @@ -0,0 +1,10 @@ +import createNextIntlPlugin from "next-intl/plugin"; + +const withNextIntl = createNextIntlPlugin(); + +/** @type {import('next').NextConfig} */ +const nextConfig = { + output: "standalone", +}; + +export default withNextIntl(nextConfig); diff --git a/zbook_frontend/package-lock.json b/zbook_frontend/package-lock.json new file mode 100644 index 0000000..c475576 --- /dev/null +++ b/zbook_frontend/package-lock.json @@ -0,0 +1,12854 @@ +{ + "name": "zbook_frontend", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "zbook_frontend", + "version": "0.1.0", + "dependencies": { + "@headlessui/react": "^1.7.18", + "@heroicons/react": "^2.1.3", + "@tippyjs/react": "^4.2.6", + "antd": "^5.15.3", + "apexcharts": "^3.48.0", + "chalk": "^5.3.0", + "d3": "^7.9.0", + "d3-geo": "^3.1.1", + "d3-geo-projection": "^4.0.0", + "formik": "^2.4.5", + "framer-motion": "^11.2.5", + "html-react-parser": "^4.2.10", + "jsdom": "^24.0.0", + "mermaid": "^10.9.0", + "next": "14.2.5", + "next-auth": "^5.0.0-beta.19", + "next-intl": "^3.15.3", + "next-themes": "^0.3.0", + "react": "^18", + "react-apexcharts": "^1.4.1", + "react-dom": "^18", + "react-icons": "^5.0.1", + "react-intersection-observer": "^9.8.1", + "react-latex-next": "3.0.0", + "react-syntax-highlighter": "^15.5.0", + "react-toastify": "^10.0.5", + "tailwind-scrollbar": "^3.1.0" + }, + "devDependencies": { + "@tailwindcss/typography": "^0.5.13", + "@testing-library/jest-dom": "^6.4.8", + "@testing-library/react": "^16.0.0", + "@types/d3": "^7.4.3", + "@types/jest": "^29.5.12", + "@types/jsdom": "^21.1.7", + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "@types/react-syntax-highlighter": "^15.5.13", + "eslint": "^8", + "eslint-config-next": "14.2.5", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "postcss": "^8", + "prettier": "3.3.3", + "tailwindcss": "^3.4.1", + "ts-node": "^10.9.2", + "typescript": "^5.5.4" + } + }, + "node_modules/@adobe/css-tools": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.0.tgz", + "integrity": "sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==", + "dev": true + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@ant-design/colors": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@ant-design/colors/-/colors-7.1.0.tgz", + "integrity": "sha512-MMoDGWn1y9LdQJQSHiCC20x3uZ3CwQnv9QMz6pCmJOrqdgM9YxsoVVY0wtrdXbmfSgnV0KNk6zi09NAhMR2jvg==", + "dependencies": { + "@ctrl/tinycolor": "^3.6.1" + } + }, + "node_modules/@ant-design/cssinjs": { + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@ant-design/cssinjs/-/cssinjs-1.21.0.tgz", + "integrity": "sha512-gIilraPl+9EoKdYxnupxjHB/Q6IHNRjEXszKbDxZdsgv4sAZ9pjkCq8yanDWNvyfjp4leir2OVAJm0vxwKK8YA==", + "dependencies": { + "@babel/runtime": "^7.11.1", + "@emotion/hash": "^0.8.0", + "@emotion/unitless": "^0.7.5", + "classnames": "^2.3.1", + "csstype": "^3.1.3", + "rc-util": "^5.35.0", + "stylis": "^4.0.13" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/@ant-design/icons": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-5.4.0.tgz", + "integrity": "sha512-QZbWC5xQYexCI5q4/fehSEkchJr5UGtvAJweT743qKUQQGs9IH2DehNLP49DJ3Ii9m9CijD2HN6fNy3WKhIFdA==", + "dependencies": { + "@ant-design/colors": "^7.0.0", + "@ant-design/icons-svg": "^4.4.0", + "@babel/runtime": "^7.24.8", + "classnames": "^2.2.6", + "rc-util": "^5.31.1" + }, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/@ant-design/icons-svg": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@ant-design/icons-svg/-/icons-svg-4.4.2.tgz", + "integrity": "sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA==" + }, + "node_modules/@ant-design/react-slick": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ant-design/react-slick/-/react-slick-1.1.2.tgz", + "integrity": "sha512-EzlvzE6xQUBrZuuhSAFTdsr4P2bBBHGZwKFemEfq8gIGyIQCxalYfZW/T2ORbtQx5rU69o+WycP3exY/7T1hGA==", + "dependencies": { + "@babel/runtime": "^7.10.4", + "classnames": "^2.2.5", + "json2mq": "^0.2.0", + "resize-observer-polyfill": "^1.5.1", + "throttle-debounce": "^5.0.0" + }, + "peerDependencies": { + "react": ">=16.9.0" + } + }, + "node_modules/@auth/core": { + "version": "0.32.0", + "resolved": "https://registry.npmjs.org/@auth/core/-/core-0.32.0.tgz", + "integrity": "sha512-3+ssTScBd+1fd0/fscAyQN1tSygXzuhysuVVzB942ggU4mdfiTbv36P0ccVnExKWYJKvu3E2r3/zxXCCAmTOrg==", + "dependencies": { + "@panva/hkdf": "^1.1.1", + "@types/cookie": "0.6.0", + "cookie": "0.6.0", + "jose": "^5.1.3", + "oauth4webapi": "^2.9.0", + "preact": "10.11.3", + "preact-render-to-string": "5.2.3" + }, + "peerDependencies": { + "@simplewebauthn/browser": "^9.0.1", + "@simplewebauthn/server": "^9.0.2", + "nodemailer": "^6.8.0" + }, + "peerDependenciesMeta": { + "@simplewebauthn/browser": { + "optional": true + }, + "@simplewebauthn/server": { + "optional": true + }, + "nodemailer": { + "optional": true + } + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.0.tgz", + "integrity": "sha512-P4fwKI2mjEb3ZU5cnMJzvRsRKGBUcs8jvxIoRmr6ufAY9Xk2Bz7JubRTTivkw55c7WQJfTECeqYVa+HZ0FzREg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.24.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.9.tgz", + "integrity": "sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.24.9", + "@babel/helper-compilation-targets": "^7.24.8", + "@babel/helper-module-transforms": "^7.24.9", + "@babel/helpers": "^7.24.8", + "@babel/parser": "^7.24.8", + "@babel/template": "^7.24.7", + "@babel/traverse": "^7.24.8", + "@babel/types": "^7.24.9", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", + "integrity": "sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.25.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.8.tgz", + "integrity": "sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.24.8", + "@babel/helper-validator-option": "^7.24.8", + "browserslist": "^4.23.1", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", + "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.0.tgz", + "integrity": "sha512-bIkOa2ZJYn7FHnepzr5iX9Kmz8FjIz4UKzJ9zhX3dnYuVW0xul9RuR3skBfoLu+FPTQw90EHW9rJsSZhyLQ3fQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.24.7", + "@babel/helper-simple-access": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "@babel/traverse": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", + "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", + "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.24.7", + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", + "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.24.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", + "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", + "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.0.tgz", + "integrity": "sha512-CzdIU9jdP0dg7HdyB+bHvDJGagUv+qtzZt5rYCWwW6tITNqV9odjp6Qu41gkG0ca5UfdDUWrKkiAnHHdGRnOrA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz", + "integrity": "sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.7.tgz", + "integrity": "sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.0.tgz", + "integrity": "sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", + "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/parser": "^7.25.0", + "@babel/types": "^7.25.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.0.tgz", + "integrity": "sha512-ubALThHQy4GCf6mbb+5ZRNmLLCI7bJ3f8Q6LHBSRlSKSWj5a7dSUzJBLv3VuIhFrFPgjF4IzPF567YG/HSCdZA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.24.7", + "@babel/generator": "^7.25.0", + "@babel/parser": "^7.25.0", + "@babel/template": "^7.25.0", + "@babel/types": "^7.25.0", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/types": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.0.tgz", + "integrity": "sha512-LcnxQSsd9aXOIgmmSpvZ/1yo46ra2ESYyqLcryaBZOghxy5qqOBjvCWP5JfkI8yl9rlxRgdLTTMCQQRcN2hdCg==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.8", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@braintree/sanitize-url": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.4.tgz", + "integrity": "sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==" + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "devOptional": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "devOptional": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@ctrl/tinycolor": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", + "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/@emotion/hash": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", + "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==" + }, + "node_modules/@emotion/unitless": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", + "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@formatjs/ecma402-abstract": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.0.0.tgz", + "integrity": "sha512-rRqXOqdFmk7RYvj4khklyqzcfQl9vEL/usogncBHRZfZBDOwMGuSRNFl02fu5KGHXdbinju+YXyuR+Nk8xlr/g==", + "dependencies": { + "@formatjs/intl-localematcher": "0.5.4", + "tslib": "^2.4.0" + } + }, + "node_modules/@formatjs/ecma402-abstract/node_modules/@formatjs/intl-localematcher": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.4.tgz", + "integrity": "sha512-zTwEpWOzZ2CiKcB93BLngUX59hQkuZjT2+SAQEscSm52peDW/getsawMcWF1rGRpMCX6D7nSJA3CzJ8gn13N/g==", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@formatjs/fast-memoize": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.0.tgz", + "integrity": "sha512-hnk/nY8FyrL5YxwP9e4r9dqeM6cAbo8PeU9UjyXojZMNvVad2Z06FAVHyR3Ecw6fza+0GH7vdJgiKIVXTMbSBA==", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@formatjs/icu-messageformat-parser": { + "version": "2.7.8", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.7.8.tgz", + "integrity": "sha512-nBZJYmhpcSX0WeJ5SDYUkZ42AgR3xiyhNCsQweFx3cz/ULJjym8bHAzWKvG5e2+1XO98dBYC0fWeeAECAVSwLA==", + "dependencies": { + "@formatjs/ecma402-abstract": "2.0.0", + "@formatjs/icu-skeleton-parser": "1.8.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@formatjs/icu-skeleton-parser": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.2.tgz", + "integrity": "sha512-k4ERKgw7aKGWJZgTarIcNEmvyTVD9FYh0mTrrBMHZ1b8hUu6iOJ4SzsZlo3UNAvHYa+PnvntIwRPt1/vy4nA9Q==", + "dependencies": { + "@formatjs/ecma402-abstract": "2.0.0", + "tslib": "^2.4.0" + } + }, + "node_modules/@formatjs/intl-localematcher": { + "version": "0.2.32", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.32.tgz", + "integrity": "sha512-k/MEBstff4sttohyEpXxCmC3MqbUn9VvHGlZ8fauLzkbwXmVrEeyzS+4uhrvAk9DWU9/7otYWxyDox4nT/KVLQ==", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@headlessui/react": { + "version": "1.7.19", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.19.tgz", + "integrity": "sha512-Ll+8q3OlMJfJbAKM/+/Y2q6PPYbryqNTXDbryx7SXLIDamkF6iQFbriYHga0dY44PvDhvvBWCx1Xj4U5+G4hOw==", + "dependencies": { + "@tanstack/react-virtual": "^3.0.0-beta.60", + "client-only": "^0.0.1" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": "^16 || ^17 || ^18", + "react-dom": "^16 || ^17 || ^18" + } + }, + "node_modules/@heroicons/react": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@heroicons/react/-/react-2.1.5.tgz", + "integrity": "sha512-FuzFN+BsHa+7OxbvAERtgBTNeZpUjgM/MIizfVkSCL2/edriN0Hx/DWRCR//aPYwO5QX/YlgLGXk+E3PcfZwjA==", + "peerDependencies": { + "react": ">= 16" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/console/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/core/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/core/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/reporters/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@next/env": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.5.tgz", + "integrity": "sha512-/zZGkrTOsraVfYjGP8uM0p6r0BDT6xWpkjdVbcz66PJVSpwXX3yNiRycxAuDfBKGWBrZBXRuK/YVlkNgxHGwmA==" + }, + "node_modules/@next/eslint-plugin-next": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.5.tgz", + "integrity": "sha512-LY3btOpPh+OTIpviNojDpUdIbHW9j0JBYBjsIp8IxtDFfYFyORvw3yNq6N231FVqQA7n7lwaf7xHbVJlA1ED7g==", + "dev": true, + "dependencies": { + "glob": "10.3.10" + } + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.5.tgz", + "integrity": "sha512-/9zVxJ+K9lrzSGli1///ujyRfon/ZneeZ+v4ptpiPoOU+GKZnm8Wj8ELWU1Pm7GHltYRBklmXMTUqM/DqQ99FQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.5.tgz", + "integrity": "sha512-vXHOPCwfDe9qLDuq7U1OYM2wUY+KQ4Ex6ozwsKxp26BlJ6XXbHleOUldenM67JRyBfVjv371oneEvYd3H2gNSA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.5.tgz", + "integrity": "sha512-vlhB8wI+lj8q1ExFW8lbWutA4M2ZazQNvMWuEDqZcuJJc78iUnLdPPunBPX8rC4IgT6lIx/adB+Cwrl99MzNaA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.5.tgz", + "integrity": "sha512-NpDB9NUR2t0hXzJJwQSGu1IAOYybsfeB+LxpGsXrRIb7QOrYmidJz3shzY8cM6+rO4Aojuef0N/PEaX18pi9OA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.5.tgz", + "integrity": "sha512-8XFikMSxWleYNryWIjiCX+gU201YS+erTUidKdyOVYi5qUQo/gRxv/3N1oZFCgqpesN6FPeqGM72Zve+nReVXQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.5.tgz", + "integrity": "sha512-6QLwi7RaYiQDcRDSU/os40r5o06b5ue7Jsk5JgdRBGGp8l37RZEh9JsLSM8QF0YDsgcosSeHjglgqi25+m04IQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.5.tgz", + "integrity": "sha512-1GpG2VhbspO+aYoMOQPQiqc/tG3LzmsdBH0LhnDS3JrtDx2QmzXe0B6mSZZiN3Bq7IOMXxv1nlsjzoS1+9mzZw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-ia32-msvc": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.5.tgz", + "integrity": "sha512-Igh9ZlxwvCDsu6438FXlQTHlRno4gFpJzqPjSIBZooD22tKeI4fE/YMRoHVJHmrQ2P5YL1DoZ0qaOKkbeFWeMg==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.5.tgz", + "integrity": "sha512-tEQ7oinq1/CjSG9uSTerca3v4AZ+dFa+4Yu6ihaG8Ud8ddqLQgFGcnwYls13H5X5CPDPZJdYxyeMui6muOLd4g==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@panva/hkdf": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@panva/hkdf/-/hkdf-1.2.1.tgz", + "integrity": "sha512-6oclG6Y3PiDFcoyk8srjLfVKyMfVCKJ27JwNPViuXziFpmdz+MZnZN/aKY0JGXgYuO/VghU0jcOAZgWXZ1Dmrw==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@rc-component/async-validator": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@rc-component/async-validator/-/async-validator-5.0.4.tgz", + "integrity": "sha512-qgGdcVIF604M9EqjNF0hbUTz42bz/RDtxWdWuU5EQe3hi7M8ob54B6B35rOsvX5eSvIHIzT9iH1R3n+hk3CGfg==", + "dependencies": { + "@babel/runtime": "^7.24.4" + }, + "engines": { + "node": ">=14.x" + } + }, + "node_modules/@rc-component/color-picker": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@rc-component/color-picker/-/color-picker-1.5.3.tgz", + "integrity": "sha512-+tGGH3nLmYXTalVe0L8hSZNs73VTP5ueSHwUlDC77KKRaN7G4DS4wcpG5DTDzdcV/Yas+rzA6UGgIyzd8fS4cw==", + "dependencies": { + "@babel/runtime": "^7.23.6", + "@ctrl/tinycolor": "^3.6.1", + "classnames": "^2.2.6", + "rc-util": "^5.38.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/context": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@rc-component/context/-/context-1.4.0.tgz", + "integrity": "sha512-kFcNxg9oLRMoL3qki0OMxK+7g5mypjgaaJp/pkOis/6rVxma9nJBF/8kCIuTYHUQNr0ii7MxqE33wirPZLJQ2w==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "rc-util": "^5.27.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/mini-decimal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rc-component/mini-decimal/-/mini-decimal-1.1.0.tgz", + "integrity": "sha512-jS4E7T9Li2GuYwI6PyiVXmxTiM6b07rlD9Ge8uGZSCz3WlzcG5ZK7g5bbuKNeZ9pgUuPK/5guV781ujdVpm4HQ==", + "dependencies": { + "@babel/runtime": "^7.18.0" + }, + "engines": { + "node": ">=8.x" + } + }, + "node_modules/@rc-component/mutate-observer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rc-component/mutate-observer/-/mutate-observer-1.1.0.tgz", + "integrity": "sha512-QjrOsDXQusNwGZPf4/qRQasg7UFEj06XiCJ8iuiq/Io7CrHrgVi6Uuetw60WAMG1799v+aM8kyc+1L/GBbHSlw==", + "dependencies": { + "@babel/runtime": "^7.18.0", + "classnames": "^2.3.2", + "rc-util": "^5.24.4" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/portal": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@rc-component/portal/-/portal-1.1.2.tgz", + "integrity": "sha512-6f813C0IsasTZms08kfA8kPAGxbbkYToa8ALaiDIGGECU4i9hj8Plgbx0sNJDrey3EtHO30hmdaxtT0138xZcg==", + "dependencies": { + "@babel/runtime": "^7.18.0", + "classnames": "^2.3.2", + "rc-util": "^5.24.4" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/qrcode": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@rc-component/qrcode/-/qrcode-1.0.0.tgz", + "integrity": "sha512-L+rZ4HXP2sJ1gHMGHjsg9jlYBX/SLN2D6OxP9Zn3qgtpMWtO2vUfxVFwiogHpAIqs54FnALxraUy/BCO1yRIgg==", + "dependencies": { + "@babel/runtime": "^7.24.7", + "classnames": "^2.3.2", + "rc-util": "^5.38.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/tour": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@rc-component/tour/-/tour-1.15.0.tgz", + "integrity": "sha512-h6hyILDwL+In9GAgRobwRWihLqqsD7Uft3fZGrJ7L4EiyCoxbnNYwzPXDfz7vNDhWeVyvAWQJj9fJCzpI4+b4g==", + "dependencies": { + "@babel/runtime": "^7.18.0", + "@rc-component/portal": "^1.0.0-9", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.3.2", + "rc-util": "^5.24.4" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rc-component/trigger": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@rc-component/trigger/-/trigger-2.2.0.tgz", + "integrity": "sha512-QarBCji02YE9aRFhZgRZmOpXBj0IZutRippsVBv85sxvG4FGk/vRxwAlkn3MS9zK5mwbETd86mAVg2tKqTkdJA==", + "dependencies": { + "@babel/runtime": "^7.23.2", + "@rc-component/portal": "^1.1.0", + "classnames": "^2.3.2", + "rc-motion": "^2.0.0", + "rc-resize-observer": "^1.3.1", + "rc-util": "^5.38.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@rushstack/eslint-patch": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.10.4.tgz", + "integrity": "sha512-WJgX9nzTqknM393q1QJDJmoW28kUfEnybeTfVNcNAPnIx210RXm2DiXiHzfNPJNIUUb1tJnz/l4QGtJ30PgWmA==", + "dev": true + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==" + }, + "node_modules/@swc/helpers": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", + "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", + "dependencies": { + "@swc/counter": "^0.1.3", + "tslib": "^2.4.0" + } + }, + "node_modules/@tailwindcss/typography": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.13.tgz", + "integrity": "sha512-ADGcJ8dX21dVVHIwTRgzrcunY6YY9uSlAHHGVKvkA+vLc5qLwEszvKts40lx7z0qc4clpjclwLeK5rVCV2P/uw==", + "dev": true, + "dependencies": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders" + } + }, + "node_modules/@tailwindcss/typography/node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@tanstack/react-virtual": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.8.3.tgz", + "integrity": "sha512-9ICwbDUUzN99CJIGc373i8NLoj6zFTKI2Hlcmo0+lCSAhPQ5mxq4dGOMKmLYoEFyHcGQ64Bd6ZVbnPpM6lNK5w==", + "dependencies": { + "@tanstack/virtual-core": "3.8.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@tanstack/virtual-core": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.8.3.tgz", + "integrity": "sha512-vd2A2TnM5lbnWZnHi9B+L2gPtkSeOtJOAw358JqokIH1+v2J7vUAzFVPwB/wrye12RFOurffXu33plm4uQ+JBQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@testing-library/dom": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", + "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "chalk": "^4.1.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@testing-library/dom/node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "peer": true, + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/@testing-library/dom/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@testing-library/dom/node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/@testing-library/dom/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@testing-library/dom/node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "peer": true + }, + "node_modules/@testing-library/jest-dom": { + "version": "6.4.8", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.4.8.tgz", + "integrity": "sha512-JD0G+Zc38f5MBHA4NgxQMR5XtO5Jx9g86jqturNTt2WUfRmLDIY7iKkWHDCCTiDuFMre6nxAD5wHw9W5kI4rGw==", + "dev": true, + "dependencies": { + "@adobe/css-tools": "^4.4.0", + "@babel/runtime": "^7.9.2", + "aria-query": "^5.0.0", + "chalk": "^3.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.6.3", + "lodash": "^4.17.21", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true + }, + "node_modules/@testing-library/react": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.0.0.tgz", + "integrity": "sha512-guuxUKRWQ+FgNX0h0NS0FIq3Q3uLtWVpBzcLOggmfMoUpgBnzBzvLLd4fbm6yS8ydJd94cIfY4yP9qUQjM2KwQ==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.12.5" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@testing-library/dom": "^10.0.0", + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", + "react": "^18.0.0", + "react-dom": "^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@tippyjs/react": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/@tippyjs/react/-/react-4.2.6.tgz", + "integrity": "sha512-91RicDR+H7oDSyPycI13q3b7o4O60wa2oRbjlz2fyRLmHImc4vyDwuUP8NtZaN0VARJY5hybvDYrFzhY9+Lbyw==", + "dependencies": { + "tippy.js": "^6.3.1" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "devOptional": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "devOptional": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "devOptional": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "devOptional": true + }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true, + "peer": true + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==" + }, + "node_modules/@types/d3": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.3.tgz", + "integrity": "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==", + "dev": true, + "dependencies": { + "@types/d3-array": "*", + "@types/d3-axis": "*", + "@types/d3-brush": "*", + "@types/d3-chord": "*", + "@types/d3-color": "*", + "@types/d3-contour": "*", + "@types/d3-delaunay": "*", + "@types/d3-dispatch": "*", + "@types/d3-drag": "*", + "@types/d3-dsv": "*", + "@types/d3-ease": "*", + "@types/d3-fetch": "*", + "@types/d3-force": "*", + "@types/d3-format": "*", + "@types/d3-geo": "*", + "@types/d3-hierarchy": "*", + "@types/d3-interpolate": "*", + "@types/d3-path": "*", + "@types/d3-polygon": "*", + "@types/d3-quadtree": "*", + "@types/d3-random": "*", + "@types/d3-scale": "*", + "@types/d3-scale-chromatic": "*", + "@types/d3-selection": "*", + "@types/d3-shape": "*", + "@types/d3-time": "*", + "@types/d3-time-format": "*", + "@types/d3-timer": "*", + "@types/d3-transition": "*", + "@types/d3-zoom": "*" + } + }, + "node_modules/@types/d3-array": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.1.tgz", + "integrity": "sha512-Y2Jn2idRrLzUfAKV2LyRImR+y4oa2AntrgID95SHJxuMUrkNXmanDSed71sRNZysveJVt1hLLemQZIady0FpEg==", + "dev": true + }, + "node_modules/@types/d3-axis": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-3.0.6.tgz", + "integrity": "sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==", + "dev": true, + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-brush": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-3.0.6.tgz", + "integrity": "sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==", + "dev": true, + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-chord": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.6.tgz", + "integrity": "sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==", + "dev": true + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "dev": true + }, + "node_modules/@types/d3-contour": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-3.0.6.tgz", + "integrity": "sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==", + "dev": true, + "dependencies": { + "@types/d3-array": "*", + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==", + "dev": true + }, + "node_modules/@types/d3-dispatch": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.6.tgz", + "integrity": "sha512-4fvZhzMeeuBJYZXRXrRIQnvUYfyXwYmLsdiN7XXmVNQKKw1cM8a5WdID0g1hVFZDqT9ZqZEY5pD44p24VS7iZQ==", + "dev": true + }, + "node_modules/@types/d3-drag": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.7.tgz", + "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==", + "dev": true, + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-dsv": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.7.tgz", + "integrity": "sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==", + "dev": true + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "dev": true + }, + "node_modules/@types/d3-fetch": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-3.0.7.tgz", + "integrity": "sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==", + "dev": true, + "dependencies": { + "@types/d3-dsv": "*" + } + }, + "node_modules/@types/d3-force": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz", + "integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==", + "dev": true + }, + "node_modules/@types/d3-format": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.4.tgz", + "integrity": "sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==", + "dev": true + }, + "node_modules/@types/d3-geo": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.1.0.tgz", + "integrity": "sha512-856sckF0oP/diXtS4jNsiQw/UuK5fQG8l/a9VVLeSouf1/PPbBE1i1W852zVwKwYCBkFJJB7nCFTbk6UMEXBOQ==", + "dev": true, + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-hierarchy": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.7.tgz", + "integrity": "sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==", + "dev": true + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "dev": true, + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-P2dlU/q51fkOc/Gfl3Ul9kicV7l+ra934qBFXCFhrZMOL6du1TM0pm1ThYvENukyOn5h9v+yMJ9Fn5JK4QozrQ==", + "dev": true + }, + "node_modules/@types/d3-polygon": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.2.tgz", + "integrity": "sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==", + "dev": true + }, + "node_modules/@types/d3-quadtree": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.6.tgz", + "integrity": "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==", + "dev": true + }, + "node_modules/@types/d3-random": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.3.tgz", + "integrity": "sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ==", + "dev": true + }, + "node_modules/@types/d3-scale": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.8.tgz", + "integrity": "sha512-gkK1VVTr5iNiYJ7vWDI+yUFFlszhNMtVeneJ6lUTKPjprsvLLI9/tgEGiXJOnlINJA8FyA88gfnQsHbybVZrYQ==", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-scale-chromatic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.0.3.tgz", + "integrity": "sha512-laXM4+1o5ImZv3RpFAsTRn3TEkzqkytiOY0Dz0sq5cnd1dtNlk6sHLon4OvqaiJb28T0S/TdsBI3Sjsy+keJrw==" + }, + "node_modules/@types/d3-selection": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.10.tgz", + "integrity": "sha512-cuHoUgS/V3hLdjJOLTT691+G2QoqAjCVLmr4kJXR4ha56w1Zdu8UUQ5TxLRqudgNjwXeQxKMq4j+lyf9sWuslg==", + "dev": true + }, + "node_modules/@types/d3-shape": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.6.tgz", + "integrity": "sha512-5KKk5aKGu2I+O6SONMYSNflgiP0WfZIQvVUMan50wHsLG1G94JlxEVnCpQARfTtzytuY0p/9PXXZb3I7giofIA==", + "dev": true, + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.3.tgz", + "integrity": "sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw==" + }, + "node_modules/@types/d3-time-format": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.3.tgz", + "integrity": "sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==", + "dev": true + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "dev": true + }, + "node_modules/@types/d3-transition": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.8.tgz", + "integrity": "sha512-ew63aJfQ/ms7QQ4X7pk5NxQ9fZH/z+i24ZfJ6tJSfqxJMrYLiK01EAs2/Rtw/JreGUsS3pLPNV644qXFGnoZNQ==", + "dev": true, + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-zoom": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.8.tgz", + "integrity": "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==", + "dev": true, + "dependencies": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/geojson": { + "version": "7946.0.14", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", + "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==", + "dev": true + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/hast": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", + "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/@types/hoist-non-react-statics": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", + "integrity": "sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==", + "dependencies": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/jest/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@types/jest/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@types/jest/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/@types/jsdom": { + "version": "21.1.7", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-21.1.7.tgz", + "integrity": "sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "node_modules/@types/mdast": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/@types/ms": { + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" + }, + "node_modules/@types/node": { + "version": "20.14.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.12.tgz", + "integrity": "sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==", + "devOptional": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/prop-types": { + "version": "15.7.12", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", + "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" + }, + "node_modules/@types/react": { + "version": "18.3.3", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz", + "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", + "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", + "dev": true, + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/react-syntax-highlighter": { + "version": "15.5.13", + "resolved": "https://registry.npmjs.org/@types/react-syntax-highlighter/-/react-syntax-highlighter-15.5.13.tgz", + "integrity": "sha512-uLGJ87j6Sz8UaBAooU0T6lWJ0dBmjZgN1PZTrj05TNql2/XpC6+4HhMT5syIdFUUt+FASfCeLLv4kBygNU+8qA==", + "dev": true, + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", + "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", + "dev": true + }, + "node_modules/@types/unist": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz", + "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==" + }, + "node_modules/@types/yargs": { + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true + }, + "node_modules/@typescript-eslint/parser": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", + "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz", + "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz", + "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz", + "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz", + "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/@yr/monotone-cubic-spline": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@yr/monotone-cubic-spline/-/monotone-cubic-spline-1.0.3.tgz", + "integrity": "sha512-FQXkOta0XBSUPHndIKON2Y9JeQz5ZeMqLYZVVK93FliNBFm7LNMIZmY6FrMEB9XPcDbE2bekMbZD6kzDkxwYjA==" + }, + "node_modules/abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "deprecated": "Use your platform's native atob() and btoa() methods instead", + "dev": true + }, + "node_modules/acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "devOptional": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "dev": true, + "dependencies": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", + "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", + "devOptional": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/antd": { + "version": "5.19.3", + "resolved": "https://registry.npmjs.org/antd/-/antd-5.19.3.tgz", + "integrity": "sha512-rhGI6yyZ4dA2MWl9bfO0MZjtNwWdzITpp3u7pKLiQpTjJYFlpF5wDFgGaG1or3sqyBihvqcO/OF1hSggmWczbQ==", + "dependencies": { + "@ant-design/colors": "^7.1.0", + "@ant-design/cssinjs": "^1.21.0", + "@ant-design/icons": "^5.3.7", + "@ant-design/react-slick": "~1.1.2", + "@babel/runtime": "^7.24.8", + "@ctrl/tinycolor": "^3.6.1", + "@rc-component/color-picker": "~1.5.3", + "@rc-component/mutate-observer": "^1.1.0", + "@rc-component/qrcode": "~1.0.0", + "@rc-component/tour": "~1.15.0", + "@rc-component/trigger": "^2.2.0", + "classnames": "^2.5.1", + "copy-to-clipboard": "^3.3.3", + "dayjs": "^1.11.11", + "rc-cascader": "~3.27.0", + "rc-checkbox": "~3.3.0", + "rc-collapse": "~3.7.3", + "rc-dialog": "~9.5.2", + "rc-drawer": "~7.2.0", + "rc-dropdown": "~4.2.0", + "rc-field-form": "~2.2.1", + "rc-image": "~7.9.0", + "rc-input": "~1.5.1", + "rc-input-number": "~9.1.0", + "rc-mentions": "~2.14.0", + "rc-menu": "~9.14.1", + "rc-motion": "^2.9.2", + "rc-notification": "~5.6.0", + "rc-pagination": "~4.2.0", + "rc-picker": "~4.6.9", + "rc-progress": "~4.0.0", + "rc-rate": "~2.13.0", + "rc-resize-observer": "^1.4.0", + "rc-segmented": "~2.3.0", + "rc-select": "~14.15.1", + "rc-slider": "~10.6.2", + "rc-steps": "~6.0.1", + "rc-switch": "~4.1.0", + "rc-table": "~7.45.7", + "rc-tabs": "~15.1.1", + "rc-textarea": "~1.7.0", + "rc-tooltip": "~6.2.0", + "rc-tree": "~5.8.8", + "rc-tree-select": "~5.22.1", + "rc-upload": "~4.6.0", + "rc-util": "^5.43.0", + "scroll-into-view-if-needed": "^3.1.0", + "throttle-debounce": "^5.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ant-design" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/apexcharts": { + "version": "3.51.0", + "resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.51.0.tgz", + "integrity": "sha512-WpCdVdGiJjf9SAyEeg2rl3q5OqCcNqiEmH0+filMraUiH6Vqyn5GFeMMyH0pon44xjNr1G0xzIRERKRmsGEuRA==", + "dependencies": { + "@yr/monotone-cubic-spline": "^1.0.3", + "svg.draggable.js": "^2.2.2", + "svg.easing.js": "^2.0.0", + "svg.filter.js": "^2.0.2", + "svg.pathmorphing.js": "^0.1.3", + "svg.resize.js": "^1.4.3", + "svg.select.js": "^3.0.1" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/aria-query": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", + "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", + "dev": true, + "dependencies": { + "deep-equal": "^2.0.5" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-tree-filter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-tree-filter/-/array-tree-filter-2.1.0.tgz", + "integrity": "sha512-4ROwICNlNw/Hqa9v+rk5h22KjmzB1JGTMVKP2AKJBOCgb0yL0ASf0+YvCcLNNwquOHNX48jkeZIJ3a+oOQqKcw==" + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", + "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.2.1", + "get-intrinsic": "^1.2.3", + "is-array-buffer": "^3.0.4", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ast-types-flow": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", + "dev": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axe-core": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.9.1.tgz", + "integrity": "sha512-QbUdXJVTpvUTHU7871ppZkdOLBeGUKBQWHkHrvN2V9IQWGMt61zf3B45BtzjxEJzYuj0JBjBZP/hmYS/R9pmAw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/axobject-query": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", + "integrity": "sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==", + "dev": true, + "dependencies": { + "deep-equal": "^2.0.5" + } + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.23.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", + "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001640", + "electron-to-chromium": "^1.4.820", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.1.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001643", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", + "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", + "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", + "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz", + "integrity": "sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==", + "dev": true + }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/comma-separated-tokens": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz", + "integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/compute-scroll-into-view": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.1.0.tgz", + "integrity": "sha512-rj8l8pD4bJ1nx+dAkMhV1xB5RuZEyVysfxJqB1pRchh1KVvwOv9b7CGB8ZfjTImVv2oF+sYMUkMZq6Na5Ftmbg==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/copy-to-clipboard": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz", + "integrity": "sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==", + "dependencies": { + "toggle-selection": "^1.0.6" + } + }, + "node_modules/cose-base": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz", + "integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==", + "dependencies": { + "layout-base": "^1.0.0" + } + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/create-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "devOptional": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dev": true + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cssom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", + "dev": true + }, + "node_modules/cssstyle": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", + "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", + "dependencies": { + "rrweb-cssom": "^0.6.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cssstyle/node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==" + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" + }, + "node_modules/cytoscape": { + "version": "3.30.1", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.30.1.tgz", + "integrity": "sha512-TRJc3HbBPkHd50u9YfJh2FxD1lDLZ+JXnJoyBn5LkncoeuT7fapO/Hq/Ed8TdFclaKshzInge2i30bg7VKeoPQ==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/cytoscape-cose-bilkent": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cytoscape-cose-bilkent/-/cytoscape-cose-bilkent-4.1.0.tgz", + "integrity": "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==", + "dependencies": { + "cose-base": "^1.0.0" + }, + "peerDependencies": { + "cytoscape": "^3.2.0" + } + }, + "node_modules/d3": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", + "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "4", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-axis": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", + "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-brush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", + "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-chord": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", + "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-contour": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", + "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", + "dependencies": { + "d3-array": "^3.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", + "dependencies": { + "delaunator": "5" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", + "dependencies": { + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" + }, + "bin": { + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", + "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", + "dependencies": { + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-force": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", + "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-geo": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz", + "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", + "dependencies": { + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-geo-projection": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/d3-geo-projection/-/d3-geo-projection-4.0.0.tgz", + "integrity": "sha512-p0bK60CEzph1iqmnxut7d/1kyTmm3UWtPlwdkM31AU+LW+BXazd5zJdoCn7VFxNCHXRngPHRnsNn5uGjLRGndg==", + "dependencies": { + "commander": "7", + "d3-array": "1 - 3", + "d3-geo": "1.12.0 - 3" + }, + "bin": { + "geo2svg": "bin/geo2svg.js", + "geograticule": "bin/geograticule.js", + "geoproject": "bin/geoproject.js", + "geoquantize": "bin/geoquantize.js", + "geostitch": "bin/geostitch.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-geo-projection/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-polygon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", + "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-random": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", + "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-sankey": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/d3-sankey/-/d3-sankey-0.12.3.tgz", + "integrity": "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==", + "dependencies": { + "d3-array": "1 - 2", + "d3-shape": "^1.2.0" + } + }, + "node_modules/d3-sankey/node_modules/d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "dependencies": { + "internmap": "^1.0.0" + } + }, + "node_modules/d3-sankey/node_modules/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==" + }, + "node_modules/d3-sankey/node_modules/d3-shape": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "dependencies": { + "d3-path": "1" + } + }, + "node_modules/d3-sankey/node_modules/internmap": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", + "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==" + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale-chromatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", + "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/dagre-d3-es": { + "version": "7.0.10", + "resolved": "https://registry.npmjs.org/dagre-d3-es/-/dagre-d3-es-7.0.10.tgz", + "integrity": "sha512-qTCQmEhcynucuaZgY5/+ti3X/rnszKZhEQH/ZdWdtP1tA/y3VoHJzcVrO9pjjJCNpigfscAtoUB5ONcd2wNn0A==", + "dependencies": { + "d3": "^7.8.2", + "lodash-es": "^4.17.21" + } + }, + "node_modules/damerau-levenshtein": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", + "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==", + "dev": true + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", + "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", + "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", + "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dayjs": { + "version": "1.11.12", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.12.tgz", + "integrity": "sha512-Rt2g+nTbLlDWZTwwrIXjy9MeiZmSDI375FvZs72ngxx8PDC6YXOeR3q5LAuPzjZQxhiWdRKac7RKV+YyQYfYIg==" + }, + "node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" + }, + "node_modules/decode-named-character-reference": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz", + "integrity": "sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/dedent": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", + "integrity": "sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-equal": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", + "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.5", + "es-get-iterator": "^1.1.3", + "get-intrinsic": "^1.2.2", + "is-arguments": "^1.1.1", + "is-array-buffer": "^3.0.2", + "is-date-object": "^1.0.5", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "isarray": "^2.0.5", + "object-is": "^1.1.5", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "side-channel": "^1.0.4", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/deepmerge": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz", + "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delaunator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.0.1.tgz", + "integrity": "sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==", + "dependencies": { + "robust-predicates": "^3.0.2" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==" + }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==" + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true, + "peer": true + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "deprecated": "Use your platform's native DOMException instead", + "dev": true, + "dependencies": { + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/dompurify": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.6.tgz", + "integrity": "sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==" + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.2.tgz", + "integrity": "sha512-kc4r3U3V3WLaaZqThjYz/Y6z8tJe+7K0bbjUVo3i+LWIypVdMx5nXCkwRe6SWbY6ILqLdc1rKcKmr3HoH7wjSQ==", + "dev": true + }, + "node_modules/elkjs": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/elkjs/-/elkjs-0.9.3.tgz", + "integrity": "sha512-f/ZeWvW/BCXbhGEf1Ujp29EASo/lk1FDnETgNKwJrsVvGZhUWCZyg3xLJjAsxfOmt8KjswHmI5EwCQcPMpOYhQ==" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/enhanced-resolve": { + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", + "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "arraybuffer.prototype.slice": "^1.0.3", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "data-view-buffer": "^1.0.1", + "data-view-byte-length": "^1.0.1", + "data-view-byte-offset": "^1.0.0", + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.0.3", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.4", + "get-symbol-description": "^1.0.2", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "hasown": "^2.0.2", + "internal-slot": "^1.0.7", + "is-array-buffer": "^3.0.4", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.1", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.3", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.13", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.5", + "regexp.prototype.flags": "^1.5.2", + "safe-array-concat": "^1.1.2", + "safe-regex-test": "^1.0.3", + "string.prototype.trim": "^1.2.9", + "string.prototype.trimend": "^1.0.8", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.2", + "typed-array-byte-length": "^1.0.1", + "typed-array-byte-offset": "^1.0.2", + "typed-array-length": "^1.0.6", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.15" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-get-iterator": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "has-symbols": "^1.0.3", + "is-arguments": "^1.1.1", + "is-map": "^2.0.2", + "is-set": "^2.0.2", + "is-string": "^1.0.7", + "isarray": "^2.0.5", + "stop-iteration-iterator": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz", + "integrity": "sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.0.3", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", + "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-next": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.2.5.tgz", + "integrity": "sha512-zogs9zlOiZ7ka+wgUnmcM0KBEDjo4Jis7kxN1jvC0N4wynQ2MIx/KBkg4mVF63J5EK4W0QMCn7xO3vNisjaAoA==", + "dev": true, + "dependencies": { + "@next/eslint-plugin-next": "14.2.5", + "@rushstack/eslint-patch": "^1.3.3", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^3.5.2", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" + }, + "peerDependencies": { + "eslint": "^7.23.0 || ^8.0.0", + "typescript": ">=3.3.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", + "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "enhanced-resolve": "^5.12.0", + "eslint-module-utils": "^2.7.4", + "fast-glob": "^3.3.1", + "get-tsconfig": "^4.5.0", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", + "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-jsx-a11y": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.9.0.tgz", + "integrity": "sha512-nOFOCaJG2pYqORjK19lqPqxMO/JpvdCZdPtNdxY3kvom3jTvkAbOvQvD8wuD0G8BYR0IGAGYDlzqWJOh/ybn2g==", + "dev": true, + "dependencies": { + "aria-query": "~5.1.3", + "array-includes": "^3.1.8", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "^4.9.1", + "axobject-query": "~3.1.1", + "damerau-levenshtein": "^1.0.8", + "emoji-regex": "^9.2.2", + "es-iterator-helpers": "^1.0.19", + "hasown": "^2.0.2", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "safe-regex-test": "^1.0.3", + "string.prototype.includes": "^2.0.0" + }, + "engines": { + "node": ">=4.0" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.35.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.35.0.tgz", + "integrity": "sha512-v501SSMOWv8gerHkk+IIQBkcGRGrO2nfybfj5pLxuJNFTPxxA3PSryhXTK+9pNbtkggheDdsC0E9Q8CuPk6JKA==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.2", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.19", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.8", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.0", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.11", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", + "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fault": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/fault/-/fault-1.0.4.tgz", + "integrity": "sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA==", + "dependencies": { + "format": "^0.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/foreground-child": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", + "integrity": "sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/format": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", + "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/formik": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/formik/-/formik-2.4.6.tgz", + "integrity": "sha512-A+2EI7U7aG296q2TLGvNapDNTZp1khVt5Vk0Q/fyfSROss0V/V6+txt2aJnwEos44IxTCW/LYAi/zgWzlevj+g==", + "funding": [ + { + "type": "individual", + "url": "https://opencollective.com/formik" + } + ], + "dependencies": { + "@types/hoist-non-react-statics": "^3.3.1", + "deepmerge": "^2.1.1", + "hoist-non-react-statics": "^3.3.0", + "lodash": "^4.17.21", + "lodash-es": "^4.17.21", + "react-fast-compare": "^2.0.1", + "tiny-warning": "^1.0.2", + "tslib": "^2.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/framer-motion": { + "version": "11.3.18", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-11.3.18.tgz", + "integrity": "sha512-pPJXcshW+AABch6FQxFCeBd/bZFaZC2w/VdkSEZGvKIaVGA4IsOS2SqUEIWMKMJJsKwr96O+7vY66M+/S7mOlw==", + "dependencies": { + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0", + "react-dom": "^18.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", + "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.6.tgz", + "integrity": "sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hast-util-parse-selector": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz", + "integrity": "sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hastscript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz", + "integrity": "sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==", + "dependencies": { + "@types/hast": "^2.0.0", + "comma-separated-tokens": "^1.0.0", + "hast-util-parse-selector": "^2.0.0", + "property-information": "^5.0.0", + "space-separated-tokens": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/highlight.js": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "engines": { + "node": "*" + } + }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/html-dom-parser": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/html-dom-parser/-/html-dom-parser-5.0.3.tgz", + "integrity": "sha512-slsc6ipw88OUZjAayRs5NTmfOQCwcUa3hNyk6AdsbQxY09H5Lr1Y3CZ4ZlconMKql3Ga6sWg3HMoUzo7KSItaQ==", + "dependencies": { + "domhandler": "5.0.3", + "htmlparser2": "9.0.0" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/html-react-parser": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/html-react-parser/-/html-react-parser-4.2.10.tgz", + "integrity": "sha512-JyKZVQ+kQ8PdycISwkuLbEEvV/k4hWhU6cb6TT7yGaYwdqA7cPt4VRYXkCZcix2vlQtgDBSMJUmPI2jpNjPGvg==", + "dependencies": { + "domhandler": "5.0.3", + "html-dom-parser": "5.0.3", + "react-property": "2.0.2", + "style-to-js": "1.1.8" + }, + "peerDependencies": { + "react": "0.14 || 15 || 16 || 17 || 18" + } + }, + "node_modules/htmlparser2": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.0.0.tgz", + "integrity": "sha512-uxbSI98wmFT/G4P2zXx4OVx04qWUmyFPrD2/CNepa2Zo3GPNaCaaxElDgwUrwYWkK1nr9fft0Ya8dws8coDLLQ==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "entities": "^4.5.0" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/inline-style-parser": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.2.tgz", + "integrity": "sha512-EcKzdTHVe8wFVOGEYXiW9WmJXPjqi1T+234YpJr98RiFYKHV3cdy1+3mkTE+KHTHxFFLH51SfaGOoUdW+v7ViQ==" + }, + "node_modules/internal-slot": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", + "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/intl-messageformat": { + "version": "10.5.14", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.5.14.tgz", + "integrity": "sha512-IjC6sI0X7YRjjyVH9aUgdftcmZK7WXdHeil4KwbjDnRWjnVitKpAx3rr6t6di1joFp5188VqKcobOPA6mCLG/w==", + "dependencies": { + "@formatjs/ecma402-abstract": "2.0.0", + "@formatjs/fast-memoize": "2.2.0", + "@formatjs/icu-messageformat-parser": "2.7.8", + "tslib": "^2.4.0" + } + }, + "node_modules/is-alphabetical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", + "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", + "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "dependencies": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-arguments": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", + "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", + "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "dev": true, + "dependencies": { + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-decimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", + "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hexadecimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", + "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==" + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", + "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", + "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/iterator.prototype": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", + "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + } + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-circus/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-config/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-config/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-config/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-config/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-diff/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-diff/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-each/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/jest-environment-jsdom": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz", + "integrity": "sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/jsdom": "^20.0.0", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0", + "jsdom": "^20.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jest-environment-jsdom/node_modules/@types/jsdom": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", + "integrity": "sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/jest-environment-jsdom/node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-environment-jsdom/node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + }, + "node_modules/jest-environment-jsdom/node_modules/data-urls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-environment-jsdom/node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-environment-jsdom/node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/jest-environment-jsdom/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/jest-environment-jsdom/node_modules/jsdom": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jest-environment-jsdom/node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dev": true, + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-environment-jsdom/node_modules/w3c-xmlserializer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "dev": true, + "dependencies": { + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/jest-environment-jsdom/node_modules/whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-environment-jsdom/node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-environment-jsdom/node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dev": true, + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-environment-jsdom/node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-leak-detector/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-leak-detector/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-leak-detector/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-matcher-utils/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-message-util/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-runtime/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-runtime/node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-snapshot/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-validate/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-validate/node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-validate/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-watcher/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jiti": { + "version": "1.21.6", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz", + "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/jose": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.6.3.tgz", + "integrity": "sha512-1Jh//hEEwMhNYPDDLwXHa2ePWgWiFNNUadVmguAAw2IJ6sj9mNxV5tGXJNqlMkJAybF6Lgw1mISDxTePP/187g==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsdom": { + "version": "24.1.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.1.tgz", + "integrity": "sha512-5O1wWV99Jhq4DV7rCLIoZ/UIhyQeDR7wHVyZAHAshbrvZsLs+Xzz7gtwnlJTJDjleiTKh54F4dXrX70vJQTyJQ==", + "dependencies": { + "cssstyle": "^4.0.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.12", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.7.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.4", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^2.11.2" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json2mq": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/json2mq/-/json2mq-0.2.0.tgz", + "integrity": "sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA==", + "dependencies": { + "string-convert": "^0.2.0" + } + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/katex": { + "version": "0.16.11", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.11.tgz", + "integrity": "sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==", + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, + "node_modules/katex/node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "engines": { + "node": ">= 12" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/khroma": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz", + "integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==" + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/language-subtag-registry": { + "version": "0.3.23", + "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.23.tgz", + "integrity": "sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==", + "dev": true + }, + "node_modules/language-tags": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", + "dev": true, + "dependencies": { + "language-subtag-registry": "^0.3.20" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/layout-base": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz", + "integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==" + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, + "node_modules/lodash.castarray": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz", + "integrity": "sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==", + "dev": true + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lowlight": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/lowlight/-/lowlight-1.20.0.tgz", + "integrity": "sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw==", + "dependencies": { + "fault": "^1.0.0", + "highlight.js": "~10.7.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "peer": true, + "bin": { + "lz-string": "bin/bin.js" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "devOptional": true + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz", + "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "mdast-util-to-string": "^3.1.0", + "micromark": "^3.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-decode-string": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "unist-util-stringify-position": "^3.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", + "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", + "dependencies": { + "@types/mdast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/mermaid": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-10.9.1.tgz", + "integrity": "sha512-Mx45Obds5W1UkW1nv/7dHRsbfMM1aOKA2+Pxs/IGHNonygDHwmng8xTHyS9z4KWVi0rbko8gjiBmuwwXQ7tiNA==", + "dependencies": { + "@braintree/sanitize-url": "^6.0.1", + "@types/d3-scale": "^4.0.3", + "@types/d3-scale-chromatic": "^3.0.0", + "cytoscape": "^3.28.1", + "cytoscape-cose-bilkent": "^4.1.0", + "d3": "^7.4.0", + "d3-sankey": "^0.12.3", + "dagre-d3-es": "7.0.10", + "dayjs": "^1.11.7", + "dompurify": "^3.0.5", + "elkjs": "^0.9.0", + "katex": "^0.16.9", + "khroma": "^2.0.0", + "lodash-es": "^4.17.21", + "mdast-util-from-markdown": "^1.3.0", + "non-layered-tidy-tree-layout": "^2.0.2", + "stylis": "^4.1.3", + "ts-dedent": "^2.2.0", + "uuid": "^9.0.0", + "web-worker": "^1.2.0" + } + }, + "node_modules/micromark": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz", + "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "micromark-core-commonmark": "^1.0.1", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-encode": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz", + "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-factory-destination": "^1.0.0", + "micromark-factory-label": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-factory-title": "^1.0.0", + "micromark-factory-whitespace": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-classify-character": "^1.0.0", + "micromark-util-html-tag-name": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "node_modules/micromark-factory-destination": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", + "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz", + "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", + "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz", + "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz", + "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz", + "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz", + "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz", + "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz", + "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz", + "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz", + "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz", + "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-util-html-tag-name": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz", + "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz", + "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz", + "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz", + "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-encode": "^1.0.0", + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz", + "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz", + "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromark-util-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz", + "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ] + }, + "node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "engines": { + "node": ">=4" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/next": { + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/next/-/next-14.2.5.tgz", + "integrity": "sha512-0f8aRfBVL+mpzfBjYfQuLWh2WyAwtJXCRfkPF4UJ5qd2YwrHczsrSzXU4tRMV0OAxR8ZJZWPFn6uhSC56UTsLA==", + "dependencies": { + "@next/env": "14.2.5", + "@swc/helpers": "0.5.5", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=18.17.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "14.2.5", + "@next/swc-darwin-x64": "14.2.5", + "@next/swc-linux-arm64-gnu": "14.2.5", + "@next/swc-linux-arm64-musl": "14.2.5", + "@next/swc-linux-x64-gnu": "14.2.5", + "@next/swc-linux-x64-musl": "14.2.5", + "@next/swc-win32-arm64-msvc": "14.2.5", + "@next/swc-win32-ia32-msvc": "14.2.5", + "@next/swc-win32-x64-msvc": "14.2.5" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/next-auth": { + "version": "5.0.0-beta.19", + "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-5.0.0-beta.19.tgz", + "integrity": "sha512-YHu1igcAxZPh8ZB7GIM93dqgY6gcAzq66FOhQFheAdOx1raxNcApt05nNyNCSB6NegSiyJ4XOPsaNow4pfDmsg==", + "dependencies": { + "@auth/core": "0.32.0" + }, + "peerDependencies": { + "@simplewebauthn/browser": "^9.0.1", + "@simplewebauthn/server": "^9.0.2", + "next": "^14 || ^15.0.0-0", + "nodemailer": "^6.6.5", + "react": "^18.2.0 || ^19.0.0-0" + }, + "peerDependenciesMeta": { + "@simplewebauthn/browser": { + "optional": true + }, + "@simplewebauthn/server": { + "optional": true + }, + "nodemailer": { + "optional": true + } + } + }, + "node_modules/next-intl": { + "version": "3.17.2", + "resolved": "https://registry.npmjs.org/next-intl/-/next-intl-3.17.2.tgz", + "integrity": "sha512-X2ly23e1lC5vdWHaJFBDZi/0iornEdFQQtqJmmPOb7WD+LDssm9vAnx+hJshYGjddaP3rUmyWaPgePCQqaxm1g==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/amannn" + } + ], + "dependencies": { + "@formatjs/intl-localematcher": "^0.2.32", + "negotiator": "^0.6.3", + "use-intl": "^3.17.2" + }, + "peerDependencies": { + "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/next-themes": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.3.0.tgz", + "integrity": "sha512-/QHIrsYpd6Kfk7xakK4svpDI5mmXP0gfvCoJdGpZQ2TOrQZmsW0QxjaiLn8wbIKjtm4BTSqLoix4lxYYOnLJ/w==", + "peerDependencies": { + "react": "^16.8 || ^17 || ^18", + "react-dom": "^16.8 || ^17 || ^18" + } + }, + "node_modules/next/node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz", + "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==", + "dev": true + }, + "node_modules/non-layered-tidy-tree-layout": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/non-layered-tidy-tree-layout/-/non-layered-tidy-tree-layout-2.0.2.tgz", + "integrity": "sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw==" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nwsapi": { + "version": "2.2.12", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.12.tgz", + "integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==" + }, + "node_modules/oauth4webapi": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/oauth4webapi/-/oauth4webapi-2.11.1.tgz", + "integrity": "sha512-aNzOnL98bL6izG97zgnZs1PFEyO4WDVRhz2Pd066NPak44w5ESLRCYmJIyey8avSBPOMtBjhF3ZDDm7bIb7UOg==", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", + "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "dependencies": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/character-entities": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", + "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", + "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postcss": { + "version": "8.4.40", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", + "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.1", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.0.1.tgz", + "integrity": "sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", + "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "lilconfig": "^3.0.0", + "yaml": "^2.3.4" + }, + "engines": { + "node": ">= 14" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-load-config/node_modules/lilconfig": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", + "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.1.tgz", + "integrity": "sha512-b4dlw/9V8A71rLIDsSwVmak9z2DuBUB7CA1/wSdelNEzqsjoSPeADTWNO09lpH49Diy3/JIZ2bSPB1dI3LJCHg==", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" + }, + "node_modules/preact": { + "version": "10.11.3", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.11.3.tgz", + "integrity": "sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/preact" + } + }, + "node_modules/preact-render-to-string": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-5.2.3.tgz", + "integrity": "sha512-aPDxUn5o3GhWdtJtW0svRC2SS/l8D9MAgo2+AWml+BhDImb27ALf04Q2d+AHqUUOc6RdSXFIBVa2gxzgMKgtZA==", + "dependencies": { + "pretty-format": "^3.8.0" + }, + "peerDependencies": { + "preact": ">=10" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-format": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz", + "integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==" + }, + "node_modules/prismjs": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", + "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "engines": { + "node": ">=6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/prompts/node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/property-information": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz", + "integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==", + "dependencies": { + "xtend": "^4.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==" + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/rc-cascader": { + "version": "3.27.0", + "resolved": "https://registry.npmjs.org/rc-cascader/-/rc-cascader-3.27.0.tgz", + "integrity": "sha512-z5uq8VvQadFUBiuZJ7YF5UAUGNkZtdEtcEYiIA94N/Kc2MIKr6lEbN5HyVddvYSgwWlKqnL6pH5bFXFuIK3MNg==", + "dependencies": { + "@babel/runtime": "^7.12.5", + "array-tree-filter": "^2.1.0", + "classnames": "^2.3.1", + "rc-select": "~14.15.0", + "rc-tree": "~5.8.1", + "rc-util": "^5.37.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-checkbox": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/rc-checkbox/-/rc-checkbox-3.3.0.tgz", + "integrity": "sha512-Ih3ZaAcoAiFKJjifzwsGiT/f/quIkxJoklW4yKGho14Olulwn8gN7hOBve0/WGDg5o/l/5mL0w7ff7/YGvefVw==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.3.2", + "rc-util": "^5.25.2" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-collapse": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/rc-collapse/-/rc-collapse-3.7.3.tgz", + "integrity": "sha512-60FJcdTRn0X5sELF18TANwtVi7FtModq649H11mYF1jh83DniMoM4MqY627sEKRCTm4+WXfGDcB7hY5oW6xhyw==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "2.x", + "rc-motion": "^2.3.4", + "rc-util": "^5.27.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-dialog": { + "version": "9.5.2", + "resolved": "https://registry.npmjs.org/rc-dialog/-/rc-dialog-9.5.2.tgz", + "integrity": "sha512-qVUjc8JukG+j/pNaHVSRa2GO2/KbV2thm7yO4hepQ902eGdYK913sGkwg/fh9yhKYV1ql3BKIN2xnud3rEXAPw==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/portal": "^1.0.0-8", + "classnames": "^2.2.6", + "rc-motion": "^2.3.0", + "rc-util": "^5.21.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-drawer": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/rc-drawer/-/rc-drawer-7.2.0.tgz", + "integrity": "sha512-9lOQ7kBekEJRdEpScHvtmEtXnAsy+NGDXiRWc2ZVC7QXAazNVbeT4EraQKYwCME8BJLa8Bxqxvs5swwyOepRwg==", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@rc-component/portal": "^1.1.1", + "classnames": "^2.2.6", + "rc-motion": "^2.6.1", + "rc-util": "^5.38.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-dropdown": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/rc-dropdown/-/rc-dropdown-4.2.0.tgz", + "integrity": "sha512-odM8Ove+gSh0zU27DUj5cG1gNKg7mLWBYzB5E4nNLrLwBmYEgYP43vHKDGOVZcJSVElQBI0+jTQgjnq0NfLjng==", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.2.6", + "rc-util": "^5.17.0" + }, + "peerDependencies": { + "react": ">=16.11.0", + "react-dom": ">=16.11.0" + } + }, + "node_modules/rc-field-form": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/rc-field-form/-/rc-field-form-2.2.1.tgz", + "integrity": "sha512-uoNqDoR7A4tn4QTSqoWPAzrR7ZwOK5I+vuZ/qdcHtbKx+ZjEsTg7QXm2wk/jalDiSksAQmATxL0T5LJkRREdIA==", + "dependencies": { + "@babel/runtime": "^7.18.0", + "@rc-component/async-validator": "^5.0.3", + "rc-util": "^5.32.2" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-image": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/rc-image/-/rc-image-7.9.0.tgz", + "integrity": "sha512-l4zqO5E0quuLMCtdKfBgj4Suv8tIS011F5k1zBBlK25iMjjiNHxA0VeTzGFtUZERSA45gvpXDg8/P6qNLjR25g==", + "dependencies": { + "@babel/runtime": "^7.11.2", + "@rc-component/portal": "^1.0.2", + "classnames": "^2.2.6", + "rc-dialog": "~9.5.2", + "rc-motion": "^2.6.2", + "rc-util": "^5.34.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-input": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/rc-input/-/rc-input-1.5.1.tgz", + "integrity": "sha512-+nOzQJDeIfIpNP/SgY45LXSKbuMlp4Yap2y8c+ZpU7XbLmNzUd6+d5/S75sA/52jsVE6S/AkhkkDEAOjIu7i6g==", + "dependencies": { + "@babel/runtime": "^7.11.1", + "classnames": "^2.2.1", + "rc-util": "^5.18.1" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/rc-input-number": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/rc-input-number/-/rc-input-number-9.1.0.tgz", + "integrity": "sha512-NqJ6i25Xn/AgYfVxynlevIhX3FuKlMwIFpucGG1h98SlK32wQwDK0zhN9VY32McOmuaqzftduNYWWooWz8pXQA==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/mini-decimal": "^1.0.1", + "classnames": "^2.2.5", + "rc-input": "~1.5.0", + "rc-util": "^5.40.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-mentions": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/rc-mentions/-/rc-mentions-2.14.0.tgz", + "integrity": "sha512-qKR59FMuF8PK4ZqsbWX3UuA5P1M/snzyqV6Yt3y1DCFbCEdqUGIBgQp6vEfLCO6Z0RoRFlzXtCeSlBTcDDpg1A==", + "dependencies": { + "@babel/runtime": "^7.22.5", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.2.6", + "rc-input": "~1.5.0", + "rc-menu": "~9.14.0", + "rc-textarea": "~1.7.0", + "rc-util": "^5.34.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-menu": { + "version": "9.14.1", + "resolved": "https://registry.npmjs.org/rc-menu/-/rc-menu-9.14.1.tgz", + "integrity": "sha512-5wlRb3M8S4yGlWhSoEYJ7ZVRElyScdcpUHxgiLxkeig1tEdyKrnED3B2fhpN0Rrpdp9jyhnmZR/Lwq2fH5VvDQ==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/trigger": "^2.0.0", + "classnames": "2.x", + "rc-motion": "^2.4.3", + "rc-overflow": "^1.3.1", + "rc-util": "^5.27.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-motion": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/rc-motion/-/rc-motion-2.9.2.tgz", + "integrity": "sha512-fUAhHKLDdkAXIDLH0GYwof3raS58dtNUmzLF2MeiR8o6n4thNpSDQhOqQzWE4WfFZDCi9VEN8n7tiB7czREcyw==", + "dependencies": { + "@babel/runtime": "^7.11.1", + "classnames": "^2.2.1", + "rc-util": "^5.43.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-notification": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/rc-notification/-/rc-notification-5.6.0.tgz", + "integrity": "sha512-TGQW5T7waOxLwgJG7fXcw8l7AQiFOjaZ7ISF5PrU526nunHRNcTMuzKihQHaF4E/h/KfOCDk3Mv8eqzbu2e28w==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "2.x", + "rc-motion": "^2.9.0", + "rc-util": "^5.20.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-overflow": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/rc-overflow/-/rc-overflow-1.3.2.tgz", + "integrity": "sha512-nsUm78jkYAoPygDAcGZeC2VwIg/IBGSodtOY3pMof4W3M9qRJgqaDYm03ZayHlde3I6ipliAxbN0RUcGf5KOzw==", + "dependencies": { + "@babel/runtime": "^7.11.1", + "classnames": "^2.2.1", + "rc-resize-observer": "^1.0.0", + "rc-util": "^5.37.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-pagination": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/rc-pagination/-/rc-pagination-4.2.0.tgz", + "integrity": "sha512-V6qeANJsT6tmOcZ4XiUmj8JXjRLbkusuufpuoBw2GiAn94fIixYjFLmbruD1Sbhn8fPLDnWawPp4CN37zQorvw==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.3.2", + "rc-util": "^5.38.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-picker": { + "version": "4.6.9", + "resolved": "https://registry.npmjs.org/rc-picker/-/rc-picker-4.6.9.tgz", + "integrity": "sha512-kwQq5xDNJ1VcX7pauLlVBiuQorpZGUwA/YczVJTO1e33YsTyDuVjaQkYAiAupXbEPUBCU3doGZo0J25HGq2ZOQ==", + "dependencies": { + "@babel/runtime": "^7.24.7", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.2.1", + "rc-overflow": "^1.3.2", + "rc-resize-observer": "^1.4.0", + "rc-util": "^5.43.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "date-fns": ">= 2.x", + "dayjs": ">= 1.x", + "luxon": ">= 3.x", + "moment": ">= 2.x", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + }, + "peerDependenciesMeta": { + "date-fns": { + "optional": true + }, + "dayjs": { + "optional": true + }, + "luxon": { + "optional": true + }, + "moment": { + "optional": true + } + } + }, + "node_modules/rc-progress": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rc-progress/-/rc-progress-4.0.0.tgz", + "integrity": "sha512-oofVMMafOCokIUIBnZLNcOZFsABaUw8PPrf1/y0ZBvKZNpOiu5h4AO9vv11Sw0p4Hb3D0yGWuEattcQGtNJ/aw==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.2.6", + "rc-util": "^5.16.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-rate": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/rc-rate/-/rc-rate-2.13.0.tgz", + "integrity": "sha512-oxvx1Q5k5wD30sjN5tqAyWTvJfLNNJn7Oq3IeS4HxWfAiC4BOXMITNAsw7u/fzdtO4MS8Ki8uRLOzcnEuoQiAw==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.2.5", + "rc-util": "^5.0.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-resize-observer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/rc-resize-observer/-/rc-resize-observer-1.4.0.tgz", + "integrity": "sha512-PnMVyRid9JLxFavTjeDXEXo65HCRqbmLBw9xX9gfC4BZiSzbLXKzW3jPz+J0P71pLbD5tBMTT+mkstV5gD0c9Q==", + "dependencies": { + "@babel/runtime": "^7.20.7", + "classnames": "^2.2.1", + "rc-util": "^5.38.0", + "resize-observer-polyfill": "^1.5.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-segmented": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/rc-segmented/-/rc-segmented-2.3.0.tgz", + "integrity": "sha512-I3FtM5Smua/ESXutFfb8gJ8ZPcvFR+qUgeeGFQHBOvRiRKyAk4aBE5nfqrxXx+h8/vn60DQjOt6i4RNtrbOobg==", + "dependencies": { + "@babel/runtime": "^7.11.1", + "classnames": "^2.2.1", + "rc-motion": "^2.4.4", + "rc-util": "^5.17.0" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/rc-select": { + "version": "14.15.1", + "resolved": "https://registry.npmjs.org/rc-select/-/rc-select-14.15.1.tgz", + "integrity": "sha512-mGvuwW1RMm1NCSI8ZUoRoLRK51R2Nb+QJnmiAvbDRcjh2//ulCkxeV6ZRFTECPpE1t2DPfyqZMPw90SVJzQ7wQ==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/trigger": "^2.1.1", + "classnames": "2.x", + "rc-motion": "^2.0.1", + "rc-overflow": "^1.3.1", + "rc-util": "^5.16.1", + "rc-virtual-list": "^3.5.2" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, + "node_modules/rc-slider": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/rc-slider/-/rc-slider-10.6.2.tgz", + "integrity": "sha512-FjkoFjyvUQWcBo1F3RgSglky3ar0+qHLM41PlFVYB4Bj3RD8E/Mv7kqMouLFBU+3aFglMzzctAIWRwajEuueSw==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.2.5", + "rc-util": "^5.36.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-steps": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/rc-steps/-/rc-steps-6.0.1.tgz", + "integrity": "sha512-lKHL+Sny0SeHkQKKDJlAjV5oZ8DwCdS2hFhAkIjuQt1/pB81M0cA0ErVFdHq9+jmPmFw1vJB2F5NBzFXLJxV+g==", + "dependencies": { + "@babel/runtime": "^7.16.7", + "classnames": "^2.2.3", + "rc-util": "^5.16.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-switch": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rc-switch/-/rc-switch-4.1.0.tgz", + "integrity": "sha512-TI8ufP2Az9oEbvyCeVE4+90PDSljGyuwix3fV58p7HV2o4wBnVToEyomJRVyTaZeqNPAp+vqeo4Wnj5u0ZZQBg==", + "dependencies": { + "@babel/runtime": "^7.21.0", + "classnames": "^2.2.1", + "rc-util": "^5.30.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-table": { + "version": "7.45.7", + "resolved": "https://registry.npmjs.org/rc-table/-/rc-table-7.45.7.tgz", + "integrity": "sha512-wi9LetBL1t1csxyGkMB2p3mCiMt+NDexMlPbXHvQFmBBAsMxrgNSAPwUci2zDLUq9m8QdWc1Nh8suvrpy9mXrg==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "@rc-component/context": "^1.4.0", + "classnames": "^2.2.5", + "rc-resize-observer": "^1.1.0", + "rc-util": "^5.37.0", + "rc-virtual-list": "^3.14.2" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-tabs": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/rc-tabs/-/rc-tabs-15.1.1.tgz", + "integrity": "sha512-Tc7bJvpEdkWIVCUL7yQrMNBJY3j44NcyWS48jF/UKMXuUlzaXK+Z/pEL5LjGcTadtPvVmNqA40yv7hmr+tCOAw==", + "dependencies": { + "@babel/runtime": "^7.11.2", + "classnames": "2.x", + "rc-dropdown": "~4.2.0", + "rc-menu": "~9.14.0", + "rc-motion": "^2.6.2", + "rc-resize-observer": "^1.0.0", + "rc-util": "^5.34.1" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-textarea": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/rc-textarea/-/rc-textarea-1.7.0.tgz", + "integrity": "sha512-UxizYJkWkmxP3zofXgc487QiGyDmhhheDLLjIWbFtDmiru1ls30KpO8odDaPyqNUIy9ugj5djxTEuezIn6t3Jg==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "^2.2.1", + "rc-input": "~1.5.0", + "rc-resize-observer": "^1.0.0", + "rc-util": "^5.27.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-tooltip": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/rc-tooltip/-/rc-tooltip-6.2.0.tgz", + "integrity": "sha512-iS/3iOAvtDh9GIx1ulY7EFUXUtktFccNLsARo3NPgLf0QW9oT0w3dA9cYWlhqAKmD+uriEwdWz1kH0Qs4zk2Aw==", + "dependencies": { + "@babel/runtime": "^7.11.2", + "@rc-component/trigger": "^2.0.0", + "classnames": "^2.3.1" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-tree": { + "version": "5.8.8", + "resolved": "https://registry.npmjs.org/rc-tree/-/rc-tree-5.8.8.tgz", + "integrity": "sha512-S+mCMWo91m5AJqjz3PdzKilGgbFm7fFJRFiTDOcoRbD7UfMOPnerXwMworiga0O2XIo383UoWuEfeHs1WOltag==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "2.x", + "rc-motion": "^2.0.1", + "rc-util": "^5.16.1", + "rc-virtual-list": "^3.5.1" + }, + "engines": { + "node": ">=10.x" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, + "node_modules/rc-tree-select": { + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/rc-tree-select/-/rc-tree-select-5.22.1.tgz", + "integrity": "sha512-b8mAK52xEpRgS+b2PTapCt29GoIrO5cO8jB7AfHttFsIJfcnynY9FCtnYzURsKXJkGHbFY6UzSEB2I3TETtdWg==", + "dependencies": { + "@babel/runtime": "^7.10.1", + "classnames": "2.x", + "rc-select": "~14.15.0", + "rc-tree": "~5.8.1", + "rc-util": "^5.16.1" + }, + "peerDependencies": { + "react": "*", + "react-dom": "*" + } + }, + "node_modules/rc-upload": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/rc-upload/-/rc-upload-4.6.0.tgz", + "integrity": "sha512-Zr0DT1NHw/ApxrP7UAoxOtGaVYuzarrrCVr0ld7RiEFsKX07uFhE1EpCBxwL11ruFn89GMcshOKWp+s6FLyAlA==", + "dependencies": { + "@babel/runtime": "^7.18.3", + "classnames": "^2.2.5", + "rc-util": "^5.2.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-util": { + "version": "5.43.0", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-5.43.0.tgz", + "integrity": "sha512-AzC7KKOXFqAdIBqdGWepL9Xn7cm3vnAmjlHqUnoQaTMZYhM4VlXGLkkHHxj/BZ7Td0+SOPKB4RGPboBVKT9htw==", + "dependencies": { + "@babel/runtime": "^7.18.3", + "react-is": "^18.2.0" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/rc-util/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" + }, + "node_modules/rc-virtual-list": { + "version": "3.14.5", + "resolved": "https://registry.npmjs.org/rc-virtual-list/-/rc-virtual-list-3.14.5.tgz", + "integrity": "sha512-ZMOnkCLv2wUN8Jz7yI4XiSLa9THlYvf00LuMhb1JlsQCewuU7ydPuHw1rGVPhe9VZYl/5UqODtNd7QKJ2DMGfg==", + "dependencies": { + "@babel/runtime": "^7.20.0", + "classnames": "^2.2.6", + "rc-resize-observer": "^1.0.0", + "rc-util": "^5.36.0" + }, + "engines": { + "node": ">=8.x" + }, + "peerDependencies": { + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-apexcharts": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/react-apexcharts/-/react-apexcharts-1.4.1.tgz", + "integrity": "sha512-G14nVaD64Bnbgy8tYxkjuXEUp/7h30Q0U33xc3AwtGFijJB9nHqOt1a6eG0WBn055RgRg+NwqbKGtqPxy15d0Q==", + "dependencies": { + "prop-types": "^15.8.1" + }, + "peerDependencies": { + "apexcharts": "^3.41.0", + "react": ">=0.13" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-fast-compare": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz", + "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==" + }, + "node_modules/react-icons": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.2.1.tgz", + "integrity": "sha512-zdbW5GstTzXaVKvGSyTaBalt7HSfuK5ovrzlpyiWHAFXndXTdd/1hdDHI4xBM1Mn7YriT6aqESucFl9kEXzrdw==", + "peerDependencies": { + "react": "*" + } + }, + "node_modules/react-intersection-observer": { + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.13.0.tgz", + "integrity": "sha512-y0UvBfjDiXqC8h0EWccyaj4dVBWMxgEx0t5RGNzQsvkfvZwugnKwxpu70StY4ivzYuMajavwUDjH4LJyIki9Lw==", + "peerDependencies": { + "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, + "node_modules/react-latex-next": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/react-latex-next/-/react-latex-next-3.0.0.tgz", + "integrity": "sha512-x70f1b1G7TronVigsRgKHKYYVUNfZk/3bciFyYX1lYLQH2y3/TXku3+5Vap8MDbJhtopePSYBsYWS6jhzIdz+g==", + "dependencies": { + "katex": "^0.16.0" + }, + "engines": { + "node": ">=12", + "npm": ">=5" + }, + "peerDependencies": { + "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/react-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/react-property/-/react-property-2.0.2.tgz", + "integrity": "sha512-+PbtI3VuDV0l6CleQMsx2gtK0JZbZKbpdu5ynr+lbsuvtmgbNcS3VM0tuY2QjFNOcWxvXeHjDpy42RO+4U2rug==" + }, + "node_modules/react-syntax-highlighter": { + "version": "15.5.0", + "resolved": "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz", + "integrity": "sha512-+zq2myprEnQmH5yw6Gqc8lD55QHnpKaU8TOcFeC/Lg/MQSs8UknEA0JC4nTZGFAXC2J2Hyj/ijJ7NlabyPi2gg==", + "dependencies": { + "@babel/runtime": "^7.3.1", + "highlight.js": "^10.4.1", + "lowlight": "^1.17.0", + "prismjs": "^1.27.0", + "refractor": "^3.6.0" + }, + "peerDependencies": { + "react": ">= 0.14.0" + } + }, + "node_modules/react-toastify": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-10.0.5.tgz", + "integrity": "sha512-mNKt2jBXJg4O7pSdbNUfDdTsK9FIdikfsIE/yUCxbAEXl4HMyJaivrVFcn3Elvt5xvCQYhUZm+hqTIu1UXM3Pw==", + "dependencies": { + "clsx": "^2.1.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", + "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.1", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/refractor": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/refractor/-/refractor-3.6.0.tgz", + "integrity": "sha512-MY9W41IOWxxk31o+YvFCNyNzdkc9M20NoZK5vq6jkv4I/uh2zkWcfudj0Q1fovjUQJrNewS9NMzeTtqPf+n5EA==", + "dependencies": { + "hastscript": "^6.0.0", + "parse-entities": "^2.0.0", + "prismjs": "~1.27.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/refractor/node_modules/prismjs": { + "version": "1.27.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.27.0.tgz", + "integrity": "sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", + "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "set-function-name": "^2.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" + }, + "node_modules/resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/robust-predicates": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz", + "integrity": "sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==" + }, + "node_modules/rrweb-cssom": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", + "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==" + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" + }, + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", + "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "get-intrinsic": "^1.2.4", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-regex-test": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", + "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/scroll-into-view-if-needed": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz", + "integrity": "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==", + "dependencies": { + "compute-scroll-into-view": "^3.0.2" + } + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/space-separated-tokens": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz", + "integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stop-iteration-iterator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "dev": true, + "dependencies": { + "internal-slot": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string-convert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz", + "integrity": "sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==" + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/string.prototype.includes": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.includes/-/string.prototype.includes-2.0.0.tgz", + "integrity": "sha512-E34CkBgyeqNDcrbU76cDjL5JLcVrtSdYq0MEh/B10r17pRP4ciHLwTgnuLV8Ay6cgEMLkcBkFCKyFZ43YldYzg==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", + "integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.7", + "regexp.prototype.flags": "^1.5.2", + "set-function-name": "^2.0.2", + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", + "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", + "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/style-to-js": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.8.tgz", + "integrity": "sha512-bPSspCXkkhETLXnEgDbaoWRWyv3lF2bj32YIc8IElok2IIMHUlZtQUrxYmAkKUNxpluhH0qnKWrmuoXUyTY12g==", + "dependencies": { + "style-to-object": "1.0.3" + } + }, + "node_modules/style-to-object": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.3.tgz", + "integrity": "sha512-xOpx7S53E0V3DpVsvt7ySvoiumRpfXiC99PUXLqGB3wiAnN9ybEIpuzlZ8LAZg+h1sl9JkEUwtSQXxcCgFqbbg==", + "dependencies": { + "inline-style-parser": "0.2.2" + } + }, + "node_modules/styled-jsx": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", + "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/stylis": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.2.tgz", + "integrity": "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==" + }, + "node_modules/sucrase": { + "version": "3.35.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.0.tgz", + "integrity": "sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "glob": "^10.3.10", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/svg.draggable.js": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/svg.draggable.js/-/svg.draggable.js-2.2.2.tgz", + "integrity": "sha512-JzNHBc2fLQMzYCZ90KZHN2ohXL0BQJGQimK1kGk6AvSeibuKcIdDX9Kr0dT9+UJ5O8nYA0RB839Lhvk4CY4MZw==", + "dependencies": { + "svg.js": "^2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.easing.js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/svg.easing.js/-/svg.easing.js-2.0.0.tgz", + "integrity": "sha512-//ctPdJMGy22YoYGV+3HEfHbm6/69LJUTAqI2/5qBvaNHZ9uUFVC82B0Pl299HzgH13rKrBgi4+XyXXyVWWthA==", + "dependencies": { + "svg.js": ">=2.3.x" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.filter.js": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/svg.filter.js/-/svg.filter.js-2.0.2.tgz", + "integrity": "sha512-xkGBwU+dKBzqg5PtilaTb0EYPqPfJ9Q6saVldX+5vCRy31P6TlRCP3U9NxH3HEufkKkpNgdTLBJnmhDHeTqAkw==", + "dependencies": { + "svg.js": "^2.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.js": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/svg.js/-/svg.js-2.7.1.tgz", + "integrity": "sha512-ycbxpizEQktk3FYvn/8BH+6/EuWXg7ZpQREJvgacqn46gIddG24tNNe4Son6omdXCnSOaApnpZw6MPCBA1dODA==" + }, + "node_modules/svg.pathmorphing.js": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/svg.pathmorphing.js/-/svg.pathmorphing.js-0.1.3.tgz", + "integrity": "sha512-49HWI9X4XQR/JG1qXkSDV8xViuTLIWm/B/7YuQELV5KMOPtXjiwH4XPJvr/ghEDibmLQ9Oc22dpWpG0vUDDNww==", + "dependencies": { + "svg.js": "^2.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.resize.js": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/svg.resize.js/-/svg.resize.js-1.4.3.tgz", + "integrity": "sha512-9k5sXJuPKp+mVzXNvxz7U0uC9oVMQrrf7cFsETznzUDDm0x8+77dtZkWdMfRlmbkEEYvUn9btKuZ3n41oNA+uw==", + "dependencies": { + "svg.js": "^2.6.5", + "svg.select.js": "^2.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.resize.js/node_modules/svg.select.js": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-2.1.2.tgz", + "integrity": "sha512-tH6ABEyJsAOVAhwcCjF8mw4crjXSI1aa7j2VQR8ZuJ37H2MBUbyeqYr5nEO7sSN3cy9AR9DUwNg0t/962HlDbQ==", + "dependencies": { + "svg.js": "^2.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/svg.select.js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-3.0.1.tgz", + "integrity": "sha512-h5IS/hKkuVCbKSieR9uQCj9w+zLHoPh+ce19bBYyqF53g6mnPB8sAtIbe1s9dh2S2fCmYX2xel1Ln3PJBbK4kw==", + "dependencies": { + "svg.js": "^2.6.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" + }, + "node_modules/tailwind-scrollbar": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tailwind-scrollbar/-/tailwind-scrollbar-3.1.0.tgz", + "integrity": "sha512-pmrtDIZeHyu2idTejfV59SbaJyvp1VRjYxAjZBH0jnyrPRo6HL1kD5Glz8VPagasqr6oAx6M05+Tuw429Z8jxg==", + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "tailwindcss": "3.x" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.7.tgz", + "integrity": "sha512-rxWZbe87YJb4OcSopb7up2Ba4U82BoiSGUdoDr3Ydrg9ckxFS/YWsvhN323GMcddgU65QRy7JndC7ahhInhvlQ==", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.5.3", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.0", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.0", + "lilconfig": "^2.1.0", + "micromatch": "^4.0.5", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.0.0", + "postcss": "^8.4.23", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", + "postcss-selector-parser": "^6.0.11", + "resolve": "^1.22.2", + "sucrase": "^3.32.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/throttle-debounce": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-5.0.2.tgz", + "integrity": "sha512-B71/4oyj61iNH0KeCamLuE2rmKuTO5byTOSVwECM5FA7TiAiAW+UqTKZ9ERueC4qvgSttUhdmq1mXC3kJqGX7A==", + "engines": { + "node": ">=12.22" + } + }, + "node_modules/tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, + "node_modules/tippy.js": { + "version": "6.3.7", + "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", + "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", + "dependencies": { + "@popperjs/core": "^2.9.0" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toggle-selection": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", + "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==" + }, + "node_modules/tough-cookie": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tr46": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/ts-dedent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.2.0.tgz", + "integrity": "sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==", + "engines": { + "node": ">=6.10" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "devOptional": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "devOptional": true + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "devOptional": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", + "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", + "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", + "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", + "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-proto": "^1.0.3", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "devOptional": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "devOptional": true + }, + "node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "dependencies": { + "@types/unist": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.2", + "picocolors": "^1.0.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/use-intl": { + "version": "3.17.2", + "resolved": "https://registry.npmjs.org/use-intl/-/use-intl-3.17.2.tgz", + "integrity": "sha512-9lPgt41nS8x4AYCLfIC9VKCmamnVxzPM2nze7lpp/I1uaSSQvIz5MQpYUFikv08cMUsCwAWahU0e+arHInpdcw==", + "dependencies": { + "@formatjs/fast-memoize": "^2.2.0", + "intl-messageformat": "^10.5.14" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/uvu": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", + "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", + "dependencies": { + "dequal": "^2.0.0", + "diff": "^5.0.0", + "kleur": "^4.0.3", + "sade": "^1.7.3" + }, + "bin": { + "uvu": "bin.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "devOptional": true + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/web-worker": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.3.0.tgz", + "integrity": "sha512-BSR9wyRsy/KOValMgd5kMyr3JzpdeoR9KVId8u5GVlTTAtNChlsE4yTxeY7zMdNSyOmoKBv8NH2qeRY9Tg+IaA==" + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", + "dependencies": { + "tr46": "^5.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz", + "integrity": "sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==", + "dev": true, + "dependencies": { + "function.prototype.name": "^1.1.5", + "has-tostringtag": "^1.0.0", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", + "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/yaml": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", + "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "devOptional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/zbook_frontend/package.json b/zbook_frontend/package.json new file mode 100644 index 0000000..5071a7b --- /dev/null +++ b/zbook_frontend/package.json @@ -0,0 +1,63 @@ +{ + "name": "zbook_frontend", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint", + "test": "jest", + "test:watch": "jest --watch" + }, + "dependencies": { + "@headlessui/react": "^1.7.18", + "@heroicons/react": "^2.1.3", + "@tippyjs/react": "^4.2.6", + "antd": "^5.15.3", + "apexcharts": "^3.48.0", + "chalk": "^5.3.0", + "d3": "^7.9.0", + "d3-geo": "^3.1.1", + "d3-geo-projection": "^4.0.0", + "formik": "^2.4.5", + "framer-motion": "^11.2.5", + "html-react-parser": "^4.2.10", + "jsdom": "^24.0.0", + "mermaid": "^10.9.0", + "next": "14.2.5", + "next-auth": "^5.0.0-beta.19", + "next-intl": "^3.15.3", + "next-themes": "^0.3.0", + "react": "^18", + "react-apexcharts": "^1.4.1", + "react-dom": "^18", + "react-icons": "^5.0.1", + "react-intersection-observer": "^9.8.1", + "react-latex-next": "3.0.0", + "react-syntax-highlighter": "^15.5.0", + "react-toastify": "^10.0.5", + "tailwind-scrollbar": "^3.1.0" + }, + "devDependencies": { + "@tailwindcss/typography": "^0.5.13", + "@testing-library/jest-dom": "^6.4.8", + "@testing-library/react": "^16.0.0", + "@types/d3": "^7.4.3", + "@types/jest": "^29.5.12", + "@types/jsdom": "^21.1.7", + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "@types/react-syntax-highlighter": "^15.5.13", + "eslint": "^8", + "eslint-config-next": "14.2.5", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "postcss": "^8", + "prettier": "3.3.3", + "tailwindcss": "^3.4.1", + "ts-node": "^10.9.2", + "typescript": "^5.5.4" + } +} diff --git a/zbook_frontend/postcss.config.mjs b/zbook_frontend/postcss.config.mjs new file mode 100644 index 0000000..1a69fd2 --- /dev/null +++ b/zbook_frontend/postcss.config.mjs @@ -0,0 +1,8 @@ +/** @type {import('postcss-load-config').Config} */ +const config = { + plugins: { + tailwindcss: {}, + }, +}; + +export default config; diff --git a/zbook_frontend/public/admin_dark.png b/zbook_frontend/public/admin_dark.png new file mode 100644 index 0000000..228c785 Binary files /dev/null and b/zbook_frontend/public/admin_dark.png differ diff --git a/zbook_frontend/public/admin_light.png b/zbook_frontend/public/admin_light.png new file mode 100644 index 0000000..df8d27e Binary files /dev/null and b/zbook_frontend/public/admin_light.png differ diff --git a/zbook_frontend/public/create_repo_dark.png b/zbook_frontend/public/create_repo_dark.png new file mode 100644 index 0000000..16a1330 Binary files /dev/null and b/zbook_frontend/public/create_repo_dark.png differ diff --git a/zbook_frontend/public/create_repo_light.png b/zbook_frontend/public/create_repo_light.png new file mode 100644 index 0000000..de7fa2e Binary files /dev/null and b/zbook_frontend/public/create_repo_light.png differ diff --git a/zbook_frontend/public/dashboard_dark.png b/zbook_frontend/public/dashboard_dark.png new file mode 100644 index 0000000..166f0ba Binary files /dev/null and b/zbook_frontend/public/dashboard_dark.png differ diff --git a/zbook_frontend/public/dashboard_light.png b/zbook_frontend/public/dashboard_light.png new file mode 100644 index 0000000..f33a862 Binary files /dev/null and b/zbook_frontend/public/dashboard_light.png differ diff --git a/zbook_frontend/public/favicon.ico b/zbook_frontend/public/favicon.ico new file mode 100644 index 0000000..43401a4 Binary files /dev/null and b/zbook_frontend/public/favicon.ico differ diff --git a/zbook_frontend/public/feature_dark.png b/zbook_frontend/public/feature_dark.png new file mode 100644 index 0000000..07bc157 Binary files /dev/null and b/zbook_frontend/public/feature_dark.png differ diff --git a/zbook_frontend/public/feature_light.png b/zbook_frontend/public/feature_light.png new file mode 100644 index 0000000..51a135f Binary files /dev/null and b/zbook_frontend/public/feature_light.png differ diff --git a/zbook_frontend/public/login.png b/zbook_frontend/public/login.png new file mode 100644 index 0000000..aa94da2 Binary files /dev/null and b/zbook_frontend/public/login.png differ diff --git a/zbook_frontend/public/logo_128.png b/zbook_frontend/public/logo_128.png new file mode 100644 index 0000000..f4376c4 Binary files /dev/null and b/zbook_frontend/public/logo_128.png differ diff --git a/zbook_frontend/public/logo_256.png b/zbook_frontend/public/logo_256.png new file mode 100644 index 0000000..55970bc Binary files /dev/null and b/zbook_frontend/public/logo_256.png differ diff --git a/zbook_frontend/public/ne_110m_lakes.geojson b/zbook_frontend/public/ne_110m_lakes.geojson new file mode 100644 index 0000000..1225bab --- /dev/null +++ b/zbook_frontend/public/ne_110m_lakes.geojson @@ -0,0 +1 @@ +{"type":"FeatureCollection","name":"ne_110m_lakes","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"features":[{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Baikal","name_alt":null,"admin":null,"min_zoom":1,"min_label":3,"name_abb":"L. Baikal","label":"Lake Baikal","wikidataid":"Q5513","name_ar":"بحيرة بايكال","name_bn":"বৈকাল হ্রদ","name_de":"Baikalsee","name_en":"Baikal","name_es":"Baikal","name_fr":"Baïkal","name_el":"Βαϊκάλη","name_hi":"बयकाल झील","name_hu":"Bajkál-tó","name_id":"Danau Baikal","name_it":"Bajkal","name_ja":"バイカル湖","name_ko":"바이칼호","name_nl":"Baikalmeer","name_pl":"Bajkał","name_pt":"Baikal","name_ru":"Байкал","name_sv":"Bajkalsjön","name_tr":"Baykal","name_vi":"Baikal","name_zh":"贝加尔湖","ne_id":1159113127,"name_fa":"دریاچه بایکال","name_he":"ימת באיקל","name_uk":"Байкал","name_ur":"جھیل بیکال","name_zht":"贝加尔湖"},"bbox":[103.620011,51.460012,109.929807,55.730914],"geometry":{"type":"Polygon","coordinates":[[[106.579986,52.799982],[106.539988,52.939999],[107.080007,53.18001],[107.299994,53.379998],[107.599975,53.519989],[108.039948,53.859969],[108.379979,54.259996],[109.052703,55.027598],[109.19347,55.535603],[109.506991,55.730914],[109.929807,55.712956],[109.700002,54.980004],[109.660005,54.719994],[109.479964,54.339991],[109.319974,53.819997],[109.220031,53.619983],[108.999993,53.780025],[108.600018,53.439994],[108.800005,53.379998],[108.760008,53.200009],[108.459974,53.140013],[108.179991,52.799982],[107.799963,52.579995],[107.319992,52.420005],[106.640034,52.320011],[106.100015,52.039976],[105.740037,51.759993],[105.240016,51.520008],[104.81999,51.460012],[104.300022,51.500009],[103.760003,51.600003],[103.620011,51.739995],[103.859997,51.859987],[104.399964,51.859987],[105.059975,52.000005],[105.480001,52.280013],[105.980022,52.519999],[106.260005,52.619993],[106.579986,52.799982]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Winnipeg","name_alt":null,"admin":null,"min_zoom":1,"min_label":3,"name_abb":"L. Winnipeg","label":"Lake Winnipeg","wikidataid":"Q3272","name_ar":"بحيرة وينيبيغ","name_bn":"লেক উইন্নিপেগ","name_de":"Winnipegsee","name_en":"Winnipeg","name_es":"Winnipeg","name_fr":"Winnipeg","name_el":"Λίμνη Γουίνιπεγκ","name_hi":"विनिपेग झील","name_hu":"Winnipeg-tó","name_id":"Danau Winnipeg","name_it":"Winnipeg","name_ja":"ウィニペグ湖","name_ko":"위니펙호","name_nl":"Winnipegmeer","name_pl":"Winnipeg","name_pt":"Winnipeg","name_ru":"Виннипег","name_sv":"Winnipegsjön","name_tr":"Winnipeg","name_vi":"Winnipeg","name_zh":"溫尼伯湖","ne_id":1159106747,"name_fa":"دریاچه وینیپگ","name_he":"אגם ויניפג","name_uk":"Вінніпег","name_ur":"جھیل ونیپیگ","name_zht":"溫尼伯湖"},"bbox":[-99.236805,50.448911,-96.237893,54.337097],"geometry":{"type":"Polygon","coordinates":[[[-98.955401,53.929783],[-97.957995,54.337097],[-97.805006,54.059388],[-97.643802,53.425215],[-96.392586,51.397302],[-96.237893,50.691015],[-96.725589,50.448911],[-96.921107,50.75406],[-97.235687,51.497787],[-98.200977,52.184567],[-99.236805,53.216287],[-98.955401,53.929783]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Great Slave Lake","name_alt":null,"admin":null,"min_zoom":1,"min_label":3,"name_abb":"Great Slave L.","label":"Great Slave Lake","wikidataid":"Q5539","name_ar":"بحيرة جريت سليف","name_bn":"গ্রেট স্লেভ লেক","name_de":"Großer Sklavensee","name_en":"Great Slave","name_es":"Gran Esclavo","name_fr":"Grand Esclaves","name_el":"Μεγάλη Λίμνη των Σκλάβων","name_hi":"ग्रेट स्लाव झील","name_hu":"Nagy-Rabszolga-tó","name_id":"Danau Great Slave","name_it":"Grande Schiavi","name_ja":"グレートスレーブ湖","name_ko":"그레이트슬레이브호","name_nl":"Great Slave","name_pl":"Wielkie Jezioro Niewolnicze","name_pt":"Grande Escravo","name_ru":"Большое Невольничье озеро","name_sv":"Stora Slavsjön","name_tr":"Büyük Esir","name_vi":"Slave Lớn","name_zh":"大奴湖","ne_id":1159106729,"name_fa":"دریاچه گریت اسلیو","name_he":"ימת העבדים הגדולה","name_uk":"Велике Невільниче озеро","name_ur":"گریٹ سلیو جھیل","name_zht":"大奴湖"},"bbox":[-118.384991,60.860006,-109.090106,63.08],"geometry":{"type":"Polygon","coordinates":[[[-115,61.972393],[-115.806698,62.541713],[-116.058595,62.778804],[-115.842794,62.750304],[-114.452595,62.428205],[-113.353411,62.044482],[-111.778908,62.443605],[-111.040013,62.92001],[-110.200012,63.08],[-109.400009,62.878178],[-109.090106,62.814099],[-109.116512,62.692814],[-110.100897,62.515616],[-111.275993,62.349114],[-112.63051,61.559912],[-113.640009,61.079993],[-115.34099,60.876595],[-116.439993,60.860006],[-118.061109,61.311968],[-118.347474,61.361371],[-118.384991,61.521103],[-118.179603,61.556295],[-116.802813,61.325895],[-115.678799,61.69179],[-115,61.972393]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Ontario","name_alt":"Great Lakes","admin":"admin-0","min_zoom":1,"min_label":3,"name_abb":"L. Ontario","label":"Lake Ontario","wikidataid":"Q1062","name_ar":"بحيرة أونتاريو","name_bn":"লেক অন্টারিও","name_de":"Ontariosee","name_en":"Ontario","name_es":"Ontario","name_fr":"Ontario","name_el":"Λίμνη Οντάριο","name_hi":"ओण्टारियो झील","name_hu":"Ontario-tó","name_id":"Danau Ontario","name_it":"Ontario","name_ja":"オンタリオ湖","name_ko":"온타리오호","name_nl":"Ontariomeer","name_pl":"Ontario","name_pt":"Ontário","name_ru":"Онтарио","name_sv":"Ontariosjön","name_tr":"Ontario","name_vi":"Ontario","name_zh":"安大略湖","ne_id":1159106765,"name_fa":"دریاچه انتاریو","name_he":"ימת אונטריו","name_uk":"Онтаріо","name_ur":"جھیل انٹاریو","name_zht":"安大略湖"},"bbox":[-79.760475,43.202376,-76.179996,44.208025],"geometry":{"type":"Polygon","coordinates":[[[-79.056306,43.254104],[-79.361688,43.202376],[-79.760475,43.297202],[-79.461165,43.639197],[-79.156171,43.757433],[-78.450529,43.903186],[-77.605361,44.039328],[-77.161486,43.85014],[-76.882692,44.069455],[-76.565554,44.208025],[-76.353034,44.134671],[-76.239269,43.97915],[-76.179996,43.590001],[-76.930002,43.259995],[-77.749151,43.342833],[-78.534994,43.379988],[-79.056306,43.254104]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Erie","name_alt":"Great Lakes","admin":"admin-0","min_zoom":1,"min_label":3,"name_abb":"L. Erie","label":"Lake Erie","wikidataid":"Q5492","name_ar":"بحيرة إري","name_bn":"ইরি হ্রদ","name_de":"Eriesee","name_en":"Erie","name_es":"Erie","name_fr":"Érié","name_el":"Λίμνη Ήρι","name_hi":"ईरी झील","name_hu":"Erie-tó","name_id":"Danau Erie","name_it":"Erie","name_ja":"エリー湖","name_ko":"이리호","name_nl":"Eriemeer","name_pl":"Erie","name_pt":"Erie","name_ru":"Эри","name_sv":"Eriesjön","name_tr":"Erie","name_vi":"Erie","name_zh":"伊利湖","ne_id":1159106757,"name_fa":"دریاچه ایری","name_he":"ימת אירי","name_uk":"Ері","name_ur":"جھیل ایری","name_zht":"伊利湖"},"bbox":[-83.462833,41.435921,-78.900579,42.965001],"geometry":{"type":"Polygon","coordinates":[[[-83.120011,42.080016],[-82.571233,42.017022],[-81.829186,42.33553],[-81.392262,42.615177],[-81.094967,42.660756],[-80.545156,42.56009],[-80.279177,42.715662],[-79.791351,42.842036],[-78.920009,42.965001],[-78.900579,42.866712],[-79.762206,42.269617],[-80.516449,41.980332],[-81.031198,41.845508],[-81.623514,41.568936],[-82.347449,41.435921],[-82.8461,41.487106],[-83.462833,41.693967],[-83.120011,42.080016],[-83.120011,42.080016]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Superior","name_alt":"Great Lakes","admin":"admin-0","min_zoom":1,"min_label":3,"name_abb":"L. Superior","label":"Lake Superior","wikidataid":"Q1066","name_ar":"بحيرة سوبيريور","name_bn":"সুপিরিয়র হ্রদ","name_de":"Oberer","name_en":"Superior","name_es":"Superior","name_fr":"Supérieur","name_el":"λίμνη Σουπίριορ","name_hi":"सुपीरियर झील","name_hu":"Felső-tó","name_id":"Danau Superior","name_it":"Superiore","name_ja":"スペリオル湖","name_ko":"슈피리어호","name_nl":"Bovenmeer","name_pl":"Jezioro Górne","name_pt":"Superior","name_ru":"Верхнее озеро","name_sv":"Övre sjön","name_tr":"Superior","name_vi":"Thượng","name_zh":"苏必利尔湖","ne_id":1159112991,"name_fa":"دریاچه سوپریور","name_he":"ימת סופיריור","name_uk":"Озеро Верхнє","name_ur":"جھیل سپیریئر","name_zht":"苏必利尔湖"},"bbox":[-92.011923,46.439595,-84.395592,48.936703],"geometry":{"type":"Polygon","coordinates":[[[-89.600003,48.00999],[-89.194059,48.405469],[-88.626419,48.562514],[-88.404237,48.806324],[-88.178953,48.936703],[-87.249036,48.735113],[-86.560008,48.711084],[-86.32103,48.577294],[-85.986529,48.010351],[-84.86422,47.860076],[-85.040618,47.575701],[-84.645009,47.282205],[-84.815283,46.902331],[-84.395592,46.776835],[-84.604908,46.439595],[-84.910005,46.480006],[-85.119993,46.760014],[-86.10262,46.672655],[-86.990008,46.450007],[-87.69428,46.831044],[-88.261222,46.958581],[-87.939924,47.485913],[-88.822609,47.154796],[-89.624989,46.830837],[-90.397035,46.576486],[-91.009995,46.920005],[-92.011923,46.711671],[-92.008771,46.858432],[-91.330001,47.280008],[-90.619993,47.68001],[-89.600003,48.00999]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Victoria","name_alt":null,"admin":"admin-0","min_zoom":1,"min_label":3,"name_abb":"L. Victoria","label":"Lake Victoria","wikidataid":"Q5505","name_ar":"بحيرة فيكتوريا","name_bn":"ভিক্টোরিয়া হ্রদ","name_de":"Victoriasee","name_en":"Nyanza","name_es":"Victoria","name_fr":"Victoria","name_el":"Βικτόρια","name_hi":"विक्टोरिया झील","name_hu":"Viktória-tó","name_id":"Danau Victoria","name_it":"Vittoria","name_ja":"ヴィクトリア湖","name_ko":"빅토리아호","name_nl":"Victoriameer","name_pl":"Jezioro Wiktorii","name_pt":"Vitória","name_ru":"Виктория","name_sv":"Victoriasjön","name_tr":"Victoria","name_vi":"Victoria","name_zh":"維多利亞湖","ne_id":1159113191,"name_fa":"دریاچه ویکتوریا","name_he":"אגם ויקטוריה","name_uk":"Вікторія","name_ur":"جھیل وکٹوریہ","name_zht":"維多利亞湖"},"bbox":[31.648022,-2.714511,34.136242,0.324993],"geometry":{"type":"Polygon","coordinates":[[[33.850368,0.128158],[33.850368,0.128158],[34.136242,-0.319308],[34.072629,-1.059832],[33.579429,-1.506006],[33.251748,-1.957968],[33.647177,-2.300893],[33.07672,-2.547131],[32.951767,-2.430446],[32.373094,-2.489925],[31.926558,-2.714511],[31.648022,-2.329212],[31.836021,-1.629306],[31.8662,-1.027379],[31.815144,-0.640426],[32.272842,-0.05612],[32.906137,0.086765],[33.331847,0.324993],[33.850368,0.128158]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Ladoga","name_alt":null,"admin":null,"min_zoom":1,"min_label":3,"name_abb":"L. Ladoga","label":"Lake Ladoga","wikidataid":"Q15288","name_ar":"بحيرة لادوغا","name_bn":"লাডোগা হ্রদ","name_de":"Ladogasee","name_en":"Ladoga","name_es":"Ládoga","name_fr":"Ladoga","name_el":"Λάντογκα","name_hi":"लादोगा झील","name_hu":"Ladoga-tó","name_id":"Danau Ladoga","name_it":"Ladoga","name_ja":"ラドガ湖","name_ko":"라도가호","name_nl":"Ladogameer","name_pl":"Ładoga","name_pt":"Ladoga","name_ru":"Ладожское озеро","name_sv":"Ladoga","name_tr":"Ladoga","name_vi":"Ladoga","name_zh":"拉多加湖","ne_id":1159113095,"name_fa":"دریاچه لادوگا","name_he":"ימת לדוגה","name_uk":"Ладозьке озеро","name_ur":"جھیل لاڈوگا","name_zht":"拉多加湖"},"bbox":[29.836711,59.920348,32.944325,61.775041],"geometry":{"type":"Polygon","coordinates":[[[29.836711,61.226082],[29.836711,61.226082],[30.851998,61.775041],[32.526883,61.11751],[32.944325,60.642604],[32.815754,60.48189],[32.599902,60.533515],[32.583882,60.208935],[31.69944,60.235652],[31.509736,59.920348],[31.106246,59.927686],[31.108934,60.146458],[30.533878,60.630098],[30.502046,60.843212],[29.836711,61.226082]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Balkhash","name_alt":"Balqash Köli","admin":null,"min_zoom":1,"min_label":3,"name_abb":"L. Balkhash","label":"Lake Balkhash","wikidataid":"Q134485","name_ar":"بحيرة بالكاش","name_bn":"লেক বালখাশ","name_de":"Balchaschsee","name_en":"Balkhash","name_es":"Baljash","name_fr":"Balkhach","name_el":"Λίμνη Μπαλκάς","name_hi":"बलख़श झील","name_hu":"Balkas-tó","name_id":"Danau Balkhash","name_it":"Balqaš","name_ja":"バルハシ湖","name_ko":"발하시호","name_nl":"Balkasjmeer","name_pl":"Bałchasz","name_pt":"Balkhash","name_ru":"Балхаш","name_sv":"Balchasjsjön","name_tr":"Balkaş","name_vi":"Balkhash","name_zh":"巴尔喀什湖","ne_id":1159113111,"name_fa":"دریاچه بالخاش","name_he":"ימת בלחש","name_uk":"Балхаш","name_ur":"جھیل بالخاش","name_zht":"巴爾喀什湖"},"bbox":[73.436738,44.988934,79.245168,46.816781],"geometry":{"type":"Polygon","coordinates":[[[78.990765,46.74862],[78.990765,46.74862],[79.245168,46.645163],[78.889893,46.369935],[78.445062,46.297174],[77.206068,46.395566],[75.611282,46.507187],[75.463332,46.670614],[75.405661,46.470807],[74.911221,46.404661],[74.771385,46.107832],[74.27803,46.004066],[74.099953,44.988934],[73.436738,45.609464],[73.439993,45.805861],[73.737133,46.012747],[73.679255,46.183073],[74.020681,46.204906],[74.09432,46.427812],[74.939385,46.816781],[76.203132,46.780013],[77.181315,46.643406],[77.85993,46.647851],[78.297009,46.468533],[78.397107,46.657669],[78.990765,46.74862]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Tanganyika","name_alt":null,"admin":"admin-0","min_zoom":1,"min_label":3,"name_abb":"L. Tanganyika","label":"Lake Tanganyika","wikidataid":"Q5511","name_ar":"بحيرة تنجانيقا","name_bn":"টাংগানিকা হ্রদ","name_de":"Tanganjikasee","name_en":"Tanganyika","name_es":"Tanganica","name_fr":"Tanganyika","name_el":"Τανγκανίκα","name_hi":"तांगान्यीका झील","name_hu":"Tanganyika-tó","name_id":"Danau Tanganyika","name_it":"Tanganica","name_ja":"タンガニーカ湖","name_ko":"탕가니카호","name_nl":"Tanganyikameer","name_pl":"Tanganika","name_pt":"Tanganica","name_ru":"Танганьика","name_sv":"Tanganyikasjön","name_tr":"Tanganika","name_vi":"Tanganyika","name_zh":"坦干依喀湖","ne_id":1159113185,"name_fa":"دریاچه تانگانیکا","name_he":"אגם טנגניקה","name_uk":"Танганьїка","name_ur":"جھیل ٹانگانیکا","name_zht":"坦干依喀湖"},"bbox":[29.101718,-8.786543,31.189032,-3.455499],"geometry":{"type":"Polygon","coordinates":[[[30.806006,-8.578339],[30.464425,-8.498189],[30.566848,-8.115008],[30.277356,-7.848358],[30.147028,-7.299244],[29.536523,-6.754161],[29.193185,-6.038029],[29.371985,-5.616453],[29.101718,-5.054006],[29.281035,-3.455499],[29.652588,-4.420143],[29.600085,-4.896393],[29.79196,-5.040881],[29.758422,-5.466901],[29.951226,-5.860986],[29.722041,-6.244115],[30.528039,-6.92273],[30.604158,-7.541917],[31.189032,-8.729906],[31.022117,-8.786543],[30.806006,-8.578339],[30.806006,-8.578339]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Malawi","name_alt":"Lake Nyasa","admin":"admin-0","min_zoom":1,"min_label":3,"name_abb":"L. Malawi","label":"Lake Malawi","wikidataid":"Q5532","name_ar":"بحيرة ملاوي","name_bn":"মালাউই হ্রদ","name_de":"Malawisee","name_en":"Malawi","name_es":"Malaui","name_fr":"Malawi","name_el":"Λίμνη Νιάσα","name_hi":"मलावी झील","name_hu":"Nyasza-tó","name_id":"Danau Malawi","name_it":"Malawi","name_ja":"マラウイ湖","name_ko":"말라위호","name_nl":"Malawimeer","name_pl":"Niasa","name_pt":"Niassa","name_ru":"Малави","name_sv":"Malawisjön","name_tr":"Malavi","name_vi":"Malawi","name_zh":"马拉维湖","ne_id":1159113163,"name_fa":"دریاچه مالاوی","name_he":"אגם מלאווי","name_uk":"Ньяса","name_ur":"جھیل ملاوی","name_zht":"马拉维湖"},"bbox":[33.906592,-14.401291,35.260205,-9.495441],"geometry":{"type":"Polygon","coordinates":[[[35.260205,-14.277474],[35.236227,-14.401291],[34.88121,-14.012013],[34.706543,-14.262023],[34.54676,-14.047669],[34.551101,-13.672085],[34.320934,-13.37939],[34.329977,-12.944584],[34.032528,-12.208557],[34.322691,-11.652983],[34.259904,-10.447579],[33.906592,-9.801727],[33.995579,-9.495441],[34.524229,-10.030137],[34.607893,-11.080512],[34.93702,-11.463434],[34.693883,-12.422394],[34.867567,-13.701127],[35.055979,-13.742933],[35.260205,-14.277474]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Vänern","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.6,"name_abb":"Vänern","label":"Vänern","wikidataid":"Q173596","name_ar":"بحيرة فنرن","name_bn":"ভেনার্ন","name_de":"Vänern","name_en":"Vänern","name_es":"Vänern","name_fr":"Vänern","name_el":"Βένερν","name_hi":"वेनर्न","name_hu":"Vänern-tó","name_id":"Vänern","name_it":"Vänern","name_ja":"ヴェーネルン湖","name_ko":"베네른호","name_nl":"Vänermeer","name_pl":"Wener","name_pt":"Vänern","name_ru":"Венерн","name_sv":"Vänern","name_tr":"Vänern","name_vi":"Vänern","name_zh":"维纳恩湖","ne_id":1159113235,"name_fa":"دریاچه ونرن","name_he":"ונן","name_uk":"Венерн","name_ur":"وینرن","name_zht":"維納恩湖"},"bbox":[12.460149,58.506197,13.984449,59.336482],"geometry":{"type":"Polygon","coordinates":[[[13.979281,59.204914],[13.979281,59.204914],[13.984449,59.086213],[13.918923,58.902503],[13.282683,58.608671],[12.830101,58.509039],[12.460149,58.506197],[12.537767,58.775948],[12.522161,58.880282],[12.697086,58.953844],[13.02704,58.993531],[13.195298,59.129001],[13.59145,59.336482],[13.979281,59.204914]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Lake Okeechobee","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.6,"name_abb":"L. Okeechobee","label":"Lake Okeechobee","wikidataid":"Q202905","name_ar":"بحيرة أوكي تشوبي","name_bn":"লেক ওকীচোবী","name_de":"Okeechobeesee","name_en":"Okeechobee","name_es":"Okeechobee","name_fr":"Okeechobee","name_el":"Λίμνη Οκιτσόμπι","name_hi":"ओकेचोबी झील","name_hu":"Okeechobbee-tó","name_id":"Danau Okeechobee","name_it":"Okeechobee","name_ja":"オキーチョビー湖","name_ko":"오키초비호","name_nl":"Okeechobeemeer","name_pl":"Okeechobee","name_pt":"Okeechobee","name_ru":"Окичоби","name_sv":"Okeechobee","name_tr":"Okeechobee","name_vi":"Hồ Okeechobee","name_zh":"奧基喬比湖","ne_id":1159106781,"name_fa":"دریاچه اوکیچوبی","name_he":"אגם אוקיצ'ובי","name_uk":"Окічобі","name_ur":"جھیل اوکیجوبی","name_zht":"奧基喬比湖"},"bbox":[-80.932445,26.788959,-80.6937,27.068917],"geometry":{"type":"Polygon","coordinates":[[[-80.706438,26.788959],[-80.932445,26.823273],[-80.919706,27.068917],[-80.6937,27.034629],[-80.706438,26.788959],[-80.706438,26.788959]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Lago de Nicaragua","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.6,"name_abb":"L. de Nicaragua","label":"Lago de Nicaragua","wikidataid":"Q173862","name_ar":"بحيرة نيكاراغوا","name_bn":"নিকারাগুয়া হ্রদ","name_de":"Nicaraguasee","name_en":"Nicaragua","name_es":"Cocibolca","name_fr":"Nicaragua","name_el":"Λίμνη Νικαράγουα","name_hi":"निकारागुआ झील","name_hu":"Nicaragua-tó","name_id":"Danau Nikaragua","name_it":"Nicaragua","name_ja":"ニカラグア湖","name_ko":"니카라과호","name_nl":"Meer van Nicaragua","name_pl":"Nikaragua","name_pt":"Nicarágua","name_ru":"Никарагуа","name_sv":"Nicaraguasjön","name_tr":"Nikaragua","name_vi":"Nicaragua","name_zh":"尼加拉瓜湖","ne_id":1159106791,"name_fa":"دریاچه نیکاراگوئه","name_he":"אגם ניקרגואה","name_uk":"Нікарагуа","name_ur":"جھیل نکاراگوا","name_zht":"尼加拉瓜湖"},"bbox":[-85.885166,11.147899,-84.855487,11.940331],"geometry":{"type":"Polygon","coordinates":[[[-84.855487,11.147899],[-85.290137,11.176166],[-85.791321,11.509737],[-85.885166,11.900101],[-85.56534,11.940331],[-85.036845,11.521648],[-84.855487,11.147899],[-84.855487,11.147899]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Lake Tana","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.6,"name_abb":"L. Tana","label":"Lake Tana","wikidataid":"Q116685","name_ar":"بحيرة تانا","name_bn":"তানা হ্রদ","name_de":"Tanasee","name_en":"Tana","name_es":"Tana","name_fr":"Tana","name_el":"Τάνα","name_hi":"ताना झील","name_hu":"Tana-tó","name_id":"Danau Tana","name_it":"Tana","name_ja":"タナ湖","name_ko":"타나호","name_nl":"Tanameer","name_pl":"Jezioro Tana","name_pt":"Tana","name_ru":"Тана","name_sv":"Tanasjön","name_tr":"Tana Gölü","name_vi":"Tana","name_zh":"塔纳湖","ne_id":1159113265,"name_fa":"دریاچه تانا","name_he":"אגם טאנה","name_uk":"Тана","name_ur":"جھیل ٹانا","name_zht":"塔納湖"},"bbox":[37.014826,11.713394,37.518361,12.233879],"geometry":{"type":"Polygon","coordinates":[[[37.143707,11.850595],[37.014826,12.035596],[37.244011,12.233879],[37.518361,12.160602],[37.481878,11.825092],[37.336357,11.713394],[37.143707,11.850595],[37.143707,11.850595]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Lago Titicaca","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.6,"name_abb":"L. Titicaca","label":"Lago Titicaca","wikidataid":"Q35342","name_ar":"بحيرة تيتيكاكا","name_bn":"তিতিকাকা হ্রদ","name_de":"Titicacasee","name_en":"Titicaca","name_es":"Titicaca","name_fr":"Titicaca","name_el":"Τιτικάκα","name_hi":"टीटीकाका झील","name_hu":"Titicaca-tó","name_id":"Danau Titicaca","name_it":"Titicaca","name_ja":"チチカカ湖","name_ko":"티티카카호","name_nl":"Titicacameer","name_pl":"Titicaca","name_pt":"Titicaca","name_ru":"Титикака","name_sv":"Titicacasjön","name_tr":"Titikaka","name_vi":"Titicaca","name_zh":"的的喀喀湖","ne_id":1159113279,"name_fa":"دریاچه تیتیکاکا","name_he":"אגם טיטיקקה","name_uk":"Тітікака","name_ur":"جھیل ٹیٹیکاکا","name_zht":"的的喀喀湖"},"bbox":[-69.983656,-16.536406,-68.746238,-15.354256],"geometry":{"type":"Polygon","coordinates":[[[-69.40674,-16.126199],[-69.729097,-15.928795],[-69.983656,-15.737179],[-69.877021,-15.669844],[-69.867978,-15.546079],[-69.8856,-15.354256],[-69.596754,-15.41048],[-68.986972,-15.885903],[-68.959687,-15.913292],[-68.746238,-16.356004],[-68.905246,-16.506641],[-69.001157,-16.536406],[-69.090842,-16.461992],[-69.182051,-16.401169],[-69.250987,-16.227536],[-69.40674,-16.126199],[-69.40674,-16.126199]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Cedar Lake","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":5,"name_abb":"Cedar L.","label":"Cedar Lake","wikidataid":"Q1052532","name_ar":"سيدار ليك","name_bn":"সেডার লেক","name_de":"Cedar","name_en":"Cedar","name_es":"Cedar","name_fr":"Cèdres","name_el":"Λίμνη Σένταρ","name_hi":"सिडर लेक","name_hu":"Cedar-tó","name_id":"Danau Cedar","name_it":"Cedar","name_ja":"シーダー湖","name_ko":"시더 레이크","name_nl":"Cedar","name_pl":"Cedar","name_pt":"Cedar","name_ru":"Сидар","name_sv":"Cedar","name_tr":"Cedar Gölü","name_vi":"Hồ Cedar","name_zh":"錫達湖","ne_id":1159123681,"name_fa":"دریاچه سدار","name_he":"סידר לייק","name_uk":"Сідар","name_ur":"کیدار جھیل","name_zht":"錫達湖"},"bbox":[-100.606851,53.120427,-99.393178,54.230334],"geometry":{"type":"Polygon","coordinates":[[[-99.403772,53.125853],[-99.548466,53.120427],[-99.804988,53.142906],[-100.431461,53.28419],[-100.606851,53.531617],[-100.334878,53.745247],[-100.426733,53.907408],[-100.404486,53.94508],[-100.3263,54.094011],[-100.235866,54.230334],[-99.995493,54.215864],[-100.047789,54.100135],[-100.183569,53.930352],[-99.871289,53.928466],[-99.910666,53.821315],[-100.056497,53.443327],[-99.665513,53.295817],[-99.393178,53.267912],[-99.403772,53.125853],[-99.403772,53.125853]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Lake Onega","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.6,"name_abb":"L. Onega","label":"Lake Onega","wikidataid":"Q166162","name_ar":"بحيرة أونيغا","name_bn":"লেক ওনেগা","name_de":"Onegasee","name_en":"Onega","name_es":"Onega","name_fr":"Onega","name_el":"Λίμνη Ονέγκα","name_hi":"ओनेगा झील","name_hu":"Onyega-tó","name_id":"Danau Onega","name_it":"Onega","name_ja":"オネガ湖","name_ko":"오네가호","name_nl":"Onegameer","name_pl":"Onega","name_pt":"Onega","name_ru":"Онежское озеро","name_sv":"Onega","name_tr":"Onega","name_vi":"Onega","name_zh":"奥涅加湖","ne_id":1159113251,"name_fa":"دریاچه اونگا","name_he":"ימת אונגה","name_uk":"Онезьке озеро","name_ur":"جھیل اونیگا","name_zht":"奧涅加湖"},"bbox":[34.26502,60.94858,36.391402,62.762448],"geometry":{"type":"Polygon","coordinates":[[[35.714647,62.28023],[36.054161,61.716311],[36.391402,61.276053],[36.109455,61.015087],[35.350742,60.94858],[34.866844,61.116373],[35.207288,61.114435],[35.578325,61.086349],[35.160004,61.394289],[34.857335,61.551799],[34.486919,61.866973],[34.26502,62.219148],[34.289825,62.297748],[34.665616,62.229794],[34.626135,62.452235],[34.835631,62.296766],[35.080267,62.141194],[35.21659,62.193284],[35.463706,62.256019],[35.139695,62.487762],[34.614353,62.762448],[34.995415,62.74847],[35.233953,62.675348],[35.714647,62.28023]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Great Salt Lake","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.6,"name_abb":"Great Salt L.","label":"Great Salt Lake","wikidataid":"Q178741","name_ar":"البحيرة المالحة الكبرى","name_bn":"গ্রেট সল্ট লেক","name_de":"Großer Salzsee","name_en":"Great Salt","name_es":"Gran Salado","name_fr":"Grand Salé","name_el":"Μεγάλη Αλμυρή Λίμνη","name_hi":"महान नमक झील","name_hu":"Nagy-sóstó","name_id":"Danau Garam Besar","name_it":"Gran Salato","name_ja":"グレートソルト湖","name_ko":"그레이트솔트호","name_nl":"Great Salt","name_pl":"Wielkie Jezioro Słone","name_pt":"Grande Salgado","name_ru":"Большое Солёное озеро","name_sv":"Stora Saltsjön","name_tr":"Büyük Tuz","name_vi":"Muối Lớn","name_zh":"大盐湖","ne_id":1159113251,"name_fa":"دریاچه نمک یوتا","name_he":"ימת המלח הגדולה","name_uk":"Велике Солоне озеро","name_ur":"گریٹ سالٹ لیک","name_zht":"大鹽湖"},"bbox":[-112.878143,40.85146,-112.138757,41.628157],"geometry":{"type":"Polygon","coordinates":[[[-112.184051,41.341249],[-112.138757,41.142347],[-112.171933,40.85146],[-112.678827,41.130487],[-112.705492,41.167539],[-112.878143,41.628157],[-112.589556,41.438918],[-112.40533,41.33802],[-112.21901,41.428557],[-112.184051,41.341249]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Great Bear Lake","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.6,"name_abb":"Great Bear L.","label":"Great Bear Lake","wikidataid":"Q5525","name_ar":"بحيرة الدب العظيم","name_bn":"গ্রেট বেয়ার লেক","name_de":"Großer Bärensee","name_en":"Great Bear","name_es":"Gran Oso","name_fr":"grand l'Ours","name_el":"Μεγάλη Λίμνη των Άρκτων","name_hi":"ग्रेट बियर झील","name_hu":"Nagy-Medve-tó","name_id":"Danau Beruang Besar","name_it":"Grande Orsi","name_ja":"グレートベア湖","name_ko":"그레이트베어호","name_nl":"Groot Berenmeer","name_pl":"Wielkie Jezioro Niedźwiedzie","name_pt":"Grande Urso","name_ru":"Большое Медвежье озеро","name_sv":"Stora Björnsjön","name_tr":"Büyük Ayı","name_vi":"Gấu lớn","name_zh":"大熊湖","ne_id":1159106721,"name_fa":"دریاچه گریت بر","name_he":"ימת הדובים הגדולה","name_uk":"Велике Ведмеже озеро","name_ur":"گریٹ بیئر لیک","name_zht":"大熊湖"},"bbox":[-124.953634,64.879994,-117.605452,66.969298],"geometry":{"type":"Polygon","coordinates":[[[-117.759292,66.223684],[-117.97375,65.854895],[-118.107101,65.766916],[-119.720052,65.734799],[-119.745684,65.654365],[-119.66481,65.527422],[-119.702198,65.367948],[-121.355094,64.879994],[-121.336103,64.994612],[-120.945274,65.377741],[-121.057283,65.446341],[-122.564504,65.03107],[-123.232706,65.180415],[-123.179634,65.319372],[-122.325991,65.793788],[-122.356222,65.901843],[-124.953634,66.04925],[-124.89754,66.151156],[-119.48725,66.969298],[-119.357438,66.875195],[-120.176949,66.465272],[-117.605452,66.559348],[-117.61279,66.419977],[-117.759292,66.223684],[-117.759292,66.223684]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Lake Athabasca","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.7,"name_abb":"L. Athabasca","label":"Lake Athabasca","wikidataid":"Q272463","name_ar":"بحيرة أثاباسكا","name_bn":"আথাবাস্কা হ্রদ","name_de":"Athabascasee","name_en":"Athabasca","name_es":"Athabasca","name_fr":"Athabasca","name_el":"Λίμνη Αθαμπάσκα","name_hi":"अथाबास्का झील","name_hu":"Atapaszka-tó","name_id":"Danau Athabasca","name_it":"Athabasca","name_ja":"アサバスカ湖","name_ko":"레이크 애서배스카","name_nl":"Athabascameer","name_pl":"Athabaska","name_pt":"Athabasca","name_ru":"Атабаска","name_sv":"Athabascasjön","name_tr":"Athabasca","name_vi":"Hồ Athabasca","name_zh":"阿萨巴斯卡湖","ne_id":1159106863,"name_fa":"دریاچه آتاباسکا","name_he":"אגם אתבסקה","name_uk":"Атабаска","name_ur":"جھیل اتھابسکا","name_zht":"阿薩巴斯卡湖"},"bbox":[-111.199486,58.560173,-106.545171,59.550422],"geometry":{"type":"Polygon","coordinates":[[[-109.653301,59.037637],[-111.086263,58.560173],[-111.199486,58.685565],[-111.160005,58.75985],[-109.09672,59.550422],[-106.545171,59.319687],[-106.546953,59.292815],[-109.653301,59.037637],[-109.653301,59.037637]]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"Lake","name":"Reindeer Lake","name_alt":null,"admin":null,"min_zoom":1.7,"min_label":3.7,"name_abb":"Reindeer L.","label":"Reindeer Lake","wikidataid":"Q1134446","name_ar":"بحيرة ريندير","name_bn":"রেইনডিয়ার লেক","name_de":"Reindeer","name_en":"Reindeer","name_es":"Reindeer","name_fr":"Reindeer","name_el":"Λίμνη Ρέιντιρ","name_hi":"रेनडियर झील","name_hu":"Reindeer-tó","name_id":"Danau Reindeer","name_it":"delle Renne","name_ja":"レーンディア湖","name_ko":"레인디어호","name_nl":"Reindeer","name_pl":"Jezioro Reniferowe","name_pt":"Reindeer","name_ru":"Оленье озеро","name_sv":"Reindeer","name_tr":"Reindeer Gölü","name_vi":"Hồ Reindeer","name_zh":"驯鹿湖","ne_id":1159106817,"name_fa":"دریاچه ریندیر","name_he":"אגם האיילים","name_uk":"Оленяче","name_ur":"رین ڈیئر جھیل","name_zht":"馴鹿湖"},"bbox":[-103.282502,56.345398,-101.543848,58.019146],"geometry":{"type":"Polygon","coordinates":[[[-101.895144,58.01403],[-101.895144,58.01403],[-101.543848,57.868096],[-101.970902,57.34867],[-101.934031,57.230667],[-103.20416,56.345398],[-103.282502,56.409942],[-103.148737,56.70411],[-103.078328,56.710802],[-103.014404,56.565101],[-102.576808,56.938282],[-102.813228,57.28715],[-102.813693,57.464348],[-102.128748,58.019146],[-101.895144,58.01403]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Huron","name_alt":"Great Lakes","admin":"admin-0","min_zoom":1,"min_label":3,"name_abb":"L. Huron","label":"Lake Huron","wikidataid":"Q1383","name_ar":"بحيرة هرون","name_bn":"লেক হুরন","name_de":"Huronsee","name_en":"Huron","name_es":"Hurón","name_fr":"Huron","name_el":"Λίμνη Χιούρον","name_hi":"ह्यूरॉन झील","name_hu":"Huron-tó","name_id":"Danau Huron","name_it":"Huron","name_ja":"ヒューロン湖","name_ko":"휴런호","name_nl":"Huronmeer","name_pl":"Huron","name_pt":"Huron","name_ru":"Гурон","name_sv":"Huronsjön","name_tr":"Huron","name_vi":"Huron","name_zh":"休伦湖","ne_id":1159113021,"name_fa":"دریاچه هیوران","name_he":"ימת יורון","name_uk":"Гурон","name_ur":"جھیل ہیورون","name_zht":"休伦湖"},"bbox":[-84.930004,42.980013,-79.762929,46.555763],"geometry":{"type":"Polygon","coordinates":[[[-80.410564,45.590137],[-79.762929,44.824603],[-80.085003,44.493925],[-80.897692,44.631643],[-81.402338,45.250055],[-81.275679,44.620171],[-81.752653,44.064649],[-81.700176,43.590053],[-81.782729,43.310845],[-82.430002,42.980013],[-82.479999,43.390013],[-82.659988,43.970004],[-83.029991,44.069998],[-83.650005,43.629999],[-83.848701,43.638319],[-83.89999,43.889983],[-83.349997,44.29001],[-83.258788,44.745745],[-83.339998,45.200006],[-84.080004,45.589982],[-84.930004,45.789996],[-84.753555,45.924484],[-84.719991,45.919988],[-83.839192,46.010215],[-84.336707,46.40877],[-84.148708,46.555763],[-83.95257,46.334278],[-83.202513,46.210151],[-82.441991,46.199635],[-81.631368,46.097548],[-80.736798,45.903813],[-80.410564,45.590137]]]}},{"type":"Feature","properties":{"scalerank":0,"featurecla":"Lake","name":"Lake Michigan","name_alt":"Great Lakes","admin":"admin-0","min_zoom":1,"min_label":3,"name_abb":"L. Michigan","label":"Lake Michigan","wikidataid":"Q1169","name_ar":"بحيرة ميشيغين","name_bn":"মিশিগান হ্রদ","name_de":"Michigansee","name_en":"Michigan","name_es":"Míchigan","name_fr":"Michigan","name_el":"Λίμνη Μίσιγκαν","name_hi":"मिशिगन झील","name_hu":"Michigan-tó","name_id":"Danau Michigan","name_it":"Michigan","name_ja":"ミシガン湖","name_ko":"미시간호","name_nl":"Michiganmeer","name_pl":"Michigan","name_pt":"Michigan","name_ru":"Мичиган","name_sv":"Michigansjön","name_tr":"Michigan","name_vi":"Michigan","name_zh":"密歇根湖","ne_id":1159113005,"name_fa":"دریاچه میشیگان","name_he":"ימת מישיגן","name_uk":"Мічиган","name_ur":"جھیل مشی گن","name_zht":"密歇根湖"},"bbox":[-87.988319,41.640714,-84.753555,46.030007],"geometry":{"type":"Polygon","coordinates":[[[-85.539993,46.030007],[-84.753555,45.924484],[-84.930004,45.789996],[-85.069996,45.409993],[-85.290447,45.308242],[-85.467103,44.814578],[-85.559992,45.150009],[-85.959838,44.910592],[-86.209358,44.574799],[-86.470272,44.084235],[-86.520011,43.659997],[-86.188429,43.041404],[-86.21605,42.381703],[-86.621916,41.89442],[-86.824436,41.756185],[-87.094446,41.646166],[-87.434218,41.640714],[-87.526177,41.708514],[-87.795695,42.234115],[-87.803446,42.493996],[-87.77673,42.740854],[-87.902148,43.230514],[-87.712212,43.7965],[-87.48636,44.493357],[-86.967477,45.262871],[-87.118062,45.259331],[-87.852823,44.615055],[-87.988319,44.733316],[-87.596431,45.093708],[-87.000007,45.739999],[-86.319997,45.829994],[-85.539993,46.030007]]]}}],"bbox":[-124.953634400057,-16.536406345285,109.929807163535,66.9692975938512]} diff --git a/zbook_frontend/public/ne_110m_land.geojson b/zbook_frontend/public/ne_110m_land.geojson new file mode 100644 index 0000000..04811d7 --- /dev/null +++ b/zbook_frontend/public/ne_110m_land.geojson @@ -0,0 +1 @@ +{"type":"FeatureCollection","name":"ne_110m_land","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"features":[{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-66.290031,-81.000327,-59.572095,-79.628679],"geometry":{"type":"Polygon","coordinates":[[[-59.572095,-80.040179],[-59.865849,-80.549657],[-60.159656,-81.000327],[-62.255393,-80.863178],[-64.488125,-80.921934],[-65.741666,-80.588827],[-65.741666,-80.549657],[-66.290031,-80.255773],[-64.037688,-80.294944],[-61.883246,-80.39287],[-61.138976,-79.981371],[-60.610119,-79.628679],[-59.572095,-80.040179]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-163.712896,-79.634209,-159.208184,-78.223338],"geometry":{"type":"Polygon","coordinates":[[[-159.208184,-79.497059],[-161.127601,-79.634209],[-162.439847,-79.281465],[-163.027408,-78.928774],[-163.066604,-78.869966],[-163.712896,-78.595667],[-163.712896,-78.595667],[-163.105801,-78.223338],[-161.245113,-78.380176],[-160.246208,-78.693645],[-159.482405,-79.046338],[-159.208184,-79.497059]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":0},"bbox":[-54.164259,-81.025442,-43.333267,-77.831476],"geometry":{"type":"Polygon","coordinates":[[[-45.154758,-78.04707],[-43.920828,-78.478103],[-43.48995,-79.08556],[-43.372438,-79.516645],[-43.333267,-80.026123],[-44.880537,-80.339644],[-46.506174,-80.594357],[-48.386421,-80.829485],[-50.482107,-81.025442],[-52.851988,-80.966685],[-54.164259,-80.633528],[-53.987991,-80.222028],[-51.853134,-79.94773],[-50.991326,-79.614623],[-50.364595,-79.183487],[-49.914131,-78.811209],[-49.306959,-78.458569],[-48.660616,-78.047018],[-48.660616,-78.047019],[-48.151396,-78.04707],[-46.662857,-77.831476],[-45.154758,-78.04707]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-122.621735,-74.08881,-118.724143,-73.324619],"geometry":{"type":"Polygon","coordinates":[[[-121.211511,-73.50099],[-119.918851,-73.657725],[-118.724143,-73.481353],[-119.292119,-73.834097],[-120.232217,-74.08881],[-121.62283,-74.010468],[-122.621735,-73.657778],[-122.621735,-73.657777],[-122.406245,-73.324619],[-121.211511,-73.50099]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-127.28313,-73.873268,-124.031882,-73.246226],"geometry":{"type":"Polygon","coordinates":[[[-125.559566,-73.481353],[-124.031882,-73.873268],[-124.619469,-73.834097],[-125.912181,-73.736118],[-127.28313,-73.461769],[-127.28313,-73.461768],[-126.558472,-73.246226],[-125.559566,-73.481353]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-102.330725,-72.521205,-96.20035,-71.717792],"geometry":{"type":"Polygon","coordinates":[[[-98.98155,-71.933334],[-97.884743,-72.070535],[-96.787937,-71.952971],[-96.20035,-72.521205],[-96.983765,-72.442864],[-98.198083,-72.482035],[-99.432013,-72.442864],[-100.783455,-72.50162],[-101.801868,-72.305663],[-102.330725,-71.894164],[-102.330725,-71.894164],[-101.703967,-71.717792],[-100.430919,-71.854993],[-98.98155,-71.933334]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-75.012625,-72.503842,-68.333834,-68.87874],"geometry":{"type":"Polygon","coordinates":[[[-68.451346,-70.955823],[-68.333834,-71.406493],[-68.510128,-71.798407],[-68.784297,-72.170736],[-69.959471,-72.307885],[-71.075889,-72.503842],[-72.388134,-72.484257],[-71.8985,-72.092343],[-73.073622,-72.229492],[-74.19004,-72.366693],[-74.953895,-72.072757],[-75.012625,-71.661258],[-73.915819,-71.269345],[-73.915819,-71.269344],[-73.230331,-71.15178],[-72.074717,-71.190951],[-71.780962,-70.681473],[-71.72218,-70.309196],[-71.741791,-69.505782],[-71.173815,-69.035475],[-70.253252,-68.87874],[-69.724447,-69.251017],[-69.489422,-69.623346],[-69.058518,-70.074016],[-68.725541,-70.505153],[-68.451346,-70.955823]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-180,-90,180,-63.27066],"geometry":{"type":"Polygon","coordinates":[[[-58.614143,-64.152467],[-59.045073,-64.36801],[-59.789342,-64.211223],[-60.611928,-64.309202],[-61.297416,-64.54433],[-62.0221,-64.799094],[-62.51176,-65.09303],[-62.648858,-65.484942],[-62.590128,-65.857219],[-62.120079,-66.190326],[-62.805567,-66.425505],[-63.74569,-66.503847],[-64.294106,-66.837004],[-64.881693,-67.150474],[-65.508425,-67.58161],[-65.665082,-67.953887],[-65.312545,-68.365335],[-64.783715,-68.678908],[-63.961103,-68.913984],[-63.1973,-69.227556],[-62.785955,-69.619419],[-62.570516,-69.991747],[-62.276736,-70.383661],[-61.806661,-70.716768],[-61.512906,-71.089045],[-61.375809,-72.010074],[-61.081977,-72.382351],[-61.003661,-72.774265],[-60.690269,-73.166179],[-60.827367,-73.695242],[-61.375809,-74.106742],[-61.96337,-74.439848],[-63.295201,-74.576997],[-63.74569,-74.92974],[-64.352836,-75.262847],[-65.860987,-75.635124],[-67.192818,-75.79191],[-68.446282,-76.007452],[-69.797724,-76.222995],[-70.600724,-76.634494],[-72.206776,-76.673665],[-73.969536,-76.634494],[-75.555977,-76.712887],[-77.24037,-76.712887],[-76.926979,-77.104802],[-75.399294,-77.28107],[-74.282876,-77.55542],[-73.656119,-77.908112],[-74.772536,-78.221633],[-76.4961,-78.123654],[-77.925858,-78.378419],[-77.984666,-78.789918],[-78.023785,-79.181833],[-76.848637,-79.514939],[-76.633224,-79.887216],[-75.360097,-80.259545],[-73.244852,-80.416331],[-71.442946,-80.69063],[-70.013163,-81.004151],[-68.191646,-81.317672],[-65.704279,-81.474458],[-63.25603,-81.748757],[-61.552026,-82.042692],[-59.691416,-82.37585],[-58.712121,-82.846106],[-58.222487,-83.218434],[-57.008117,-82.865691],[-55.362894,-82.571755],[-53.619771,-82.258235],[-51.543644,-82.003521],[-49.76135,-81.729171],[-47.273931,-81.709586],[-44.825708,-81.846735],[-42.808363,-82.081915],[-42.16202,-81.65083],[-40.771433,-81.356894],[-38.244818,-81.337309],[-36.26667,-81.121715],[-34.386397,-80.906172],[-32.310296,-80.769023],[-30.097098,-80.592651],[-28.549802,-80.337938],[-29.254901,-79.985195],[-29.685805,-79.632503],[-29.685805,-79.260226],[-31.624808,-79.299397],[-33.681324,-79.456132],[-35.639912,-79.456132],[-35.914107,-79.083855],[-35.77701,-78.339248],[-35.326546,-78.123654],[-33.896763,-77.888526],[-32.212369,-77.65345],[-30.998051,-77.359515],[-29.783732,-77.065579],[-28.882779,-76.673665],[-27.511752,-76.497345],[-26.160336,-76.360144],[-25.474822,-76.281803],[-23.927552,-76.24258],[-22.458598,-76.105431],[-21.224694,-75.909474],[-20.010375,-75.674346],[-18.913543,-75.439218],[-17.522982,-75.125698],[-16.641589,-74.79254],[-15.701491,-74.498604],[-15.40771,-74.106742],[-16.46532,-73.871614],[-16.112784,-73.460114],[-15.446855,-73.146542],[-14.408805,-72.950585],[-13.311973,-72.715457],[-12.293508,-72.401936],[-11.510067,-72.010074],[-11.020433,-71.539767],[-10.295774,-71.265416],[-9.101015,-71.324224],[-8.611381,-71.65733],[-7.416622,-71.696501],[-7.377451,-71.324224],[-6.868232,-70.93231],[-5.790985,-71.030289],[-5.536375,-71.402617],[-4.341667,-71.461373],[-3.048981,-71.285053],[-1.795492,-71.167438],[-0.659489,-71.226246],[-0.228637,-71.637745],[0.868195,-71.304639],[1.886686,-71.128267],[3.022638,-70.991118],[4.139055,-70.853917],[5.157546,-70.618789],[6.273912,-70.462055],[7.13572,-70.246512],[7.742866,-69.893769],[8.48711,-70.148534],[9.525135,-70.011333],[10.249845,-70.48164],[10.817821,-70.834332],[11.953824,-70.638375],[12.404287,-70.246512],[13.422778,-69.972162],[14.734998,-70.030918],[15.126757,-70.403247],[15.949342,-70.030918],[17.026589,-69.913354],[18.201711,-69.874183],[19.259373,-69.893769],[20.375739,-70.011333],[21.452985,-70.07014],[21.923034,-70.403247],[22.569403,-70.697182],[23.666184,-70.520811],[24.841357,-70.48164],[25.977309,-70.48164],[27.093726,-70.462055],[28.09258,-70.324854],[29.150242,-70.20729],[30.031583,-69.93294],[30.971733,-69.75662],[31.990172,-69.658641],[32.754053,-69.384291],[33.302443,-68.835642],[33.870419,-68.502588],[34.908495,-68.659271],[35.300202,-69.012014],[36.16201,-69.247142],[37.200035,-69.168748],[37.905108,-69.52144],[38.649404,-69.776205],[39.667894,-69.541077],[40.020431,-69.109941],[40.921358,-68.933621],[41.959434,-68.600514],[42.938702,-68.463313],[44.113876,-68.267408],[44.897291,-68.051866],[45.719928,-67.816738],[46.503343,-67.601196],[47.44344,-67.718759],[48.344419,-67.366068],[48.990736,-67.091718],[49.930885,-67.111303],[50.753471,-66.876175],[50.949325,-66.523484],[51.791547,-66.249133],[52.614133,-66.053176],[53.613038,-65.89639],[54.53355,-65.818049],[55.414943,-65.876805],[56.355041,-65.974783],[57.158093,-66.249133],[57.255968,-66.680218],[58.137361,-67.013324],[58.744508,-67.287675],[59.939318,-67.405239],[60.605221,-67.679589],[61.427806,-67.953887],[62.387489,-68.012695],[63.19049,-67.816738],[64.052349,-67.405239],[64.992447,-67.620729],[65.971715,-67.738345],[66.911864,-67.855909],[67.891133,-67.934302],[68.890038,-67.934302],[69.712624,-68.972791],[69.673453,-69.227556],[69.555941,-69.678226],[68.596258,-69.93294],[67.81274,-70.305268],[67.949889,-70.697182],[69.066307,-70.677545],[68.929157,-71.069459],[68.419989,-71.441788],[67.949889,-71.853287],[68.71377,-72.166808],[69.869307,-72.264787],[71.024895,-72.088415],[71.573285,-71.696501],[71.906288,-71.324224],[72.454627,-71.010703],[73.08141,-70.716768],[73.33602,-70.364024],[73.864877,-69.874183],[74.491557,-69.776205],[75.62756,-69.737034],[76.626465,-69.619419],[77.644904,-69.462684],[78.134539,-69.07077],[78.428371,-68.698441],[79.113859,-68.326216],[80.093127,-68.071503],[80.93535,-67.875546],[81.483792,-67.542388],[82.051767,-67.366068],[82.776426,-67.209282],[83.775331,-67.30726],[84.676206,-67.209282],[85.655527,-67.091718],[86.752359,-67.150474],[87.477017,-66.876175],[87.986289,-66.209911],[88.358411,-66.484261],[88.828408,-66.954568],[89.67063,-67.150474],[90.630365,-67.228867],[91.5901,-67.111303],[92.608539,-67.189696],[93.548637,-67.209282],[94.17542,-67.111303],[95.017591,-67.170111],[95.781472,-67.385653],[96.682399,-67.248504],[97.759646,-67.248504],[98.68021,-67.111303],[99.718182,-67.248504],[100.384188,-66.915346],[100.893356,-66.58224],[101.578896,-66.30789],[102.832411,-65.563284],[103.478676,-65.700485],[104.242557,-65.974783],[104.90846,-66.327527],[106.181561,-66.934931],[107.160881,-66.954568],[108.081393,-66.954568],[109.15864,-66.837004],[110.235835,-66.699804],[111.058472,-66.425505],[111.74396,-66.13157],[112.860378,-66.092347],[113.604673,-65.876805],[114.388088,-66.072762],[114.897308,-66.386283],[115.602381,-66.699804],[116.699161,-66.660633],[117.384701,-66.915346],[118.57946,-67.170111],[119.832924,-67.268089],[120.871,-67.189696],[121.654415,-66.876175],[122.320369,-66.562654],[123.221296,-66.484261],[124.122274,-66.621462],[125.160247,-66.719389],[126.100396,-66.562654],[127.001427,-66.562654],[127.882768,-66.660633],[128.80328,-66.758611],[129.704259,-66.58224],[130.781454,-66.425505],[131.799945,-66.386283],[132.935896,-66.386283],[133.85646,-66.288304],[134.757387,-66.209963],[135.031582,-65.72007],[135.070753,-65.308571],[135.697485,-65.582869],[135.873805,-66.033591],[136.206705,-66.44509],[136.618049,-66.778197],[137.460271,-66.954568],[138.596223,-66.895761],[139.908442,-66.876175],[140.809421,-66.817367],[142.121692,-66.817367],[143.061842,-66.797782],[144.374061,-66.837004],[145.490427,-66.915346],[146.195552,-67.228867],[145.999699,-67.601196],[146.646067,-67.895131],[147.723263,-68.130259],[148.839629,-68.385024],[150.132314,-68.561292],[151.483705,-68.71813],[152.502247,-68.874813],[153.638199,-68.894502],[154.284567,-68.561292],[155.165857,-68.835642],[155.92979,-69.149215],[156.811132,-69.384291],[158.025528,-69.482269],[159.181013,-69.599833],[159.670699,-69.991747],[160.80665,-70.226875],[161.570479,-70.579618],[162.686897,-70.736353],[163.842434,-70.716768],[164.919681,-70.775524],[166.11444,-70.755938],[167.309095,-70.834332],[168.425616,-70.971481],[169.463589,-71.20666],[170.501665,-71.402617],[171.20679,-71.696501],[171.089227,-72.088415],[170.560422,-72.441159],[170.109958,-72.891829],[169.75737,-73.24452],[169.287321,-73.65602],[167.975101,-73.812806],[167.387489,-74.165498],[166.094803,-74.38104],[165.644391,-74.772954],[164.958851,-75.145283],[164.234193,-75.458804],[163.822797,-75.870303],[163.568239,-76.24258],[163.47026,-76.693302],[163.489897,-77.065579],[164.057873,-77.457442],[164.273363,-77.82977],[164.743464,-78.182514],[166.604126,-78.319611],[166.995781,-78.750748],[165.193876,-78.907483],[163.666217,-79.123025],[161.766385,-79.162248],[160.924162,-79.730482],[160.747894,-80.200737],[160.316964,-80.573066],[159.788211,-80.945395],[161.120016,-81.278501],[161.629287,-81.690001],[162.490992,-82.062278],[163.705336,-82.395435],[165.095949,-82.708956],[166.604126,-83.022477],[168.895665,-83.335998],[169.404782,-83.825891],[172.283934,-84.041433],[172.477049,-84.117914],[173.224083,-84.41371],[175.985672,-84.158997],[178.277212,-84.472518],[180,-84.71338],[180,-90],[-180,-90],[-180,-84.71338],[-179.942499,-84.721443],[-179.058677,-84.139412],[-177.256772,-84.452933],[-177.140807,-84.417941],[-176.861993,-84.333812],[-176.523952,-84.231811],[-176.230303,-84.143203],[-176.084673,-84.099259],[-175.934101,-84.101591],[-175.829882,-84.117914],[-174.382503,-84.534323],[-173.116559,-84.117914],[-172.889106,-84.061019],[-169.951223,-83.884647],[-168.999989,-84.117914],[-168.530199,-84.23739],[-167.022099,-84.570497],[-164.182144,-84.82521],[-161.929775,-85.138731],[-158.07138,-85.37391],[-155.192253,-85.09956],[-150.942099,-85.295517],[-148.533073,-85.609038],[-145.888918,-85.315102],[-143.107718,-85.040752],[-142.892279,-84.570497],[-146.829068,-84.531274],[-150.060732,-84.296146],[-150.902928,-83.904232],[-153.586201,-83.68869],[-153.409907,-83.23802],[-153.037759,-82.82652],[-152.665637,-82.454192],[-152.861517,-82.042692],[-154.526299,-81.768394],[-155.29018,-81.41565],[-156.83745,-81.102129],[-154.408787,-81.160937],[-152.097662,-81.004151],[-150.648293,-81.337309],[-148.865998,-81.043373],[-147.22075,-80.671045],[-146.417749,-80.337938],[-146.770286,-79.926439],[-148.062947,-79.652089],[-149.531901,-79.358205],[-151.588416,-79.299397],[-153.390322,-79.162248],[-155.329376,-79.064269],[-155.975668,-78.69194],[-157.268302,-78.378419],[-158.051768,-78.025676],[-158.365134,-76.889207],[-157.875474,-76.987238],[-156.974573,-77.300759],[-155.329376,-77.202728],[-153.742832,-77.065579],[-152.920247,-77.496664],[-151.33378,-77.398737],[-150.00195,-77.183143],[-148.748486,-76.908845],[-147.612483,-76.575738],[-146.104409,-76.47776],[-146.143528,-76.105431],[-146.496091,-75.733154],[-146.20231,-75.380411],[-144.909624,-75.204039],[-144.322037,-75.537197],[-142.794353,-75.34124],[-141.638764,-75.086475],[-140.209007,-75.06689],[-138.85759,-74.968911],[-137.5062,-74.733783],[-136.428901,-74.518241],[-135.214583,-74.302699],[-134.431194,-74.361455],[-133.745654,-74.439848],[-132.257168,-74.302699],[-130.925311,-74.479019],[-129.554284,-74.459433],[-128.242038,-74.322284],[-126.890622,-74.420263],[-125.402082,-74.518241],[-124.011496,-74.479019],[-122.562152,-74.498604],[-121.073613,-74.518241],[-119.70256,-74.479019],[-118.684145,-74.185083],[-117.469801,-74.028348],[-116.216312,-74.243891],[-115.021552,-74.067519],[-113.944331,-73.714828],[-113.297988,-74.028348],[-112.945452,-74.38104],[-112.299083,-74.714198],[-111.261059,-74.420263],[-110.066325,-74.79254],[-108.714909,-74.910103],[-107.559346,-75.184454],[-106.149148,-75.125698],[-104.876074,-74.949326],[-103.367949,-74.988497],[-102.016507,-75.125698],[-100.645531,-75.302018],[-100.1167,-74.870933],[-100.763043,-74.537826],[-101.252703,-74.185083],[-102.545337,-74.106742],[-103.113313,-73.734413],[-103.328752,-73.362084],[-103.681289,-72.61753],[-102.917485,-72.754679],[-101.60524,-72.813436],[-100.312528,-72.754679],[-99.13738,-72.911414],[-98.118889,-73.20535],[-97.688037,-73.558041],[-96.336595,-73.616849],[-95.043961,-73.4797],[-93.672907,-73.283743],[-92.439003,-73.166179],[-91.420564,-73.401307],[-90.088733,-73.322914],[-89.226951,-72.558722],[-88.423951,-73.009393],[-87.268337,-73.185764],[-86.014822,-73.087786],[-85.192236,-73.4797],[-83.879991,-73.518871],[-82.665646,-73.636434],[-81.470913,-73.851977],[-80.687447,-73.4797],[-80.295791,-73.126956],[-79.296886,-73.518871],[-77.925858,-73.420892],[-76.907367,-73.636434],[-76.221879,-73.969541],[-74.890049,-73.871614],[-73.852024,-73.65602],[-72.833533,-73.401307],[-71.619215,-73.264157],[-70.209042,-73.146542],[-68.935916,-73.009393],[-67.956622,-72.79385],[-67.369061,-72.480329],[-67.134036,-72.049244],[-67.251548,-71.637745],[-67.56494,-71.245831],[-67.917477,-70.853917],[-68.230843,-70.462055],[-68.485452,-70.109311],[-68.544209,-69.717397],[-68.446282,-69.325535],[-67.976233,-68.953206],[-67.5845,-68.541707],[-67.427843,-68.149844],[-67.62367,-67.718759],[-67.741183,-67.326845],[-67.251548,-66.876175],[-66.703184,-66.58224],[-66.056815,-66.209963],[-65.371327,-65.89639],[-64.568276,-65.602506],[-64.176542,-65.171423],[-63.628152,-64.897073],[-63.001394,-64.642308],[-62.041686,-64.583552],[-61.414928,-64.270031],[-60.709855,-64.074074],[-59.887269,-63.95651],[-59.162585,-63.701745],[-58.594557,-63.388224],[-57.811143,-63.27066],[-57.223582,-63.525425],[-57.59573,-63.858532],[-58.614143,-64.152467]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-74.66253,-55.61183,-65.05,-52.5183],"geometry":{"type":"Polygon","coordinates":[[[-67.75,-53.85],[-66.45,-54.45],[-65.05,-54.7],[-65.5,-55.2],[-66.45,-55.25],[-66.95992,-54.89681],[-67.29103,-55.30124],[-68.14863,-55.61183],[-69.2321,-55.49906],[-69.95809,-55.19843],[-71.00568,-55.05383],[-72.2639,-54.49514],[-73.2852,-53.95752],[-74.66253,-52.83749],[-73.8381,-53.04743],[-72.43418,-53.7154],[-71.10773,-54.07433],[-70.59178,-53.61583],[-70.26748,-52.93123],[-69.34565,-52.5183],[-68.63411,-52.63625],[-68.63401,-52.63637],[-68.25,-53.1],[-67.75,-53.85]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0.5},"bbox":[-61.2,-52.3,-57.75,-51.1],"geometry":{"type":"Polygon","coordinates":[[[-58.55,-51.1],[-57.75,-51.55],[-58.05,-51.9],[-59.4,-52.2],[-59.85,-51.85],[-60.7,-52.3],[-61.2,-51.85],[-60,-51.25],[-59.15,-51.5],[-58.55,-51.1]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0.5},"bbox":[68.72,-49.775,70.56,-48.625],"geometry":{"type":"Polygon","coordinates":[[[70.28,-49.71],[68.745,-49.775],[68.72,-49.2425],[68.8675,-48.83],[68.935,-48.625],[69.58,-48.94],[70.525,-49.065],[70.56,-49.255],[70.28,-49.71]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[144.718071,-43.634597,148.359865,-40.703975],"geometry":{"type":"Polygon","coordinates":[[[145.397978,-40.792549],[146.364121,-41.137695],[146.908584,-41.000546],[147.689259,-40.808258],[148.289068,-40.875438],[148.359865,-42.062445],[148.017301,-42.407024],[147.914052,-43.211522],[147.564564,-42.937689],[146.870343,-43.634597],[146.663327,-43.580854],[146.048378,-43.549745],[145.43193,-42.693776],[145.29509,-42.03361],[144.718071,-41.162552],[144.743755,-40.703975],[145.397978,-40.792549]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[166.509144,-46.641235,174.248517,-40.493962],"geometry":{"type":"Polygon","coordinates":[[[173.020375,-40.919052],[173.247234,-41.331999],[173.958405,-40.926701],[174.247587,-41.349155],[174.248517,-41.770008],[173.876447,-42.233184],[173.22274,-42.970038],[172.711246,-43.372288],[173.080113,-43.853344],[172.308584,-43.865694],[171.452925,-44.242519],[171.185138,-44.897104],[170.616697,-45.908929],[169.831422,-46.355775],[169.332331,-46.641235],[168.411354,-46.619945],[167.763745,-46.290197],[166.676886,-46.219917],[166.509144,-45.852705],[167.046424,-45.110941],[168.303763,-44.123973],[168.949409,-43.935819],[169.667815,-43.555326],[170.52492,-43.031688],[171.12509,-42.512754],[171.569714,-41.767424],[171.948709,-41.514417],[172.097227,-40.956104],[172.79858,-40.493962],[173.020375,-40.919052]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[172.636005,-41.688308,178.517094,-34.450662],"geometry":{"type":"Polygon","coordinates":[[[174.612009,-36.156397],[175.336616,-37.209098],[175.357596,-36.526194],[175.808887,-36.798942],[175.95849,-37.555382],[176.763195,-37.881253],[177.438813,-37.961248],[178.010354,-37.579825],[178.517094,-37.695373],[178.274731,-38.582813],[177.97046,-39.166343],[177.206993,-39.145776],[176.939981,-39.449736],[177.032946,-39.879943],[176.885824,-40.065978],[176.508017,-40.604808],[176.01244,-41.289624],[175.239567,-41.688308],[175.067898,-41.425895],[174.650973,-41.281821],[175.22763,-40.459236],[174.900157,-39.908933],[173.824047,-39.508854],[173.852262,-39.146602],[174.574802,-38.797683],[174.743474,-38.027808],[174.697017,-37.381129],[174.292028,-36.711092],[174.319004,-36.534824],[173.840997,-36.121981],[173.054171,-35.237125],[172.636005,-34.529107],[173.007042,-34.450662],[173.551298,-35.006183],[174.32939,-35.265496],[174.612009,-36.156397]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[164.029606,-22.399976,167.120011,-20.105646],"geometry":{"type":"Polygon","coordinates":[[[167.120011,-22.159991],[166.740035,-22.399976],[166.189732,-22.129708],[165.474375,-21.679607],[164.829815,-21.14982],[164.167995,-20.444747],[164.029606,-20.105646],[164.459967,-20.120012],[165.020036,-20.459991],[165.460009,-20.800022],[165.77999,-21.080005],[166.599991,-21.700019],[167.120011,-22.159991]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0.5},"bbox":[177.28504,-18.28799,178.71806,-17.33992],"geometry":{"type":"Polygon","coordinates":[[[178.3736,-17.33992],[178.71806,-17.62846],[178.55271,-18.15059],[177.93266,-18.28799],[177.38146,-18.16432],[177.28504,-17.72465],[177.67087,-17.38114],[178.12557,-17.50481],[178.3736,-17.33992]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[178.596839,-17.012042,180,-16.067133],"geometry":{"type":"Polygon","coordinates":[[[179.364143,-16.801354],[178.725059,-17.012042],[178.596839,-16.63915],[179.096609,-16.433984],[179.413509,-16.379054],[180,-16.067133],[180,-16.555217],[179.364143,-16.801354]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[-180,-16.555217,-179.79332,-16.020882],"geometry":{"type":"Polygon","coordinates":[[[-179.917369,-16.501783],[-180,-16.555217],[-180,-16.067133],[-179.79332,-16.020882],[-179.917369,-16.501783]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[167.180008,-16.59785,167.844877,-15.891846],"geometry":{"type":"Polygon","coordinates":[[[167.844877,-16.466333],[167.515181,-16.59785],[167.180008,-16.159995],[167.216801,-15.891846],[167.844877,-16.466333]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[166.629137,-15.740021,167.270028,-14.626497],"geometry":{"type":"Polygon","coordinates":[[[167.107712,-14.93392],[167.270028,-15.740021],[167.001207,-15.614602],[166.793158,-15.668811],[166.649859,-15.392704],[166.629137,-14.626497],[167.107712,-14.93392]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[43.254187,-25.601434,50.476537,-12.040557],"geometry":{"type":"Polygon","coordinates":[[[50.056511,-13.555761],[50.217431,-14.758789],[50.476537,-15.226512],[50.377111,-15.706069],[50.200275,-16.000263],[49.860606,-15.414253],[49.672607,-15.710204],[49.863344,-16.451037],[49.774564,-16.875042],[49.498612,-17.106036],[49.435619,-17.953064],[49.041792,-19.118781],[48.548541,-20.496888],[47.930749,-22.391501],[47.547723,-23.781959],[47.095761,-24.94163],[46.282478,-25.178463],[45.409508,-25.601434],[44.833574,-25.346101],[44.03972,-24.988345],[43.763768,-24.460677],[43.697778,-23.574116],[43.345654,-22.776904],[43.254187,-22.057413],[43.433298,-21.336475],[43.893683,-21.163307],[43.89637,-20.830459],[44.374325,-20.072366],[44.464397,-19.435454],[44.232422,-18.961995],[44.042976,-18.331387],[43.963084,-17.409945],[44.312469,-16.850496],[44.446517,-16.216219],[44.944937,-16.179374],[45.502732,-15.974373],[45.872994,-15.793454],[46.312243,-15.780018],[46.882183,-15.210182],[47.70513,-14.594303],[48.005215,-14.091233],[47.869047,-13.663869],[48.293828,-13.784068],[48.84506,-13.089175],[48.863509,-12.487868],[49.194651,-12.040557],[49.543519,-12.469833],[49.808981,-12.895285],[50.056511,-13.555761]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[113.338953,-39.035757,153.569469,-10.668186],"geometry":{"type":"Polygon","coordinates":[[[143.561811,-13.763656],[143.922099,-14.548311],[144.563714,-14.171176],[144.894908,-14.594458],[145.374724,-14.984976],[145.271991,-15.428205],[145.48526,-16.285672],[145.637033,-16.784918],[145.888904,-16.906926],[146.160309,-17.761655],[146.063674,-18.280073],[146.387478,-18.958274],[147.471082,-19.480723],[148.177602,-19.955939],[148.848414,-20.39121],[148.717465,-20.633469],[149.28942,-21.260511],[149.678337,-22.342512],[150.077382,-22.122784],[150.482939,-22.556142],[150.727265,-22.402405],[150.899554,-23.462237],[151.609175,-24.076256],[152.07354,-24.457887],[152.855197,-25.267501],[153.136162,-26.071173],[153.161949,-26.641319],[153.092909,-27.2603],[153.569469,-28.110067],[153.512108,-28.995077],[153.339095,-29.458202],[153.069241,-30.35024],[153.089602,-30.923642],[152.891578,-31.640446],[152.450002,-32.550003],[151.709117,-33.041342],[151.343972,-33.816023],[151.010555,-34.31036],[150.714139,-35.17346],[150.32822,-35.671879],[150.075212,-36.420206],[149.946124,-37.109052],[149.997284,-37.425261],[149.423882,-37.772681],[148.304622,-37.809061],[147.381733,-38.219217],[146.922123,-38.606532],[146.317922,-39.035757],[145.489652,-38.593768],[144.876976,-38.417448],[145.032212,-37.896188],[144.485682,-38.085324],[143.609974,-38.809465],[142.745427,-38.538268],[142.17833,-38.380034],[141.606582,-38.308514],[140.638579,-38.019333],[139.992158,-37.402936],[139.806588,-36.643603],[139.574148,-36.138362],[139.082808,-35.732754],[138.120748,-35.612296],[138.449462,-35.127261],[138.207564,-34.384723],[137.71917,-35.076825],[136.829406,-35.260535],[137.352371,-34.707339],[137.503886,-34.130268],[137.890116,-33.640479],[137.810328,-32.900007],[136.996837,-33.752771],[136.372069,-34.094766],[135.989043,-34.890118],[135.208213,-34.47867],[135.239218,-33.947953],[134.613417,-33.222778],[134.085904,-32.848072],[134.273903,-32.617234],[132.990777,-32.011224],[132.288081,-31.982647],[131.326331,-31.495803],[129.535794,-31.590423],[128.240938,-31.948489],[127.102867,-32.282267],[126.148714,-32.215966],[125.088623,-32.728751],[124.221648,-32.959487],[124.028947,-33.483847],[123.659667,-33.890179],[122.811036,-33.914467],[122.183064,-34.003402],[121.299191,-33.821036],[120.580268,-33.930177],[119.893695,-33.976065],[119.298899,-34.509366],[119.007341,-34.464149],[118.505718,-34.746819],[118.024972,-35.064733],[117.295507,-35.025459],[116.625109,-35.025097],[115.564347,-34.386428],[115.026809,-34.196517],[115.048616,-33.623425],[115.545123,-33.487258],[115.714674,-33.259572],[115.679379,-32.900369],[115.801645,-32.205062],[115.689611,-31.612437],[115.160909,-30.601594],[114.997043,-30.030725],[115.040038,-29.461095],[114.641974,-28.810231],[114.616498,-28.516399],[114.173579,-28.118077],[114.048884,-27.334765],[113.477498,-26.543134],[113.338953,-26.116545],[113.778358,-26.549025],[113.440962,-25.621278],[113.936901,-25.911235],[114.232852,-26.298446],[114.216161,-25.786281],[113.721255,-24.998939],[113.625344,-24.683971],[113.393523,-24.384764],[113.502044,-23.80635],[113.706993,-23.560215],[113.843418,-23.059987],[113.736552,-22.475475],[114.149756,-21.755881],[114.225307,-22.517488],[114.647762,-21.82952],[115.460167,-21.495173],[115.947373,-21.068688],[116.711615,-20.701682],[117.166316,-20.623599],[117.441545,-20.746899],[118.229559,-20.374208],[118.836085,-20.263311],[118.987807,-20.044203],[119.252494,-19.952942],[119.805225,-19.976506],[120.85622,-19.683708],[121.399856,-19.239756],[121.655138,-18.705318],[122.241665,-18.197649],[122.286624,-17.798603],[122.312772,-17.254967],[123.012574,-16.4052],[123.433789,-17.268558],[123.859345,-17.069035],[123.503242,-16.596506],[123.817073,-16.111316],[124.258287,-16.327944],[124.379726,-15.56706],[124.926153,-15.0751],[125.167275,-14.680396],[125.670087,-14.51007],[125.685796,-14.230656],[126.125149,-14.347341],[126.142823,-14.095987],[126.582589,-13.952791],[127.065867,-13.817968],[127.804633,-14.276906],[128.35969,-14.86917],[128.985543,-14.875991],[129.621473,-14.969784],[129.4096,-14.42067],[129.888641,-13.618703],[130.339466,-13.357376],[130.183506,-13.10752],[130.617795,-12.536392],[131.223495,-12.183649],[131.735091,-12.302453],[132.575298,-12.114041],[132.557212,-11.603012],[131.824698,-11.273782],[132.357224,-11.128519],[133.019561,-11.376411],[133.550846,-11.786515],[134.393068,-12.042365],[134.678632,-11.941183],[135.298491,-12.248606],[135.882693,-11.962267],[136.258381,-12.049342],[136.492475,-11.857209],[136.95162,-12.351959],[136.685125,-12.887223],[136.305407,-13.29123],[135.961758,-13.324509],[136.077617,-13.724278],[135.783836,-14.223989],[135.428664,-14.715432],[135.500184,-14.997741],[136.295175,-15.550265],[137.06536,-15.870762],[137.580471,-16.215082],[138.303217,-16.807604],[138.585164,-16.806622],[139.108543,-17.062679],[139.260575,-17.371601],[140.215245,-17.710805],[140.875463,-17.369069],[141.07111,-16.832047],[141.274095,-16.38887],[141.398222,-15.840532],[141.702183,-15.044921],[141.56338,-14.561333],[141.63552,-14.270395],[141.519869,-13.698078],[141.65092,-12.944688],[141.842691,-12.741548],[141.68699,-12.407614],[141.928629,-11.877466],[142.118488,-11.328042],[142.143706,-11.042737],[142.51526,-10.668186],[142.79731,-11.157355],[142.866763,-11.784707],[143.115947,-11.90563],[143.158632,-12.325656],[143.522124,-12.834358],[143.597158,-13.400422],[143.561811,-13.763656]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[161.319797,-10.826367,162.398646,-10.204751],"geometry":{"type":"Polygon","coordinates":[[[162.119025,-10.482719],[162.398646,-10.826367],[161.700032,-10.820011],[161.319797,-10.204751],[161.917383,-10.446701],[162.119025,-10.482719]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[118.967808,-10.25865,120.775502,-9.36134],"geometry":{"type":"Polygon","coordinates":[[[120.715609,-10.239581],[120.295014,-10.25865],[118.967808,-9.557969],[119.90031,-9.36134],[120.425756,-9.665921],[120.775502,-9.969675],[120.715609,-10.239581]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[159.640003,-9.89521,160.852229,-9.24295],"geometry":{"type":"Polygon","coordinates":[[[160.852229,-9.872937],[160.462588,-9.89521],[159.849447,-9.794027],[159.640003,-9.63998],[159.702945,-9.24295],[160.362956,-9.400304],[160.688518,-9.610162],[160.852229,-9.872937]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[160.579997,-9.784312,161.679982,-8.320009],"geometry":{"type":"Polygon","coordinates":[[[161.679982,-9.599982],[161.529397,-9.784312],[160.788253,-8.917543],[160.579997,-8.320009],[160.920028,-8.320009],[161.280006,-9.120011],[161.679982,-9.599982]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[123.459989,-10.359987,127.335928,-8.273345],"geometry":{"type":"Polygon","coordinates":[[[124.43595,-10.140001],[123.579982,-10.359987],[123.459989,-10.239995],[123.550009,-9.900016],[123.980009,-9.290027],[124.968682,-8.89279],[125.086246,-8.656887],[125.947072,-8.432095],[126.644704,-8.398247],[126.957243,-8.273345],[127.335928,-8.397317],[126.967992,-8.668256],[125.925885,-9.106007],[125.08852,-9.393173],[124.43595,-10.140001]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[116.740141,-9.040895,119.126507,-8.095681],"geometry":{"type":"Polygon","coordinates":[[[117.900018,-8.095681],[118.260616,-8.362383],[118.87846,-8.280683],[119.126507,-8.705825],[117.970402,-8.906639],[117.277731,-9.040895],[116.740141,-9.032937],[117.083737,-8.457158],[117.632024,-8.449303],[117.900018,-8.095681]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[119.920929,-8.933666,122.903537,-8.094234],"geometry":{"type":"Polygon","coordinates":[[[122.903537,-8.094234],[122.756983,-8.649808],[121.254491,-8.933666],[119.924391,-8.810418],[119.920929,-8.444859],[120.715092,-8.236965],[121.341669,-8.53674],[122.007365,-8.46062],[122.903537,-8.094234]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[158.21115,-8.53829,159.917402,-7.320018],"geometry":{"type":"Polygon","coordinates":[[[159.875027,-8.33732],[159.917402,-8.53829],[159.133677,-8.114181],[158.586114,-7.754824],[158.21115,-7.421872],[158.359978,-7.320018],[158.820001,-7.560003],[159.640003,-8.020027],[159.875027,-8.33732]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[156.491358,-7.404767,157.538426,-6.599338],"geometry":{"type":"Polygon","coordinates":[[[157.538426,-7.34782],[157.33942,-7.404767],[156.90203,-7.176874],[156.491358,-6.765943],[156.542828,-6.599338],[157.14,-7.021638],[157.538426,-7.34782]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[105.365486,-8.751817,115.705527,-5.895919],"geometry":{"type":"Polygon","coordinates":[[[108.623479,-6.777674],[110.539227,-6.877358],[110.759576,-6.465186],[112.614811,-6.946036],[112.978768,-7.594213],[114.478935,-7.776528],[115.705527,-8.370807],[114.564511,-8.751817],[113.464734,-8.348947],[112.559672,-8.376181],[111.522061,-8.302129],[110.58615,-8.122605],[109.427667,-7.740664],[108.693655,-7.6416],[108.277763,-7.766657],[106.454102,-7.3549],[106.280624,-6.9249],[105.365486,-6.851416],[106.051646,-5.895919],[107.265009,-5.954985],[108.072091,-6.345762],[108.486846,-6.421985],[108.623479,-6.777674]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[134.112776,-6.895238,134.727002,-5.445042],"geometry":{"type":"Polygon","coordinates":[[[134.724624,-6.214401],[134.210134,-6.895238],[134.112776,-6.142467],[134.290336,-5.783058],[134.499625,-5.445042],[134.727002,-5.737582],[134.724624,-6.214401]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[154.514114,-6.919991,156.019965,-5.042431],"geometry":{"type":"Polygon","coordinates":[[[155.880026,-6.819997],[155.599991,-6.919991],[155.166994,-6.535931],[154.729192,-5.900828],[154.514114,-5.139118],[154.652504,-5.042431],[154.759991,-5.339984],[155.062918,-5.566792],[155.547746,-6.200655],[156.019965,-6.540014],[155.880026,-6.819997]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[148.318937,-6.317754,152.338743,-4.14879],"geometry":{"type":"Polygon","coordinates":[[[151.982796,-5.478063],[151.459107,-5.56028],[151.30139,-5.840728],[150.754447,-6.083763],[150.241197,-6.317754],[149.709963,-6.316513],[148.890065,-6.02604],[148.318937,-5.747142],[148.401826,-5.437756],[149.298412,-5.583742],[149.845562,-5.505503],[149.99625,-5.026101],[150.139756,-5.001348],[150.236908,-5.53222],[150.807467,-5.455842],[151.089672,-5.113693],[151.647881,-4.757074],[151.537862,-4.167807],[152.136792,-4.14879],[152.338743,-4.312966],[152.318693,-4.867661],[151.982796,-5.478063]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[125.989034,-3.790983,127.249215,-3.129318],"geometry":{"type":"Polygon","coordinates":[[[127.249215,-3.459065],[126.874923,-3.790983],[126.183802,-3.607376],[125.989034,-3.177273],[127.000651,-3.129318],[127.249215,-3.459065]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[127.898891,-3.858472,130.834836,-2.802154],"geometry":{"type":"Polygon","coordinates":[[[130.471344,-3.093764],[130.834836,-3.858472],[129.990547,-3.446301],[129.155249,-3.362637],[128.590684,-3.428679],[127.898891,-3.393436],[128.135879,-2.84365],[129.370998,-2.802154],[130.471344,-3.093764]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[150.66205,-4.766427,153.140038,-2.500002],"geometry":{"type":"Polygon","coordinates":[[[153.140038,-4.499983],[152.827292,-4.766427],[152.638673,-4.176127],[152.406026,-3.789743],[151.953237,-3.462062],[151.384279,-3.035422],[150.66205,-2.741486],[150.939965,-2.500002],[151.479984,-2.779985],[151.820015,-2.999972],[152.239989,-3.240009],[152.640017,-3.659983],[153.019994,-3.980015],[153.140038,-4.499983]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[130.519558,-10.652476,150.801628,-0.369538],"geometry":{"type":"Polygon","coordinates":[[[134.143368,-1.151867],[134.422627,-2.769185],[135.457603,-3.367753],[136.293314,-2.307042],[137.440738,-1.703513],[138.329727,-1.702686],[139.184921,-2.051296],[139.926684,-2.409052],[141.00021,-2.600151],[142.735247,-3.289153],[144.583971,-3.861418],[145.27318,-4.373738],[145.829786,-4.876498],[145.981922,-5.465609],[147.648073,-6.083659],[147.891108,-6.614015],[146.970905,-6.721657],[147.191874,-7.388024],[148.084636,-8.044108],[148.734105,-9.104664],[149.306835,-9.071436],[149.266631,-9.514406],[150.038728,-9.684318],[149.738798,-9.872937],[150.801628,-10.293687],[150.690575,-10.582713],[150.028393,-10.652476],[149.78231,-10.393267],[148.923138,-10.280923],[147.913018,-10.130441],[147.135443,-9.492444],[146.567881,-8.942555],[146.048481,-8.067414],[144.744168,-7.630128],[143.897088,-7.91533],[143.286376,-8.245491],[143.413913,-8.983069],[142.628431,-9.326821],[142.068259,-9.159596],[141.033852,-9.117893],[140.143415,-8.297168],[139.127767,-8.096043],[138.881477,-8.380935],[137.614474,-8.411683],[138.039099,-7.597882],[138.668621,-7.320225],[138.407914,-6.232849],[137.92784,-5.393366],[135.98925,-4.546544],[135.164598,-4.462931],[133.66288,-3.538853],[133.367705,-4.024819],[132.983956,-4.112979],[132.756941,-3.746283],[132.753789,-3.311787],[131.989804,-2.820551],[133.066845,-2.460418],[133.780031,-2.479848],[133.696212,-2.214542],[132.232373,-2.212526],[131.836222,-1.617162],[130.94284,-1.432522],[130.519558,-0.93772],[131.867538,-0.695461],[132.380116,-0.369538],[133.985548,-0.78021],[134.143368,-1.151867]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[118.767769,-5.6734,125.240501,1.643259],"geometry":{"type":"Polygon","coordinates":[[[125.240501,1.419836],[124.437035,0.427881],[123.685505,0.235593],[122.723083,0.431137],[121.056725,0.381217],[120.183083,0.237247],[120.04087,-0.519658],[120.935905,-1.408906],[121.475821,-0.955962],[123.340565,-0.615673],[123.258399,-1.076213],[122.822715,-0.930951],[122.38853,-1.516858],[121.508274,-1.904483],[122.454572,-3.186058],[122.271896,-3.5295],[123.170963,-4.683693],[123.162333,-5.340604],[122.628515,-5.634591],[122.236394,-5.282933],[122.719569,-4.464172],[121.738234,-4.851331],[121.489463,-4.574553],[121.619171,-4.188478],[120.898182,-3.602105],[120.972389,-2.627643],[120.305453,-2.931604],[120.390047,-4.097579],[120.430717,-5.528241],[119.796543,-5.6734],[119.366906,-5.379878],[119.653606,-4.459417],[119.498835,-3.494412],[119.078344,-3.487022],[118.767769,-2.801999],[119.180974,-2.147104],[119.323394,-1.353147],[119.825999,0.154254],[120.035702,0.566477],[120.885779,1.309223],[121.666817,1.013944],[122.927567,0.875192],[124.077522,0.917102],[125.065989,1.643259],[125.240501,1.419836]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[127.39949,-0.899996,128.688249,2.174596],"geometry":{"type":"Polygon","coordinates":[[[128.688249,1.132386],[128.635952,0.258486],[128.12017,0.356413],[127.968034,-0.252077],[128.379999,-0.780004],[128.100016,-0.899996],[127.696475,-0.266598],[127.39949,1.011722],[127.600512,1.810691],[127.932378,2.174596],[128.004156,1.628531],[128.594559,1.540811],[128.688249,1.132386]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[95.293026,-5.873285,106.108593,5.479821],"geometry":{"type":"Polygon","coordinates":[[[105.817655,-5.852356],[104.710384,-5.873285],[103.868213,-5.037315],[102.584261,-4.220259],[102.156173,-3.614146],[101.399113,-2.799777],[100.902503,-2.050262],[100.141981,-0.650348],[99.26374,0.183142],[98.970011,1.042882],[98.601351,1.823507],[97.699598,2.453184],[97.176942,3.308791],[96.424017,3.86886],[95.380876,4.970782],[95.293026,5.479821],[95.936863,5.439513],[97.484882,5.246321],[98.369169,4.26837],[99.142559,3.59035],[99.693998,3.174329],[100.641434,2.099381],[101.658012,2.083697],[102.498271,1.3987],[103.07684,0.561361],[103.838396,0.104542],[103.437645,-0.711946],[104.010789,-1.059212],[104.369991,-1.084843],[104.53949,-1.782372],[104.887893,-2.340425],[105.622111,-2.428844],[106.108593,-3.061777],[105.857446,-4.305525],[105.817655,-5.852356]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[108.952658,-4.106984,119.181904,6.928053],"geometry":{"type":"Polygon","coordinates":[[[117.875627,1.827641],[118.996747,0.902219],[117.811858,0.784242],[117.478339,0.102475],[117.521644,-0.803723],[116.560048,-1.487661],[116.533797,-2.483517],[116.148084,-4.012726],[116.000858,-3.657037],[114.864803,-4.106984],[114.468652,-3.495704],[113.755672,-3.43917],[113.256994,-3.118776],[112.068126,-3.478392],[111.703291,-2.994442],[111.04824,-3.049426],[110.223846,-2.934032],[110.070936,-1.592874],[109.571948,-1.314907],[109.091874,-0.459507],[108.952658,0.415375],[109.069136,1.341934],[109.66326,2.006467],[110.396135,1.663775],[111.168853,1.850637],[111.370081,2.697303],[111.796928,2.885897],[112.995615,3.102395],[113.712935,3.893509],[114.204017,4.525874],[114.599961,4.900011],[115.45071,5.44773],[116.220741,6.143191],[116.725103,6.924771],[117.129626,6.928053],[117.643393,6.422166],[117.689075,5.98749],[118.347691,5.708696],[119.181904,5.407836],[119.110694,5.016128],[118.439727,4.966519],[118.618321,4.478202],[117.882035,4.137551],[117.313232,3.234428],[118.04833,2.28769],[117.875627,1.827641]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[121.919928,5.581003,126.537424,9.760335],"geometry":{"type":"Polygon","coordinates":[[[126.376814,8.414706],[126.478513,7.750354],[126.537424,7.189381],[126.196773,6.274294],[125.831421,7.293715],[125.363852,6.786485],[125.683161,6.049657],[125.396512,5.581003],[124.219788,6.161355],[123.93872,6.885136],[124.243662,7.36061],[123.610212,7.833527],[123.296071,7.418876],[122.825506,7.457375],[122.085499,6.899424],[121.919928,7.192119],[122.312359,8.034962],[122.942398,8.316237],[123.487688,8.69301],[123.841154,8.240324],[124.60147,8.514158],[124.764612,8.960409],[125.471391,8.986997],[125.412118,9.760335],[126.222714,9.286074],[126.306637,8.782487],[126.376814,8.414706]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[79.695167,5.96837,81.787959,9.824078],"geometry":{"type":"Polygon","coordinates":[[[81.21802,6.197141],[80.348357,5.96837],[79.872469,6.763463],[79.695167,8.200843],[80.147801,9.824078],[80.838818,9.268427],[81.304319,8.564206],[81.787959,7.523055],[81.637322,6.481775],[81.21802,6.197141]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[-61.95,10,-60.895,10.89],"geometry":{"type":"Polygon","coordinates":[[[-60.935,10.11],[-61.77,10],[-61.95,10.09],[-61.66,10.365],[-61.68,10.76],[-61.105,10.89],[-60.895,10.855],[-60.935,10.11]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[122.380055,9.022189,124.077936,11.232726],"geometry":{"type":"Polygon","coordinates":[[[123.982438,10.278779],[123.623183,9.950091],[123.309921,9.318269],[122.995883,9.022189],[122.380055,9.713361],[122.586089,9.981045],[122.837081,10.261157],[122.947411,10.881868],[123.49885,10.940624],[123.337774,10.267384],[124.077936,11.232726],[123.982438,10.278779]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[117.174275,8.3675,119.689677,11.369668],"geometry":{"type":"Polygon","coordinates":[[[118.504581,9.316383],[117.174275,8.3675],[117.664477,9.066889],[118.386914,9.6845],[118.987342,10.376292],[119.511496,11.369668],[119.689677,10.554291],[119.029458,10.003653],[118.504581,9.316383]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[121.883548,10.441017,123.120217,11.891755],"geometry":{"type":"Polygon","coordinates":[[[121.883548,11.891755],[122.483821,11.582187],[123.120217,11.58366],[123.100838,11.165934],[122.637714,10.741308],[122.00261,10.441017],[121.967367,10.905691],[122.03837,11.415841],[121.883548,11.891755]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[124.266762,10.134679,125.783465,12.557761],"geometry":{"type":"Polygon","coordinates":[[[125.502552,12.162695],[125.783465,11.046122],[125.011884,11.311455],[125.032761,10.975816],[125.277449,10.358722],[124.801819,10.134679],[124.760168,10.837995],[124.459101,10.88993],[124.302522,11.495371],[124.891013,11.415583],[124.87799,11.79419],[124.266762,12.557761],[125.227116,12.535721],[125.502552,12.162695]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[120.323436,12.20556,121.527394,13.466413],"geometry":{"type":"Polygon","coordinates":[[[121.527394,13.06959],[121.26219,12.20556],[120.833896,12.704496],[120.323436,13.466413],[121.180128,13.429697],[121.527394,13.06959]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[119.883773,12.536677,124.181289,18.505227],"geometry":{"type":"Polygon","coordinates":[[[121.321308,18.504065],[121.937601,18.218552],[122.246006,18.47895],[122.336957,18.224883],[122.174279,17.810283],[122.515654,17.093505],[122.252311,16.262444],[121.662786,15.931018],[121.50507,15.124814],[121.728829,14.328376],[122.258925,14.218202],[122.701276,14.336541],[123.950295,13.782131],[123.855107,13.237771],[124.181289,12.997527],[124.077419,12.536677],[123.298035,13.027526],[122.928652,13.55292],[122.671355,13.185836],[122.03465,13.784482],[121.126385,13.636687],[120.628637,13.857656],[120.679384,14.271016],[120.991819,14.525393],[120.693336,14.756671],[120.564145,14.396279],[120.070429,14.970869],[119.920929,15.406347],[119.883773,16.363704],[120.286488,16.034629],[120.390047,17.599081],[120.715867,18.505227],[121.321308,18.504065]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-67.242428,17.946553,-65.591004,18.520601],"geometry":{"type":"Polygon","coordinates":[[[-65.591004,18.228035],[-65.847164,17.975906],[-66.599934,17.981823],[-67.184162,17.946553],[-67.242428,18.37446],[-67.100679,18.520601],[-66.282434,18.514762],[-65.771303,18.426679],[-65.591004,18.228035]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-78.337719,17.701116,-76.199659,18.524218],"geometry":{"type":"Polygon","coordinates":[[[-76.902561,17.868238],[-77.206341,17.701116],[-77.766023,17.861597],[-78.337719,18.225968],[-78.217727,18.454533],[-77.797365,18.524218],[-77.569601,18.490525],[-76.896619,18.400867],[-76.365359,18.160701],[-76.199659,17.886867],[-76.902561,17.868238]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-74.458034,17.598564,-68.317943,19.915684],"geometry":{"type":"Polygon","coordinates":[[[-72.579673,19.871501],[-71.712361,19.714456],[-71.587304,19.884911],[-70.806706,19.880286],[-70.214365,19.622885],[-69.950815,19.648],[-69.76925,19.293267],[-69.222126,19.313214],[-69.254346,19.015196],[-68.809412,18.979074],[-68.317943,18.612198],[-68.689316,18.205142],[-69.164946,18.422648],[-69.623988,18.380713],[-69.952934,18.428307],[-70.133233,18.245915],[-70.517137,18.184291],[-70.669298,18.426886],[-70.99995,18.283329],[-71.40021,17.598564],[-71.657662,17.757573],[-71.708305,18.044997],[-72.372476,18.214961],[-72.844411,18.145611],[-73.454555,18.217906],[-73.922433,18.030993],[-74.458034,18.34255],[-74.369925,18.664908],[-73.449542,18.526053],[-72.694937,18.445799],[-72.334882,18.668422],[-72.79165,19.101625],[-72.784105,19.483591],[-73.415022,19.639551],[-73.189791,19.915684],[-72.579673,19.871501]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[108.626217,18.197701,111.010051,20.101254],"geometry":{"type":"Polygon","coordinates":[[[110.339188,18.678395],[109.47521,18.197701],[108.655208,18.507682],[108.626217,19.367888],[109.119056,19.821039],[110.211599,20.101254],[110.786551,20.077534],[111.010051,19.69593],[110.570647,19.255879],[110.339188,18.678395]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0.5},"bbox":[-156.07347,18.91619,-154.80741,20.26721],"geometry":{"type":"Polygon","coordinates":[[[-155.54211,19.08348],[-155.68817,18.91619],[-155.93665,19.05939],[-155.90806,19.33888],[-156.07347,19.70294],[-156.02368,19.81422],[-155.85008,19.97729],[-155.91907,20.17395],[-155.86108,20.26721],[-155.78505,20.2487],[-155.40214,20.07975],[-155.22452,19.99302],[-155.06226,19.8591],[-154.80741,19.50871],[-154.83147,19.45328],[-155.22217,19.23972],[-155.54211,19.08348]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[-156.71055,20.57241,-155.99566,21.01249],"geometry":{"type":"Polygon","coordinates":[[[-156.07926,20.64397],[-156.41445,20.57241],[-156.58673,20.783],[-156.70167,20.8643],[-156.71055,20.92676],[-156.61258,21.01249],[-156.25711,20.91745],[-155.99566,20.76404],[-156.07926,20.64397]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[-157.32521,21.06873,-156.75824,21.21958],"geometry":{"type":"Polygon","coordinates":[[[-156.75824,21.17684],[-156.78933,21.06873],[-157.32521,21.09777],[-157.25027,21.21958],[-156.75824,21.17684]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[-158.29265,21.26442,-157.65283,21.71696],"geometry":{"type":"Polygon","coordinates":[[[-157.65283,21.32217],[-157.70703,21.26442],[-157.7786,21.27729],[-158.12667,21.31244],[-158.2538,21.53919],[-158.29265,21.57912],[-158.0252,21.71696],[-157.94161,21.65272],[-157.65283,21.32217]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[-159.80051,21.88299,-159.34512,22.23618],"geometry":{"type":"Polygon","coordinates":[[[-159.34512,21.982],[-159.46372,21.88299],[-159.80051,22.06533],[-159.74877,22.1382],[-159.5962,22.23618],[-159.36569,22.21494],[-159.34512,21.982]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-84.974911,19.855481,-74.178025,23.188611],"geometry":{"type":"Polygon","coordinates":[[[-79.679524,22.765303],[-79.281486,22.399202],[-78.347434,22.512166],[-77.993296,22.277194],[-77.146422,21.657851],[-76.523825,21.20682],[-76.19462,21.220565],[-75.598222,21.016624],[-75.67106,20.735091],[-74.933896,20.693905],[-74.178025,20.284628],[-74.296648,20.050379],[-74.961595,19.923435],[-75.63468,19.873774],[-76.323656,19.952891],[-77.755481,19.855481],[-77.085108,20.413354],[-77.492655,20.673105],[-78.137292,20.739949],[-78.482827,21.028613],[-78.719867,21.598114],[-79.285,21.559175],[-80.217475,21.827324],[-80.517535,22.037079],[-81.820943,22.192057],[-82.169992,22.387109],[-81.795002,22.636965],[-82.775898,22.68815],[-83.494459,22.168518],[-83.9088,22.154565],[-84.052151,21.910575],[-84.54703,21.801228],[-84.974911,21.896028],[-84.447062,22.20495],[-84.230357,22.565755],[-83.77824,22.788118],[-83.267548,22.983042],[-82.510436,23.078747],[-82.268151,23.188611],[-81.404457,23.117271],[-80.618769,23.10598],[-79.679524,22.765303]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[-78.40848,23.71,-77.53466,25.2103],"geometry":{"type":"Polygon","coordinates":[[[-77.53466,23.75975],[-77.78,23.71],[-78.03405,24.28615],[-78.40848,24.57564],[-78.19087,25.2103],[-77.89,25.17],[-77.54,24.34],[-77.53466,23.75975]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[120.106189,21.970571,121.951244,25.295459],"geometry":{"type":"Polygon","coordinates":[[[121.175632,22.790857],[120.74708,21.970571],[120.220083,22.814861],[120.106189,23.556263],[120.69468,24.538451],[121.495044,25.295459],[121.951244,24.997596],[121.777818,24.394274],[121.175632,22.790857]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[-78.98,26.42,-77.82,26.87],"geometry":{"type":"Polygon","coordinates":[[[-77.82,26.58],[-78.91,26.42],[-78.98,26.79],[-78.51,26.87],[-77.85,26.84],[-77.82,26.58]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[-77.79,25.87918,-77,27.04],"geometry":{"type":"Polygon","coordinates":[[[-77,26.59],[-77.17255,25.87918],[-77.35641,26.00735],[-77.34,26.53],[-77.78802,26.92516],[-77.79,27.04],[-77,26.59]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[132.363115,32.704567,134.766379,34.364931],"geometry":{"type":"Polygon","coordinates":[[[134.638428,34.149234],[134.766379,33.806335],[134.203416,33.201178],[133.79295,33.521985],[133.280268,33.28957],[133.014858,32.704567],[132.363115,32.989382],[132.371176,33.463642],[132.924373,34.060299],[133.492968,33.944621],[133.904106,34.364931],[134.638428,34.149234]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[32.256667,34.571869,34.576474,35.671596],"geometry":{"type":"Polygon","coordinates":[[[34.576474,35.671596],[33.900804,35.245756],[33.973617,35.058506],[34.004881,34.978098],[32.979827,34.571869],[32.490296,34.701655],[32.256667,35.103232],[32.73178,35.140026],[32.802474,35.145504],[32.946961,35.386703],[33.667227,35.373216],[34.576474,35.671596]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[23.514978,34.919988,26.290003,35.705004],"geometry":{"type":"Polygon","coordinates":[[[23.69998,35.705004],[24.246665,35.368022],[25.025015,35.424996],[25.769208,35.354018],[25.745023,35.179998],[26.290003,35.29999],[26.164998,35.004995],[24.724982,34.919988],[24.735007,35.084991],[23.514978,35.279992],[23.69998,35.705004]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[12.431004,36.619987,15.520376,38.231155],"geometry":{"type":"Polygon","coordinates":[[[15.520376,38.231155],[15.160243,37.444046],[15.309898,37.134219],[15.099988,36.619987],[14.335229,36.996631],[13.826733,37.104531],[12.431004,37.61295],[12.570944,38.126381],[13.741156,38.034966],[14.761249,38.143874],[15.520376,38.231155]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[8.159998,38.906618,9.809975,41.209991],"geometry":{"type":"Polygon","coordinates":[[[9.210012,41.209991],[9.809975,40.500009],[9.669519,39.177376],[9.214818,39.240473],[8.806936,38.906618],[8.428302,39.171847],[8.388253,40.378311],[8.159998,40.950007],[8.709991,40.899984],[9.210012,41.209991]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[129.408463,31.029579,141.914263,41.37856],"geometry":{"type":"Polygon","coordinates":[[[140.976388,37.142074],[140.59977,36.343983],[140.774074,35.842877],[140.253279,35.138114],[138.975528,34.6676],[137.217599,34.606286],[135.792983,33.464805],[135.120983,33.849071],[135.079435,34.596545],[133.340316,34.375938],[132.156771,33.904933],[130.986145,33.885761],[132.000036,33.149992],[131.33279,31.450355],[130.686318,31.029579],[130.20242,31.418238],[130.447676,32.319475],[129.814692,32.61031],[129.408463,33.296056],[130.353935,33.604151],[130.878451,34.232743],[131.884229,34.749714],[132.617673,35.433393],[134.608301,35.731618],[135.677538,35.527134],[136.723831,37.304984],[137.390612,36.827391],[138.857602,37.827485],[139.426405,38.215962],[140.05479,39.438807],[139.883379,40.563312],[140.305783,41.195005],[141.368973,41.37856],[141.914263,39.991616],[141.884601,39.180865],[140.959489,38.174001],[140.976388,37.142074]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[8.544213,41.380007,9.560016,43.009985],"geometry":{"type":"Polygon","coordinates":[[[9.560016,42.152492],[9.229752,41.380007],[8.775723,41.583612],[8.544213,42.256517],[8.746009,42.628122],[9.390001,43.009985],[9.560016,42.152492]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[139.817544,41.569556,145.543137,45.551483],"geometry":{"type":"Polygon","coordinates":[[[143.910162,44.1741],[144.613427,43.960883],[145.320825,44.384733],[145.543137,43.262088],[144.059662,42.988358],[143.18385,41.995215],[141.611491,42.678791],[141.067286,41.584594],[139.955106,41.569556],[139.817544,42.563759],[140.312087,43.333273],[141.380549,43.388825],[141.671952,44.772125],[141.967645,45.551483],[143.14287,44.510358],[143.910162,44.1741]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[-64.39261,45.96818,-62.01208,47.03601],"geometry":{"type":"Polygon","coordinates":[[[-63.6645,46.55001],[-62.9393,46.41587],[-62.01208,46.44314],[-62.50391,46.03339],[-62.87433,45.96818],[-64.1428,46.39265],[-64.39261,46.72747],[-64.01486,47.03601],[-63.6645,46.55001]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[-64.51912,49.08717,-61.806305,49.95718],"geometry":{"type":"Polygon","coordinates":[[[-61.806305,49.10506],[-62.29318,49.08717],[-63.58926,49.40069],[-64.51912,49.87304],[-64.17322,49.95718],[-62.85829,49.70641],[-61.835585,49.28855],[-61.806305,49.10506]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-128.444584,48.370846,-123.510002,50.770648],"geometry":{"type":"Polygon","coordinates":[[[-123.510002,48.510011],[-124.012891,48.370846],[-125.655013,48.825005],[-125.954994,49.179996],[-126.850004,49.53],[-127.029993,49.814996],[-128.059336,49.994959],[-128.444584,50.539138],[-128.358414,50.770648],[-127.308581,50.552574],[-126.695001,50.400903],[-125.755007,50.295018],[-125.415002,49.950001],[-124.920768,49.475275],[-123.922509,49.062484],[-123.510002,48.510011]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-59.419494,46.618292,-52.648099,51.632094],"geometry":{"type":"Polygon","coordinates":[[[-56.134036,50.68701],[-56.795882,49.812309],[-56.143105,50.150117],[-55.471492,49.935815],[-55.822401,49.587129],[-54.935143,49.313011],[-54.473775,49.556691],[-53.476549,49.249139],[-53.786014,48.516781],[-53.086134,48.687804],[-52.958648,48.157164],[-52.648099,47.535548],[-53.069158,46.655499],[-53.521456,46.618292],[-54.178936,46.807066],[-53.961869,47.625207],[-54.240482,47.752279],[-55.400773,46.884994],[-55.997481,46.91972],[-55.291219,47.389562],[-56.250799,47.632545],[-57.325229,47.572807],[-59.266015,47.603348],[-59.419494,47.899454],[-58.796586,48.251525],[-59.231625,48.523188],[-58.391805,49.125581],[-57.35869,50.718274],[-56.73865,51.287438],[-55.870977,51.632094],[-55.406974,51.588273],[-55.600218,51.317075],[-56.134036,50.68701]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-133.239664,52.180433,-131.179043,54.169975],"geometry":{"type":"Polygon","coordinates":[[[-132.710008,54.040009],[-132.710009,54.040009],[-132.710008,54.040009],[-132.710008,54.040009],[-131.74999,54.120004],[-132.04948,52.984621],[-131.179043,52.180433],[-131.57783,52.182371],[-132.180428,52.639707],[-132.549992,53.100015],[-133.054611,53.411469],[-133.239664,53.85108],[-133.180004,54.169975],[-132.710008,54.040009]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[141.594076,45.966755,144.654148,54.365881],"geometry":{"type":"Polygon","coordinates":[[[143.648007,50.7476],[144.654148,48.976391],[143.173928,49.306551],[142.558668,47.861575],[143.533492,46.836728],[143.505277,46.137908],[142.747701,46.740765],[142.09203,45.966755],[141.906925,46.805929],[142.018443,47.780133],[141.904445,48.859189],[142.1358,49.615163],[142.179983,50.952342],[141.594076,51.935435],[141.682546,53.301966],[142.606934,53.762145],[142.209749,54.225476],[142.654786,54.365881],[142.914616,53.704578],[143.260848,52.74076],[143.235268,51.75666],[143.648007,50.7476]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-9.977086,51.669301,-5.661949,55.17286],"geometry":{"type":"Polygon","coordinates":[[[-6.788857,52.260118],[-8.561617,51.669301],[-9.977086,51.820455],[-9.166283,52.864629],[-9.688525,53.881363],[-8.327987,54.664519],[-7.572168,55.131622],[-6.733847,55.17286],[-5.661949,54.554603],[-6.197885,53.867565],[-6.032985,53.153164],[-6.788857,52.260118]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[10.903914,54.800015,12.690006,56.111407],"geometry":{"type":"Polygon","coordinates":[[[12.690006,55.609991],[12.089991,54.800015],[11.043543,55.364864],[10.903914,55.779955],[12.370904,56.111407],[12.690006,55.609991]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-154.670993,56.734677,-152.141147,57.968968],"geometry":{"type":"Polygon","coordinates":[[[-153.006314,57.115842],[-154.00509,56.734677],[-154.516403,56.992749],[-154.670993,57.461196],[-153.76278,57.816575],[-153.228729,57.968968],[-152.564791,57.901427],[-152.141147,57.591059],[-153.006314,57.115842]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-6.149981,49.96,1.681531,58.635],"geometry":{"type":"Polygon","coordinates":[[[-3.005005,58.635],[-4.073828,57.553025],[-3.055002,57.690019],[-1.959281,57.6848],[-2.219988,56.870017],[-3.119003,55.973793],[-2.085009,55.909998],[-1.114991,54.624986],[-0.430485,54.464376],[0.184981,53.325014],[0.469977,52.929999],[1.681531,52.73952],[1.559988,52.099998],[1.050562,51.806761],[1.449865,51.289428],[0.550334,50.765739],[-0.787517,50.774989],[-2.489998,50.500019],[-2.956274,50.69688],[-3.617448,50.228356],[-4.542508,50.341837],[-5.245023,49.96],[-5.776567,50.159678],[-4.30999,51.210001],[-3.414851,51.426009],[-4.984367,51.593466],[-5.267296,51.9914],[-4.222347,52.301356],[-4.770013,52.840005],[-4.579999,53.495004],[-3.09208,53.404441],[-2.945009,53.985],[-3.630005,54.615013],[-4.844169,54.790971],[-5.082527,55.061601],[-4.719112,55.508473],[-5.047981,55.783986],[-5.586398,55.311146],[-5.644999,56.275015],[-6.149981,56.78501],[-5.786825,57.818848],[-5.009999,58.630013],[-4.211495,58.550845],[-3.005005,58.635]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[-167.455277,59.754441,-165.579164,60.38417],"geometry":{"type":"Polygon","coordinates":[[[-165.579164,59.909987],[-166.19277,59.754441],[-166.848337,59.941406],[-167.455277,60.213069],[-166.467792,60.38417],[-165.67443,60.293607],[-165.579164,59.909987]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[-80.36215,61.63308,-79.26582,62.3856],"geometry":{"type":"Polygon","coordinates":[[[-79.26582,62.158675],[-79.65752,61.63308],[-80.09956,61.7181],[-80.36215,62.01649],[-80.315395,62.085565],[-79.92939,62.3856],[-79.52002,62.36371],[-79.26582,62.158675]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[-83.99367,62.15922,-81.87699,62.91409],"geometry":{"type":"Polygon","coordinates":[[[-81.89825,62.7108],[-83.06857,62.15922],[-83.77462,62.18231],[-83.99367,62.4528],[-83.25048,62.91409],[-81.87699,62.90458],[-81.89825,62.7108]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[-171.791111,62.976931,-168.689439,63.782515],"geometry":{"type":"Polygon","coordinates":[[[-171.731657,63.782515],[-171.114434,63.592191],[-170.491112,63.694975],[-169.682505,63.431116],[-168.689439,63.297506],[-168.771941,63.188598],[-169.52944,62.976931],[-170.290556,63.194438],[-170.671386,63.375822],[-171.553063,63.317789],[-171.791111,63.405846],[-171.731657,63.782515]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":0.5},"bbox":[-87.221983,63.052379,-80.103451,65.738778],"geometry":{"type":"Polygon","coordinates":[[[-85.161308,65.657285],[-84.975764,65.217518],[-84.464012,65.371772],[-83.882626,65.109618],[-82.787577,64.766693],[-81.642014,64.455136],[-81.55344,63.979609],[-80.817361,64.057486],[-80.103451,63.725981],[-80.99102,63.411246],[-82.547178,63.651722],[-83.108798,64.101876],[-84.100417,63.569712],[-85.523405,63.052379],[-85.866769,63.637253],[-87.221983,63.541238],[-86.35276,64.035833],[-86.224886,64.822917],[-85.883848,65.738778],[-85.161308,65.657285]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-24.326184,63.496383,-13.609732,66.526792],"geometry":{"type":"Polygon","coordinates":[[[-14.508695,66.455892],[-14.739637,65.808748],[-13.609732,65.126671],[-14.909834,64.364082],[-17.794438,63.678749],[-18.656246,63.496383],[-19.972755,63.643635],[-22.762972,63.960179],[-21.778484,64.402116],[-23.955044,64.89113],[-22.184403,65.084968],[-22.227423,65.378594],[-24.326184,65.611189],[-23.650515,66.262519],[-22.134922,66.410469],[-20.576284,65.732112],[-19.056842,66.276601],[-17.798624,65.993853],[-16.167819,66.526792],[-14.508695,66.455892]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[-77.2364,67.09873,-75.10333,68.28721],"geometry":{"type":"Polygon","coordinates":[[[-75.86588,67.14886],[-76.98687,67.09873],[-77.2364,67.58809],[-76.81166,68.14856],[-75.89521,68.28721],[-75.1145,68.01036],[-75.10333,67.58202],[-75.21597,67.44425],[-75.86588,67.14886]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-180,64.25269,-169.89958,68.963636],"geometry":{"type":"Polygon","coordinates":[[[-175.01425,66.58435],[-174.33983,66.33556],[-174.57182,67.06219],[-171.85731,66.91308],[-169.89958,65.97724],[-170.89107,65.54139],[-172.53025,65.43791],[-172.555,64.46079],[-172.95533,64.25269],[-173.89184,64.2826],[-174.65392,64.63125],[-175.98353,64.92288],[-176.20716,65.35667],[-177.22266,65.52024],[-178.35993,65.39052],[-178.90332,65.74044],[-178.68611,66.11211],[-179.88377,65.87456],[-179.43268,65.40411],[-180,64.979709],[-180,68.963636],[-177.55,68.2],[-174.92825,67.20589],[-175.01425,66.58435]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[-99.797401,68.75704,-95.647681,70.14354],"geometry":{"type":"Polygon","coordinates":[[[-95.647681,69.10769],[-96.269521,68.75704],[-97.617401,69.06003],[-98.431801,68.9507],[-99.797401,69.40003],[-98.917401,69.71003],[-98.218261,70.14354],[-97.157401,69.86003],[-96.557401,69.68003],[-96.257401,69.49003],[-95.647681,69.10769]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[178.7253,70.78114,180,71.515714],"geometry":{"type":"Polygon","coordinates":[[[180,70.832199],[178.903425,70.78114],[178.7253,71.0988],[180,71.515714],[180,70.832199]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-180,70.832199,-177.577945,71.55762],"geometry":{"type":"Polygon","coordinates":[[[-178.69378,70.89302],[-180,70.832199],[-180,71.515714],[-179.871875,71.55762],[-179.02433,71.55553],[-177.577945,71.26948],[-177.663575,71.13277],[-178.69378,70.89302]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-168.110474,-53.856384,-34.72998,71.920471],"geometry":{"type":"Polygon","coordinates":[[[-90.547119,69.497681],[-90.551514,68.475098],[-89.215088,69.258728],[-88.019592,68.615112],[-88.317505,67.873474],[-87.350098,67.19873],[-86.306091,67.921509],[-85.576599,68.784485],[-85.521912,69.88208],[-84.100769,69.805481],[-82.622498,69.658325],[-81.280396,69.162109],[-81.220215,68.66571],[-81.964294,68.132507],[-81.259277,67.59729],[-81.386475,67.110901],[-83.344482,66.411682],[-84.735413,66.257324],[-85.769409,66.558289],[-86.067627,66.056274],[-87.031372,65.213074],[-87.323181,64.775696],[-88.48291,64.099121],[-89.914429,64.032715],[-90.703979,63.610291],[-90.77002,62.960327],[-91.933411,62.835083],[-93.156982,62.024719],[-94.241516,60.898682],[-94.629272,60.110291],[-94.684509,58.948914],[-93.215027,58.782104],[-92.764587,57.845703],[-92.296997,57.087097],[-90.897705,57.284729],[-89.03949,56.851685],[-88.039795,56.47168],[-87.324219,55.999084],[-86.071228,55.723877],[-85.01178,55.302673],[-83.360474,55.244873],[-82.272827,55.148315],[-82.436218,54.282288],[-82.125,53.2771],[-81.400696,52.157898],[-79.912903,51.208496],[-79.143005,51.533875],[-78.601929,52.562073],[-79.124207,54.141479],[-79.82959,54.667725],[-78.228699,55.136475],[-77.095581,55.837524],[-76.541382,56.534302],[-76.623108,57.202698],[-77.302185,58.052124],[-78.516907,58.804688],[-77.33667,59.852722],[-77.772705,60.757874],[-78.106812,62.319702],[-77.410583,62.550476],[-75.696228,62.278503],[-74.668213,62.181091],[-73.839905,62.443909],[-72.908508,62.105103],[-71.677002,61.52533],[-71.373718,61.137085],[-69.590393,61.061523],[-69.6203,60.221313],[-69.287903,58.957275],[-68.374512,58.801086],[-67.64978,58.212097],[-66.201782,58.767273],[-65.245178,59.870728],[-64.583496,60.335693],[-63.804687,59.442688],[-62.50238,58.167114],[-61.396484,56.967529],[-61.798584,56.339478],[-60.468506,55.775513],[-59.56958,55.204102],[-57.975098,54.945496],[-57.333191,54.626526],[-56.93689,53.780273],[-56.158081,53.647522],[-55.756287,53.270508],[-55.683289,52.146729],[-56.40918,51.770691],[-57.126892,51.419678],[-58.77478,51.06427],[-60.033081,50.24292],[-61.723572,50.080505],[-63.862488,50.291077],[-65.363281,50.298279],[-66.398987,50.228882],[-67.236328,49.511475],[-68.511108,49.068481],[-69.953613,47.744873],[-71.104492,46.821716],[-70.255188,46.986084],[-68.650024,48.30011],[-66.552429,49.133118],[-65.056213,49.23291],[-64.171021,48.742493],[-65.115479,48.070923],[-64.798523,46.993103],[-64.472107,46.238525],[-63.173279,45.739075],[-61.520691,45.883911],[-60.518127,47.007874],[-60.448608,46.282715],[-59.802795,45.920471],[-61.039795,45.26532],[-63.2547,44.670288],[-64.246582,44.265503],[-65.364075,43.545288],[-66.123413,43.618713],[-66.161682,44.465088],[-64.425476,45.292114],[-66.026001,45.259277],[-67.13739,45.137512],[-66.9646,44.809692],[-68.032471,44.325317],[-69.059998,43.980103],[-70.116089,43.684082],[-70.690002,43.03009],[-70.81488,42.865295],[-70.825012,42.335083],[-70.494995,41.805115],[-70.080017,41.78009],[-70.184998,42.145081],[-69.884888,41.922913],[-69.965027,41.637085],[-70.640015,41.475098],[-71.1203,41.494507],[-71.859985,41.320129],[-72.294983,41.270081],[-72.876404,41.220703],[-73.710022,40.931091],[-72.241211,41.119507],[-71.945007,40.930115],[-73.34491,40.630127],[-73.981995,40.628113],[-73.952271,40.750671],[-74.256714,40.473511],[-73.962402,40.427673],[-74.178406,39.70929],[-74.906006,38.939514],[-74.980408,39.196472],[-75.200012,39.248474],[-75.528076,39.498474],[-75.320007,38.960083],[-75.083496,38.781311],[-75.056702,38.404114],[-75.37738,38.015503],[-75.940186,37.216919],[-76.031189,37.256714],[-75.721985,37.937073],[-76.232788,38.319275],[-76.349976,39.150085],[-76.542725,38.717712],[-76.329285,38.083313],[-76.960022,38.23291],[-76.301575,37.918091],[-76.258728,36.966492],[-75.971802,36.897278],[-75.867981,36.551331],[-75.727478,35.55072],[-76.363098,34.808472],[-77.397583,34.512085],[-78.054871,33.925476],[-78.554321,33.861328],[-79.060608,33.49408],[-79.203491,33.158508],[-80.30127,32.509277],[-80.86499,32.033325],[-81.336304,31.440491],[-81.490417,30.730103],[-81.313721,30.035522],[-80.97998,29.180115],[-80.535583,28.472107],[-80.530029,28.0401],[-80.056519,26.880127],[-80.088013,26.205688],[-80.13147,25.816895],[-80.380981,25.206299],[-80.679993,25.080078],[-81.172119,25.201294],[-81.330017,25.640076],[-81.710022,25.870117],[-82.23999,26.730103],[-82.705078,27.495117],[-82.855286,27.886292],[-82.650024,28.55011],[-82.929993,29.100098],[-83.709595,29.936707],[-84.099976,30.090088],[-85.108826,29.636292],[-85.287781,29.686096],[-85.77301,30.15271],[-86.400024,30.400085],[-87.530273,30.274475],[-88.417786,30.384888],[-89.180481,30.316101],[-89.604919,30.176331],[-89.413696,29.894287],[-89.429993,29.488708],[-89.21759,29.291077],[-89.408203,29.159729],[-89.779297,29.307129],[-90.154602,29.117493],[-90.880188,29.148682],[-91.626709,29.677124],[-92.499084,29.552307],[-93.226379,29.783875],[-93.848389,29.713684],[-94.690002,29.480103],[-95.600281,28.738708],[-96.593994,28.307495],[-97.140015,27.830078],[-97.369995,27.380127],[-97.380005,26.690125],[-97.330017,26.210083],[-97.140198,25.869507],[-97.138611,25.86792],[-97.141785,25.865906],[-97.528076,24.992126],[-97.702881,24.272278],[-97.776001,22.932678],[-97.872375,22.444275],[-97.698975,21.898682],[-97.388977,21.411072],[-97.18927,20.635498],[-96.525513,19.89093],[-96.292114,19.320496],[-95.900879,18.828125],[-94.838989,18.562683],[-94.42572,18.144287],[-93.548584,18.423889],[-92.786072,18.524902],[-92.037292,18.704712],[-91.407898,18.876099],[-90.77179,19.284119],[-90.533508,19.867493],[-90.451477,20.70752],[-90.278625,20.999878],[-89.601318,21.261719],[-88.543884,21.493713],[-87.658386,21.458923],[-87.05188,21.543518],[-86.812012,21.331482],[-86.845886,20.849915],[-87.383301,20.255493],[-87.620972,19.646484],[-87.436707,19.472473],[-87.586487,19.0401],[-87.837219,18.259888],[-88.090576,18.516724],[-88.299988,18.500122],[-88.296326,18.353271],[-88.106812,18.348694],[-88.123413,18.076721],[-88.285278,17.644287],[-88.197876,17.489502],[-88.302612,17.131714],[-88.239502,17.036072],[-88.355408,16.530884],[-88.551819,16.265503],[-88.732422,16.233704],[-88.930603,15.887329],[-88.604614,15.706482],[-88.518311,15.85553],[-88.224976,15.727722],[-88.121094,15.688721],[-87.901794,15.864502],[-87.615601,15.878906],[-87.522888,15.797302],[-87.367676,15.846924],[-86.903198,15.756714],[-86.440918,15.782898],[-86.119202,15.893494],[-86.001892,16.005493],[-85.683289,15.953674],[-85.44397,15.885681],[-85.182373,15.909302],[-84.983704,15.995911],[-84.526978,15.8573],[-84.368225,15.835083],[-84.062988,15.648315],[-83.773987,15.424072],[-83.4104,15.270874],[-83.147217,14.995911],[-83.233215,14.899902],[-83.28418,14.676697],[-83.182129,14.31073],[-83.412476,13.970093],[-83.519775,13.567688],[-83.552185,13.127075],[-83.498474,12.869324],[-83.473328,12.419128],[-83.626099,12.320923],[-83.719604,11.893127],[-83.650879,11.629089],[-83.855408,11.373291],[-83.808899,11.103088],[-83.655579,10.938904],[-83.402283,10.395508],[-83.015686,9.993103],[-82.546204,9.566284],[-82.187073,9.20752],[-82.207581,8.995728],[-81.808594,8.950684],[-81.714111,9.032104],[-81.439209,8.786316],[-80.947327,8.858521],[-80.521912,9.111084],[-79.914612,9.312683],[-79.573303,9.611694],[-79.021179,9.552917],[-79.058411,9.454712],[-78.500916,9.420471],[-78.055908,9.247681],[-77.729492,8.946899],[-77.353271,8.670471],[-76.836609,8.638672],[-76.086304,9.336914],[-75.674622,9.443298],[-75.664673,9.774109],[-75.480408,10.61908],[-74.906921,11.08313],[-74.276672,11.102112],[-74.197205,11.310486],[-73.414673,11.227112],[-72.627808,11.732117],[-72.23822,11.955688],[-71.754089,12.437317],[-71.39978,12.376099],[-71.13739,12.113098],[-71.331604,11.776306],[-71.359985,11.5401],[-71.947021,11.423279],[-71.620789,10.969482],[-71.632996,10.446472],[-72.074097,9.865723],[-71.695618,9.072327],[-71.264587,9.137329],[-71.039978,9.860107],[-71.350098,10.211914],[-71.400574,10.969116],[-70.155212,11.375488],[-70.293823,11.846924],[-69.943176,12.162292],[-69.58429,11.459717],[-68.882996,11.443481],[-68.233276,10.885681],[-68.194092,10.554688],[-67.296204,10.545898],[-66.227783,10.648682],[-65.655212,10.200928],[-64.890381,10.077271],[-64.329407,10.389709],[-64.317993,10.641479],[-63.079285,10.701721],[-61.88092,10.715698],[-62.730103,10.420288],[-62.388489,9.948303],[-61.588684,9.873108],[-60.830505,9.381287],[-60.671204,8.580322],[-60.150085,8.602905],[-59.758301,8.367126],[-59.101685,7.999329],[-58.48291,7.347717],[-58.454895,6.832886],[-58.078125,6.809082],[-57.542175,6.321289],[-57.1474,5.973083],[-55.94928,5.772888],[-55.841797,5.953125],[-55.033203,6.02533],[-53.958008,5.756531],[-53.618408,5.646484],[-52.88208,5.409912],[-51.823303,4.565918],[-51.657776,4.156311],[-51.317078,4.203491],[-51.069702,3.650513],[-50.508789,1.901489],[-49.973999,1.736511],[-49.947083,1.046326],[-50.69928,0.223083],[-50.388184,-0.078369],[-48.620483,-0.235413],[-48.584412,-1.237793],[-47.82489,-0.581604],[-46.566589,-0.940979],[-44.905701,-1.551697],[-44.417603,-2.137695],[-44.581604,-2.691284],[-43.418701,-2.383118],[-41.472595,-2.911987],[-39.978577,-2.872986],[-38.500305,-3.700623],[-37.223206,-4.820923],[-36.452881,-5.109375],[-35.597778,-5.149475],[-35.235413,-5.464905],[-34.895996,-6.73822],[-34.72998,-7.343201],[-35.128174,-8.996399],[-35.636902,-9.649292],[-37.046509,-11.04071],[-37.683594,-12.171204],[-38.423889,-13.038086],[-38.673889,-13.057678],[-38.953186,-13.793396],[-38.882324,-15.666992],[-39.161011,-17.208374],[-39.267273,-17.867676],[-39.583496,-18.262207],[-39.760803,-19.599121],[-40.774719,-20.90448],[-40.944702,-21.937317],[-41.754089,-22.370605],[-41.988281,-22.970093],[-43.074707,-22.967712],[-44.647827,-23.35199],[-45.352112,-23.796814],[-46.472107,-24.088989],[-47.648987,-24.885193],[-48.495483,-25.877014],[-48.640991,-26.623718],[-48.47467,-27.175903],[-48.661499,-28.186096],[-48.888428,-28.674072],[-49.58728,-29.224487],[-50.696899,-30.984375],[-51.576172,-31.77771],[-52.256104,-32.2453],[-52.712097,-33.196594],[-53.373596,-33.768311],[-53.806396,-34.39679],[-54.935791,-34.952576],[-55.674011,-34.752686],[-56.21521,-34.859802],[-57.139709,-34.430481],[-57.81781,-34.462524],[-58.427002,-33.909485],[-58.495422,-34.431519],[-57.225769,-35.288025],[-57.362305,-35.977417],[-56.737488,-36.413086],[-56.788208,-36.901489],[-57.749084,-38.183899],[-59.231812,-38.720215],[-61.237427,-38.928406],[-62.335876,-38.827698],[-62.125793,-39.424072],[-62.330505,-40.172607],[-62.145996,-40.67688],[-62.745789,-41.028687],[-63.770508,-41.166809],[-64.732117,-40.802612],[-65.117981,-41.06427],[-64.978577,-42.057983],[-64.303406,-42.359009],[-63.75592,-42.043701],[-63.458008,-42.56311],[-64.378784,-42.873474],[-65.181824,-43.4953],[-65.328796,-44.501282],[-65.565186,-45.036804],[-66.509888,-45.039612],[-67.293823,-45.55188],[-67.580505,-46.301697],[-66.596985,-47.033875],[-65.640991,-47.236084],[-65.985107,-48.133301],[-67.166199,-48.697327],[-67.816101,-49.86969],[-68.728699,-50.264221],[-69.138489,-50.732483],[-68.815491,-51.771118],[-68.150024,-52.349976],[-68.571472,-52.299377],[-69.461304,-52.29187],[-69.942688,-52.537903],[-70.845093,-52.89917],[-71.006287,-53.833191],[-71.42981,-53.856384],[-72.557922,-53.531372],[-73.702698,-52.835083],[-74.946777,-52.262695],[-75.26001,-51.629272],[-74.976624,-51.043396],[-75.479675,-50.378296],[-75.607971,-48.673706],[-75.182678,-47.711914],[-74.126587,-46.939209],[-75.644409,-46.647583],[-74.692078,-45.763977],[-74.351685,-44.103027],[-73.240295,-44.454895],[-72.717712,-42.383301],[-73.388916,-42.117493],[-73.701294,-43.365784],[-74.331909,-43.224976],[-74.017883,-41.7948],[-73.677124,-39.9422],[-73.21759,-39.258606],[-73.505493,-38.282898],[-73.588013,-37.156311],[-73.166687,-37.123779],[-72.553101,-35.508789],[-71.861694,-33.909119],[-71.438477,-32.418884],[-71.668701,-30.920593],[-71.369995,-30.095703],[-71.489807,-28.861389],[-70.90509,-27.640381],[-70.724976,-25.705872],[-70.403992,-23.628906],[-70.091187,-21.393311],[-70.164429,-19.756409],[-70.372498,-18.3479],[-71.375183,-17.773804],[-71.461975,-17.363403],[-73.444519,-16.359375],[-75.237793,-15.265686],[-76.009216,-14.649292],[-76.423401,-13.823181],[-76.259216,-13.534973],[-77.106201,-12.222717],[-78.092102,-10.377686],[-79.036926,-8.386597],[-79.445923,-7.930786],[-79.760498,-7.194275],[-80.537476,-6.541687],[-81.25,-6.13678],[-80.92627,-5.690491],[-81.410889,-4.736694],[-81.099609,-4.036377],[-80.30249,-3.404785],[-79.770203,-2.657471],[-79.986511,-2.220703],[-80.368713,-2.685181],[-80.967712,-2.246887],[-80.764771,-1.965027],[-80.933594,-1.057373],[-80.583313,-0.906677],[-80.399292,-0.283691],[-80.020813,0.360474],[-80.090576,0.768494],[-79.542786,0.98291],[-78.855286,1.38092],[-78.990906,1.691284],[-78.617798,1.766479],[-78.662109,2.267273],[-78.427612,2.6297],[-77.931519,2.696716],[-77.510376,3.325073],[-77.127686,3.84967],[-77.496277,4.087708],[-77.307617,4.668091],[-77.533203,5.582886],[-77.318787,5.845276],[-77.476685,6.691101],[-77.881592,7.223877],[-78.214905,7.512329],[-78.429077,8.052124],[-78.182007,8.319275],[-78.435486,8.387695],[-78.62207,8.718079],[-79.1203,8.996094],[-79.5578,8.932495],[-79.760498,8.584473],[-80.16449,8.333313],[-80.382629,8.298523],[-80.480713,8.090271],[-80.003601,7.547485],[-80.276611,7.419678],[-80.421082,7.271484],[-80.886414,7.22052],[-81.059509,7.817871],[-81.189697,7.647888],[-81.51947,7.706726],[-81.721313,8.108887],[-82.131409,8.175476],[-82.390869,8.29248],[-82.820007,8.290894],[-82.850891,8.073914],[-82.965698,8.225098],[-83.508423,8.446899],[-83.711487,8.656921],[-83.596313,8.830505],[-83.632629,9.051514],[-83.909912,9.290894],[-84.303406,9.487488],[-84.647583,9.615479],[-84.713379,9.908081],[-84.975586,10.086731],[-84.911377,9.796082],[-85.110901,9.557129],[-85.339478,9.834473],[-85.660706,9.933289],[-85.797424,10.134888],[-85.791687,10.43927],[-85.659302,10.754272],[-85.941711,10.895325],[-85.712524,11.088501],[-86.058411,11.403503],[-86.525879,11.806885],[-86.745911,12.144104],[-87.16748,12.458313],[-87.668518,12.909912],[-87.557495,13.064697],[-87.392395,12.914124],[-87.316589,12.98468],[-87.48938,13.297485],[-87.793091,13.384521],[-87.904114,13.149109],[-88.483276,13.163879],[-88.843201,13.259705],[-89.256714,13.458679],[-89.812378,13.520691],[-90.095581,13.735474],[-90.608582,13.909912],[-91.232422,13.927917],[-91.689697,14.126282],[-92.227722,14.538879],[-93.359375,15.615479],[-93.875183,15.940308],[-94.691589,16.201111],[-95.250183,16.128296],[-96.053406,15.752075],[-96.557373,15.653503],[-97.263611,15.917114],[-98.013,16.1073],[-98.947693,16.566101],[-99.697388,16.706299],[-100.829529,17.171082],[-101.666077,17.649109],[-101.918518,17.916077],[-102.478088,17.975891],[-103.500977,18.292297],[-103.91748,18.748718],[-104.992004,19.316284],[-105.492981,19.946899],[-105.731384,20.434082],[-105.397705,20.531677],[-105.50061,20.816895],[-105.270691,21.076294],[-105.265808,21.422119],[-105.603088,21.871277],[-105.69342,22.269104],[-106.028687,22.773682],[-106.909912,23.767883],[-107.915405,24.548889],[-108.401917,25.172302],[-109.260193,25.580688],[-109.444092,25.82489],[-109.291626,26.442871],[-109.801392,26.676086],[-110.391724,27.162109],[-110.640991,27.859924],[-111.178894,27.941284],[-111.759583,28.468079],[-112.22821,28.954529],[-112.27179,29.266907],[-112.809509,30.021118],[-113.163818,30.786926],[-113.148682,31.171082],[-113.871887,31.567688],[-114.205688,31.524109],[-114.776428,31.799683],[-114.936707,31.393494],[-114.771179,30.913696],[-114.673889,30.16272],[-114.330994,29.750488],[-113.588806,29.061707],[-113.424011,28.826294],[-113.271912,28.754883],[-113.140015,28.411316],[-112.96228,28.425293],[-112.761597,27.780273],[-112.457886,27.525879],[-112.244873,27.171875],[-111.616516,26.662903],[-111.284607,25.732727],[-110.987793,25.294678],[-110.710022,24.826111],[-110.655029,24.298706],[-110.172791,24.265686],[-109.77179,23.811279],[-109.409119,23.364685],[-109.433411,23.18573],[-109.854187,22.818298],[-110.031311,22.82312],[-110.294983,23.431091],[-110.949524,24.001099],[-111.670593,24.484497],[-112.182007,24.738525],[-112.148987,25.470276],[-112.30072,26.012085],[-112.777283,26.322083],[-113.4646,26.768311],[-113.59668,26.639526],[-113.848877,26.900085],[-114.465698,27.14209],[-115.055115,27.722717],[-114.982178,27.798279],[-114.570312,27.741516],[-114.19928,28.115112],[-114.161987,28.566101],[-114.931824,29.27948],[-115.518677,29.556274],[-115.88739,30.180908],[-116.258301,30.836487],[-116.721497,31.635681],[-117.127686,32.535278],[-117.295898,33.046326],[-117.943909,33.621277],[-118.410583,33.740906],[-118.519897,34.027893],[-119.080994,34.078125],[-119.438782,34.348511],[-120.367798,34.447083],[-120.622803,34.608521],[-120.744324,35.156921],[-121.7146,36.161682],[-122.547485,37.55188],[-122.512024,37.783508],[-122.953186,38.113708],[-123.727112,38.951721],[-123.865112,39.76709],[-124.39801,40.313293],[-124.178772,41.14209],[-124.213684,41.999695],[-124.532776,42.766113],[-124.14209,43.708496],[-123.898926,45.523499],[-124.07959,46.864685],[-124.395691,47.720276],[-124.687195,48.184509],[-124.566101,48.3797],[-123.119995,48.0401],[-122.58728,47.09613],[-122.340027,47.360107],[-122.5,48.180115],[-122.840027,49.000122],[-122.974182,49.002686],[-124.910217,49.98468],[-125.624573,50.416687],[-127.435608,50.830688],[-127.992676,51.715881],[-127.850281,52.329712],[-129.1297,52.755493],[-129.305176,53.561707],[-130.514893,54.28772],[-130.536072,54.802673],[-131.085815,55.178894],[-131.967224,55.497925],[-132.25,56.370117],[-133.539185,57.178894],[-134.078003,58.123108],[-135.038208,58.187683],[-136.627991,58.21228],[-137.799988,58.500122],[-139.867798,59.537903],[-140.825195,59.727478],[-142.574402,60.084473],[-143.958801,59.999329],[-145.925476,60.458679],[-147.11438,60.884705],[-148.224304,60.673096],[-148.018005,59.978271],[-148.570801,59.914307],[-149.727783,59.705688],[-150.608215,59.368286],[-151.716309,59.155884],[-151.859375,59.745117],[-151.409729,60.725891],[-150.346924,61.033691],[-150.621094,61.284485],[-151.895813,60.727295],[-152.578308,60.061707],[-154.019104,59.350281],[-153.287476,58.864685],[-154.232483,58.146484],[-155.307495,57.727905],[-156.308289,57.422913],[-156.556091,56.980103],[-158.117187,56.463684],[-158.433289,55.99408],[-159.603271,55.566711],[-160.289673,55.643677],[-161.223022,55.364685],[-162.237793,55.024292],[-163.069397,54.68988],[-164.785583,54.404297],[-164.9422,54.572327],[-163.848328,55.03949],[-162.869995,55.348083],[-161.804199,55.895081],[-160.563599,56.008118],[-160.070496,56.418091],[-158.684387,57.016724],[-158.461121,57.216919],[-157.722778,57.570129],[-157.550293,58.328308],[-157.041687,58.918884],[-158.194702,58.615906],[-158.517212,58.787903],[-159.058594,58.424316],[-159.711609,58.931519],[-159.981201,58.572693],[-160.355286,59.071106],[-161.35498,58.670898],[-161.968811,58.671692],[-162.054993,59.266907],[-161.874084,59.633728],[-162.518005,59.989685],[-163.818298,59.798096],[-164.66217,60.267517],[-165.346375,60.507507],[-165.350769,61.073914],[-166.121399,61.500122],[-165.734375,62.075073],[-164.919189,62.633118],[-164.5625,63.146484],[-163.753296,63.219482],[-163.0672,63.059509],[-162.260498,63.54187],[-161.534424,63.455872],[-160.772522,63.766113],[-160.958313,64.2229],[-161.518005,64.402893],[-160.77771,64.788696],[-161.391907,64.777283],[-162.453003,64.559509],[-162.757813,64.338684],[-163.546387,64.559082],[-164.960815,64.447083],[-166.425293,64.686707],[-166.844971,65.088928],[-168.110474,65.670105],[-166.7052,66.088318],[-164.47467,66.576721],[-163.652527,66.576721],[-163.788513,66.077271],[-161.677795,66.116089],[-162.489685,66.735474],[-163.719727,67.116516],[-164.430908,67.616272],[-165.390198,68.042908],[-166.764404,68.358887],[-166.204712,68.883118],[-164.430786,68.915527],[-163.168579,69.371094],[-162.930481,69.858093],[-161.908875,70.333313],[-160.934814,70.447693],[-159.039185,70.891724],[-158.11969,70.824707],[-156.580811,71.35791],[-155.06781,71.147888],[-154.344177,70.696472],[-153.900024,70.890076],[-152.210022,70.830078],[-152.27002,70.600098],[-150.73999,70.430115],[-149.719971,70.53009],[-147.613281,70.214111],[-145.690002,70.120117],[-144.919983,69.990112],[-143.589417,70.152527],[-142.07251,69.851929],[-140.985901,69.712097],[-139.120483,69.47113],[-137.546387,68.990112],[-136.503601,68.898071],[-135.625671,69.315125],[-134.414612,69.627502],[-132.929199,69.50531],[-131.431274,69.944519],[-129.794678,70.193726],[-129.107727,69.779297],[-128.361511,70.012878],[-128.138184,70.483887],[-127.447083,70.377319],[-125.756287,69.480713],[-124.424805,70.158508],[-124.289612,69.399719],[-123.061096,69.563721],[-122.683411,69.85553],[-121.47229,69.797913],[-119.94281,69.37793],[-117.6026,69.011292],[-116.226379,68.841492],[-115.246887,68.905884],[-113.897888,68.398926],[-115.30481,67.90271],[-113.497192,67.688293],[-110.797913,67.806091],[-109.946106,67.981079],[-108.880188,67.381531],[-107.792419,67.887512],[-108.812988,68.311707],[-108.167175,68.653931],[-106.950012,68.700073],[-106.150024,68.80011],[-105.342773,68.561279],[-104.337891,68.018127],[-103.221069,68.0979],[-101.454285,67.646912],[-99.901978,67.805725],[-98.443176,67.781677],[-98.558594,68.403931],[-97.669495,68.578674],[-96.119873,68.239502],[-96.125793,67.293518],[-95.48938,68.090698],[-94.684998,68.063904],[-94.232788,69.069092],[-95.304077,69.68573],[-96.471313,70.089905],[-96.391113,71.194885],[-95.208801,71.920471],[-93.889893,71.760071],[-92.878113,71.318726],[-91.519592,70.191284],[-92.406921,69.700073],[-90.547119,69.497681]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-119.40199,68.53554,-100.98078,73.31459],"geometry":{"type":"Polygon","coordinates":[[[-114.16717,73.12145],[-114.66634,72.65277],[-112.44102,72.9554],[-111.05039,72.4504],[-109.92035,72.96113],[-109.00654,72.63335],[-108.18835,71.65089],[-107.68599,72.06548],[-108.39639,73.08953],[-107.51645,73.23598],[-106.52259,73.07601],[-105.40246,72.67259],[-104.77484,71.6984],[-104.46476,70.99297],[-102.78537,70.49776],[-100.98078,70.02432],[-101.08929,69.58447],[-102.73116,69.50402],[-102.09329,69.11962],[-102.43024,68.75282],[-104.24,68.91],[-105.96,69.18],[-107.12254,69.11922],[-109,68.78],[-111.9668,68.60446],[-113.3132,68.53554],[-113.85496,69.00744],[-115.22,69.28],[-116.10794,69.16821],[-117.34,69.96],[-116.67473,70.06655],[-115.13112,70.2373],[-113.72141,70.19237],[-112.4161,70.36638],[-114.35,70.6],[-116.48684,70.52045],[-117.9048,70.54056],[-118.43238,70.9092],[-116.11311,71.30918],[-117.65568,71.2952],[-119.40199,71.55859],[-118.56267,72.30785],[-117.86642,72.70594],[-115.18909,73.31459],[-114.16717,73.12145]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1.5},"bbox":[-106.94,72.76,-104.5,73.64],"geometry":{"type":"Polygon","coordinates":[[[-104.5,73.42],[-105.38,72.76],[-106.94,73.46],[-106.6,73.6],[-105.26,73.64],[-104.5,73.42]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[-80.876099,72.742203,-76.251404,73.75972],"geometry":{"type":"Polygon","coordinates":[[[-76.34,73.102685],[-76.251404,72.826385],[-77.314438,72.855545],[-78.39167,72.876656],[-79.486252,72.742203],[-79.775833,72.802902],[-80.876099,73.333183],[-80.833885,73.693184],[-80.353058,73.75972],[-78.064438,73.651932],[-76.34,73.102685]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-90.20516,61.930897,-61.851981,73.803816],"geometry":{"type":"Polygon","coordinates":[[[-86.562179,73.157447],[-85.774371,72.534126],[-84.850112,73.340278],[-82.31559,73.750951],[-80.600088,72.716544],[-80.748942,72.061907],[-78.770639,72.352173],[-77.824624,72.749617],[-75.605845,72.243678],[-74.228616,71.767144],[-74.099141,71.33084],[-72.242226,71.556925],[-71.200015,70.920013],[-68.786054,70.525024],[-67.91497,70.121948],[-66.969033,69.186087],[-68.805123,68.720198],[-66.449866,68.067163],[-64.862314,67.847539],[-63.424934,66.928473],[-61.851981,66.862121],[-62.163177,66.160251],[-63.918444,64.998669],[-65.14886,65.426033],[-66.721219,66.388041],[-68.015016,66.262726],[-68.141287,65.689789],[-67.089646,65.108455],[-65.73208,64.648406],[-65.320168,64.382737],[-64.669406,63.392927],[-65.013804,62.674185],[-66.275045,62.945099],[-68.783186,63.74567],[-67.369681,62.883966],[-66.328297,62.280075],[-66.165568,61.930897],[-68.877367,62.330149],[-71.023437,62.910708],[-72.235379,63.397836],[-71.886278,63.679989],[-73.378306,64.193963],[-74.834419,64.679076],[-74.818503,64.389093],[-77.70998,64.229542],[-78.555949,64.572906],[-77.897281,65.309192],[-76.018274,65.326969],[-73.959795,65.454765],[-74.293883,65.811771],[-73.944912,66.310578],[-72.651167,67.284576],[-72.92606,67.726926],[-73.311618,68.069437],[-74.843307,68.554627],[-76.869101,68.894736],[-76.228649,69.147769],[-77.28737,69.76954],[-78.168634,69.826488],[-78.957242,70.16688],[-79.492455,69.871808],[-81.305471,69.743185],[-84.944706,69.966634],[-87.060003,70.260001],[-88.681713,70.410741],[-89.51342,70.762038],[-88.467721,71.218186],[-89.888151,71.222552],[-90.20516,72.235074],[-89.436577,73.129464],[-88.408242,73.537889],[-85.826151,73.803816],[-86.562179,73.157447]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-102.5,71.27285,-96.54,73.84389],"geometry":{"type":"Polygon","coordinates":[[[-100.35642,73.84389],[-99.16387,73.63339],[-97.38,73.76],[-97.12,73.47],[-98.05359,72.99052],[-96.54,72.56],[-96.72,71.66],[-98.35966,71.27285],[-99.32286,71.35639],[-100.01482,71.73827],[-102.5,72.51],[-102.48,72.83],[-100.43836,72.70588],[-101.54,73.36],[-100.35642,73.84389]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[139.86312,73.20544,143.60385,73.85758],"geometry":{"type":"Polygon","coordinates":[[[143.60385,73.21244],[142.08763,73.20544],[140.038155,73.31692],[139.86312,73.36983],[140.81171,73.76506],[142.06207,73.85758],[143.48283,73.47525],[143.60385,73.21244]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0.5},"bbox":[-96.033745,72.024596,-90.509793,74.134907],"geometry":{"type":"Polygon","coordinates":[[[-93.196296,72.771992],[-94.269047,72.024596],[-95.409856,72.061881],[-96.033745,72.940277],[-96.018268,73.43743],[-95.495793,73.862417],[-94.503658,74.134907],[-92.420012,74.100025],[-90.509793,73.856732],[-92.003965,72.966244],[-93.196296,72.771992]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-125.92896,70.90164,-115.51081,74.44893],"geometry":{"type":"Polygon","coordinates":[[[-120.46,71.4],[-123.09219,70.90164],[-123.62,71.34],[-125.92896,71.86868],[-125.59271,72.19452],[-124.80729,73.02256],[-123.94,73.68],[-124.91775,74.29275],[-121.53788,74.44893],[-120.10978,74.24135],[-117.55564,74.18577],[-116.58442,73.89607],[-115.51081,73.47519],[-116.76794,73.22292],[-119.22,72.52],[-120.46,71.82],[-120.46,71.4]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":1},"bbox":[146.11919,74.68892,150.73167,75.49682],"geometry":{"type":"Polygon","coordinates":[[[150.73167,75.08406],[149.575925,74.68892],[147.977465,74.778355],[146.11919,75.17298],[146.358485,75.49682],[148.22223,75.345845],[150.73167,75.08406]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[-96.820932,74.592347,-93.612756,75.647218],"geometry":{"type":"Polygon","coordinates":[[[-93.612756,74.979997],[-94.156909,74.592347],[-95.608681,74.666864],[-96.820932,74.927623],[-96.288587,75.377828],[-94.85082,75.647218],[-93.977747,75.29649],[-93.612756,74.979997]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[136.97439,74.61148,145.086285,76.13676],"geometry":{"type":"Polygon","coordinates":[[[145.086285,75.562625],[144.3,74.82],[140.61381,74.84768],[138.95544,74.61148],[136.97439,75.26167],[137.51176,75.94917],[138.831075,76.13676],[141.471615,76.09289],[145.086285,75.562625]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-102.56552,74.89744,-97.704415,76.72],"geometry":{"type":"Polygon","coordinates":[[[-98.5,76.72],[-97.735585,76.25656],[-97.704415,75.74344],[-98.16,75],[-99.80874,74.89744],[-100.88366,75.05736],[-100.86292,75.64075],[-102.50209,75.5638],[-102.56552,76.3366],[-101.48973,76.30537],[-99.98349,76.64634],[-98.57699,76.58859],[-98.5,76.72]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-117.7104,74.39427,-105.70498,76.79417],"geometry":{"type":"Polygon","coordinates":[[[-108.21141,76.20168],[-107.81943,75.84552],[-106.92893,76.01282],[-105.881,75.9694],[-105.70498,75.47951],[-106.31347,75.00527],[-109.7,74.85],[-112.22307,74.41696],[-113.74381,74.39427],[-113.87135,74.72029],[-111.79421,75.1625],[-116.31221,75.04343],[-117.7104,75.2222],[-116.34602,76.19903],[-115.40487,76.47887],[-112.59056,76.14134],[-110.81422,75.54919],[-109.0671,75.47321],[-110.49726,76.42982],[-109.5811,76.79417],[-108.54859,76.67832],[-108.21141,76.20168]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[51.455754,70.632743,68.852211,76.939697],"geometry":{"type":"Polygon","coordinates":[[[57.535693,70.720464],[56.944979,70.632743],[53.677375,70.762658],[53.412017,71.206662],[51.601895,71.474759],[51.455754,72.014881],[52.478275,72.229442],[52.444169,72.774731],[54.427614,73.627548],[53.50829,73.749814],[55.902459,74.627486],[55.631933,75.081412],[57.868644,75.60939],[61.170044,76.251883],[64.498368,76.439055],[66.210977,76.809782],[68.15706,76.939697],[68.852211,76.544811],[68.180573,76.233642],[64.637326,75.737755],[61.583508,75.260885],[58.477082,74.309056],[56.986786,73.333044],[55.419336,72.371268],[55.622838,71.540595],[57.535693,70.720464]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-97.121379,74.392307,-79.833933,77.161389],"geometry":{"type":"Polygon","coordinates":[[[-94.684086,77.097878],[-93.573921,76.776296],[-91.605023,76.778518],[-90.741846,76.449597],[-90.969661,76.074013],[-89.822238,75.847774],[-89.187083,75.610166],[-87.838276,75.566189],[-86.379192,75.482421],[-84.789625,75.699204],[-82.753445,75.784315],[-81.128531,75.713983],[-80.057511,75.336849],[-79.833933,74.923127],[-80.457771,74.657304],[-81.948843,74.442459],[-83.228894,74.564028],[-86.097452,74.410032],[-88.15035,74.392307],[-89.764722,74.515555],[-92.422441,74.837758],[-92.768285,75.38682],[-92.889906,75.882655],[-93.893824,76.319244],[-95.962457,76.441381],[-97.121379,76.751078],[-96.745123,77.161389],[-94.684086,77.097878]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":0.5},"bbox":[-122.854925,75.900019,-116.198587,77.645287],"geometry":{"type":"Polygon","coordinates":[[[-116.198587,77.645287],[-116.335813,76.876962],[-117.106051,76.530032],[-118.040412,76.481172],[-119.899318,76.053213],[-121.499995,75.900019],[-122.854924,76.116543],[-122.854925,76.116543],[-121.157535,76.864508],[-119.103939,77.51222],[-117.570131,77.498319],[-116.198587,77.645287]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-17.625,-34.819092,180,77.697876],"geometry":{"type":"Polygon","coordinates":[[[106.970276,76.974304],[107.240112,76.480103],[108.153931,76.723328],[111.077271,76.710083],[113.331482,76.22229],[114.134277,75.847717],[113.885498,75.327881],[112.779297,75.031921],[110.151306,74.476685],[109.400085,74.180115],[110.640076,74.0401],[112.119324,73.78772],[113.01947,73.976929],[113.529724,73.335083],[113.968872,73.59491],[115.567871,73.75293],[118.776306,73.587708],[119.020081,73.120117],[123.200684,72.971313],[123.257874,73.735107],[125.380127,73.56012],[126.976501,73.565491],[128.591309,73.038696],[129.051697,72.398682],[128.460083,71.980103],[129.716125,71.193115],[131.288696,70.787109],[132.253479,71.836304],[133.857727,71.386475],[135.562073,71.655273],[137.497681,71.347717],[138.234131,71.628113],[139.869873,71.487915],[139.147888,72.416321],[140.468079,72.849487],[149.500122,72.200073],[150.351318,71.606506],[152.968872,70.842285],[157.006897,71.031494],[158.997925,70.866699],[159.830322,70.453308],[159.708679,69.722107],[160.940674,69.437317],[162.279114,69.64209],[164.05249,69.668274],[165.940491,69.472107],[167.835693,69.582703],[169.577698,68.693909],[170.816895,69.013672],[170.008301,69.652893],[170.453491,70.097107],[173.643921,69.817505],[175.724121,69.877319],[178.600098,69.400085],[180,68.963722],[180,64.979584],[179.99292,64.974304],[178.707275,64.534912],[177.411316,64.608276],[178.31311,64.075928],[178.908325,63.252075],[179.370483,62.982727],[179.486511,62.569092],[179.228271,62.304077],[177.364319,62.521912],[174.569275,61.769287],[173.680115,61.65271],[172.150085,60.950073],[170.698486,60.336304],[170.330872,59.881897],[168.900513,60.573486],[166.295105,59.788696],[165.840088,60.160095],[164.876892,59.731689],[163.539307,59.868713],[163.217102,59.211121],[162.017273,58.243286],[162.053101,57.839111],[163.191895,57.615112],[163.057922,56.159302],[162.1297,56.122314],[161.701477,55.285706],[162.117493,54.855286],[160.368896,54.344482],[160.021729,53.202698],[158.530884,52.958679],[158.231323,51.942688],[156.789917,51.011108],[156.420105,51.700073],[155.991882,53.158875],[155.433716,55.381104],[155.91449,56.767883],[156.758301,57.364685],[156.810486,57.832092],[158.364319,58.055725],[160.150696,59.31488],[161.87207,60.343079],[163.669678,61.14093],[164.473694,62.55072],[163.258484,62.466309],[162.657898,61.642517],[160.121521,60.544312],[159.302307,61.774109],[156.720703,61.434509],[154.218079,59.758301],[155.043884,59.145081],[152.81189,58.883911],[151.265686,58.780884],[151.338074,59.504089],[149.783691,59.655701],[148.544922,59.16449],[145.487305,59.336487],[142.197876,59.0401],[138.958496,57.088074],[135.126282,54.729675],[136.701721,54.603699],[137.193481,53.977295],[138.164673,53.755127],[138.804688,54.2547],[139.901489,54.189697],[141.345276,53.089722],[141.379272,52.238892],[140.597473,51.239685],[140.513123,50.045471],[140.062073,48.446716],[138.554688,46.999695],[138.219727,46.307922],[136.862305,45.143494],[135.51532,43.989075],[134.869507,43.398315],[133.536926,42.811523],[132.906311,42.798523],[132.278076,43.284485],[130.935913,42.552673],[130.78009,42.220093],[130.400085,42.28009],[129.965881,41.941284],[129.66748,41.601074],[129.705322,40.882874],[129.18811,40.661926],[129.010498,40.485474],[128.633484,40.18988],[127.967529,40.025513],[127.533508,39.756897],[127.502075,39.323914],[127.385498,39.213501],[127.783325,39.050903],[128.34967,38.612305],[129.212891,37.432495],[129.46051,36.784302],[129.468323,35.63208],[129.091492,35.08252],[128.185913,34.890503],[127.386475,34.475708],[126.485718,34.390076],[126.373901,34.934692],[126.559326,35.684692],[126.117493,36.725525],[126.860291,36.893921],[126.174683,37.749695],[125.689087,37.940125],[125.568481,37.752075],[125.27533,37.669128],[125.240112,37.8573],[124.981079,37.948914],[124.71228,38.108276],[124.986084,38.548523],[125.221924,38.665894],[125.132874,38.848694],[125.386719,39.387878],[125.321106,39.551514],[124.737488,39.660278],[124.265686,39.928528],[122.867676,39.637878],[122.131531,39.170471],[121.054688,38.897522],[121.586121,39.360901],[121.376892,39.750305],[122.168701,40.422485],[121.640503,40.946472],[120.768677,40.593506],[119.639709,39.898071],[119.023499,39.252319],[118.042725,39.204285],[117.532715,38.737671],[118.059692,38.061523],[118.878296,37.897278],[118.911682,37.448486],[119.702881,37.156494],[120.823486,37.870483],[121.711304,37.481079],[122.35791,37.454529],[122.520081,36.930725],[121.104309,36.651306],[120.637085,36.111511],[119.664673,35.609924],[119.151306,34.909912],[120.227478,34.360474],[120.620483,33.376709],[121.229126,32.460327],[121.908081,31.692322],[121.891907,30.94928],[121.264282,30.676331],[121.503479,30.142883],[122.092102,29.83252],[121.938477,29.018127],[121.684509,28.225525],[121.125671,28.135681],[120.395508,27.053284],[119.58551,25.740906],[118.656921,24.547485],[117.281677,23.624512],[115.890686,22.782898],[114.763916,22.668091],[114.152527,22.223877],[113.806885,22.548279],[113.241089,22.051514],[111.843689,21.550476],[110.785522,21.397278],[110.444092,20.341125],[109.889893,20.282471],[109.627686,21.008301],[109.864502,21.395081],[108.522888,21.715271],[108.050293,21.55249],[106.715088,20.696899],[105.881714,19.752075],[105.662109,19.058289],[106.42688,18.004089],[107.361877,16.69751],[108.26947,16.079712],[108.877075,15.276672],[109.335327,13.426086],[109.200073,11.66687],[108.366089,11.008301],[107.220886,10.364502],[106.40509,9.530884],[105.158325,8.59967],[104.795288,9.241089],[105.076294,9.918518],[104.334473,10.486694],[103.497314,10.63269],[103.090698,11.153687],[102.585083,12.186707],[101.687073,12.645874],[100.831909,12.627075],[100.978516,13.41272],[100.0979,13.406921],[100.018677,12.307129],[99.478882,10.846497],[99.153687,9.963074],[99.222473,9.239319],[99.873901,9.207886],[100.279724,8.295288],[100.45929,7.429687],[101.017273,6.856873],[101.623108,6.740723],[102.141296,6.22168],[102.371277,6.128296],[102.961731,5.524475],[103.381287,4.855103],[103.438721,4.181702],[103.332092,3.726685],[103.429504,3.382874],[103.502502,2.791077],[103.854675,2.515503],[104.247925,1.631287],[104.228882,1.293091],[103.519714,1.226318],[102.57373,1.967102],[101.390686,2.760925],[101.273682,3.270325],[100.695496,3.939087],[100.557495,4.767273],[100.196716,5.3125],[100.306274,6.04071],[100.085876,6.464478],[99.690674,6.848328],[99.519714,7.343506],[98.988281,7.908081],[98.503906,8.382324],[98.339722,7.794495],[98.150085,8.350098],[98.259277,8.973877],[98.553528,9.933105],[98.457275,10.675293],[98.764526,11.441284],[98.428284,12.033081],[98.509705,13.122498],[98.103699,13.640503],[97.77771,14.83728],[97.597107,16.100708],[97.164673,16.928711],[96.50592,16.427307],[95.369324,15.714478],[94.808472,15.803528],[94.188904,16.038086],[94.533508,17.277283],[94.32489,18.213501],[93.541077,19.366516],[93.66333,19.727112],[93.078308,19.855286],[92.36853,20.670898],[92.082886,21.192322],[92.02533,21.701721],[91.8349,22.182922],[91.417114,22.765076],[90.496094,22.805115],[90.587097,22.392883],[90.272888,21.836487],[89.847473,22.039124],[89.702087,21.857117],[89.418884,21.966309],[89.032104,22.055725],[88.888916,21.690674],[88.208496,21.703308],[86.975708,21.495483],[87.033081,20.743286],[86.499329,20.151672],[85.060303,19.478699],[83.941101,18.302124],[83.18927,17.671326],[82.192871,17.016724],[82.191284,16.556702],[81.692688,16.310303],[80.792114,15.952087],[80.32489,15.899292],[80.025085,15.136475],[80.233276,13.835876],[80.286316,13.006287],[79.862488,12.056274],[79.858093,10.3573],[79.340515,10.308899],[78.885498,9.546082],[79.189697,9.216675],[78.278076,8.933105],[77.941284,8.25293],[77.539917,7.965515],[76.593079,8.899292],[76.130127,10.299683],[75.746521,11.308289],[75.396118,11.781311],[74.864929,12.741882],[74.616699,13.992676],[74.443909,14.61731],[73.534302,15.990723],[73.119873,17.928711],[72.820923,19.208313],[72.824524,20.419495],[72.630676,21.356079],[71.175293,20.757507],[70.47052,20.877319],[69.164124,22.089294],[69.644897,22.450684],[69.34967,22.843323],[68.176697,23.692078],[67.443726,23.944885],[67.145508,24.663696],[66.372925,25.425293],[64.530518,25.237122],[62.905701,25.218506],[61.497498,25.078308],[59.616089,25.380127],[58.525879,25.610107],[57.397278,25.739929],[56.970886,26.966125],[56.492126,27.143311],[55.723694,26.964722],[54.715088,26.480713],[53.493103,26.8125],[52.483704,27.580872],[51.520874,27.865723],[50.853088,28.814514],[50.115112,30.147888],[49.576904,29.985718],[48.941284,30.317078],[48.568115,29.92688],[47.974487,29.975891],[48.183289,29.534485],[48.093872,29.306274],[48.416077,28.552124],[48.807678,27.689697],[49.299683,27.461304],[49.470886,27.110107],[50.152527,26.689697],[50.213074,26.2771],[50.113281,25.944092],[50.239929,25.608093],[50.527527,25.327881],[50.660706,24.999878],[50.81012,24.754883],[50.743896,25.482483],[51.013489,26.00708],[51.286499,26.114685],[51.589111,25.801086],[51.606689,25.215698],[51.389709,24.627502],[51.579529,24.245483],[51.757507,24.294128],[51.794495,24.019897],[52.577087,24.17749],[53.404114,24.151306],[54.008118,24.121887],[54.693115,24.797913],[55.439087,25.439087],[56.070923,26.055481],[56.362122,26.395874],[56.485718,26.309082],[56.391479,25.896118],[56.261108,25.714722],[56.396912,24.924683],[56.845276,24.241699],[57.403503,23.878723],[58.137085,23.747925],[58.729309,23.565674],[59.180481,22.992493],[59.450073,22.660278],[59.808105,22.533691],[59.806274,22.310486],[59.442322,21.714478],[59.282471,21.433899],[58.861084,21.114075],[58.488098,20.429077],[58.034302,20.481506],[57.826477,20.243103],[57.665894,19.736084],[57.788696,19.067688],[57.694519,18.944702],[57.234314,18.94812],[56.60968,18.57428],[56.512329,18.087097],[56.283508,17.876099],[55.661499,17.884277],[55.270081,17.632324],[55.274902,17.228271],[54.791077,16.950684],[54.239319,17.045105],[53.570496,16.707703],[53.108704,16.651123],[52.385315,16.382507],[52.191711,15.938477],[52.168274,15.597473],[51.172485,15.175293],[49.574707,14.708679],[48.679321,14.003296],[48.239075,13.94812],[47.938904,14.007324],[47.354492,13.592285],[46.717102,13.399719],[45.877686,13.3479],[45.625122,13.291077],[45.406494,13.026917],[45.144287,12.953918],[44.989685,12.699707],[44.49469,12.72168],[44.17511,12.585876],[43.483093,12.636902],[43.2229,13.220886],[43.251526,13.7677],[43.088074,14.062683],[42.892273,14.802307],[42.604919,15.213318],[42.805115,15.262085],[42.702515,15.718872],[42.82373,15.911682],[42.77948,16.3479],[42.649719,16.774719],[42.348083,17.075928],[42.270874,17.47467],[41.754517,17.83313],[41.221497,18.671692],[40.93927,19.486511],[40.247681,20.174683],[39.801697,20.338928],[39.139526,21.29187],[39.023682,21.986877],[39.066284,22.579712],[38.49292,23.688477],[38.023926,24.078674],[37.483704,24.285522],[37.154907,24.858521],[37.209473,25.084473],[36.931702,25.603088],[36.639709,25.826294],[36.249084,26.570129],[35.64032,27.376526],[35.13031,28.063477],[34.632324,28.058472],[34.787903,28.607483],[34.832275,28.95752],[34.956116,29.356689],[34.922729,29.501282],[34.641724,29.099487],[34.426697,28.344116],[34.15448,27.823303],[33.921509,27.648682],[33.588074,27.971497],[33.136902,28.417725],[32.423279,29.851074],[32.320496,29.760498],[32.734924,28.705322],[33.348877,27.69989],[34.104675,26.142273],[34.473877,25.598694],[34.795105,25.033875],[35.692505,23.926697],[35.493713,23.752502],[35.526123,23.102478],[36.690674,22.204895],[36.866272,22.000122],[37.188721,21.018921],[36.969482,20.837524],[37.114685,19.808105],[37.481873,18.614075],[37.862671,18.36792],[38.410095,17.998291],[38.990723,16.840698],[39.266113,15.922729],[39.81427,15.43573],[41.179321,14.491089],[41.734924,13.921082],[42.276917,13.344116],[42.589722,13.000488],[43.081299,12.699707],[43.317871,12.390076],[43.286499,11.974915],[42.715881,11.735718],[43.145325,11.462097],[43.470703,11.27771],[43.666687,10.864319],[44.11792,10.445679],[44.614319,10.442322],[45.556885,10.69812],[46.645508,10.816528],[47.525696,11.127319],[48.021729,11.193115],[48.378906,11.375488],[48.948303,11.410706],[49.267883,11.430481],[49.728699,11.578918],[50.258911,11.679688],[50.732117,12.021912],[51.111328,12.024719],[51.133911,11.748291],[51.041504,11.166504],[51.045288,10.64093],[50.83429,10.279724],[50.55249,9.19873],[50.070923,8.081726],[49.452698,6.804688],[48.594482,5.339111],[47.740906,4.219482],[46.56488,2.855286],[45.564087,2.045898],[44.068298,1.052917],[43.136108,0.292297],[42.041687,-0.919189],[41.811096,-1.446411],[41.585083,-1.683228],[40.884888,-2.08252],[40.637878,-2.499817],[40.263123,-2.57312],[40.121277,-3.27771],[39.80011,-3.681091],[39.604919,-4.346497],[39.202271,-4.676697],[38.740479,-5.908875],[38.799683,-6.475586],[39.440125,-6.840027],[39.470093,-7.099976],[39.194702,-7.703918],[39.252075,-8.007812],[39.186523,-8.485474],[39.535889,-9.112305],[39.949707,-10.098389],[40.316711,-10.317078],[40.478516,-10.765381],[40.437317,-11.761719],[40.560913,-12.639099],[40.59967,-14.201904],[40.775513,-14.691711],[40.477295,-15.406311],[40.089294,-16.100708],[39.452698,-16.720886],[38.53833,-17.101013],[37.411072,-17.586304],[36.281311,-18.659607],[35.896484,-18.842285],[35.198486,-19.552795],[34.786499,-19.783997],[34.701904,-20.497009],[35.176086,-21.254272],[35.373474,-21.84082],[35.385925,-22.140015],[35.562683,-22.090027],[35.533875,-23.070801],[35.371887,-23.535278],[35.607483,-23.706482],[35.458679,-24.12262],[35.04071,-24.478271],[34.215881,-24.816284],[33.013306,-25.357483],[32.574707,-25.727295],[32.660278,-26.148499],[32.916077,-26.215881],[32.830078,-26.742188],[32.580322,-27.470093],[32.46228,-28.301025],[32.203491,-28.75238],[31.521118,-29.257385],[31.325684,-29.401978],[30.901672,-29.909912],[30.622925,-30.423706],[30.055725,-31.140198],[28.925476,-32.171997],[28.219727,-32.771912],[27.464722,-33.22699],[26.419495,-33.614929],[25.909729,-33.666992],[25.780701,-33.94458],[25.172913,-33.796875],[24.677917,-33.987183],[23.594116,-33.794495],[22.988281,-33.916382],[22.57428,-33.864075],[21.542908,-34.258789],[20.689087,-34.417175],[20.071289,-34.795105],[19.616516,-34.819092],[19.193298,-34.462585],[18.855286,-34.444275],[18.424683,-33.997803],[18.377502,-34.136475],[18.244507,-33.867676],[18.250122,-33.281372],[17.925293,-32.611206],[18.247925,-32.429077],[18.22168,-31.661621],[17.566895,-30.725708],[17.064514,-29.878601],[17.062927,-29.875977],[16.345093,-28.576721],[15.601929,-27.821228],[15.21051,-27.090881],[14.989685,-26.11731],[14.743286,-25.392883],[14.408081,-23.853027],[14.385681,-22.656677],[14.25769,-22.111206],[13.868713,-21.698975],[13.352478,-20.872803],[12.826904,-19.673096],[12.608704,-19.045288],[11.794922,-18.069092],[11.734314,-17.30188],[11.640076,-16.673096],[11.778687,-15.793823],[12.123718,-14.878296],[12.17572,-14.449097],[12.500122,-13.547729],[12.738525,-13.137878],[13.312927,-12.483582],[13.633728,-12.038574],[13.738708,-11.297791],[13.686523,-10.731079],[13.387329,-10.373596],[13.121094,-9.766907],[12.875488,-9.16687],[12.929077,-8.959106],[13.236511,-8.562622],[12.933105,-7.596497],[12.728271,-6.927124],[12.227478,-6.294373],[12.32251,-6.100098],[12.182312,-5.789917],[11.9151,-5.037903],[11.093689,-3.978821],[10.066284,-2.969482],[9.405273,-2.144287],[8.798096,-1.111328],[8.830078,-0.778992],[9.048523,-0.45929],[9.291321,0.268677],[9.49292,1.010071],[9.305725,1.160889],[9.649292,2.283875],[9.795288,3.073486],[9.40448,3.734497],[8.94812,3.904114],[8.744873,4.352295],[8.488892,4.495728],[8.500305,4.772095],[7.462097,4.412109],[7.082703,4.464722],[6.69812,4.240723],[5.898315,4.262512],[5.362915,4.888123],[5.033691,5.611877],[4.325684,6.270691],[3.57428,6.258301],[2.691711,6.258911],[1.865295,6.142273],[1.06012,5.928894],[-0.507629,5.343506],[-1.063599,5.000488],[-1.964722,4.71051],[-2.856079,4.994507],[-3.311096,4.984314],[-4.008789,5.179871],[-4.649902,5.168274],[-5.834412,4.993713],[-6.528687,4.705078],[-7.518921,4.338318],[-7.712097,4.364685],[-7.974121,4.355896],[-9.004822,4.83252],[-9.913391,5.593689],[-10.765381,6.140686],[-11.438782,6.785889],[-11.708191,6.860107],[-12.428101,7.262878],[-12.948975,7.798706],[-13.124023,8.163879],[-13.246521,8.903076],[-13.685181,9.494873],[-14.073975,9.886292],[-14.330078,10.015686],[-14.579712,10.214478],[-14.693176,10.656311],[-14.839478,10.876709],[-15.13031,11.040527],[-15.664185,11.458496],[-16.085205,11.524719],[-16.314697,11.806519],[-16.308899,11.958679],[-16.61377,12.170898],[-16.677429,12.384888],[-16.841492,13.151489],[-16.713684,13.595093],[-17.126099,14.373474],[-17.625,14.729675],[-17.185181,14.919495],[-16.700684,15.621521],[-16.463013,16.135071],[-16.549683,16.673889],[-16.270508,17.167114],[-16.146301,18.108521],[-16.256897,19.09668],[-16.377625,19.593872],[-16.277771,20.092529],[-16.536316,20.567871],[-17.063416,20.999878],[-17.020386,21.422302],[-16.973206,21.885681],[-16.589111,22.158325],[-16.261902,22.679321],[-16.326416,23.017883],[-15.982605,23.723511],[-15.426025,24.359131],[-15.089294,24.520325],[-14.824585,25.103516],[-14.800903,25.636292],[-14.43988,26.254517],[-13.773804,26.618896],[-13.139893,27.640076],[-12.618774,28.03833],[-11.688904,28.148682],[-10.900879,28.832275],[-10.399597,29.098694],[-9.564819,29.933716],[-9.814697,31.177673],[-9.434814,32.038086],[-9.30072,32.564697],[-8.65741,33.240295],[-7.654175,33.697083],[-6.912476,34.110474],[-6.244324,35.145874],[-5.929993,35.760071],[-5.193787,35.75531],[-4.591003,35.330688],[-3.640076,35.399902],[-2.604309,35.179077],[-2.169922,35.168518],[-1.208618,35.714905],[-0.12738,35.888672],[0.503906,36.301331],[1.466919,36.605713],[3.161682,36.783875],[4.815674,36.865112],[5.320129,36.716492],[6.261902,37.110718],[7.330505,37.11853],[7.737122,36.885681],[8.421082,36.946472],[9.510071,37.350098],[10.210083,37.230103],[10.180725,36.724121],[11.028931,37.092102],[11.100098,36.900085],[10.600098,36.410095],[10.593323,35.94751],[10.939514,35.699097],[10.807922,34.833496],[10.149719,34.330688],[10.339722,33.785889],[10.856873,33.768677],[11.108521,33.293274],[11.488892,33.137085],[12.66333,32.792908],[13.083313,32.878906],[13.918701,32.712097],[15.245728,32.265076],[15.713928,31.376282],[16.611694,31.182312],[18.021118,30.763489],[19.086487,30.266479],[19.574097,30.525879],[20.053284,30.985901],[19.820312,31.751892],[20.134094,32.238281],[20.854492,32.706909],[21.543091,32.843323],[22.895874,32.638489],[23.236877,32.191528],[23.609131,32.187317],[23.92749,32.016724],[24.921082,31.899475],[25.164917,31.569275],[26.4953,31.585693],[27.457703,31.321289],[28.4505,31.025879],[28.913513,30.870117],[29.683472,31.18689],[30.095093,31.473511],[30.976929,31.555908],[31.68811,31.429688],[31.96051,30.933716],[32.192505,31.260315],[32.993896,31.024109],[33.773499,30.967529],[34.265503,31.219482],[34.556519,31.548889],[34.488098,31.60553],[34.752686,32.072876],[34.955505,32.827515],[35.098511,33.080688],[35.126099,33.090881],[35.4823,33.905518],[35.979675,34.610107],[35.998474,34.644897],[35.90509,35.410095],[36.149902,35.821472],[35.782104,36.275085],[36.160889,36.650696],[35.551086,36.565491],[34.714478,36.795471],[34.026917,36.220093],[32.509277,36.107483],[31.699707,36.644287],[30.621704,36.677917],[30.391113,36.263123],[29.700073,36.144287],[28.73291,36.67688],[27.641296,36.658875],[27.048889,37.653503],[26.318298,38.20813],[26.804688,38.985901],[26.170898,39.463684],[27.28009,40.420105],[28.820129,40.460083],[29.240112,41.220093],[31.145874,41.087708],[32.348083,41.736328],[33.513306,42.019104],[35.167725,42.040283],[36.913086,41.33551],[38.347717,40.94873],[39.512695,41.102905],[40.373474,41.013672],[41.554077,41.535706],[41.703308,41.963074],[41.453491,42.645081],[40.875488,43.013672],[40.321472,43.128723],[39.955078,43.43512],[38.680115,44.28009],[37.539124,44.657288],[36.675476,45.24469],[37.40332,45.40448],[38.233093,46.240906],[37.673706,46.636719],[39.147705,47.044678],[39.121277,47.263489],[38.223694,47.102295],[37.42511,47.022278],[36.759888,46.69873],[35.82373,46.645874],[34.96228,46.273315],[35.020874,45.651306],[35.510071,45.410095],[36.53009,45.470093],[36.334717,45.113281],[35.240112,44.940125],[33.882507,44.361511],[33.326477,44.56488],[33.546875,45.034912],[32.454285,45.327515],[32.63092,45.519287],[33.588074,45.851685],[33.298706,46.080688],[31.74408,46.333496],[31.675293,46.706299],[30.748901,46.58313],[30.377686,46.032471],[29.603271,45.293274],[29.626526,45.035522],[29.141724,44.820312],[28.837891,44.913879],[28.558105,43.70752],[28.039124,43.293274],[27.673889,42.577881],[27.996704,42.007507],[28.115479,41.622925],[28.988525,41.299927],[28.806519,41.054871],[27.61908,40.999878],[27.192505,40.690674],[26.358093,40.1521],[26.043274,40.617676],[26.056885,40.824097],[25.447693,40.852478],[24.925903,40.947083],[23.714905,40.687073],[24.408081,40.125122],[23.900085,39.962097],[23.343079,39.961121],[22.814087,40.476074],[22.626282,40.256531],[22.84967,39.659302],[23.350098,39.190125],[22.973083,38.970886],[23.53009,38.510071],[24.025085,38.220093],[24.0401,37.65509],[23.115112,37.920105],[23.410095,37.410095],[22.775085,37.305115],[23.154297,36.422485],[22.490112,36.410095],[21.670105,36.845093],[21.295105,37.645081],[21.120117,38.310303],[20.730103,38.770081],[20.217712,39.340271],[20.150085,39.625122],[19.980103,39.695129],[19.960083,39.9151],[19.406128,40.250916],[19.319092,40.727295],[19.403687,41.409485],[19.5401,41.720093],[19.371887,41.877686],[19.162476,41.955078],[18.88208,42.281494],[18.450073,42.480103],[17.509888,42.850098],[16.930115,43.210083],[16.015503,43.507324],[15.1745,44.243286],[15.376282,44.317871],[14.920288,44.738525],[14.901672,45.076111],[14.258728,45.233887],[13.952271,44.802124],[13.657104,45.137085],[13.679504,45.484131],[13.715088,45.500305],[13.937683,45.591125],[13.141724,45.736694],[12.328674,45.381897],[12.383911,44.885498],[12.261475,44.600525],[12.589294,44.091492],[13.526917,43.587708],[14.029907,42.761108],[15.1427,41.955078],[15.926331,41.961304],[16.169922,41.740295],[15.889282,41.541077],[16.785095,41.179688],[17.519287,40.877075],[18.376709,40.355713],[18.480286,40.168884],[18.293518,39.810913],[17.738525,40.27771],[16.86969,40.442322],[16.44873,39.795471],[17.171509,39.424683],[17.052917,38.902893],[16.635071,38.843689],[16.101074,37.985901],[15.684082,37.908875],[15.68811,38.214722],[15.89209,38.750916],[16.109314,38.964478],[15.718872,39.544128],[15.413696,40.048279],[14.998474,40.173096],[14.703308,40.604675],[14.06073,40.786499],[13.628113,41.188293],[12.888123,41.253113],[12.106689,41.704529],[11.191895,42.35553],[10.512085,42.931519],[10.200073,43.920105],[9.702515,44.036316],[8.888916,44.366272],[8.428711,44.231323],[7.850891,43.767273],[7.435303,43.693909],[6.529297,43.128906],[4.556885,43.399719],[3.100525,43.075317],[2.986084,42.473083],[3.03949,41.89209],[2.091919,41.226074],[0.810486,41.014709],[0.721313,40.678284],[0.106689,40.124084],[-0.278687,39.31012],[0.111328,38.738525],[-0.467102,38.29248],[-0.683411,37.642273],[-1.438293,37.443115],[-2.146423,36.674072],[-3.41571,36.658875],[-4.368896,36.677917],[-4.995178,36.324707],[-5.377075,35.946899],[-5.866394,36.029907],[-6.236694,36.367676],[-6.520203,36.942871],[-7.453674,37.0979],[-7.855591,36.838318],[-8.382812,36.978882],[-8.898804,36.868896],[-8.746094,37.651489],[-8.840027,38.266296],[-9.287476,38.358521],[-9.526489,38.737488],[-9.446899,39.39209],[-9.048279,39.755127],[-8.977295,40.159302],[-8.768677,40.760681],[-8.790771,41.184326],[-8.990784,41.543518],[-9.03479,41.880676],[-8.984375,42.592896],[-9.392883,43.026672],[-7.97821,43.748474],[-6.754517,43.567871],[-5.411804,43.57428],[-4.347778,43.403503],[-3.517517,43.455872],[-1.901306,43.422913],[-1.384216,44.022705],[-1.193787,46.014893],[-2.225708,47.064514],[-2.963196,47.570312],[-4.491577,47.955078],[-4.592285,48.684082],[-3.295776,48.901672],[-1.616516,48.64447],[-1.933411,49.776489],[-0.98938,49.347473],[1.338684,50.127319],[1.639099,50.946716],[2.513489,51.148499],[3.315125,51.345886],[3.830322,51.620483],[4.706116,53.091919],[6.07428,53.510498],[6.905273,53.4823],[7.100525,53.693909],[7.936279,53.748291],[8.121704,53.527893],[8.80072,54.020874],[8.572083,54.395691],[8.526306,54.962891],[8.1203,55.5177],[8.090088,56.5401],[8.256714,56.81012],[8.543518,57.110107],[9.4245,57.172119],[9.775696,57.447876],[10.580078,57.730103],[10.546082,57.215881],[10.250122,56.890076],[10.370117,56.610107],[10.912292,56.458679],[10.667908,56.081482],[10.370117,56.190125],[9.650085,55.470093],[9.921875,54.983093],[9.939697,54.59668],[10.950073,54.363708],[10.939514,54.008728],[11.956299,54.196472],[12.518494,54.47052],[13.647522,54.0755],[14.11969,53.75708],[14.802917,54.05072],[16.363525,54.513306],[17.622925,54.851685],[18.620911,54.682678],[18.696289,54.438721],[19.660706,54.426086],[19.888489,54.866089],[21.268494,55.190491],[21.055908,56.031128],[21.090515,56.783875],[21.581909,57.411926],[22.524475,57.753479],[23.318481,57.006287],[24.120728,57.025696],[24.312927,57.793518],[24.429077,58.383484],[24.061279,58.257507],[23.426697,58.612671],[23.339905,59.187317],[24.604309,59.465881],[25.864319,59.611084],[26.94928,59.445923],[27.981079,59.475525],[29.117676,60.028076],[28.070129,60.503479],[26.25531,60.423889],[24.496704,60.057312],[22.86969,59.846497],[22.290894,60.391907],[21.322327,60.720276],[21.544922,61.705322],[21.059326,62.607483],[21.536072,63.18988],[22.442688,63.817871],[24.73053,64.902283],[25.398071,65.111511],[25.294128,65.534485],[23.903503,66.006897],[22.183289,65.723877],[21.213501,65.026123],[21.36969,64.413696],[19.778931,63.60968],[17.8479,62.749512],[17.11969,61.341309],[17.831482,60.636719],[18.78772,60.081909],[17.869324,58.953918],[16.829285,58.71991],[16.447693,57.041077],[15.879883,56.104309],[14.666687,56.200928],[14.100708,55.407898],[12.942871,55.361877],[12.625122,56.307129],[11.788086,57.441895],[11.027283,58.856079],[10.356689,59.46991],[8.38208,58.313293],[7.048889,58.078918],[5.665894,58.588074],[5.308289,59.66333],[4.992126,61.97113],[5.912903,62.614502],[8.553528,63.454102],[10.52771,64.486084],[12.358276,65.8797],[14.761292,67.81073],[16.435913,68.563293],[19.184082,69.817505],[21.378479,70.25531],[23.023682,70.202087],[24.546692,71.030518],[26.370117,70.986328],[28.165527,71.185486],[31.293518,70.453918],[30.005493,70.186279],[31.101074,69.558105],[32.13269,69.905884],[33.775513,69.301514],[36.514099,69.063477],[40.29248,67.932495],[41.059875,67.457275],[41.126099,66.791687],[40.01593,66.266296],[38.382874,65.999512],[33.918701,66.759705],[33.184509,66.632507],[34.81488,65.900085],[34.943909,64.41449],[36.231323,64.109497],[37.012878,63.849915],[37.14209,64.334717],[36.5177,64.780273],[37.176086,65.143311],[39.593506,64.520874],[40.43573,64.764526],[39.762695,65.496887],[42.093079,66.476318],[43.016113,66.418701],[43.94989,66.069092],[44.532288,66.756287],[43.698486,67.352478],[44.187927,67.9505],[43.452881,68.570923],[46.250122,68.250122],[46.821289,67.68988],[45.555298,67.566528],[45.562073,67.010071],[46.349121,66.667725],[47.894287,66.884521],[48.138672,67.522522],[50.227722,67.998718],[53.717529,68.857483],[54.47168,68.808289],[53.485901,68.201294],[54.726318,68.097107],[55.442688,68.438721],[57.317078,68.466309],[58.802124,68.88092],[59.941528,68.278503],[61.077881,68.940674],[60.03009,69.520081],[60.55011,69.850098],[63.504089,69.547485],[64.888123,69.234924],[68.512085,68.092285],[69.180725,68.615723],[68.16449,69.144287],[68.135315,69.356506],[66.930115,69.454712],[67.259888,69.928711],[66.724915,70.708923],[66.694702,71.029114],[68.5401,71.934509],[69.196289,72.843506],[69.940125,73.0401],[72.587524,72.776306],[72.796082,72.220093],[71.848083,71.409119],[72.470093,71.090271],[72.79187,70.391113],[72.564697,69.020874],[73.667908,68.407898],[73.238708,67.740479],[71.28009,66.320129],[72.423096,66.172729],[72.820679,66.532715],[73.921082,66.78949],[74.186523,67.284302],[75.052124,67.760498],[74.469299,68.329102],[74.935913,68.989319],[73.842285,69.071472],[73.601929,69.627686],[74.399902,70.631897],[73.101074,71.447083],[74.89093,72.121277],[74.659302,72.832275],[75.158081,72.855103],[75.683472,72.300476],[75.289124,71.335693],[76.359131,71.152893],[75.903076,71.874084],[77.576721,72.267273],[79.6521,72.320129],[81.500122,71.750122],[80.610718,72.582886],[80.511108,73.648315],[82.250122,73.850098],[84.655273,73.805908],[86.822327,73.93689],[86.009705,74.459717],[87.16687,75.116516],[88.315674,75.143921],[90.260071,75.640076],[92.900696,75.773315],[93.234314,76.047302],[95.860107,76.140076],[96.678284,75.915527],[98.922485,76.446899],[100.759705,76.430298],[101.035278,76.861877],[101.990906,77.287476],[104.351685,77.697876],[106.066711,77.373901],[104.705078,77.127502],[106.970276,76.974304]],[[49.110291,41.282288],[49.618896,40.572876],[50.0849,40.526306],[50.392883,40.256531],[49.569275,40.176086],[49.395325,39.399475],[49.223328,39.049316],[48.856506,38.815491],[48.883301,38.320313],[49.199707,37.582886],[50.147888,37.374695],[50.842285,36.872925],[52.264099,36.7005],[53.825928,36.965088],[53.921692,37.198914],[53.735474,37.906128],[53.88092,38.952087],[53.101074,39.29071],[53.35791,39.975281],[52.694092,40.033691],[52.915283,40.876526],[53.858276,40.631104],[54.736877,40.951111],[54.008301,41.551331],[53.72168,42.123291],[52.916687,41.868103],[52.814697,41.135498],[52.502502,41.783325],[52.446289,42.027283],[52.692078,42.443909],[52.501526,42.792297],[51.342529,43.133118],[50.891296,44.031128],[50.339111,44.284119],[50.305725,44.609924],[51.278503,44.514893],[51.316895,45.246094],[52.16748,45.408508],[53.040894,45.259094],[53.220886,46.23468],[53.042725,46.853088],[52.042114,46.804687],[51.192078,47.048706],[50.034119,46.609131],[49.101318,46.399475],[48.645508,45.806274],[47.675903,45.641479],[46.682129,44.609314],[47.590881,43.660278],[47.492493,42.986694],[48.584473,41.808899],[49.110291,41.282288]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[-96.436304,77.491343,-93.720656,77.834629],"geometry":{"type":"Polygon","coordinates":[[[-93.840003,77.519997],[-94.295608,77.491343],[-96.169654,77.555111],[-96.436304,77.834629],[-94.422577,77.820005],[-93.720656,77.634331],[-93.840003,77.519997]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-113.534279,77.409229,-109.854452,78.152956],"geometry":{"type":"Polygon","coordinates":[[[-110.186938,77.697015],[-112.051191,77.409229],[-113.534279,77.732207],[-112.724587,78.05105],[-111.264443,78.152956],[-109.854452,77.996325],[-110.186938,77.697015]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[20.72601,77.44493,24.72412,78.45494],"geometry":{"type":"Polygon","coordinates":[[[24.72412,77.85385],[22.49032,77.44493],[20.72601,77.67704],[21.41611,77.93504],[20.8119,78.25463],[22.88426,78.45494],[23.28134,78.07954],[24.72412,77.85385]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1.5},"bbox":[-112.542091,78.40692,-109.663146,78.849994],"geometry":{"type":"Polygon","coordinates":[[[-109.663146,78.601973],[-110.881314,78.40692],[-112.542091,78.407902],[-112.525891,78.550555],[-111.50001,78.849994],[-110.963661,78.804441],[-109.663146,78.601973]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[-98.631984,77.850597,-95.559278,78.87193],"geometry":{"type":"Polygon","coordinates":[[[-95.830295,78.056941],[-97.309843,77.850597],[-98.124289,78.082857],[-98.552868,78.458105],[-98.631984,78.87193],[-97.337231,78.831984],[-96.754399,78.765813],[-95.559278,78.418315],[-95.830295,78.056941]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":0.5},"bbox":[-105.492289,77.907545,-99.670939,79.301594],"geometry":{"type":"Polygon","coordinates":[[[-100.060192,78.324754],[-99.670939,77.907545],[-101.30394,78.018985],[-102.949809,78.343229],[-105.176133,78.380332],[-104.210429,78.67742],[-105.41958,78.918336],[-105.492289,79.301594],[-103.529282,79.165349],[-100.825158,78.800462],[-100.060192,78.324754]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0.5},"bbox":[99.43814,77.921,105.37243,79.34641],"geometry":{"type":"Polygon","coordinates":[[[105.07547,78.30689],[99.43814,77.921],[101.2649,79.23399],[102.08635,79.34641],[102.837815,79.28129],[105.37243,78.71334],[105.07547,78.30689]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[10.44453,76.77045,21.54383,80.05086],"geometry":{"type":"Polygon","coordinates":[[[18.25183,79.70175],[21.54383,78.95611],[19.02737,78.5626],[18.47172,77.82669],[17.59441,77.63796],[17.1182,76.80941],[15.91315,76.77045],[13.76259,77.38035],[14.66956,77.73565],[13.1706,78.02493],[11.22231,78.8693],[10.44453,79.65239],[13.17077,80.01046],[13.71852,79.66039],[15.14282,79.67431],[15.52255,80.01608],[16.99085,80.05086],[18.25183,79.70175]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[17.368015,79.400012,27.407506,80.657144],"geometry":{"type":"Polygon","coordinates":[[[25.447625,80.40734],[27.407506,80.056406],[25.924651,79.517834],[23.024466,79.400012],[20.075188,79.566823],[19.897266,79.842362],[18.462264,79.85988],[17.368015,80.318896],[20.455992,80.598156],[21.907945,80.357679],[22.919253,80.657144],[25.447625,80.40734]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":1,"min_zoom":1},"bbox":[44.846958,80.010181,51.522933,80.918885],"geometry":{"type":"Polygon","coordinates":[[[51.136187,80.54728],[49.793685,80.415428],[48.894411,80.339567],[48.754937,80.175468],[47.586119,80.010181],[46.502826,80.247247],[47.072455,80.559424],[44.846958,80.58981],[46.799139,80.771918],[48.318477,80.78401],[48.522806,80.514569],[49.09719,80.753986],[50.039768,80.918885],[51.522933,80.699726],[51.136187,80.54728]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[91.18107,78.7562,100.186655,81.2504],"geometry":{"type":"Polygon","coordinates":[[[99.93976,78.88094],[97.75794,78.7562],[94.97259,79.044745],[93.31288,79.4265],[92.5454,80.14379],[91.18107,80.34146],[93.77766,81.0246],[95.940895,81.2504],[97.88385,80.746975],[100.186655,79.780135],[99.93976,78.88094]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-96.70972,78.21533,-85.81435,81.25739],"geometry":{"type":"Polygon","coordinates":[[[-87.02,79.66],[-85.81435,79.3369],[-87.18756,79.0393],[-89.03535,78.28723],[-90.80436,78.21533],[-92.87669,78.34333],[-93.95116,78.75099],[-93.93574,79.11373],[-93.14524,79.3801],[-94.974,79.37248],[-96.07614,79.70502],[-96.70972,80.15777],[-96.01644,80.60233],[-95.32345,80.90729],[-94.29843,80.97727],[-94.73542,81.20646],[-92.40984,81.25739],[-91.13289,80.72345],[-89.45,80.509322],[-87.81,80.32],[-87.02,79.66]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-91.58702,76.17812,-61.85,83.23324],"geometry":{"type":"Polygon","coordinates":[[[-68.5,83.106322],[-65.82735,83.02801],[-63.68,82.9],[-61.85,82.6286],[-61.89388,82.36165],[-64.334,81.92775],[-66.75342,81.72527],[-67.65755,81.50141],[-65.48031,81.50657],[-67.84,80.9],[-69.4697,80.61683],[-71.18,79.8],[-73.2428,79.63415],[-73.88,79.430162],[-76.90773,79.32309],[-75.52924,79.19766],[-76.22046,79.01907],[-75.39345,78.52581],[-76.34354,78.18296],[-77.88851,77.89991],[-78.36269,77.50859],[-79.75951,77.20968],[-79.61965,76.98336],[-77.91089,77.022045],[-77.88911,76.777955],[-80.56125,76.17812],[-83.17439,76.45403],[-86.11184,76.29901],[-87.6,76.42],[-89.49068,76.47239],[-89.6161,76.95213],[-87.76739,77.17833],[-88.26,77.9],[-87.65,77.970222],[-84.97634,77.53873],[-86.34,78.18],[-87.96192,78.37181],[-87.15198,78.75867],[-85.37868,78.9969],[-85.09495,79.34543],[-86.50734,79.73624],[-86.93179,80.25145],[-84.19844,80.20836],[-83.408696,80.1],[-81.84823,80.46442],[-84.1,80.58],[-87.59895,80.51627],[-89.36663,80.85569],[-90.2,81.26],[-91.36786,81.5531],[-91.58702,81.89429],[-90.1,82.085],[-88.93227,82.11751],[-86.97024,82.27961],[-85.5,82.652273],[-84.260005,82.6],[-83.18,82.32],[-82.42,82.86],[-81.1,83.02],[-79.30664,83.13056],[-76.25,83.172059],[-75.71878,83.06404],[-72.83153,83.23324],[-70.665765,83.169781],[-68.5,83.106322]]]}},{"type":"Feature","properties":{"featurecla":"Land","scalerank":0,"min_zoom":0},"bbox":[-73.297,60.03676,-12.20855,83.64513],"geometry":{"type":"Polygon","coordinates":[[[-27.10046,83.51966],[-20.84539,82.72669],[-22.69182,82.34165],[-26.51753,82.29765],[-31.9,82.2],[-31.39646,82.02154],[-27.85666,82.13178],[-24.84448,81.78697],[-22.90328,82.09317],[-22.07175,81.73449],[-23.16961,81.15271],[-20.62363,81.52462],[-15.76818,81.91245],[-12.77018,81.71885],[-12.20855,81.29154],[-16.28533,80.58004],[-16.85,80.35],[-20.04624,80.17708],[-17.73035,80.12912],[-18.9,79.4],[-19.70499,78.75128],[-19.67353,77.63859],[-18.47285,76.98565],[-20.03503,76.94434],[-21.67944,76.62795],[-19.83407,76.09808],[-19.59896,75.24838],[-20.66818,75.15585],[-19.37281,74.29561],[-21.59422,74.22382],[-20.43454,73.81713],[-20.76234,73.46436],[-22.17221,73.30955],[-23.56593,73.30663],[-22.31311,72.62928],[-22.29954,72.18409],[-24.27834,72.59788],[-24.79296,72.3302],[-23.44296,72.08016],[-22.13281,71.46898],[-21.75356,70.66369],[-23.53603,70.471],[-24.30702,70.85649],[-25.54341,71.43094],[-25.20135,70.75226],[-26.36276,70.22646],[-23.72742,70.18401],[-22.34902,70.12946],[-25.02927,69.2588],[-27.74737,68.47046],[-30.67371,68.12503],[-31.77665,68.12078],[-32.81105,67.73547],[-34.20196,66.67974],[-36.35284,65.9789],[-37.04378,65.93768],[-38.37505,65.69213],[-39.81222,65.45848],[-40.66899,64.83997],[-40.68281,64.13902],[-41.1887,63.48246],[-42.81938,62.68233],[-42.41666,61.90093],[-42.86619,61.07404],[-43.3784,60.09772],[-44.7875,60.03676],[-46.26364,60.85328],[-48.26294,60.85843],[-49.23308,61.40681],[-49.90039,62.38336],[-51.63325,63.62691],[-52.14014,64.27842],[-52.27659,65.1767],[-53.66166,66.09957],[-53.30161,66.8365],[-53.96911,67.18899],[-52.9804,68.35759],[-51.47536,68.72958],[-51.08041,69.14781],[-50.87122,69.9291],[-52.013585,69.574925],[-52.55792,69.42616],[-53.45629,69.283625],[-54.68336,69.61003],[-54.75001,70.28932],[-54.35884,70.821315],[-53.431315,70.835755],[-51.39014,70.56978],[-53.10937,71.20485],[-54.00422,71.54719],[-55,71.406537],[-55.83468,71.65444],[-54.71819,72.58625],[-55.32634,72.95861],[-56.12003,73.64977],[-57.32363,74.71026],[-58.59679,75.09861],[-58.58516,75.51727],[-61.26861,76.10238],[-63.39165,76.1752],[-66.06427,76.13486],[-68.50438,76.06141],[-69.66485,76.37975],[-71.40257,77.00857],[-68.77671,77.32312],[-66.76397,77.37595],[-71.04293,77.63595],[-73.297,78.04419],[-73.15938,78.43271],[-69.37345,78.91388],[-65.7107,79.39436],[-65.3239,79.75814],[-68.02298,80.11721],[-67.15129,80.51582],[-63.68925,81.21396],[-62.23444,81.3211],[-62.65116,81.77042],[-60.28249,82.03363],[-57.20744,82.19074],[-54.13442,82.19962],[-53.04328,81.88833],[-50.39061,82.43883],[-48.00386,82.06481],[-46.59984,81.985945],[-44.523,81.6607],[-46.9007,82.19979],[-46.76379,82.62796],[-43.40644,83.22516],[-39.89753,83.18018],[-38.62214,83.54905],[-35.08787,83.64513],[-27.10046,83.51966]]]}}],"bbox":[-180,-90,180,83.64513]} diff --git a/zbook_frontend/public/ne_110m_rivers_lake_centerlines.geojson b/zbook_frontend/public/ne_110m_rivers_lake_centerlines.geojson new file mode 100644 index 0000000..0e92c5b --- /dev/null +++ b/zbook_frontend/public/ne_110m_rivers_lake_centerlines.geojson @@ -0,0 +1 @@ +{"type":"FeatureCollection","name":"ne_110m_rivers_lake_centerlines","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"features":[{"type":"Feature","properties":{"scalerank":2,"featurecla":"River","name":"Brahmaputra","name_alt":null,"min_zoom":2.1,"name_en":"Brahmaputra","min_label":3.1,"wikidataid":"Q45403","label":"Brahmaputra","name_ar":"نهر براهمابوترا","name_bn":"ব্রহ্মপুত্র নদ","name_de":"Brahmaputra","name_es":"Brahmaputra","name_fr":"Brahmapoutre","name_el":"Βραχμαπούτρας","name_hi":"ब्रह्मपुत्र नदी","name_hu":"Brahmaputra","name_id":"Sungai Brahmaputra","name_it":"Brahmaputra","name_ja":"ブラマプトラ川","name_ko":"브라마푸트라강","name_nl":"Brahmaputra","name_pl":"Brahmaputra","name_pt":"Bramaputra","name_ru":"Брахмапутра","name_sv":"Brahmaputra","name_tr":"Brahmaputra","name_vi":"Brahmaputra","name_zh":"布拉马普特拉河","ne_id":1159120261,"name_he":"בראהמאפוטרה","name_uk":"Брахмапутра","name_ur":"دریائے برہم پتر","name_fa":"رود براهماپوترا","name_zht":"布拉马普特拉河"},"bbox":[82.40048,22.780238,95.396482,30.411477],"geometry":{"type":"LineString","coordinates":[[82.40048,30.411477],[82.722734,30.365046],[83.761017,29.833321],[84.066735,29.613283],[84.379067,29.494505],[84.707212,29.296352],[85.408668,29.274389],[87.66021,29.151528],[87.78873,29.265604],[87.984118,29.342034],[88.630797,29.350664],[91.037989,29.316505],[92.095495,29.253409],[93.25005,29.069802],[93.607496,29.108585],[94.356029,29.309529],[94.820394,29.542151],[95.150606,29.810119],[95.265431,29.828541],[95.336021,29.740717],[95.372608,29.595739],[95.316901,29.417688],[94.876462,28.967948],[94.87083,28.831961],[95.043532,28.511232],[95.087922,28.217244],[95.396482,28.002916],[95.38284,27.904344],[95.289926,27.787865],[94.831504,27.464164],[94.3952,27.042407],[93.751622,26.732038],[92.677889,26.555124],[92.322251,26.464431],[91.683427,26.21486],[91.250379,26.183208],[90.606077,26.180831],[90.334052,26.134762],[90.11236,26.029523],[89.924982,25.873796],[89.788039,25.632105],[89.612649,24.948374],[89.714194,24.584624],[89.744424,23.858673],[90.0057,23.659021],[90.225687,23.418416],[90.387279,23.119829],[90.50753,22.780238]]}},{"type":"Feature","properties":{"scalerank":2,"featurecla":"River","name":"Mekong","name_alt":null,"min_zoom":2.1,"name_en":"Mekong","min_label":3.1,"wikidataid":"Q41179","label":"Mekong","name_ar":"نهر ميكونغ","name_bn":"মেকং নদী","name_de":"Mekong","name_es":"Mekong","name_fr":"Mékong","name_el":"Μεκόνγκ","name_hi":"मीकांग नदी","name_hu":"Mekong","name_id":"Mekong","name_it":"Mekong","name_ja":"メコン川","name_ko":"메콩강","name_nl":"Mekong","name_pl":"Mekong","name_pt":"Mekong","name_ru":"Меконг","name_sv":"Mekong","name_tr":"Mekong","name_vi":"Mê Kông","name_zh":"湄公河","ne_id":1159121023,"name_he":"מקונג","name_uk":"Меконг","name_ur":"دریائے میکانگ","name_fa":"مکونگ","name_zht":"湄公河"},"bbox":[94.084004,9.433791,106.361084,33.163299],"geometry":{"type":"LineString","coordinates":[[94.084004,33.155858],[94.447703,33.163299],[94.94142,33.089273],[95.840435,32.632272],[96.239325,32.52587],[96.941298,31.965543],[97.16516,31.488518],[97.256782,31.096474],[97.846255,30.277739],[98.284575,29.666897],[98.623986,28.963116],[99.028095,27.516279],[99.150155,27.02786],[99.172583,26.026448],[99.240279,25.668253],[99.391277,25.344758],[99.666816,25.013564],[99.916568,24.833833],[100.300317,24.721463],[100.421292,24.647256],[100.487334,24.525945],[100.519942,24.377918],[100.475552,24.163978],[100.138519,23.473115],[100.122395,23.311136],[100.171488,23.106574],[100.983738,21.844972],[101.018258,21.797714],[101.150033,21.849984],[101.180005,21.436573],[100.329101,20.786122],[100.115988,20.41785],[100.548881,20.109238],[100.559087,20.002371],[100.569293,19.89553],[100.597302,19.89305],[101.11479,19.852148],[101.471564,19.870131],[102.184802,20.048906],[101.883735,19.555189],[101.764828,18.721777],[101.492286,18.160029],[101.485981,17.969704],[101.563651,17.820515],[101.585975,17.810464],[102.113592,18.109102],[102.413005,17.932782],[102.998706,17.961695],[103.200192,18.309632],[103.956477,18.240954],[104.716947,17.428859],[104.779321,16.441865],[105.589039,15.570316],[105.576068,15.324646],[105.781688,15.120524],[105.891036,14.771088],[105.869693,14.21784],[105.964933,13.857397],[105.949327,13.35009],[105.972271,12.659641],[105.929896,12.397073],[105.810162,12.28677],[105.650689,12.233956],[105.368122,11.970484],[105.049847,11.804603],[104.951145,11.590921],[105.112582,10.932615],[105.207977,10.706866],[105.566611,10.267074],[106.361084,9.433791]]}},{"type":"Feature","properties":{"scalerank":2,"featurecla":"River","name":"Ob","name_alt":null,"min_zoom":2.1,"name_en":"Ob","min_label":3.1,"wikidataid":"Q973","label":"Ob","name_ar":"أوبي","name_bn":"ওব নদী","name_de":"Ob","name_es":"Obi","name_fr":"Ob","name_el":"Ομπ","name_hi":"ओब नदी","name_hu":"Ob","name_id":"Sungai Ob","name_it":"Ob'","name_ja":"オビ川","name_ko":"오비강","name_nl":"Ob","name_pl":"Ob","name_pt":"Ob","name_ru":"Обь","name_sv":"Ob","name_tr":"Obi","name_vi":"Obi","name_zh":"鄂畢河","ne_id":1159114911,"name_he":"אוב","name_uk":"Об","name_ur":"اوب","name_fa":"رود اب","name_zht":"鄂畢河"},"bbox":[65.303229,47.069143,90.325371,66.788353],"geometry":{"type":"LineString","coordinates":[[90.325371,47.650167],[90.20052,47.408011],[89.733417,47.162496],[89.3969,47.069143],[89.048136,47.087436],[86.943562,47.660114],[86.400132,47.856562],[85.267075,47.994383],[84.356846,47.732126],[83.835638,48.035518],[83.619734,48.193984],[83.551159,48.313124],[83.491576,48.778573],[83.61901,48.896499],[83.868401,49.025354],[84.011648,49.175913],[83.882767,49.346239],[83.363728,49.643843],[82.484816,50.060407],[82.140031,50.182157],[81.781086,50.251868],[80.427784,50.385194],[78.545315,50.767289],[77.242862,51.869031],[76.998846,52.1301],[76.606105,52.69252],[76.327879,52.901784],[75.589526,53.296489],[75.309336,53.496322],[75.117824,53.687886],[75.021912,53.847902],[74.993593,53.985594],[74.519927,54.375286],[74.396175,54.42505],[74.123685,54.534527],[73.850614,54.644003],[73.725092,54.693768],[73.633211,54.741349],[73.465896,54.829716],[73.376121,54.877297],[73.081772,55.229549],[73.115155,55.30603],[73.334056,55.445763],[73.655174,55.585496],[74.241081,55.761248],[74.471868,55.874884],[74.62452,56.027278],[74.710303,56.20334],[74.702655,56.412345],[74.629843,56.644346],[74.478069,56.859475],[74.279942,57.027786],[73.69021,57.255472],[72.90106,57.446313],[71.474325,57.658755],[70.289023,57.946231],[68.83986,58.03359],[68.680607,58.068497],[68.384501,58.133106],[68.224032,58.167277],[68.245388,58.249416],[68.268112,58.332383],[68.503705,58.527074],[68.601425,58.746079],[68.793145,58.984074],[68.968328,59.404746],[69.129559,59.550422],[69.334301,59.649538],[69.782749,59.872625],[69.804556,59.996028],[69.767659,60.107132],[69.837319,60.256865],[69.804091,60.515015],[69.725078,60.658339],[69.497495,60.813084],[69.398069,60.861725],[69.179142,60.968734],[68.959814,61.075704],[68.859136,61.124228],[68.821787,61.10671],[68.786117,61.089346],[68.408466,61.20691],[68.225893,61.447671],[67.645101,61.73047],[67.232827,62.068124],[66.28074,62.446835],[65.688735,62.662377],[65.409941,62.847275],[65.303229,63.075065],[65.427252,63.306524],[65.688993,63.587333],[65.833326,64.015163],[65.918385,64.115053],[65.926033,64.224349],[65.582282,64.707368],[65.510658,64.965647],[65.411026,65.040165],[65.368393,65.16747],[65.766301,65.802676],[65.835393,65.999796],[65.839268,66.157177],[66.341408,66.44318],[66.677305,66.566531],[67.033097,66.605082],[68.192872,66.575756],[69.013493,66.788353],[69.93044,66.746831],[70.8401,66.653038],[71.469571,66.663476]]}},{"type":"Feature","properties":{"scalerank":2,"featurecla":"River","name":"Peace","name_alt":null,"min_zoom":2.1,"name_en":"Peace","min_label":3.1,"wikidataid":"Q2220","label":"Peace","name_ar":"بيس","name_bn":"পীস","name_de":"Peace","name_es":"de la Paz","name_fr":"Paix","name_el":"Πις","name_hi":"पीस","name_hu":"Peace","name_id":"Peace","name_it":"Peace","name_ja":"ピース川","name_ko":"피스강","name_nl":"Peace","name_pl":"Peace","name_pt":"Peace","name_ru":"Пис","name_sv":"Peace","name_tr":"Peace","name_vi":"Peace","name_zh":"皮斯河","ne_id":1159117465,"name_he":"נהר פיס","name_uk":"Піс","name_ur":"دریائے پیس","name_fa":"رود پیس","name_zht":"皮斯河"},"bbox":[-135.313414,55.981312,-111.410765,69.374991],"geometry":{"type":"LineString","coordinates":[[-124.83563,56.756924],[-124.20045,56.243492],[-123.888738,56.088825],[-123.54354,56.044719],[-122.730075,56.09854],[-122.221708,56.021232],[-121.973635,56.019785],[-121.357136,56.189749],[-120.244594,56.151973],[-119.509445,56.251451],[-119.188714,56.244371],[-118.670348,56.016219],[-118.346233,55.981312],[-117.779136,56.054098],[-117.50613,56.155358],[-117.20036,56.412319],[-117.176899,56.545024],[-117.258212,56.854876],[-117.132276,57.281026],[-117.107523,57.654156],[-117.037011,57.929229],[-116.854154,58.069582],[-116.676232,58.127408],[-116.542106,58.288949],[-116.323153,58.370959],[-115.98847,58.418708],[-114.972512,58.409717],[-114.613231,58.475863],[-114.488959,58.512165],[-114.21144,58.590481],[-113.923622,58.66496],[-113.768451,58.689751],[-113.583488,58.723574],[-113.29753,58.807845],[-113.149186,58.855323],[-112.647615,59.097608],[-112.322673,59.1259],[-112.06504,59.083577],[-111.92647,58.973455],[-111.410765,59.005055],[-111.443838,59.536625],[-111.569024,59.847949],[-112.383135,60.221544],[-112.493206,60.314613],[-112.483697,60.450522],[-112.57134,60.540594],[-113.160116,60.853237],[-113.28246,61.173812],[-113.459658,61.24267],[-113.58198,61.244208],[-113.70401,61.245874],[-113.8389,61.256003],[-114.136035,61.278108],[-114.433242,61.300186],[-114.56835,61.310211],[-116.334341,61.089398],[-116.698634,61.121386],[-117.668109,61.307834],[-118.154979,61.421471],[-119.070634,61.301323],[-119.76837,61.334138],[-120.317819,61.463355],[-120.575039,61.569679],[-120.813396,61.780958],[-121.589163,61.973685],[-123.024217,62.242299],[-123.254668,62.348908],[-123.296113,62.509932],[-123.228933,62.86668],[-123.320504,63.05734],[-123.954419,63.741019],[-124.336489,64.00276],[-124.489347,64.22316],[-124.761682,64.423872],[-125.025155,64.692021],[-125.300228,64.805967],[-126.181621,65.049105],[-126.929328,65.29139],[-128.030191,65.608347],[-128.671418,65.722759],[-128.908561,65.860554],[-128.983363,66.029665],[-128.842079,66.322515],[-129.025608,66.455479],[-129.770524,66.731612],[-130.043711,66.880879],[-130.345037,67.213779],[-130.532829,67.30584],[-130.759404,67.353667],[-131.208679,67.454694],[-132.652829,67.293309],[-133.015776,67.29274],[-133.37255,67.359351],[-133.829732,67.520582],[-134.190072,67.741524],[-134.399568,68.052642],[-134.40719,68.182092],[-134.159686,68.449672],[-134.244228,68.706194],[-134.835898,68.963775],[-135.313414,69.374991]]}},{"type":"Feature","properties":{"scalerank":2,"featurecla":"River","name":"Donau","name_alt":"Danube","min_zoom":2.1,"name_en":"Danube","min_label":3.1,"wikidataid":"Q1653","label":"Donau","name_ar":"دانوب","name_bn":"দানিউব নদী","name_de":"Donau","name_es":"Danubio","name_fr":"Danube","name_el":"Δούναβης","name_hi":"डैन्यूब नदी","name_hu":"Duna","name_id":"Sungai Donau","name_it":"Danubio","name_ja":"ドナウ川","name_ko":"도나우강","name_nl":"Donau","name_pl":"Dunaj","name_pt":"Danúbio","name_ru":"Дунай","name_sv":"Donau","name_tr":"Tuna","name_vi":"Đa Nuýp","name_zh":"多瑙河","ne_id":1159118769,"name_he":"דנובה","name_uk":"Дунай","name_ur":"دریائے ڈینیوب","name_fa":"دانوب","name_zht":"多瑙河"},"bbox":[8.219788,43.688445,29.603289,49.027499],"geometry":{"type":"LineString","coordinates":[[8.219788,48.046809],[8.553359,47.980818],[9.414082,48.138354],[10.719894,48.64871],[11.683556,48.794128],[12.032992,49.027499],[12.155762,49.000756],[12.383785,48.951819],[12.506555,48.927556],[12.659698,48.875105],[12.996602,48.756094],[13.333507,48.636386],[13.48665,48.581841],[14.701666,48.234059],[14.995602,48.213052],[15.634426,48.374619],[15.936733,48.353483],[16.878071,48.171789],[17.488473,47.867466],[17.857133,47.758429],[18.696513,47.880954],[18.909885,47.8061],[19.025692,47.668202],[18.933243,47.175932],[18.952311,46.777765],[18.88229,46.279656],[18.764209,46.034348],[18.780513,45.965115],[18.810976,45.901436],[18.887225,45.806248],[19.009091,45.62166],[19.072769,45.521511],[19.155206,45.448001],[19.308633,45.313462],[19.392233,45.246825],[19.512975,45.232653],[19.776899,45.191428],[20.040488,45.148278],[20.160248,45.128305],[20.541982,44.801762],[20.767808,44.744194],[21.360071,44.82667],[21.562023,44.768947],[22.145088,44.478422],[22.459022,44.702517],[22.705726,44.578003],[22.474008,44.409228],[22.65715,44.234923],[22.944832,43.823785],[23.332302,43.897011],[24.100679,43.741051],[25.569272,43.688445],[26.065159,43.943494],[27.2424,44.175986],[27.285058,44.153042],[27.301517,44.133379],[27.384419,44.166555],[27.600853,44.235233],[27.823837,44.303084],[27.926389,44.33378],[28.052789,44.409408],[28.044108,44.495837],[27.876676,44.744117],[27.988194,45.218481],[28.04673,45.279317],[28.157447,45.395912],[28.223012,45.46937],[28.346118,45.434914],[28.563701,45.351095],[28.679779,45.304031],[29.149725,45.464925],[29.603289,45.293308]]}},{"type":"Feature","properties":{"scalerank":2,"featurecla":"River","name":"Paraná","name_alt":null,"min_zoom":2.1,"name_en":"Paraná","min_label":3.1,"wikidataid":"Q127892","label":"Paraná","name_ar":"نهر بارانا","name_bn":"পারানা","name_de":"Paraná","name_es":"Paraná","name_fr":"Paraná","name_el":"Παρανά","name_hi":"पराना नदी","name_hu":"Paraná","name_id":"Sungai Paraná","name_it":"Paraná","name_ja":"パラナ川","name_ko":"파라나강","name_nl":"Paraná","name_pl":"Parana","name_pt":"Paraná","name_ru":"Парана","name_sv":"Paranáfloden","name_tr":"Paraná","name_vi":"Paraná","name_zh":"巴拉那河","ne_id":1159118169,"name_he":"פרנה","name_uk":"Парана","name_ur":"دریائے پارانا","name_fa":"رودخانه پارانا","name_zht":"巴拉那河"},"bbox":[-60.726495,-33.993584,-55.075289,-14.319384],"geometry":{"type":"LineString","coordinates":[[-55.075289,-14.319384],[-55.432451,-14.357366],[-56.120574,-14.689129],[-56.33467,-14.858576],[-56.393684,-15.068382],[-56.087217,-15.843322],[-55.934694,-16.078863],[-55.92733,-16.215341],[-55.999134,-16.336884],[-56.429392,-16.652472],[-56.540548,-16.808224],[-56.589744,-17.067175],[-56.98016,-17.59474],[-57.175006,-17.735196],[-57.318227,-17.925469],[-57.442716,-18.467555],[-57.59976,-18.879364],[-57.337192,-19.21092],[-57.386957,-19.393493],[-57.456513,-19.484314],[-57.610399,-19.683934],[-57.766417,-19.883079],[-57.842381,-19.972476],[-57.930522,-20.021982],[-58.010097,-20.073348],[-58.166392,-20.176701],[-57.870674,-20.732688],[-57.888787,-21.102639],[-57.937156,-22.090176],[-57.974673,-22.162213],[-57.832356,-22.550148],[-57.829281,-22.819795],[-57.342102,-23.702739],[-57.201102,-24.04308],[-57.121779,-24.334742],[-57.130383,-24.639529],[-57.268463,-24.971602],[-57.573147,-25.258458],[-57.630508,-25.421755],[-57.62866,-25.510536],[-57.629733,-25.601176],[-57.704315,-25.714819],[-57.88774,-25.997011],[-58.125426,-26.363378],[-58.362782,-26.729537],[-58.545232,-27.011109],[-58.618174,-27.123719],[-58.850227,-27.610769],[-58.893066,-27.964753],[-59.073805,-28.348554],[-59.227361,-29.058329],[-59.39624,-29.196822],[-59.52264,-29.403011],[-59.588967,-29.704957],[-59.654286,-30.717246],[-60.063512,-31.269616],[-60.380443,-31.531667],[-60.59118,-31.781574],[-60.696212,-32.051118],[-60.726495,-32.334563],[-60.71249,-32.557031],[-60.64159,-32.784614],[-60.490178,-33.019431],[-60.248953,-33.243397],[-59.868511,-33.498317],[-59.200438,-33.812354],[-58.668842,-33.993584],[-58.429477,-33.990948]]}},{"type":"Feature","properties":{"scalerank":2,"featurecla":"River","name":"Congo","name_alt":null,"min_zoom":2.1,"name_en":"Congo","min_label":3.1,"wikidataid":"Q3503","label":"Congo","name_ar":"نهر الكونغو","name_bn":"কঙ্গো নদী","name_de":"Kongo","name_es":"Congo","name_fr":"Congo","name_el":"Κονγκό","name_hi":"कांगो नदी","name_hu":"Kongó","name_id":"Sungai Kongo","name_it":"Congo","name_ja":"コンゴ川","name_ko":"콩고강","name_nl":"Kongo","name_pl":"Kongo","name_pt":"Congo","name_ru":"Конго","name_sv":"Kongofloden","name_tr":"Kongo","name_vi":"Congo","name_zh":"刚果河","ne_id":1159120849,"name_he":"קונגו","name_uk":"Конго","name_ur":"دریائے کانگو","name_fa":"کنگو","name_zht":"刚果河"},"bbox":[12.322432,-11.7429,27.01709,2.141032],"geometry":{"type":"LineString","coordinates":[[26.249282,-11.7429],[25.938293,-11.6535],[25.639603,-11.185777],[25.711175,-10.742548],[25.467107,-10.37518],[25.448194,-10.092924],[25.501937,-9.45503],[25.646735,-9.248272],[25.923204,-9.099703],[26.081437,-8.766235],[26.441311,-8.272001],[26.732043,-8.161724],[26.857565,-8.046589],[26.91937,-7.916674],[26.888261,-7.642376],[27.00939,-6.987428],[27.01709,-6.622179],[26.930481,-5.610252],[26.981899,-5.252237],[26.946397,-5.008635],[26.812452,-4.746738],[26.359611,-4.334722],[26.136627,-4.068278],[26.014464,-3.742975],[25.99285,-3.587061],[25.945321,-3.24433],[25.897779,-2.90231],[25.876178,-2.748514],[25.868478,-2.604983],[25.850133,-2.259481],[25.828222,-1.84636],[25.809877,-1.499966],[25.802177,-1.354646],[25.681565,-1.012341],[25.552425,-0.778815],[25.480182,-0.539037],[25.513409,-0.054415],[25.409436,0.345664],[24.9336,0.538572],[24.292295,0.78171],[22.734871,1.950036],[22.347091,2.129379],[21.712608,2.141032],[20.267528,1.923449],[19.907653,1.842885],[19.142842,1.573599],[18.712481,1.190109],[18.487585,0.911366],[18.335863,0.586993],[18.199231,0.099788],[17.599577,-0.649056],[17.523716,-0.74383],[16.865307,-1.225816],[16.407092,-1.740927],[15.972803,-2.712392],[16.00629,-3.535133],[15.75354,-3.855165],[15.170992,-4.343507],[14.582604,-4.970239],[14.195909,-4.971841],[14.074624,-5.020313],[13.826423,-5.257715],[13.60995,-5.363393],[13.469597,-5.759596],[13.428152,-5.776443],[13.375597,-5.864241],[13.024869,-5.984389],[12.735171,-5.965682],[12.322432,-6.100092]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"River","name":"Lena","name_alt":null,"min_zoom":2,"name_en":"Lena","min_label":3,"wikidataid":"Q46841","label":"Lena","name_ar":"نهر لينا","name_bn":"লেনা নদী","name_de":"Lena","name_es":"Lena","name_fr":"Léna","name_el":"Λένας ποταμός","name_hi":"लेना नदी","name_hu":"Léna","name_id":"Sungai Lena","name_it":"Lena","name_ja":"レナ川","name_ko":"레나강","name_nl":"Lena","name_pl":"Lena","name_pt":"Lena","name_ru":"Лена","name_sv":"Lena","name_tr":"Lena","name_vi":"Lena","name_zh":"勒拿河","ne_id":1159112191,"name_he":"לנה","name_uk":"Лена","name_ur":"لینا","name_fa":"رود لنا","name_zht":"勒拿河"},"bbox":[105.155267,53.871131,129.956027,72.906506],"geometry":{"type":"LineString","coordinates":[[107.980107,54.004146],[108.043359,54.102047],[108.040672,54.185013],[107.78291,54.293792],[107.181706,53.92136],[107.023163,53.871131],[106.927148,53.884334],[106.107353,53.885445],[105.665416,54.021664],[105.287765,54.385001],[105.155267,54.88094],[105.169736,55.053591],[105.723191,55.844757],[105.785719,56.229126],[106.246414,56.485261],[106.18802,56.564791],[105.982296,56.651168],[105.86189,56.760722],[106.011028,56.896941],[106.325014,57.010396],[106.807259,57.111295],[107.032878,57.270846],[107.393476,57.300921],[107.69723,57.438303],[108.081548,57.760299],[108.608906,58.04532],[108.925062,58.165132],[109.4857,58.283058],[110.00882,58.563325],[111.10126,58.783053],[111.833877,59.142747],[112.34997,59.30067],[112.642768,59.544531],[113.510829,59.928074],[114.430928,60.493052],[114.944436,60.732417],[115.471794,60.744535],[116.151805,60.607154],[116.862356,60.355283],[117.46821,60.013185],[117.801626,59.880428],[118.317409,59.800536],[118.660075,59.877379],[119.362978,60.164287],[119.496691,60.189169],[119.815612,60.248584],[120.196519,60.319626],[120.516086,60.379429],[120.651117,60.405099],[120.793563,60.453403],[121.055226,60.541434],[121.195838,60.588679],[123.551146,60.591651],[124.994882,60.757635],[126.324207,61.055705],[128.476117,61.289076],[129.215607,61.499192],[129.743068,61.9094],[129.919905,62.144941],[129.956027,62.415209],[129.857428,62.712038],[129.379628,63.489872],[128.301141,63.599762],[127.955012,63.716473],[126.85265,64.224452],[125.509166,64.67998],[124.79722,65.018409],[124.52566,65.236535],[124.179635,65.856394],[123.696874,66.502659],[123.233543,67.359584],[123.1459,67.649463],[123.183417,67.888518],[123.742866,68.411277],[124.076334,68.97548],[124.323812,69.183426],[124.621572,69.33644],[125.07126,69.775586],[125.484775,69.973662],[125.908728,70.227858],[125.940665,70.427872],[127.101731,70.641218],[127.336238,70.749997],[127.460365,70.8703],[127.455507,71.004348],[127.27557,71.331409],[127.109895,71.830293],[126.928821,72.069839],[126.689663,72.294399],[126.012288,72.32972],[124.61165,72.651586],[122.751919,72.906506]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"River","name":"Chang","name_alt":null,"min_zoom":2,"name_en":"Yangtze","min_label":3,"wikidataid":"Q5413","label":"Yangtze","name_ar":"يانغتسي","name_bn":"ছাং চিয়াং নদী","name_de":"Jangtsekiang","name_es":"Yangtsé","name_fr":"Yangzi","name_el":"Γιανγκτσέ","name_hi":"यांग्त्सीक्यांग","name_hu":"Jangce","name_id":"Sungai Panjang","name_it":"Fiume Azzurro","name_ja":"長江","name_ko":"창 강","name_nl":"Jangtsekiang","name_pl":"Jangcy","name_pt":"Yangtzé","name_ru":"Янцзы","name_sv":"Yangtze","name_tr":"Yangtze","name_vi":"Trường Giang","name_zh":"长江","ne_id":1159113707,"name_he":"יאנגצה","name_uk":"Янцзи","name_ur":"دریائے یانگزے","name_fa":"رود یانگتسه","name_zht":"長江"},"bbox":[90.794696,26.104273,121.858226,34.674525],"geometry":{"type":"LineString","coordinates":[[90.794696,34.300413],[91.151574,34.320903],[92.992805,34.100296],[93.837611,34.320903],[94.155835,34.556392],[94.388947,34.653828],[94.681694,34.674525],[95.004052,34.601713],[95.37483,34.406582],[96.003784,33.884082],[96.409857,33.680942],[97.032817,33.23686],[97.450155,32.780893],[98.161792,32.286583],[98.375319,32.009752],[98.54151,31.689797],[98.774157,31.359688],[98.69871,31.150941],[98.909033,30.675854],[98.984377,30.342774],[99.096412,29.250489],[99.232217,28.433381],[99.275367,28.35367],[99.355466,28.204997],[99.398615,28.123012],[99.434556,28.016572],[99.513647,27.78572],[99.592738,27.555508],[99.628679,27.450986],[99.798229,27.165009],[99.980492,27.080621],[100.140379,27.245547],[100.246005,27.495661],[100.371269,27.658519],[100.470074,27.569119],[100.511984,27.360372],[100.440619,26.798649],[100.453176,26.376116],[100.504904,26.240776],[100.614769,26.215144],[101.002187,26.258449],[101.663025,26.529854],[101.823067,26.529544],[101.886112,26.410481],[101.912157,26.220906],[101.996545,26.104273],[102.442977,26.277001],[102.756395,26.312554],[102.897368,26.393221],[102.980929,26.592176],[102.957778,27.223662],[103.025164,27.373523],[103.147017,27.434346],[103.470615,27.885301],[103.543634,28.146138],[103.789769,28.332224],[103.845631,28.483068],[103.850747,28.668044],[104.325601,28.667191],[104.741235,28.77721],[105.112789,28.766927],[105.547129,28.880486],[105.820032,28.876894],[105.905712,29.012028],[106.614299,29.548739],[107.604316,29.923678],[107.88988,30.141261],[108.308149,30.579529],[108.401993,30.73598],[108.57604,30.859745],[108.863567,30.937285],[109.460017,31.01002],[110.255782,31.022706],[110.827582,30.921705],[111.215052,30.728977],[111.533585,30.379748],[112.032573,30.351739],[112.207963,30.220326],[112.440403,29.818232],[112.595794,29.741234],[112.781881,29.743947],[112.915826,29.709996],[112.956547,29.550936],[113.1277,29.462776],[113.65759,29.893524],[113.934989,30.064005],[113.922845,30.21844],[114.050538,30.301768],[114.303235,30.593043],[114.543531,30.595445],[114.78765,30.517931],[115.390352,30.013155],[115.679172,29.856137],[115.976105,29.805442],[116.263374,29.838722],[116.695337,30.049536],[116.95434,30.40817],[117.326617,30.694768],[117.598951,30.815432],[117.877332,31.104975],[118.273019,31.382219],[118.550366,31.820849],[118.738003,32.02218],[119.004447,32.150699],[119.331817,32.204908],[119.745849,32.137031],[120.577426,31.613755],[120.921229,31.51619],[121.858226,31.414904]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"River","name":"Nile","name_alt":null,"min_zoom":2,"name_en":"Nile","min_label":3,"wikidataid":"Q3392","label":"Nile","name_ar":"نهر النيل","name_bn":"নীলনদ","name_de":"Nil","name_es":"Nilo","name_fr":"Nil","name_el":"Νείλος","name_hi":"नील नदी","name_hu":"Nílus","name_id":"Sungai Nil","name_it":"Nilo","name_ja":"ナイル川","name_ko":"나일강","name_nl":"Nijl","name_pl":"Nil","name_pt":"Nilo","name_ru":"Нил","name_sv":"Nilen","name_tr":"Nil","name_vi":"Nin","name_zh":"尼罗河","ne_id":1159121589,"name_he":"נילוס","name_uk":"Ніл","name_ur":"دریائے نیل","name_fa":"نیل","name_zht":"尼羅河"},"bbox":[30.264024,0.261535,33.91269,31.531797],"geometry":{"type":"LineString","coordinates":[[33.206893,0.261535],[33.187256,0.428191],[32.893114,1.311445],[32.801505,1.366545],[32.624758,1.471713],[32.510037,1.536754],[32.362488,1.606879],[32.240957,1.665842],[32.17259,1.682223],[32.15936,1.72527],[32.294598,1.93058],[32.295321,2.07915],[32.188248,2.207824],[31.998647,2.284202],[31.76693,2.292935],[31.662944,2.267],[31.469906,2.218877],[31.366231,2.193096],[31.420646,2.296876],[31.474751,2.400577],[31.457168,2.538211],[31.439559,2.675728],[31.461418,2.950415],[31.564048,3.224661],[31.719749,3.435217],[32.015855,3.613656],[31.729567,4.022597],[31.604666,4.342681],[31.603477,4.686278],[31.745536,5.419282],[31.672827,5.929974],[31.148311,6.829661],[30.789935,7.24129],[30.592066,7.544191],[30.458431,7.880398],[30.288415,8.573095],[30.264024,8.90894],[30.329911,9.210988],[30.519099,9.399375],[30.79226,9.460818],[31.124747,9.432525],[31.321582,9.404077],[31.53852,9.45963],[31.783931,9.633934],[32.158224,10.040008],[32.239459,10.22041],[32.175122,10.439415],[32.199203,10.569743],[32.584812,11.130329],[32.688114,11.470721],[32.749144,11.99534],[32.778599,12.634268],[32.748058,12.995693],[32.650183,13.344948],[32.31718,14.124565],[32.253618,14.462838],[32.490141,15.63455],[32.559336,15.945513],[32.702738,16.218752],[32.951095,16.438583],[33.312003,16.642395],[33.580462,16.871865],[33.772337,17.168358],[33.881064,17.55557],[33.91269,17.913816],[33.877343,18.197313],[33.595914,18.804899],[33.379699,19.42313],[33.159093,19.448529],[32.91704,19.400418],[32.644654,19.24836],[32.092904,18.793685],[31.494801,18.150107],[31.310007,18.039494],[31.14459,18.035024],[30.977262,18.077657],[30.821871,18.20553],[30.685083,18.406887],[30.494501,19.024498],[30.34774,19.821762],[30.55858,20.085906],[30.585245,20.194582],[30.364896,20.52867],[30.345466,20.650626],[30.611806,21.054632],[31.09064,21.609198],[31.433565,22.096739],[31.772356,22.44478],[32.004486,22.617845],[32.451177,22.729621],[32.58905,22.860879],[32.745113,23.069135],[32.859576,23.350978],[32.896835,23.659796],[32.879471,23.987683],[32.888928,24.563049],[32.841334,24.885923],[32.589773,25.32724],[32.523214,25.612003],[32.724442,25.876612],[32.749195,26.003994],[32.664601,26.084661],[32.121947,26.138508],[31.785223,26.490476],[31.303547,27.098553],[31.085886,27.299419],[30.927446,27.520129],[30.852825,27.769003],[30.837426,28.037669],[30.77159,28.267887],[30.798978,28.455757],[31.168568,29.302527],[31.227273,29.652299],[31.237608,30.120694],[31.175544,31.016893],[31.033538,31.531797]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"River","name":"Amazonas","name_alt":"Amazon","min_zoom":2,"name_en":"Amazon","min_label":3,"wikidataid":"Q3783","label":"Amazonas","name_ar":"نهر الأمازون","name_bn":"আমাজন নদী","name_de":"Amazonas","name_es":"Amazonas","name_fr":"Amazone","name_el":"Αμαζόνιος","name_hi":"अमेज़न नदी","name_hu":"Amazonas","name_id":"Sungai Amazon","name_it":"delle Amazzoni","name_ja":"アマゾン川","name_ko":"아마존강","name_nl":"Amazone","name_pl":"Amazonka","name_pt":"Amazonas","name_ru":"Амазонка","name_sv":"Amazonfloden","name_tr":"Amazon","name_vi":"Amazon","name_zh":"亚马逊河","ne_id":1159116655,"name_he":"אמזונאס","name_uk":"Амазонка","name_ur":"دریائے ایمیزون","name_fa":"آمازون","name_zht":"亚马逊河"},"bbox":[-75.215688,-15.336376,-50.554816,0.056276],"geometry":{"type":"LineString","coordinates":[[-71.668747,-15.336376],[-71.50116,-14.792327],[-71.557539,-14.28688],[-71.659212,-14.077952],[-71.857133,-13.901683],[-72.136806,-13.739213],[-72.750748,-13.486825],[-73.221107,-13.421868],[-73.5623,-13.017551],[-73.858665,-12.496136],[-73.980673,-12.198377],[-74.144228,-11.452789],[-74.145159,-11.277658],[-73.802596,-11.188774],[-73.735726,-11.029766],[-73.788281,-10.802079],[-73.995375,-10.394352],[-74.050591,-10.181704],[-74.006614,-9.860328],[-74.166889,-9.681476],[-74.4755,-9.029216],[-74.468188,-8.738846],[-74.337343,-8.511677],[-74.483071,-8.390134],[-74.660321,-8.069016],[-74.908394,-7.836369],[-75.021772,-7.461508],[-75.215688,-7.178063],[-75.208195,-7.085459],[-75.136028,-7.012337],[-75.160781,-6.52663],[-75.103472,-6.238482],[-74.938444,-6.066038],[-74.747086,-5.970126],[-74.306182,-5.639862],[-74.064337,-5.137877],[-73.974265,-5.044911],[-73.806575,-4.972358],[-73.488635,-4.444845],[-73.358282,-4.173388],[-73.215784,-4.037221],[-73.139122,-3.683702],[-73.035046,-3.55477],[-72.87211,-3.494773],[-72.475855,-3.481028],[-72.13262,-3.420101],[-71.865556,-3.435966],[-71.542734,-3.731296],[-71.265825,-3.859661],[-70.900473,-3.960068],[-70.628991,-3.888186],[-70.365493,-3.911182],[-70.113389,-4.06833],[-69.869296,-4.320356],[-69.664037,-4.271729],[-69.503246,-4.139179],[-69.262873,-3.622156],[-68.952943,-3.443304],[-68.06876,-3.296904],[-67.96011,-3.217013],[-67.932385,-3.108027],[-67.658216,-2.865406],[-67.378905,-2.707328],[-66.846586,-2.659217],[-66.541463,-2.486256],[-65.997878,-2.49654],[-65.760968,-2.602993],[-65.620459,-2.609246],[-65.439101,-2.684642],[-64.575614,-3.39819],[-64.011126,-3.743544],[-63.177275,-4.035154],[-62.736501,-3.855888],[-62.410552,-3.789432],[-61.810821,-3.855165],[-61.493554,-3.769589],[-60.596063,-3.350855],[-59.924502,-3.205954],[-59.82996,-3.141927],[-59.657929,-3.12322],[-58.689048,-3.342328],[-58.535595,-3.226263],[-58.315918,-3.211845],[-57.766494,-2.658494],[-57.475892,-2.495506],[-56.702244,-2.47928],[-56.119541,-2.132996],[-55.822143,-2.014502],[-55.514849,-1.949493],[-55.151021,-2.137595],[-54.806391,-2.175629],[-54.525116,-2.440316],[-54.185964,-2.311176],[-53.791982,-1.978535],[-53.496445,-1.828105],[-52.4362,-1.430765],[-51.788177,-1.085101],[-51.000241,-0.483174],[-50.554816,0.056276]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"River","name":"Mississippi","name_alt":null,"min_zoom":2,"name_en":"Mississippi","min_label":3,"wikidataid":"Q1497","label":"Mississippi","name_ar":"نهر المسيسيبي","name_bn":"মিসিসিপি নদী","name_de":"Mississippi","name_es":"Misisipi","name_fr":"Mississippi","name_el":"Ποταμός Μισσισσιππής","name_hi":"मिसिसिप्पी नदी","name_hu":"Mississippi","name_id":"Sungai Mississippi","name_it":"Mississippi","name_ja":"ミシシッピ川","name_ko":"미시시피강","name_nl":"Mississippi","name_pl":"Missisipi","name_pt":"Mississípi","name_ru":"Миссисипи","name_sv":"Mississippifloden","name_tr":"Mississippi","name_vi":"Mississippi","name_zh":"密西西比河","ne_id":1159119147,"name_he":"מיסיסיפי","name_uk":"Міссісіпі","name_ur":"دریائے مسیسپی","name_fa":"رودخانه میسیسیپی","name_zht":"密西西比河"},"bbox":[-111.921974,29.157213,-89.102954,48.128019],"geometry":{"type":"LineString","coordinates":[[-110.7437,44.726728],[-110.929399,44.678927],[-111.099673,44.756519],[-111.204415,44.812472],[-111.309195,44.86845],[-111.425512,44.905567],[-111.541791,44.942658],[-111.635945,45.077507],[-111.654058,45.309715],[-111.448515,46.024581],[-111.452804,46.222657],[-111.48432,46.291645],[-111.515797,46.361434],[-111.562849,46.43975],[-111.65045,46.584172],[-111.698034,46.662139],[-111.783624,46.738116],[-111.86867,46.81368],[-111.921974,46.941295],[-111.855906,47.108184],[-111.644498,47.292256],[-111.170625,47.588026],[-110.511544,47.91382],[-110.226651,47.964256],[-109.819079,47.806927],[-108.938022,47.764139],[-108.821287,47.738766],[-108.564679,47.682943],[-108.308606,47.627106],[-108.193468,47.601694],[-108.108087,47.586876],[-107.946519,47.559449],[-107.859225,47.544695],[-106.883961,47.750962],[-106.759957,47.820802],[-106.529676,47.950549],[-106.405722,48.020532],[-106.233571,48.031784],[-105.822967,48.058462],[-105.332867,48.090243],[-104.922237,48.116857],[-104.750035,48.128019],[-103.772317,48.027301],[-103.240437,48.092414],[-102.894024,48.058669],[-102.140091,47.650218],[-101.793626,47.553273],[-101.691594,47.540974],[-101.502064,47.518159],[-101.399877,47.505989],[-101.355397,47.427002],[-101.311072,47.34786],[-101.005276,47.171126],[-100.946129,47.052542],[-100.836291,46.832271],[-100.777176,46.713531],[-100.691452,46.604778],[-100.605688,46.49618],[-100.570419,46.140543],[-100.355393,45.350333],[-100.370509,45.084923],[-100.459366,44.910205],[-100.639872,44.747708],[-100.629382,44.640118],[-100.55719,44.533716],[-100.475477,44.484133],[-100.393918,44.434962],[-100.271242,44.372873],[-100.043197,44.256976],[-99.920381,44.194512],[-99.625516,44.166452],[-99.557832,44.12086],[-99.432181,44.03624],[-99.364653,43.990752],[-99.376962,43.914788],[-99.399576,43.77353],[-99.41173,43.697462],[-99.377314,43.594678],[-99.250183,43.510652],[-98.973511,43.323532],[-98.70437,43.130804],[-98.599842,43.029932],[-98.612037,43.003751],[-98.59408,43.000011],[-98.336111,42.873637],[-97.968175,42.794546],[-97.881823,42.839711],[-97.644086,42.836352],[-97.287389,42.846171],[-97.028284,42.717651],[-96.75414,42.633832],[-96.708794,42.551098],[-96.623037,42.502651],[-96.455399,42.48888],[-96.410363,42.389273],[-96.346594,42.224606],[-96.34892,42.14195],[-96.167251,41.953305],[-96.104568,41.787682],[-96.096894,41.556689],[-96.024857,41.524546],[-95.958633,41.404915],[-95.855952,41.11656],[-95.834248,40.944039],[-95.861869,40.764721],[-95.796369,40.58419],[-95.776422,40.501352],[-95.608138,40.343223],[-95.452359,40.215065],[-95.322936,40.001331],[-95.085172,39.86798],[-94.955,39.869996],[-94.926552,39.725379],[-95.06706,39.53968],[-94.991302,39.444414],[-94.868002,39.234608],[-94.604788,39.139704],[-93.181697,39.317962],[-92.992535,39.275536],[-92.844792,39.033483],[-92.531582,38.876878],[-92.292914,38.658881],[-92.047244,38.614465],[-91.451751,38.670482],[-90.885377,38.635058],[-90.432717,38.794945],[-90.355471,38.800274],[-90.214197,38.805455],[-90.144596,38.794299],[-90.182849,38.680288],[-90.212498,38.584829],[-90.30549,38.439075],[-90.369724,38.263401],[-90.22795,38.113385],[-90.030184,37.972179],[-89.917012,37.968535],[-89.654961,37.748601],[-89.553882,37.719016],[-89.479287,37.477377],[-89.516236,37.326818],[-89.388311,37.081458],[-89.280178,37.107089],[-89.102954,36.952215],[-89.134373,36.851989],[-89.115098,36.694556],[-89.273822,36.611719],[-89.498201,36.506402],[-89.524039,36.409432],[-89.585353,36.266882],[-89.663023,36.02328],[-89.684265,36.02328],[-89.687311,36.02328],[-89.67142,35.981719],[-89.673746,35.940158],[-89.775109,35.799417],[-89.950266,35.701981],[-89.988972,35.536462],[-90.147283,35.405255],[-90.13519,35.113878],[-90.249395,35.020653],[-90.268076,34.941485],[-90.446386,34.866994],[-90.450107,34.722041],[-90.584336,34.454254],[-90.69973,34.397539],[-90.87654,34.261733],[-90.981909,34.054873],[-91.200629,33.70616],[-91.223419,33.469069],[-91.108309,33.206656],[-91.15611,33.009923],[-91.084641,32.952873],[-91.175644,32.80854],[-91.031027,32.60261],[-91.071826,32.478896],[-90.943074,32.306685],[-91.081618,32.204675],[-91.128205,32.015462],[-91.321449,31.859606],[-91.411417,31.649955],[-91.502161,31.408626],[-91.62466,31.296953],[-91.583758,31.047356],[-91.52893,30.808352],[-91.340362,30.646864],[-91.121849,30.269987],[-90.991366,30.133768],[-90.783394,30.052895],[-90.045894,29.895721],[-89.952695,29.801334],[-89.887686,29.6477],[-89.403866,29.157213]]}},{"type":"Feature","properties":{"scalerank":1,"featurecla":"River","name":"Yangtze","name_alt":null,"min_zoom":2,"name_en":"Yangtze","min_label":3,"wikidataid":"Q5413","label":"Yangtze","name_ar":"يانغتسي","name_bn":"ছাং চিয়াং নদী","name_de":"Jangtsekiang","name_es":"Yangtsé","name_fr":"Yangzi","name_el":"Γιανγκτσέ","name_hi":"यांग्त्सीक्यांग","name_hu":"Jangce","name_id":"Sungai Panjang","name_it":"Fiume Azzurro","name_ja":"長江","name_ko":"창 강","name_nl":"Jangtsekiang","name_pl":"Jangcy","name_pt":"Yangtzé","name_ru":"Янцзы","name_sv":"Yangtze","name_tr":"Yangtze","name_vi":"Trường Giang","name_zh":"长江","ne_id":1159113707,"name_he":"יאנגצה","name_uk":"Янцзи","name_ur":"دریائے یانگزے","name_fa":"رود یانگتسه","name_zht":"長江"},"bbox":[116.19759,29.751388,116.211853,29.785159],"geometry":{"type":"LineString","coordinates":[[116.19759,29.751388],[116.211853,29.785159]]}}],"bbox":[-135.31341387245,-33.9935836728287,129.956026646037,72.9065062527291]} diff --git a/zbook_frontend/public/notification_dark.png b/zbook_frontend/public/notification_dark.png new file mode 100644 index 0000000..2a076d7 Binary files /dev/null and b/zbook_frontend/public/notification_dark.png differ diff --git a/zbook_frontend/public/notification_light.png b/zbook_frontend/public/notification_light.png new file mode 100644 index 0000000..7228b30 Binary files /dev/null and b/zbook_frontend/public/notification_light.png differ diff --git a/zbook_frontend/public/search_dark.png b/zbook_frontend/public/search_dark.png new file mode 100644 index 0000000..5344ec8 Binary files /dev/null and b/zbook_frontend/public/search_dark.png differ diff --git a/zbook_frontend/public/search_light.png b/zbook_frontend/public/search_light.png new file mode 100644 index 0000000..7863c46 Binary files /dev/null and b/zbook_frontend/public/search_light.png differ diff --git a/zbook_frontend/public/session_dark.png b/zbook_frontend/public/session_dark.png new file mode 100644 index 0000000..b8a0530 Binary files /dev/null and b/zbook_frontend/public/session_dark.png differ diff --git a/zbook_frontend/public/session_light.png b/zbook_frontend/public/session_light.png new file mode 100644 index 0000000..081a925 Binary files /dev/null and b/zbook_frontend/public/session_light.png differ diff --git a/zbook_frontend/src/app/[locale]/FeatureTabGroup.tsx b/zbook_frontend/src/app/[locale]/FeatureTabGroup.tsx new file mode 100644 index 0000000..3f39301 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/FeatureTabGroup.tsx @@ -0,0 +1,92 @@ +"use client"; +import { Tab } from "@headlessui/react"; +import { MdImage } from "react-icons/md"; +import { MdOutlineFeaturedVideo } from "react-icons/md"; + +import Image from "next/image"; +export default function FeatureTabGroup({ + categories, + image_urls, + video_urls, +}: { + categories: string[]; + image_urls: string[]; + video_urls: string[]; +}) { + function classNames(...classes: string[]): string { + return classes.filter(Boolean).join(" "); + } + return ( +
+ + + {categories.map((category, index) => ( + + classNames( + "w-full text-xs md:text-sm font-medium leading-3 md:leading-5 focus:outline-none rounded-full", + selected + ? "bg-transparent shadow bg-white dark:bg-slate-700/50" + : "text-slate-500 hover:bg-gray-100/25 dark:hover:bg-gray-900/25 hover:text-slate-700 dark:hover:text-slate-200" + ) + } + > +
+ {index == 0 ? ( + + ) : ( + + )} + {category} +
+
+ ))} +
+ + + +
+ Picturel of light image +
+
+ Picture of dark image +
+
+ +
+ +
+
+ +
+
+
+
+
+ ); +} diff --git a/zbook_frontend/src/app/[locale]/HomeFooter.tsx b/zbook_frontend/src/app/[locale]/HomeFooter.tsx new file mode 100644 index 0000000..654e51f --- /dev/null +++ b/zbook_frontend/src/app/[locale]/HomeFooter.tsx @@ -0,0 +1,205 @@ +/* eslint-disable react/jsx-no-literals */ + +import { FaDiscord, FaGithub } from "react-icons/fa"; +import { FaBilibili } from "react-icons/fa6"; +import { FaYoutube } from "react-icons/fa"; +import { Link } from "@/navigation"; +import { getTranslations } from "next-intl/server"; + +async function LinkElement({ url, title }: { url: string; title: string }) { + return ( +
  • + + {title} + +
  • + ); +} +export default async function HomeFooter() { + const t = await getTranslations("HomePage"); + return ( +
    +
    +
    +
    +

    + {t("GettingStarted")} +

    +
      + + + + +
    +
    +
    +

    + {t("CoreConcepts")} +

    +
      +
    • + + {t("FeatureSection")} + +
    • +
    • + + {t("DashboardSection")} + +
    • +
    • + + {t("CreateRepoSection")} + +
    • + +
    • + + {t("MultiUserSection")} + +
    • +
    +
    +
    +

    + {t("Community")} +

    +
      +
    • + + GitHub + +
    • +
    • + + Bilibili + +
    • +
    • + + YouTube + +
    • +
    • + + Discord + +
    • +
    +
    +
    +

    + {t("Links")} +

    +
      +
    • + + {t("Terms")} + +
    • +
    • + + {t("Privacy")} + +
    • +
    • + + {t("LinChatWeb")} + +
    • +
    • + + {t("LinChatApp")} + +
    • +
    +
    +
    + +
    +
    + + + + + + + + + + + + +
    + + {t("BeiAn")} + +

    + Copyright ©2024 zizdlp.com. {t("AllRightsReserved")} +

    +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/TabGroup.tsx b/zbook_frontend/src/app/[locale]/TabGroup.tsx new file mode 100644 index 0000000..64febff --- /dev/null +++ b/zbook_frontend/src/app/[locale]/TabGroup.tsx @@ -0,0 +1,138 @@ +"use client"; +import { Tab } from "@headlessui/react"; +import { useTranslations } from "next-intl"; +import { AiOutlineBook } from "react-icons/ai"; +import { MdDashboard } from "react-icons/md"; +import { AiOutlineFileSearch } from "react-icons/ai"; +import { IoIosNotifications } from "react-icons/io"; + +import Image from "next/image"; +export default function TabGroup() { + function classNames(...classes: string[]): string { + return classes.filter(Boolean).join(" "); + } + const t = useTranslations("HomePage"); + let categories = [ + t("RepoHome"), + t("DashBoard"), + t("SearchDoc"), + t("Notification"), + ]; + return ( +
    + + + {categories.map((category, index) => ( + + classNames( + "w-full text-xs md:text-sm font-medium leading-3 md:leading-5 focus:outline-none rounded-full", + selected + ? "bg-transparent shadow text-slate-700 dark:text-slate-200 bg-white dark:bg-slate-700/50" + : "text-slate-500 hover:bg-gray-100/25 dark:hover:bg-gray-900/25 hover:text-slate-700 dark:hover:text-slate-200" + ) + } + > +
    + {index == 0 ? ( + + ) : index == 1 ? ( + + ) : index == 2 ? ( + + ) : ( + + )} + {category} +
    +
    + ))} +
    + + + +
    + Picture of dark mac md head +
    +
    + Picture of dark mac md head +
    +
    + +
    + Picture of dark mac md head +
    +
    + Picture of dark mac md head +
    +
    + +
    + Picture of light search +
    +
    + Picture of dark search +
    +
    + +
    + Picture of light search +
    +
    + Picture of dark search +
    +
    +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/auth/forget/ResetPasswordForm.tsx b/zbook_frontend/src/app/[locale]/auth/forget/ResetPasswordForm.tsx new file mode 100644 index 0000000..919e34c --- /dev/null +++ b/zbook_frontend/src/app/[locale]/auth/forget/ResetPasswordForm.tsx @@ -0,0 +1,214 @@ +"use client"; +import { Link } from "@/navigation"; +import Image from "next/image"; +import { useState } from "react"; +import { useFormik } from "formik"; + +import { useRouter } from "@/navigation"; +import { toast } from "react-toastify"; +import { HiFingerPrint, HiOutlineUser } from "react-icons/hi"; +import { useTranslations } from "next-intl"; +import FormRow from "@/components/forms/FormRow"; +import InputRow from "@/components/forms/InputRow"; +import { emailRegex } from "@/utils/const_value"; +import { fetchServerWithoutAuthWrapper } from "@/fetchs/server_without_auth"; +import { FetchServerWithoutAuthWrapperEndPoint } from "@/fetchs/server_without_auth_util"; +import { FetchError } from "@/fetchs/util"; +export default function ResetPasswordForm({ + verification_url, +}: { + verification_url: string; +}) { + const t = useTranslations("ForgetForm"); + + const [show, setShow] = useState({ password: false, cpassword: false }); + const router = useRouter(); + + function forget_check_validate(values: { [key: string]: string }) { + const errors: { [key: string]: string } = {}; + // validation for email + if (!values.email) { + errors.email = t("Required"); + } else if (!emailRegex.test(values.email)) { + errors.email = t("InvalidEmailFormat"); + } + if (!values.password) { + errors.password = t("Required"); + } else if (values.password.length < 8 || values.password.length > 20) { + errors.password = t("CharacterCount"); + } else if (values.password.includes(" ")) { + errors.password = t("InvaliPassword"); + } + + // validate confirm password + if (!values.cpassword) { + errors.cpassword = t("Required"); + } else if (values.cpassword.length < 8 || values.cpassword.length > 20) { + errors.cpassword = t("CharacterCount"); + } else if (values.cpassword.includes(" ")) { + errors.cpassword = t("InvaliPassword"); + } else if (values.password !== values.cpassword) { + errors.cpassword = t("PasswordNotMatch"); + } + return errors; + } + + const formikResetPassword = useFormik({ + initialValues: { + email: "", + password: "", + verification_url: "", + cpassword: "", + }, + validate: forget_check_validate, + onSubmit: onSubmitResetPassword, + }); + async function onSubmitResetPassword(values: { + email: string; + verification_url: string; + password: string; + }) { + values.verification_url = verification_url; + const id = toast(t("ResettingPassword"), { + type: "info", + isLoading: false, + }); + try { + const data = await fetchServerWithoutAuthWrapper({ + endpoint: FetchServerWithoutAuthWrapperEndPoint.RESET_PASSWORD, + values: values, + xforward: "", + agent: "", + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } + toast.update(id, { + render: t("PasswordResetSuccessful"), + type: "success", + isLoading: false, + autoClose: 500, + }); + + router.push(`/auth/login`); + } catch (error) { + toast.update(id, { + render: t("PasswordResetFailed"), + type: "error", + isLoading: false, + autoClose: 1500, + }); + } + } + + return ( +
    +
    +
    + LOGO + +
    +

    + + {t("AppName")} + +

    +
    + +
    + + +
    + +
    +
    + + + +
    + setShow({ ...show, password: !show.password })} + /> +
    +
    + + +
    + + setShow({ ...show, cpassword: !show.cpassword }) + } + /> +
    +
    + + +
    + +
    + +

    + {t("NotReceiveEmail")} +

    + +
    + +
    +

    {t("NeedAnAccount")}

    + + + +
    +
    +
    + LOGO +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/auth/forget/SendForgetForm.tsx b/zbook_frontend/src/app/[locale]/auth/forget/SendForgetForm.tsx new file mode 100644 index 0000000..62b8cfc --- /dev/null +++ b/zbook_frontend/src/app/[locale]/auth/forget/SendForgetForm.tsx @@ -0,0 +1,129 @@ +"use client"; +import { Link } from "@/navigation"; +import Image from "next/image"; +import { useFormik } from "formik"; +import { toast } from "react-toastify"; +import { HiOutlineUser } from "react-icons/hi"; +import { useTranslations } from "next-intl"; +import FormRow from "@/components/forms/FormRow"; +import InputRow from "@/components/forms/InputRow"; +import { emailRegex } from "@/utils/const_value"; +import { fetchServerWithoutAuthWrapper } from "@/fetchs/server_without_auth"; +import { FetchServerWithoutAuthWrapperEndPoint } from "@/fetchs/server_without_auth_util"; +import { FetchError } from "@/fetchs/util"; +export default function SendForgetForm() { + const t = useTranslations("ForgetForm"); + + function forget_validate(values: { [key: string]: string }) { + const errors: { [key: string]: string } = {}; + // validation for email + if (!values.email) { + errors.email = t("Required"); + } else if (!emailRegex.test(values.email)) { + errors.email = t("InvalidEmailFormat"); + } + return errors; + } + + const formikSendEmail = useFormik({ + initialValues: { + email: "", + }, + validate: forget_validate, + onSubmit: onSubmitSendEmail, + }); + async function onSubmitSendEmail(values: { email: string }) { + const id = toast(`Send Verify Code Email...`, { + type: "info", + isLoading: false, + }); + try { + const data = await fetchServerWithoutAuthWrapper({ + endpoint: + FetchServerWithoutAuthWrapperEndPoint.SEND_EMAIL_TO_RESET_PASSWORD, + xforward: "", + agent: "", + values: values, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } + toast.update(id, { + render: `Send Email Success,please write token blow which received`, + type: "success", + isLoading: false, + autoClose: 500, + }); + } catch (error) { + toast.update(id, { + render: `Send Email failed:` + error, + type: "error", + isLoading: false, + autoClose: 1500, + }); + } + } + + return ( +
    +
    +
    + LOGO + +
    +

    + + {t("AppName")} + +

    +
    + +
    + + +
    + +
    +
    + +
    + +
    +

    {t("NeedAnAccount")}

    + + + +
    +
    +
    + LOGO +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/auth/forget/page.tsx b/zbook_frontend/src/app/[locale]/auth/forget/page.tsx new file mode 100644 index 0000000..dd09d45 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/auth/forget/page.tsx @@ -0,0 +1,12 @@ +import { getTranslations } from "next-intl/server"; +import SendForgetForm from "./SendForgetForm"; +import { Metadata } from "next"; +export async function generateMetadata(): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: t("ForgetPassword"), + }; +} +export default async function forget() { + return ; +} diff --git a/zbook_frontend/src/app/[locale]/auth/layout.tsx b/zbook_frontend/src/app/[locale]/auth/layout.tsx new file mode 100644 index 0000000..f5ea020 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/auth/layout.tsx @@ -0,0 +1,7 @@ +export default function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + return <>{children}; +} diff --git a/zbook_frontend/src/app/[locale]/auth/login/LoginForm.tsx b/zbook_frontend/src/app/[locale]/auth/login/LoginForm.tsx new file mode 100644 index 0000000..848b624 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/auth/login/LoginForm.tsx @@ -0,0 +1,191 @@ +"use client"; +import { useFormik } from "formik"; +import { toast } from "react-toastify"; +import { HiFingerPrint, HiOutlineUser } from "react-icons/hi"; +import { useState } from "react"; +import { FaGithub } from "react-icons/fa"; +import { FaGoogle } from "react-icons/fa"; +import { useLocale, useTranslations } from "next-intl"; +import FormRow from "@/components/forms/FormRow"; +import InputRow from "@/components/forms/InputRow"; +import { emailRegex } from "@/utils/const_value"; +import { + fetchServerWithoutAuthWrapper, + serverSignIn, +} from "@/fetchs/server_without_auth"; +import { FetchServerWithoutAuthWrapperEndPoint } from "@/fetchs/server_without_auth_util"; +import { FetchError } from "@/fetchs/util"; +import { toastError, toastInfo } from "@/utils/util"; +import { redirectPage } from "@/fetchs/server_with_auth"; +import { Link } from "@/navigation"; +export default function LoginForm({ + xforward, + agent, +}: { + xforward: string; + agent: string; +}) { + const locale = useLocale(); + const t = useTranslations("LoginForm"); + const [showPassword, setShowPassword] = useState(false); + const [sendVerifyEmail, setSendVerifyEmail] = useState(false); + const [sendEmail, setSendEmail] = useState(""); + + function login_validate(values: { [key: string]: string }) { + const errors: { [key: string]: string } = {}; + // validation for email + if (!values.email) { + errors.email = t("Required"); + } else if (!emailRegex.test(values.email)) { + errors.email = t("InvalidEmailFormat"); + } + + // validation for password + if (!values.password) { + errors.password = t("Required"); + } else if (values.password.length < 8 || values.password.length > 20) { + errors.password = t("CharacterCount"); + } else if (values.password.includes(" ")) { + errors.password = t("InvaliPassword"); + } + + return errors; + } + + const formik = useFormik({ + initialValues: { + email: "", + password: "", + }, + validate: login_validate, + onSubmit: onSubmit, + }); + async function sendVerify({ email }: { email: string }) { + const id = toast(t("ResendEmail"), { + type: "info", + isLoading: false, + }); + try { + const data = await fetchServerWithoutAuthWrapper({ + endpoint: + FetchServerWithoutAuthWrapperEndPoint.SEND_EMAIL_TO_VERIFY_EMAIL, + xforward: xforward, + agent: agent, + values: { + email: email, + }, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } + toastInfo(id, t("ResendSuccessful")); + } catch (error) { + toastError(id, t("ResendFailed")); + } + } + async function onSubmit(values: { email: string; password: string }) { + const id = toast(t("LoggingIn"), { type: "info", isLoading: true }); + + const status = await serverSignIn({ + email: values.email, + password: values.password, + }); + if (status.error) { + if (status.status == 404) { + toastError(id, t("LoginFailedExist")); + } else if (status.status == 401) { + toastError(id, t("LoginFailedIncorrect")); + } else if ( + status.status == 403 && + status.message == "email not verified for this account" + ) { + setSendEmail(values.email); + setSendVerifyEmail(true); + toastError(id, t("LoginFailedEmailVerify")); + } else { + toastError(id, status.status + ":" + status.message); + } + } else { + toastInfo(id, t("LoginSuccessful")); + redirectPage(`/workspace/`); + } + } + return ( +
    +
    + + +
    + +
    +
    + + + + +
    + setShowPassword(!showPassword)} + /> +
    +
    + + +
    + + {sendVerifyEmail && ( +
    { + sendVerify({ email: sendEmail }); + setSendVerifyEmail(false); + }} + > + {t("ReSendEmail")} +
    + )} +
    +
    + {t("LoginType")} +
    +
    +
    + + +

    {t("Github")}

    + + + +

    {t("Google")}

    + +
    +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/auth/login/page.tsx b/zbook_frontend/src/app/[locale]/auth/login/page.tsx new file mode 100644 index 0000000..56e7ae5 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/auth/login/page.tsx @@ -0,0 +1,70 @@ +import { Link } from "@/navigation"; +import Image from "next/image"; + +import LoginForm from "@/app/[locale]/auth/login/LoginForm"; +import { headers } from "next/headers"; +import { Metadata } from "next"; +import { auth } from "@/auth"; +import { redirect } from "@/navigation"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata(): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: t("Login"), + }; +} +export default async function Login() { + const t = await getTranslations("LoginPage"); + const xforward = headers().get("x-forwarded-for") ?? ""; + const agent = headers().get("User-Agent") ?? ""; + const session = await auth(); + if (session && session.access_token) { + redirect(`/workspace/${session.username}`); // Navigate to the workspace + } + return ( +
    +
    +
    + LOGO + +
    +

    + + {t("AppName")} + +

    +
    + +

    {t("Login")}

    +

    {t("SignInMessage")}

    + + +
    + +

    + {t("ForgetPassword")} +

    + +
    +
    +

    {t("NeedAnAccount")}

    + + + +
    +
    +
    + LOGO +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/auth/register/RegisterForm.tsx b/zbook_frontend/src/app/[locale]/auth/register/RegisterForm.tsx new file mode 100644 index 0000000..53ed992 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/auth/register/RegisterForm.tsx @@ -0,0 +1,176 @@ +"use client"; +import { useFormik } from "formik"; +import { toast } from "react-toastify"; +import { useState } from "react"; +import { useRouter } from "@/navigation"; +import { HiAtSymbol, HiFingerPrint, HiOutlineUser } from "react-icons/hi"; +import { useTranslations } from "next-intl"; +import FormRow from "@/components/forms/FormRow"; +import InputRow from "@/components/forms/InputRow"; +import { emailRegex } from "@/utils/const_value"; +import { fetchServerWithoutAuthWrapper } from "@/fetchs/server_without_auth"; +import { createUserRequest } from "@/fetchs/server_without_auth_request"; +import { FetchServerWithoutAuthWrapperEndPoint } from "@/fetchs/server_without_auth_util"; +import { toastError, toastInfo } from "@/utils/util"; +export default function RegisterForm({ + invitation_url, +}: { + invitation_url: string; +}) { + const t = useTranslations("RegisterForm"); + + const [show, setShow] = useState({ password: false, cpassword: false }); + const router = useRouter(); + + function registerValidate(values: { [key: string]: string }) { + const errors: { [key: string]: string } = {}; + const usernameRegex = /^[a-z0-9_]+$/; // Regular expression to match lowercase letters, digits, and underscores. + if (!values.username) { + errors.username = t("Required"); + } else if (values.username.includes(" ")) { + errors.username = t("InvalidUsername"); + } else if (!usernameRegex.test(values.username)) { + errors.username = t("OnlyLower"); + } else if (values.username.length < 4 || values.username.length > 20) { + errors.username = t("UsernameCount"); + } + + if (!values.email) { + errors.email = t("Required"); + } else if (!emailRegex.test(values.email)) { + errors.email = t("InvalidEmailFormat"); + } + + // validation for password + if (!values.password) { + errors.password = t("Required"); + } else if (values.password.length < 8 || values.password.length > 20) { + errors.password = t("CharacterCount"); + } else if (values.password.includes(" ")) { + errors.password = t("InvaliPassword"); + } + + // validate confirm password + if (!values.cpassword) { + errors.cpassword = t("Required"); + } else if (values.cpassword.length < 8 || values.cpassword.length > 20) { + errors.cpassword = t("CharacterCount"); + } else if (values.cpassword.includes(" ")) { + errors.cpassword = t("InvaliPassword"); + } else if (values.password !== values.cpassword) { + errors.cpassword = t("PasswordNotMatch"); + } + + return errors; + } + const formik = useFormik({ + initialValues: { + username: "", + email: "", + password: "", + cpassword: "", + invitation_url: "", + }, + validate: registerValidate, + onSubmit: onSubmit, + }); + async function onSubmit(values: createUserRequest) { + const id = toast(t("Registering"), { + type: "info", + isLoading: true, + }); + try { + values.invitation_url = invitation_url; + const data = await fetchServerWithoutAuthWrapper({ + endpoint: FetchServerWithoutAuthWrapperEndPoint.CREATE_USER, + xforward: "", + agent: "", + values: values, + }); + if (data.error) { + toastError(id, data.status + " " + data.message); + } else { + toastInfo(id, t("RegistrationSuccessful")); + router.push(`/auth/login`); + } + } catch (error) {} + } + + return ( +
    + + +
    + +
    +
    + + + +
    + +
    +
    + + + +
    + setShow({ ...show, password: !show.password })} + /> +
    +
    + + + +
    + setShow({ ...show, cpassword: !show.cpassword })} + /> +
    +
    + + +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/auth/register/page.tsx b/zbook_frontend/src/app/[locale]/auth/register/page.tsx new file mode 100644 index 0000000..7d2c73a --- /dev/null +++ b/zbook_frontend/src/app/[locale]/auth/register/page.tsx @@ -0,0 +1,62 @@ +import { Link } from "@/navigation"; +import Image from "next/image"; +import RegisterForm from "@/app/[locale]/auth/register/RegisterForm"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata(): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: t("Register"), + }; +} +export default async function Register({ + searchParams, +}: { + searchParams?: { invitation_url?: string }; +}) { + const invitation_url = searchParams?.invitation_url || ""; + const t = await getTranslations("RegisterPage"); + return ( +
    +
    +
    + LOGO +
    +

    + + {t("AppName")} + +

    +
    + +

    {t("Register")}

    + +
    + +

    + {t("ForgetPassword")} +

    + +
    +
    +

    {t("OwnAnAccount")}

    + + + +
    +
    +
    + Login +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/cases/page.tsx b/zbook_frontend/src/app/[locale]/cases/page.tsx new file mode 100644 index 0000000..b5c2841 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/cases/page.tsx @@ -0,0 +1,31 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata(): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: t("Cases"), + }; +} + +export default async function CasesPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( +
    + +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/layout.tsx b/zbook_frontend/src/app/[locale]/layout.tsx new file mode 100644 index 0000000..2141f6c --- /dev/null +++ b/zbook_frontend/src/app/[locale]/layout.tsx @@ -0,0 +1,113 @@ +import "../globals.css"; +import "react-toastify/dist/ReactToastify.css"; +import SearchDialog from "@/providers/dialogs/SearchDialog"; +import SideBarProvider from "@/providers/SideBarProvider"; +import SearchDialogProvider from "@/providers/SearchDialogProvider"; +import { ThemeProvider } from "next-themes"; +import NotiDialogProvider from "@/providers/NotiDialogProvider"; +import { ToastContainer } from "react-toastify"; +import NavBar from "@/components/navbars/NavBar"; +import NotificationDialog from "@/components/notifications/NotificationDialog"; +import OperationProvider from "@/providers/OperationProvider"; +import CreateCommentReportDialog from "@/providers/dialogs/CreateCommentReportDialog"; +import CreateSystemNotification from "@/providers/dialogs/CreateSystemNotification"; + +import UpdateUserDialog from "@/providers/dialogs/UpdateUserDialog"; + +import CreateRepoDialog from "@/providers/dialogs/CreateRepoDialog"; +import UpdateRepoDialog from "@/providers/dialogs/UpdateRepoDialog"; +import DeleteRepoDialog from "@/providers/dialogs/DeleteRepoDialog"; +import { Metadata } from "next"; +import { NextIntlClientProvider } from "next-intl"; +import { ReactNode } from "react"; +import LogVisitor from "@/components/LogVisitor"; +import DeleteUserDialog from "@/providers/dialogs/DeleteUserDialog"; +import { SessionProvider } from "next-auth/react"; +import CreateCommentDialog from "@/components/comments/CreateCommentDialog"; +import { + getMessages, + getTranslations, + unstable_setRequestLocale, +} from "next-intl/server"; + +export async function generateMetadata({ + params: { locale }, +}: Omit): Promise { + const t = await getTranslations({ locale, namespace: "GenerateMetaData" }); + return { + title: { + template: "%s - ZBook", + default: "ZBook | " + t("Slogan"), // a default is required when creating a template + }, + }; +} + +type Props = { + children: ReactNode; + params: { locale: string }; +}; +import { JetBrains_Mono } from "next/font/google"; +import CreateInvitation from "@/providers/dialogs/CreateInvitation"; + +const jetbrains_mono = JetBrains_Mono({ + subsets: ["latin"], + display: "swap", + variable: "--font-jetbrains-mono", +}); + +export default async function LocaleLayout({ + children, + params: { locale }, +}: Props) { + // Enable static rendering + unstable_setRequestLocale(locale); + const messages = await getMessages(); + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + {children} + + + + + + + + + + ); +} diff --git a/zbook_frontend/src/app/[locale]/oauth/github/page.tsx b/zbook_frontend/src/app/[locale]/oauth/github/page.tsx new file mode 100644 index 0000000..464b2b5 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/oauth/github/page.tsx @@ -0,0 +1,10 @@ +import LinkOAuth from "@/components/LinkOAuth"; +export default async function GitTest({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { access_token?: string }; +}) { + return ; +} diff --git a/zbook_frontend/src/app/[locale]/oauth/google/page.tsx b/zbook_frontend/src/app/[locale]/oauth/google/page.tsx new file mode 100644 index 0000000..2f5aea6 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/oauth/google/page.tsx @@ -0,0 +1,11 @@ +import LinkOAuth from "@/components/LinkOAuth"; + +export default async function GitTest({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { access_token?: string }; +}) { + return ; +} diff --git a/zbook_frontend/src/app/[locale]/oauth/layout.tsx b/zbook_frontend/src/app/[locale]/oauth/layout.tsx new file mode 100644 index 0000000..f5ea020 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/oauth/layout.tsx @@ -0,0 +1,7 @@ +export default function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + return <>{children}; +} diff --git a/zbook_frontend/src/app/[locale]/oauth/oauth/page.tsx b/zbook_frontend/src/app/[locale]/oauth/oauth/page.tsx new file mode 100644 index 0000000..03da091 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/oauth/oauth/page.tsx @@ -0,0 +1,34 @@ +import { auth } from "@/auth"; +import CallSignIn from "@/components/CallSignIn"; +import { getTranslations } from "next-intl/server"; +import { redirect } from "@/navigation"; +export default async function OAuth({ + searchParams, +}: { + searchParams?: { oauth_type?: string }; +}) { + const t = await getTranslations("NotFoundPage"); + + const oauthType = searchParams?.oauth_type || ""; + const session = await auth(); + if (!session) { + return ; + } else if (session.access_token) { + redirect(`/workspace/${session.username}`); // Navigate to the workspace + } else { + return ( +
    +
    +

    {t("404")}

    +

    {t("UserNotLinked")}

    + + {t("BackToHome")} + +
    +
    + ); + } +} diff --git a/zbook_frontend/src/app/[locale]/page.tsx b/zbook_frontend/src/app/[locale]/page.tsx new file mode 100644 index 0000000..73aff58 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/page.tsx @@ -0,0 +1,246 @@ +import MotionBounce from "../../components/MotionBounce"; +import { FaUsers } from "react-icons/fa"; +import { MdVisibility } from "react-icons/md"; +import { FaGithub } from "react-icons/fa"; +import HomeFooter from "./HomeFooter"; +import TabGroup from "./TabGroup"; +import { MdChevronRight, MdTableChart } from "react-icons/md"; +import { TbMathFunction } from "react-icons/tb"; +import { AiOutlineCode } from "react-icons/ai"; +import { MdOutlineFeaturedPlayList } from "react-icons/md"; + +import { Link } from "@/navigation"; +import FeatureTabGroup from "./FeatureTabGroup"; +import { getTranslations } from "next-intl/server"; + +import { redirect } from "@/navigation"; +import { auth } from "@/auth"; +export default async function Home() { + const t = await getTranslations("HomePage"); + const session = await auth(); + if (session && session.access_token) { + redirect(`/workspace/${session.username}`); // Navigate to the new post page + } + return ( +
    +
    + +
    +
    +
    +
    +

    {t("HomeSloganA")}

    +

    {t("HomeSloganB")}

    +
    +

    + {t("HomeSubTitle")} +

    +
    + + + {t("SignIn")} + + + + + {t("Docs")} + + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +

    {t("ManageUsers")}

    +

    {t("HomeSloganB")}

    +
    +

    + {t("HomeSubTitle")} +

    + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +

    {t("NewRepo")}

    +

    {t("HomeSloganB")}

    +
    +

    + {t("HomeSubTitle")} +

    + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +

    {t("MarkdownSuperset")}

    +

    {t("HomeSloganB")}

    +
    +

    + {t("HomeSubTitle")} +

    + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +

    {t("MultiUserSection")}

    +

    {t("HomeSloganB")}

    +
    +

    + {t("HomeSubTitle")} +

    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + + {t("FeatureSection")} +
    +
    +

    {t("SimpleDocumentation")}

    +

    {t("VisuallyAppealing")}

    +
    +
    +

    {t("DocumentationForTeam")}

    +
    +
    +
    + + + {t("Cases")} + + + + + {t("Docs")} + + +
    +
    + +
    +
    + +

    {t("Math")}

    +

    {t("MathDetail")}

    +
    +
    + +

    {t("Code")}

    +

    {t("CodeDetail")}

    +
    +
    + +

    {t("Figure")}

    +

    {t("FigureDetail")}

    +
    +
    + +

    {t("MultiUserSection")}

    +

    {t("ZBookSupports")}

    +
    +
    + +

    {t("MultiLevelPermissions")}

    +

    {t("ZBookPermissions")}

    +
    +
    + +

    {t("SelfHost")}

    +

    {t("ZBookIsOpenSource")}

    +
    +
    +
    +
    + +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/privacy/page.tsx b/zbook_frontend/src/app/[locale]/privacy/page.tsx new file mode 100644 index 0000000..e434937 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/privacy/page.tsx @@ -0,0 +1,46 @@ +/* eslint-disable react/jsx-no-literals */ +export default function Privacy() { + return ( +
    +

    Privacy Policy

    + +
    +

    1. Introduction

    +

    + We are committed to protecting your privacy. This Privacy Policy + explains how we collect, use, and disclose information when you use + ZBook. +

    +
    + +
    +

    + 2. Information We Collect +

    +

    + Personal Information: We do not collect any personal + information unless you voluntarily provide it to us, such as by + contacting us via email or signing up for our newsletter. +

    +

    + Usage Data: We may collect information on how the + Software is accessed a nd used. This usage data may include + information such as your computers Internet Protocol IP address, + browser type, browser version, the pages of our Software that you + visit, the time and date of your visit, the time spent on those pages, + and other diagnostic data. +

    +
    + +
    +

    3. Use of Data

    +

    We use the collected data for various purposes:

    +
      +
    • To provide and maintain the Software
    • +
    • To notify you about changes to our Software
    • +
    • To allow you to participate in interactive features
    • +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/reset_password/page.tsx b/zbook_frontend/src/app/[locale]/reset_password/page.tsx new file mode 100644 index 0000000..06022db --- /dev/null +++ b/zbook_frontend/src/app/[locale]/reset_password/page.tsx @@ -0,0 +1,12 @@ +import ResetPasswordForm from "../auth/forget/ResetPasswordForm"; + +export default async function ResetPassword({ + searchParams, +}: { + searchParams?: { + verification_url?: string; + }; +}) { + const verification_url = searchParams?.verification_url || ""; + return ; +} diff --git a/zbook_frontend/src/app/[locale]/terms/page.tsx b/zbook_frontend/src/app/[locale]/terms/page.tsx new file mode 100644 index 0000000..09ea055 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/terms/page.tsx @@ -0,0 +1,117 @@ +/* eslint-disable react/jsx-no-literals */ +import { Link } from "@/navigation"; +export default function Terms() { + return ( +
    +

    Terms of Service

    +
    +

    1. Acceptance of Terms

    +

    + By accessing and using ZBook, you agree to comply + with and be bound by these Terms of Service (Terms). If you do not + agree to these Terms, please do not use the Software. +

    +
    + +
    +

    2. License

    +

    + ZBook is licensed under the{" "} + + + GPL-3.0 license + + + . This means you are free to use, copy of the Software, subject to the + conditions outlined in the license. +

    +
    + +
    +

    3. Use of Software

    +

    + You agree to use the Software in compliance with all applicable laws + and regulations. You are responsible for ensuring that your use of the + Software does not violate any rights of third parties. +

    +
    + +
    +

    + 4. Modifications to the Software +

    +

    + We reserve the right to modify, suspend, or discontinue the Software + at any time without notice. We are not liable to you or any third + party for any modifications, suspensions, or discontinuations of the + Software. +

    +
    + +
    +

    + 5. Disclaimer of Warranties +

    +

    + The Software is provided as is, without warranty of any kind, express + or implied, including but not limited to the warranties of + merchantability, fitness for a particular purpose, and + noninfringement. In no event shall the authors or copyright holders be + liable for any claim, damages, or other liability, whether in an + action of contract, tort, or otherwise, arising from, out of, or in + connection with the Software or the use or other dealings in the + Software. +

    +
    + +
    +

    + 6. Limitation of Liability +

    +

    + In no event shall we be liable for any indirect, incidental, special, + consequential, or punitive damages, or any loss of profits or + revenues, whether incurred directly or indirectly, or any loss of + data, use, goodwill, or other intangible losses, resulting from (i) + your use or inability to use the Software; (ii) any unauthorized + access to or use of our servers and/or any personal information stored + therein; (iii) any interruption or cessation of transmission to or + from the Software; (iv) any bugs, viruses, trojan horses, or the like + that may be transmitted to or through the Software by any third party; + (v) any errors or omissions in any content or for any loss or damage + incurred as a result of the use of any content posted, emailed, + transmitted, or otherwise made available through the Software; and/or + (vi) the defamatory, offensive, or illegal conduct of any third party. +

    +
    + +
    +

    7. Governing Law

    +

    + These Terms shall be governed and construed in accordance with the + laws of [Your Country/State], without regard to its conflict of law + provisions. +

    +
    + +
    +

    8. Changes to the Terms

    +

    + We reserve the right, at our sole discretion, to modify or replace + these Terms at any time. If a revision is material, we will provide at + least 30 days notice prior to any new terms taking effect. What + constitutes a material change will be determined at our sole + discretion. +

    +
    + +
    +

    9. Contact Us

    +

    + If you have any questions about these Terms, please contact us at + zizdlp@gmail.com. +

    +
    +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/verify_email/page.tsx b/zbook_frontend/src/app/[locale]/verify_email/page.tsx new file mode 100644 index 0000000..964e541 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/verify_email/page.tsx @@ -0,0 +1,61 @@ +import { getVerify } from "@/fetchs/server_without_auth"; +import { getTranslations } from "next-intl/server"; +export default async function VerifyEmail({ + searchParams, +}: { + searchParams?: { + verification_url?: string; + }; +}) { + const t = await getTranslations("VerifyEmail"); + try { + const verification_url = searchParams?.verification_url || ""; + const verify_result = await getVerify(verification_url); + if (verify_result && verify_result.code == undefined) { + return ( +
    +
    +

    {t("VerifiedSuccess")}

    + + {t("BackToHome")} + +
    +
    + ); + } else { + return ( +
    +
    +

    + {t("VerifiedFailed")} + {verify_result.message} +

    + + {t("BackToHome")} + +
    +
    + ); + } + } catch (error) { + return ( +
    +
    +

    {t("VerifiedFailed")}

    + + {t("BackToHome")} + +
    +
    + ); + } +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/comments/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/comments/page.tsx new file mode 100644 index 0000000..26c3c6d --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/comments/page.tsx @@ -0,0 +1,29 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("DashBoard") + " - " + t("Comments"), + }; +} +export default async function AdminCommentsPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/@visitors/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/@visitors/page.tsx new file mode 100644 index 0000000..714e73b --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/@visitors/page.tsx @@ -0,0 +1,199 @@ +import SomeThingWrong from "@/components/SomeThingWrong"; +import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth"; +import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util"; +import { headers } from "next/headers"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +import DonuChart from "@/components/charts/DonutChart"; +import EarthChart from "@/components/charts/EarthChart"; +import NDay from "@/components/charts/NDay"; +import { promises as fs } from "fs"; + +import BarChart from "@/components/charts/BarChart"; +import { FetchError } from "@/fetchs/util"; +import { logger } from "@/utils/logger"; +import { parseUserAgent } from "@/utils/util"; +interface Visitor { + IP: string; + Agent?: string; + Count: number; + city?: string; + lat?: number; + long?: number; +} +function hasValidCoordinates(visitor: Visitor): visitor is Visitor { + return typeof visitor.lat === "number" && typeof visitor.long === "number"; +} + +export default async function AdminOverviewPage({ + params, + searchParams, +}: { + params: { locale: string }; + searchParams?: { ndays?: string }; +}) { + const ndays = Number(searchParams?.ndays) || 1; + const t = await getTranslations("AdminOverView"); + const xforward = headers().get("x-forwarded-for") ?? ""; + const agent = headers().get("User-Agent") ?? ""; + try { + const dailyVisitors = await fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GetDailyVisitors, + xforward, + agent: agent, + tags: [], + values: { + lang: params.locale == "zh" ? "zh-CN" : params.locale, + ndays: ndays, + }, + }); + if (dailyVisitors.error) { + throw new FetchError(dailyVisitors.message, dailyVisitors.status); + } + const landFile = await fs.readFile( + process.cwd() + "/public/ne_110m_land.geojson", + "utf8" + ); + const lakeFile = await fs.readFile( + process.cwd() + "/public/ne_110m_lakes.geojson", + "utf8" + ); + const riverFile = await fs.readFile( + process.cwd() + "/public/ne_110m_rivers_lake_centerlines.geojson", + "utf8" + ); + const landData = JSON.parse(landFile); + const lakeData = JSON.parse(lakeFile); + const riverData = JSON.parse(riverFile); + + // 聚合 IP 计数 + const aggregated = dailyVisitors.visitors.reduce( + (acc: any, visitor: Visitor) => { + if (!acc[visitor.IP]) { + acc[visitor.IP] = 0; + } + acc[visitor.IP] += visitor.Count; + return acc; + }, + {} as Record + ); + + // 转换为数组并排序 + const sorted = Object.entries(aggregated) + .sort((a: any, b: any) => b[1] - a[1]) + .slice(0, 5); + + // 分别提取 IP 和计数 + const ips = sorted.map((entry) => entry[0]); + const counts = sorted.map((entry) => entry[1] as number); + + // 分类统计 + const agentCounts = { + computer: 0, + phone: 0, + tablet: 0, + bot: 0, + unknown: 0, + }; + + dailyVisitors.visitors.forEach((visitor: any) => { + const agentString = parseUserAgent(visitor.Agent).platform.toLowerCase(); + const osString = parseUserAgent(visitor.Agent).os.toLowerCase(); + const agent = visitor.Agent; + let visited = false; + if (agent && typeof agent === "string") { + const agentLowerCase = agent.toLowerCase(); + if ( + agentLowerCase.includes("bot") || + agentLowerCase.includes("spider") + ) { + visited = true; + agentCounts.bot++; + } + } + if (visited) { + } else if ( + agentString.includes("windows") || + agentString.includes("macintosh") || + (agentString.includes("linux") && !osString.includes("android")) + ) { + agentCounts.computer++; + } else if ( + agentString.includes("iphone") || + agentString.includes("android") || + osString.includes("android") || + agentString.includes("windows phone") || + agentString.includes("blackberry") + ) { + agentCounts.phone++; + } else if ( + agentString.includes("ipad") || + agentString.includes("android tablet") || + agentString.includes("kindle") + ) { + agentCounts.tablet++; + } else { + agentCounts.unknown++; + } + }); + let filteredVisitors = dailyVisitors.visitors.filter(hasValidCoordinates); + return ( + <> +
    +
    +
    +
    +
    +
    + {dailyVisitors.visitors.length} +
    +

    + {t("VisitorRegion")} +

    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    + + ); + } catch (error) { + let currentError = error as FetchError; + logger.error( + `Dashboard visitors Error:${currentError.status} ${currentError.message}` + ); + return ; + } +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/layout.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/layout.tsx new file mode 100644 index 0000000..0067c9f --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/layout.tsx @@ -0,0 +1,14 @@ +export default function Layout({ + children, + visitors, +}: { + children: React.ReactNode; + visitors: React.ReactNode; +}) { + return ( +
    + {visitors} + {children} +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/page.tsx new file mode 100644 index 0000000..6745e7b --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/dashboard/page.tsx @@ -0,0 +1,199 @@ +import SomeThingWrong from "@/components/SomeThingWrong"; +import PieChart from "@/components/charts/PieChart"; +import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth"; +import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util"; +import { headers } from "next/headers"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +import AreaChart from "@/components/charts/AreaChart"; +import AreaUserChart from "@/components/charts/AreaUserChart"; +import { FetchError } from "@/fetchs/util"; +import { logger } from "@/utils/logger"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("DashBoard") + " - " + t("OverView"), + }; +} +export default async function AdminOverviewPage({ + params, + searchParams, +}: { + params: { locale: string }; + searchParams?: { ndays?: string }; +}) { + const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + + const t = await getTranslations("AdminOverView"); + const xforward = headers().get("x-forwarded-for") ?? ""; + const agent = headers().get("User-Agent") ?? ""; + try { + const [ + repoCountRes, + commentCountRes, + commentReportCountRes, + userCountRes, + visitors, + newUsers, + activeUsers, + allow_registration, + allow_login, + allow_invitation, + ] = await Promise.all([ + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GET_LIST_REPO_COUNT, + xforward, + agent: agent, + tags: [], + values: { query: "" }, + }), + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GET_LIST_COMMENT_COUNT, + xforward, + agent: agent, + tags: [], + values: { query: "" }, + }), + fetchServerWithAuthWrapper({ + endpoint: + FetchServerWithAuthWrapperEndPoint.GET_LIST_COMMENT_REPORT_COUNT, + xforward, + agent: agent, + tags: [], + values: { query: "" }, + }), + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GET_LIST_USER_COUNT, + xforward, + agent: agent, + tags: [], + values: { query: "" }, + }), + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.DAILY_VISITOR_COUNT, + xforward, + agent: agent, + tags: [], + values: { ndays: 31, time_zone: "Asia/Shanghai" }, + }), + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.DAILY_CREATE_USER_COUNT, + xforward, + agent: agent, + tags: [], + values: { + time_zone: "Asia/Shanghai", + ndays: 7, + }, + }), + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.DAILY_ACTIVE_USER_COUNT, + xforward, + agent: agent, + tags: [], + values: { time_zone: "Asia/Shanghai", ndays: 7 }, + }), + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GetConfiguration, + xforward, + agent: agent, + tags: [], + values: { config_name: "allow_registration" }, + }), + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GetConfiguration, + xforward, + agent: agent, + tags: [], + values: { config_name: "allow_login" }, + }), + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GetConfiguration, + xforward, + agent: agent, + tags: [], + values: { config_name: "allow_invitation" }, + }), + ]); + if (repoCountRes.error) { + throw new FetchError(repoCountRes.message, repoCountRes.status); + } + + if (commentCountRes.error) { + throw new FetchError(commentCountRes.message, commentCountRes.status); + } + if (commentReportCountRes.error) { + throw new FetchError( + commentReportCountRes.message, + commentReportCountRes.status + ); + } + if (userCountRes.error) { + throw new FetchError(userCountRes.message, userCountRes.status); + } + if (visitors.error) { + throw new FetchError(visitors.message, visitors.status); + } + if (newUsers.error) { + throw new FetchError(newUsers.message, newUsers.status); + } + if (activeUsers.error) { + throw new FetchError(activeUsers.message, activeUsers.status); + } + + if (allow_registration.error) { + throw new FetchError( + allow_registration.message, + allow_registration.status + ); + } + if (allow_login.error) { + throw new FetchError(allow_login.message, allow_login.status); + } + + if (allow_invitation.error) { + throw new FetchError(allow_invitation.message, allow_invitation.status); + } + return ( + <> +
    + +
    +
    + +
    +
    + +
    + + ); + } catch (error) { + let currentError = error as FetchError; + logger.error( + `AdminOverviewPage Error:${currentError.status} ${currentError.message}`, + currentError.status + ); + return ; + } +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/favorite/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/favorite/page.tsx new file mode 100644 index 0000000..c948ffe --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/favorite/page.tsx @@ -0,0 +1,29 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("Favorite"), + }; +} +export default async function LikeRepoPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/follower/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/follower/page.tsx new file mode 100644 index 0000000..32613f5 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/follower/page.tsx @@ -0,0 +1,29 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("Follower"), + }; +} +export default async function RepoPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/following/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/following/page.tsx new file mode 100644 index 0000000..e897d21 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/following/page.tsx @@ -0,0 +1,29 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("Following"), + }; +} +export default async function RepoPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/layout.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/layout.tsx new file mode 100644 index 0000000..2abd98b --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/layout.tsx @@ -0,0 +1,41 @@ +import UserSideBar from "@/components/sidebars/UserSideBar"; +import SideBarToggleSmall from "@/components/sidebars/SideBarToggleSmall"; +import { auth } from "@/auth"; +import { redirect } from "@/navigation"; +import { Suspense } from "react"; +import UserSideBarLoading from "@/components/loadings/UserSideBarLoading"; +import MainContentWrapper from "@/components/wrappers/MainContentWrapper"; +export default async function RootLayout({ + children, + params, +}: { + children: React.ReactNode; + params: { username: string }; +}) { + const session = await auth(); + if (session && session.access_token) { + return ( +
    + + } + > + + + + {children} +
    + ); + } else { + redirect(`/auth/login`); // Navigate to the new post page + } +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/page.tsx new file mode 100644 index 0000000..ca0dc4b --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/page.tsx @@ -0,0 +1,29 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("Repo"), + }; +} +export default async function OwnRepoPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/reports/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/reports/page.tsx new file mode 100644 index 0000000..e3dd10f --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/reports/page.tsx @@ -0,0 +1,29 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("DashBoard") + " - " + t("Report"), + }; +} +export default async function RepoPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/repos/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/repos/page.tsx new file mode 100644 index 0000000..ed157cf --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/repos/page.tsx @@ -0,0 +1,29 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("DashBoard") + " - " + t("Repo"), + }; +} +export default async function RepoPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/sessions/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/sessions/page.tsx new file mode 100644 index 0000000..743d361 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/sessions/page.tsx @@ -0,0 +1,29 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("DashBoard") + " - " + t("Session"), + }; +} +export default async function RepoPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/users/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/users/page.tsx new file mode 100644 index 0000000..3a95de1 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(dashboards)/users/page.tsx @@ -0,0 +1,29 @@ +import ListPageWrapper from "@/components/elements/ListPageWrapper"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { getTranslations } from "next-intl/server"; +export async function generateMetadata({ + params, +}: { + params: { username: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - " + t("DashBoard") + " - " + t("User"), + }; +} +export default async function RepoPage({ + params, + searchParams, +}: { + params: { username: string }; + searchParams?: { query?: string; page?: string }; +}) { + return ( + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/(overview)/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/(overview)/page.tsx new file mode 100644 index 0000000..73231cc --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/(overview)/page.tsx @@ -0,0 +1,34 @@ +import { redirect } from "@/navigation"; +import NotFound from "@/components/loadings/NotFound"; +import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth"; +import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util"; +import { headers } from "next/headers"; +import { FetchError } from "@/fetchs/util"; +export default async function RepoDetail({ + params: { reponame, username }, +}: { + params: { reponame: string; username: string }; +}) { + let home_page = "readme"; + try { + const xforward = headers().get("x-forwarded-for") ?? ""; + const agent = headers().get("User-Agent") ?? ""; + const repo_data = await fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GET_REPO_BASIC_INFO, + xforward: xforward, + agent: agent, + tags: [], + values: { + username: username, + repo_name: decodeURIComponent(reponame), + }, + }); + if (repo_data.error) { + throw new FetchError(repo_data.message, repo_data.status); + } + home_page = repo_data.home_page; + } catch (error) { + return ; + } + redirect(`/workspace/${username}/o/${reponame}/${home_page}`); // Navigate to the new post page +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/[...href]/layout.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/[...href]/layout.tsx new file mode 100644 index 0000000..49c0a12 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/[...href]/layout.tsx @@ -0,0 +1,21 @@ +import { Suspense } from "react"; +import MarkdownLoading from "@/components/loadings/MarkdownLoading"; +import ContentBarLoading from "@/components/loadings/ContentBarLoading"; + +export default function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + + + + } + > + {children} + + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/[...href]/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/[...href]/page.tsx new file mode 100644 index 0000000..2bce23a --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/[...href]/page.tsx @@ -0,0 +1,94 @@ +import WikiInfo from "@/components/WikiInfo"; +import NotFound from "@/components/loadings/NotFound"; +import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth"; +import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util"; +import { headers } from "next/headers"; +import { Metadata } from "next"; +import { SearchParams } from "@/types/interface"; +import { FetchError } from "@/fetchs/util"; +import { logger } from "@/utils/logger"; +export async function generateMetadata({ + params, +}: { + params: { href: string; username: string; reponame: string }; +}): Promise { + var url = decodeURIComponent(params.href); // 将 params.href 转换为字符串 + var parts = url.split(","); + var lastPart = parts[parts.length - 1]; + var firstPart = parts[0] ?? ""; + return { + title: parts.length > 1 ? firstPart + ": " + lastPart : lastPart, + }; +} + +export default async function MarkdownPage({ + params, + searchParams, +}: { + params: { href: string; username: string; reponame: string }; + searchParams?: SearchParams; +}) { + try { + const currentPage = Number(searchParams?.page) || 1; + // const delay = Math.floor(Math.random() * 4000) + 1400; + // await new Promise((resolve) => setTimeout(resolve, delay)); + const xforward = headers().get("x-forwarded-for") ?? ""; + const agent = headers().get("User-Agent") ?? ""; + const data = await fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GET_MARKDOWN_CONTENT, + xforward: xforward, + agent: agent, + tags: [], + values: { + username: params.username, + repo_name: decodeURIComponent(params.reponame), + relative_path: decodeURIComponent(params.href).split(",").join("/"), + }, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } + + const { markdown, prev, next, footers, updated_at, theme_color } = data; + const markdownText = markdown.main_content; + const markdownID = markdown.markdown_id; + const href_seg = markdown.relative_path.split("/"); + const href = href_seg.slice(0, -1).join("/"); + let markdownList = ""; + let sectionIds: string[] = []; + + if (markdown.table_content) { + markdownList = markdown.table_content; + const reg = /href="#(.*?)"/g; + const res = markdownList.match(reg); + + if (res) { + sectionIds = res.map((value: string) => value.slice(7, -1)); + } + } + + return ( + + ); + } catch (error) { + let e = error as FetchError; + logger.error(`fetch MarkdownPage failed:${e.message}`, e.status); + return ; + } +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/layout.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/layout.tsx new file mode 100644 index 0000000..40b3ac8 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/layout.tsx @@ -0,0 +1,25 @@ +import RepoSideBarLayout from "@/components/sidebars/RepoSideBarLayout"; +import { Suspense } from "react"; +import RepoSideBarLoading from "@/components/loadings/RepoSideBarLoading"; +import SideBarToggleSmall from "@/components/sidebars/SideBarToggleSmall"; + +export default function RootLayout({ + children, + params, +}: { + children: React.ReactNode; + params: { reponame: string; username: string }; +}) { + return ( +
    + }> + + + + {children} +
    + ); +} diff --git a/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/~visi/page.tsx b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/~visi/page.tsx new file mode 100644 index 0000000..36bed6a --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/[username]/(repos)/o/[reponame]/~visi/page.tsx @@ -0,0 +1,59 @@ +import ListElementWrapper from "@/components/elements/ListElementWrapper"; +import LoadingList from "@/components/loadings/LoadingList"; +import { ListDataType } from "@/fetchs/model"; +import { Metadata } from "next"; +import { Suspense } from "react"; +import SearchList from "@/components/SearchList"; +import { getTranslations } from "next-intl/server"; +import { auth } from "@/auth"; +import MainContentWrapper from "@/components/wrappers/MainContentWrapper"; +export async function generateMetadata({ + params, +}: { + params: { username: string; reponame: string }; +}): Promise { + const t = await getTranslations("GenerateMetaData"); + return { + title: params.username + " - repo - " + params.reponame + t("WhoCanSee"), + }; +} +export default async function ListRepoVisi({ + params, + searchParams, +}: { + params: { username: string; reponame: string }; + searchParams?: { query?: string; page?: string }; +}) { + try { + let authname = ""; + const session = await auth(); + if (session?.access_token) { + authname = session.username; + } + const query = searchParams?.query || ""; + const currentPage = Number(searchParams?.page) || 1; + + return ( + + + } + > + + + + ); + } catch {} +} diff --git a/zbook_frontend/src/app/[locale]/workspace/layout.tsx b/zbook_frontend/src/app/[locale]/workspace/layout.tsx new file mode 100644 index 0000000..6e8ad28 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/layout.tsx @@ -0,0 +1,7 @@ +export default async function WorkspaceLayout({ + children, +}: { + children: React.ReactNode; +}) { + return <>{children}; +} diff --git a/zbook_frontend/src/app/[locale]/workspace/page.tsx b/zbook_frontend/src/app/[locale]/workspace/page.tsx new file mode 100644 index 0000000..d09a1b4 --- /dev/null +++ b/zbook_frontend/src/app/[locale]/workspace/page.tsx @@ -0,0 +1,10 @@ +import { redirect } from "@/navigation"; +import { auth } from "@/auth"; +export default async function WorkSpacePage() { + const session = await auth(); + if (session && session.access_token) { + redirect(`/workspace/${session.username}`); // Navigate to the new post page + } else { + redirect(`/auth/login`); // Navigate to the new post page + } +} diff --git a/zbook_frontend/src/app/api/auth/[...nextauth]/route.ts b/zbook_frontend/src/app/api/auth/[...nextauth]/route.ts new file mode 100644 index 0000000..00db783 --- /dev/null +++ b/zbook_frontend/src/app/api/auth/[...nextauth]/route.ts @@ -0,0 +1,2 @@ +import { handlers } from "@/auth"; // Referring to the auth.ts we just created +export const { GET, POST } = handlers; diff --git a/zbook_frontend/src/app/globals.css b/zbook_frontend/src/app/globals.css new file mode 100644 index 0000000..4faff8c --- /dev/null +++ b/zbook_frontend/src/app/globals.css @@ -0,0 +1,15 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +.aspect-mac { + aspect-ratio: 1728 / 1080; +} + +.dark\:bg-grid-dark:is(.dark *) { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='rgb(51 65 85 / 0.25)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e"); +} + +.bg-grid-light { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='rgb(51 65 85 / 0.05)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e"); +} diff --git a/zbook_frontend/src/app/robots.ts b/zbook_frontend/src/app/robots.ts new file mode 100644 index 0000000..3d97e62 --- /dev/null +++ b/zbook_frontend/src/app/robots.ts @@ -0,0 +1,11 @@ +import { MetadataRoute } from "next"; + +export default function robots(): MetadataRoute.Robots { + return { + rules: { + userAgent: "*", + allow: "/", + disallow: "/auth/", + }, + }; +} diff --git a/zbook_frontend/src/auth.ts b/zbook_frontend/src/auth.ts new file mode 100644 index 0000000..1b0c54b --- /dev/null +++ b/zbook_frontend/src/auth.ts @@ -0,0 +1,178 @@ +import NextAuth, { Session, User } from "next-auth"; +import CredentialsProvider from "next-auth/providers/credentials"; +import GitHubProvider from "next-auth/providers/github"; +import GoogleProvider from "next-auth/providers/google"; +import { FetchError } from "@/fetchs/util"; +import { JWT } from "next-auth/jwt"; +import { fetchServerWithoutAuthWrapper } from "./fetchs/server_without_auth"; +import { FetchServerWithoutAuthWrapperEndPoint } from "./fetchs/server_without_auth_util"; +import { logger } from "./utils/logger"; +export const { handlers, signIn, signOut, auth } = NextAuth({ + providers: [ + CredentialsProvider({ + credentials: { + email: {}, + password: {}, + }, + name: "Credentials", + async authorize(credentials, request: Request) { + const headers = request.headers; + if (credentials != undefined) { + try { + const data = await fetchServerWithoutAuthWrapper({ + endpoint: FetchServerWithoutAuthWrapperEndPoint.LOGIN_USER, + xforward: headers.get("x-forwarded-for") ?? "", + agent: headers.get("User-Agent") ?? "", + values: { + email: (credentials.email as string) ?? "", + password: (credentials.password as string) ?? "", + }, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } + const user: User = { + id: data.username, + username: data.username, + role: data.role, + access_token: data.access_token, + access_token_expires_at: new Date( + data.access_token_expires_at + ).getTime(), + refresh_token: data.refresh_token, + refresh_token_expires_at: new Date( + data.refresh_token_expires_at + ).getTime(), + }; + return user; + } catch (error) { + throw error; + } + } + return Promise.reject(new Error("cred is invalid")); + }, + }), + GitHubProvider({ + clientId: process.env.GITHUB_ID as string, + clientSecret: process.env.GITHUB_SECRET as string, + }), + GoogleProvider({ + clientId: process.env.GOOGLE_CLIENT_ID as string, + clientSecret: process.env.GOOGLE_CLIENT_SECRET as string, + }), + ], + secret: process.env.AUTH_SECRET, + session: { + strategy: "jwt", // trigger jwt callback + }, + callbacks: { + async jwt({ token, user }: { token: JWT; user?: User }) { + // first call of jwt function just user object is provided + if (user?.username) { + return { ...token, ...user }; + } + // on subsequent calls, token is provided and we need to check if it's expired + if ( + token?.access_token_expires_at && + Date.now() + 3000 > token?.access_token_expires_at + ) { + return refreshAccessToken(token); + } + return { ...token, ...user }; + }, + async session({ + session, + token, + }: { + session: Session; + token: JWT; + }): Promise { + if (token.app_id) { + // oauth + session.app_id = token.app_id; + return Promise.resolve(session); + } + if ( + !token?.access_token_expires_at || + Date.now() > token?.access_token_expires_at + ) { + return Promise.reject({ + error: new Error( + "token has expired. Please log in again to get a new token." + ), + }); + } + session.username = token.username; + (session.role = token.role), (session.access_token = token?.access_token); + return Promise.resolve(session); + }, + + async signIn({ user, account }) { + if (account?.provider === "github" || account?.provider === "google") { + let check_token = { + oauth_type: account.provider, + app_id: account.providerAccountId, + access_token: account.access_token ?? "", + }; + try { + const data = await fetchServerWithoutAuthWrapper({ + endpoint: FetchServerWithoutAuthWrapperEndPoint.LOGIN_BY_OAUTH, + xforward: "", + agent: "", + values: check_token, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } else { + user.username = data.username; + user.role = data.role; + user.access_token = data.access_token; + user.access_token_expires_at = new Date( + data.access_token_expires_at + ).getTime(); + user.refresh_token = data.refresh_token; + user.refresh_token_expires_at = new Date( + data.refresh_token_expires_at + ).getTime(); + return true; + } + } catch (error) { + let e = error as FetchError; + if (e.status == 404) { + user.error = "oauth user not link error"; + user.app_id = account.providerAccountId; + return true; + } else { + logger.error( + `error founded in oauth process:${e.message}`, + e.status + ); + return false; + } + } + } else { + return true; + } + }, + }, +}); + +async function refreshAccessToken(token: JWT) { + const data = await fetchServerWithoutAuthWrapper({ + endpoint: FetchServerWithoutAuthWrapperEndPoint.REFRESH_TOKEN, + xforward: "", + agent: "", + values: { refresh_token: token.refresh_token }, + }); + if (data.error == true) { + logger.error(`refresh token failed:${data.message}`, data.status); + } else { + token.access_token = data.access_token; + token.access_token_expires_at = new Date( + data.access_token_expires_at + ).getTime(); + } + return { + ...token, + }; +} diff --git a/zbook_frontend/src/components/AvatarImageClient.tsx b/zbook_frontend/src/components/AvatarImageClient.tsx new file mode 100644 index 0000000..03e358b --- /dev/null +++ b/zbook_frontend/src/components/AvatarImageClient.tsx @@ -0,0 +1,45 @@ +"use client"; +import Image from "next/image"; +import { useEffect, useState, useMemo } from "react"; +import LoadingElement from "./loadings/LoadingElement"; +import { logger } from "@/utils/logger"; +import { getUserAvatarServer } from "@/fetchs/server_without_auth"; + +export default function AvatarImageClient({ + username, + className, +}: { + username: string; + className: string; +}) { + const [userImage, setUserImage] = useState(); + + useEffect(() => { + getUserAvatarServer({ username }) + .then((data: any) => { + setUserImage(data.avatar); + }) + .catch((error) => { + logger.error(`Failed to fetch user avatar:${error}`); + }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + const avatar = useMemo(() => { + return userImage ? `data:image/png;base64,${userImage}` : null; + }, [userImage]); + + if (avatar) { + return ( + avatar + ); + } else { + return ; + } +} diff --git a/zbook_frontend/src/components/AvatarImageServer.tsx b/zbook_frontend/src/components/AvatarImageServer.tsx new file mode 100644 index 0000000..386aaef --- /dev/null +++ b/zbook_frontend/src/components/AvatarImageServer.tsx @@ -0,0 +1,34 @@ +import Image from "next/image"; +import LoadingElement from "./loadings/LoadingElement"; +import { logger } from "@/utils/logger"; +import { FetchError } from "@/fetchs/util"; +import { getUserAvatarServer } from "@/fetchs/server_without_auth"; + +export default async function AvatarImageServer({ + username, + className, +}: { + username: string; + className: string; +}) { + try { + const data = await getUserAvatarServer({ username }); + if (data.avatar) { + const avatar = `data:image/png;base64,${data.avatar}`; + return ( + avatar + ); + } else { + throw new FetchError("server fetch avatar failed", 404); + } + } catch (error) { + logger.error(`get avatar from server side failed:${error}`); + return ; + } +} diff --git a/zbook_frontend/src/components/CallSignIn.tsx b/zbook_frontend/src/components/CallSignIn.tsx new file mode 100644 index 0000000..838428f --- /dev/null +++ b/zbook_frontend/src/components/CallSignIn.tsx @@ -0,0 +1,11 @@ +"use client"; +import { signIn } from "next-auth/react"; +import { useEffect } from "react"; + +export default function CallSignIn({ oauthType }: { oauthType: string }) { + useEffect(() => { + signIn(oauthType); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + return <>; +} diff --git a/zbook_frontend/src/components/DialogComponent.tsx b/zbook_frontend/src/components/DialogComponent.tsx new file mode 100644 index 0000000..b5ea7a3 --- /dev/null +++ b/zbook_frontend/src/components/DialogComponent.tsx @@ -0,0 +1,36 @@ +import { Dialog, Transition } from "@headlessui/react"; +import React, { Fragment } from "react"; +type DialogCompentProps = { + children: React.ReactNode; + showDialog: boolean; + setShowDialog: React.Dispatch>; +}; +export default function DialogComponent(props: DialogCompentProps) { + function closeModal() { + props.setShowDialog(false); + } + return ( + + +
    + +
    +
    + + {props.children} + +
    +
    +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/components/GitHost.tsx b/zbook_frontend/src/components/GitHost.tsx new file mode 100644 index 0000000..f2a7f8c --- /dev/null +++ b/zbook_frontend/src/components/GitHost.tsx @@ -0,0 +1,26 @@ +import { FaGithub } from "react-icons/fa"; +import { SiGitee } from "react-icons/si"; +import { FaGitlab } from "react-icons/fa6"; +import { FaGit } from "react-icons/fa6"; + +export default function GitHost({ + git_host, + className, +}: { + git_host: string; + className: string; +}) { + if (git_host.includes("github")) { + return ( + + ); + } else if (git_host.includes("gitee")) { + return ( + + ); + } else if (git_host.includes("gitlab")) { + return ; + } else { + return ; + } +} diff --git a/zbook_frontend/src/components/IconFilter.tsx b/zbook_frontend/src/components/IconFilter.tsx new file mode 100644 index 0000000..66b04f6 --- /dev/null +++ b/zbook_frontend/src/components/IconFilter.tsx @@ -0,0 +1,24 @@ +import { FaDiscord, FaGithub } from "react-icons/fa"; +import { IconType } from "react-icons/lib"; + +const IconText = ({ + Icon, + class_name, +}: { + Icon: IconType; + class_name: string; +}) => ; +export default function IconFilter({ + icon_name, + class_name, +}: { + icon_name: string; + class_name: string; +}) { + if (icon_name == "discord") { + return ; + } else if (icon_name == "github") { + return ; + } + return <>; +} diff --git a/zbook_frontend/src/components/IsEmpty.tsx b/zbook_frontend/src/components/IsEmpty.tsx new file mode 100644 index 0000000..0735d82 --- /dev/null +++ b/zbook_frontend/src/components/IsEmpty.tsx @@ -0,0 +1,69 @@ +import { ListDataType } from "@/fetchs/model"; +import { ReactNode } from "react"; +import { FaBox } from "react-icons/fa"; +import { useTranslations } from "next-intl"; +export default function IsEmpty({ + is_empty, + listType, + children, +}: { + is_empty: boolean; + listType: ListDataType; + children: ReactNode; +}) { + const t = useTranslations("DataList"); + let title = ""; + switch (listType) { + case ListDataType.LIST_USER_REPO: + title = t("NoListUserRepoTip"); + break; + case ListDataType.LIST_USER_FAVORITE: + title = t("NoListUserFavoriteTip"); + break; + case ListDataType.LIST_PUBLIC_REPO: + title = t("NoPublicRepoTip"); + break; + case ListDataType.LIST_USER_FOLLOWER: + title = t("NoListUserFollowerTip"); + break; + case ListDataType.LIST_USER_FOLLOWING: + title = t("NoListUserFollowingTip"); + break; + + case ListDataType.LIST_ADMIN_COMMENT: + title = t("NoListAdminCommentTip"); + break; + case ListDataType.LIST_ADMIN_COMMENT_REPORT: + title = t("NoListAdminCommentReportTip"); + break; + case ListDataType.LIST_ADMIN_SESSION: + title = t("NoListAdminSessionTip"); + break; + case ListDataType.LIST_ADMIN_REPO: + title = t("NoListAdminRepoTip"); + break; + case ListDataType.LIST_ADMIN_USER: + title = t("NoListAdminUserTip"); + break; + case ListDataType.LIST_REPO_VISI: + title = t("NoListRepoUserTip"); + break; + default: + break; + throw new Error("Unsupported oauth-party type"); + } + if (is_empty) { + return ( +
    +
    + +

    + {title} +

    +
    +
    + ); + } else { + return children; + } +} diff --git a/zbook_frontend/src/components/LinkOAuth.tsx b/zbook_frontend/src/components/LinkOAuth.tsx new file mode 100644 index 0000000..4402fd0 --- /dev/null +++ b/zbook_frontend/src/components/LinkOAuth.tsx @@ -0,0 +1,65 @@ +import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth"; +import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util"; +import { redirect } from "@/navigation"; +import { auth } from "@/auth"; +import { createOAuthLink } from "@/fetchs/server_without_auth"; +import { FetchError } from "@/fetchs/util"; +import CallSignIn from "./CallSignIn"; +import { logger } from "@/utils/logger"; +export default async function LinkOAuth({ + searchParams, + oauthType, +}: { + searchParams?: { access_token?: string }; + oauthType: string; +}) { + const access_token = searchParams?.access_token || ""; + const session = await auth(); + let redirect2workspace = false; + try { + if (session?.app_id) { + //should created link + let values = { + oauth_type: oauthType, + app_id: session.app_id ?? "", + }; + + const data = await createOAuthLink(values, access_token ?? ""); + if (data.error) { + throw new FetchError(data.message, data.status); + } + return ; + } else if (session?.access_token) { + const data = await fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.CHECK_OAUTH_STATUS, + xforward: "", + agent: "", + tags: [], + values: {}, + }); + if (oauthType == "github") { + if (data?.github) { + redirect2workspace = true; + } else { + return ; + } + } else if (oauthType == "google") { + if (data?.google) { + redirect2workspace = true; + } else { + return ; + } + } + } else { + return <>; + } + } catch (error) { + let e = error as FetchError; + logger.error(`LinkOAuth failed:${e.message}`, e.status); + return <>; + } + if (redirect2workspace) { + redirect(`/workspace`); // Navigate to the new post page + } + return <>; +} diff --git a/zbook_frontend/src/components/LogVisitor.tsx b/zbook_frontend/src/components/LogVisitor.tsx new file mode 100644 index 0000000..6a2e020 --- /dev/null +++ b/zbook_frontend/src/components/LogVisitor.tsx @@ -0,0 +1,25 @@ +import { fetchServerWithoutAuthWrapper } from "@/fetchs/server_without_auth"; +import { FetchServerWithoutAuthWrapperEndPoint } from "@/fetchs/server_without_auth_util"; +import { FetchError } from "@/fetchs/util"; +import { logger } from "@/utils/logger"; +import { headers } from "next/headers"; +export default async function LogVisitor() { + const xforward = headers().get("x-forwarded-for") ?? ""; + const userAgent = headers().get("User-Agent") ?? ""; + try { + const data = await fetchServerWithoutAuthWrapper({ + endpoint: FetchServerWithoutAuthWrapperEndPoint.LOG_VISITOR, + xforward: xforward, + agent: userAgent, + values: {}, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } + return <>; + } catch (error) { + let e = error as FetchError; + logger.error(`LogVisitor failed:${e.message}`, e.status); + return <>; + } +} diff --git a/zbook_frontend/src/components/MainContentFooter.tsx b/zbook_frontend/src/components/MainContentFooter.tsx new file mode 100644 index 0000000..ac24148 --- /dev/null +++ b/zbook_frontend/src/components/MainContentFooter.tsx @@ -0,0 +1,94 @@ +import { FooterSocial } from "@/types/interface"; +import { getTranslations } from "next-intl/server"; +import { Link } from "@/navigation"; +import IconFilter from "./IconFilter"; +import TimeElement from "./TimeElement"; +import { ThemeColor } from "./TableOfContent"; +export default async function MainContentFooter({ + prev, + next, + username, + repo_name, + updated_at, + footers, + theme_color, +}: { + prev: string; + next: string; + username: string; + repo_name: string; + updated_at: string; + footers: FooterSocial[]; + theme_color: ThemeColor; +}) { + const t = await getTranslations("Footer"); + return ( +
    +
    + {prev && ( +
    +
    +

    + + + {t("PrevPage")} + +

    +

    + {prev} +

    +
    +
    + )} + + {next && ( +
    +
    +

    + + + {t("NextPage")} + +

    +

    + {next} +

    +
    +
    + )} +
    + +
    +
    + {footers?.map((footer: FooterSocial, index: any) => ( + + + + ))} + +
    + {t("UpdatedAt")} + +
    +
    +
    + + {t("PowerBy")} + +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/components/MotionBounce.tsx b/zbook_frontend/src/components/MotionBounce.tsx new file mode 100644 index 0000000..8e2a522 --- /dev/null +++ b/zbook_frontend/src/components/MotionBounce.tsx @@ -0,0 +1,41 @@ +"use client"; +import { motion, Variants } from "framer-motion"; + +const cardVariants: Variants = { + offxscreen: { + y: 100, + opacity: 0, + }, + offyscreen: { + y: 100, + opacity: 0, + }, + onscreen: { + x: 0, + y: 0, + opacity: 1, + transition: { + type: "spring", + bounce: 0.2, + duration: 1.5, + }, + }, +}; + +export default function MotionBounce({ + children, + direction, +}: { + children: React.ReactNode; + direction: string; +}) { + return ( + + {children} + + ); +} diff --git a/zbook_frontend/src/components/NoItemFound.tsx b/zbook_frontend/src/components/NoItemFound.tsx new file mode 100644 index 0000000..1170c2c --- /dev/null +++ b/zbook_frontend/src/components/NoItemFound.tsx @@ -0,0 +1,12 @@ +import { FaBox } from "react-icons/fa"; + +export default function NoItemFound({ title }: { title: string }) { + return (
    +
    + +

    + {title} +

    +
    +
    ) +} \ No newline at end of file diff --git a/zbook_frontend/src/components/NotFoundDemo.tsx b/zbook_frontend/src/components/NotFoundDemo.tsx new file mode 100644 index 0000000..d1ce575 --- /dev/null +++ b/zbook_frontend/src/components/NotFoundDemo.tsx @@ -0,0 +1,19 @@ +import { useTranslations } from "next-intl"; + +export default function NotFoundDemo() { + const t = useTranslations("NotFoundPage"); + return ( +
    +
    +

    {t("404")}

    +

    {t("PageNotFound")}

    + + {t("BackToHome")} + +
    +
    + ); +} diff --git a/zbook_frontend/src/components/PageBar.tsx b/zbook_frontend/src/components/PageBar.tsx new file mode 100644 index 0000000..abd43c5 --- /dev/null +++ b/zbook_frontend/src/components/PageBar.tsx @@ -0,0 +1,189 @@ +import { useTranslations } from "next-intl"; + +export default function PageBar({ + currentPage, + totalPages, + setCurrentPage, +}: { + currentPage: number; + totalPages: number; + setCurrentPage: React.Dispatch>; +}) { + const t = useTranslations("Pagination"); + const isHidden = (condition: boolean) => (condition ? "hidden" : ""); + + function RenderPageLink({ + pageNumber, + condition, + label, + }: { + pageNumber: number; + condition: boolean; + label?: string; + }) { + return ( + { + setCurrentPage(pageNumber); + }} + className={`mx-0.5 cursor-pointer ${isHidden( + condition + )} hover:text-sky-500`} + > + {label || pageNumber} + + ); + } + + if (totalPages <= 1) { + return <>; + } + return ( +
    +
    + + + {t("TotalPage", { duration: totalPages })} + + {totalPages > 1 && ( + <> + + + + {t("Ellipsis")} + + + + + {currentPage} + + = totalPages} + /> + = totalPages} + /> + = totalPages)}`}> + {t("Ellipsis")} + + + + + )} + {/* { + props.setCurrentPage(props.currentPage - 1); + }} + className={`${ + props.currentPage == 1 && "hidden" + } cursor-pointer mr-0.5`} + > + {t("Previous")} + + { + props.setCurrentPage(1); + }} + className={`mx-0.5 cursor-pointer ${ + props.currentPage == 1 && "hidden" + }`} + > + 1 + + + {t("Ellipsis")} + + { + props.setCurrentPage(props.currentPage - 2); + }} + className={`mx-0.5 cursor-pointer ${ + props.currentPage - 2 <= 1 && "hidden" + }`} + > + {props.currentPage - 2} + + { + props.setCurrentPage(props.currentPage - 1); + }} + className={`mx-0.5 cursor-pointer ${ + props.currentPage - 1 <= 1 && "hidden" + }`} + > + {props.currentPage - 1} + + + {props.currentPage} + + { + props.setCurrentPage(props.currentPage + 1); + }} + className={`mx-0.5 cursor-pointer ${ + props.currentPage + 1 >= props.pageNumber && "hidden" + }`} + > + {props.currentPage + 1} + + { + props.setCurrentPage(props.currentPage + 1); + }} + className={`mx-0.5 cursor-pointer ${ + props.currentPage + 2 >= props.pageNumber && "hidden" + }`} + > + {props.currentPage + 2} + + = props.pageNumber && "hidden" + }`} + > + {t("Ellipsis")} + + { + props.setCurrentPage(props.pageNumber); + }} + className={`mx-0.5 cursor-pointer ${ + props.currentPage == props.pageNumber && "hidden" + }`} + > + {props.pageNumber} + + { + props.setCurrentPage(props.currentPage + 1); + }} + className={`${ + props.currentPage == props.pageNumber && "hidden" + } cursor-pointer ml-0.5`} + > + {t("Next")} + {" "} */} + +
    +
    + ); +} diff --git a/zbook_frontend/src/components/SearchList.tsx b/zbook_frontend/src/components/SearchList.tsx new file mode 100644 index 0000000..adc5f68 --- /dev/null +++ b/zbook_frontend/src/components/SearchList.tsx @@ -0,0 +1,110 @@ +"use client"; + +import { MdSearch } from "react-icons/md"; +import { useSearchParams } from "next/navigation"; +import { usePathname, useRouter } from "@/navigation"; +import { ListDataType } from "@/fetchs/model"; +import { useTranslations } from "next-intl"; +import { IoMdPersonAdd } from "react-icons/io"; +import { useContext } from "react"; +import { SearchDialogContext } from "@/providers/SearchDialogProvider"; +import { OperationContext } from "@/providers/OperationProvider"; +import { SearchType } from "@/utils/const_value"; + +export default function SearchList({ + listType, + username, + repo_name, +}: { + listType: ListDataType; + username: string; + repo_name: string; +}) { + const searchParams = useSearchParams(); + const pathname = usePathname(); + const { replace } = useRouter(); + const t = useTranslations("DataList"); + const { setSearchDialogOpen, setSearchType } = + useContext(SearchDialogContext); + const { setOperationUsername, setOperationRepoName } = + useContext(OperationContext); + function handleSearch(term: string) { + if (searchParams) { + const params = new URLSearchParams(searchParams); + if (term) { + params.set("query", term); + } else { + params.delete("query"); + } + replace(`${pathname}?${params.toString()}`); + } + } + + let placeholder = ""; + switch (listType) { + case ListDataType.LIST_USER_REPO: + placeholder = t("SearchListUserRepoTip"); + break; + case ListDataType.LIST_USER_FAVORITE: + placeholder = t("SearchListUserFavoriteTip"); + break; + case ListDataType.LIST_PUBLIC_REPO: + placeholder = t("SearchPublicRepoTip"); + break; + case ListDataType.LIST_USER_FOLLOWER: + placeholder = t("SearchListUserFollowerTip"); + break; + case ListDataType.LIST_USER_FOLLOWING: + placeholder = t("SearchListUserFollowingTip"); + break; + + case ListDataType.LIST_ADMIN_COMMENT: + placeholder = t("SearchListAdminCommentTip"); + break; + case ListDataType.LIST_ADMIN_COMMENT_REPORT: + placeholder = t("SearchListAdminCommentReportTip"); + break; + case ListDataType.LIST_ADMIN_SESSION: + placeholder = t("SearchListAdminSessionTip"); + break; + case ListDataType.LIST_ADMIN_REPO: + placeholder = t("SearchListAdminRepoTip"); + break; + case ListDataType.LIST_ADMIN_USER: + placeholder = t("SearchListAdminUserTip"); + break; + case ListDataType.LIST_REPO_VISI: + placeholder = t("SearchListRepoUserTip"); + break; + default: + break; + throw new Error("Unsupported oauth-party type"); + } + return ( +
    + { + handleSearch(e.target.value); + }} + className={`py-3 h-12 pl-10 rounded-md border border-slate-300/75 dark:border-0 dark:text-slate-400 grow dark:bg-slate-800 + placeholder:text-slate-400/75 dark:placeholder:text-slate-500/75 placeholder:text-sm placeholder:font-base + ${"focus:outline-0"}`} + /> + + {listType == ListDataType.LIST_REPO_VISI && ( + { + setOperationRepoName(decodeURIComponent(repo_name)); + setOperationUsername(username); + setSearchType(SearchType.VISI_USER); //搜索仓库可见用户 + setSearchDialogOpen(true); + }} + /> + )} +
    + ); +} diff --git a/zbook_frontend/src/components/ShowComponent.tsx b/zbook_frontend/src/components/ShowComponent.tsx new file mode 100644 index 0000000..cfdd7aa --- /dev/null +++ b/zbook_frontend/src/components/ShowComponent.tsx @@ -0,0 +1,14 @@ +import { ReactNode } from "react"; +export default function ShowComponent({ + show, + children, +}: { + show: boolean; + children: ReactNode; +}) { + if (show) { + return <>{children}; + } else { + return <>; + } +} diff --git a/zbook_frontend/src/components/SomeThingWrong.tsx b/zbook_frontend/src/components/SomeThingWrong.tsx new file mode 100644 index 0000000..a6d8a85 --- /dev/null +++ b/zbook_frontend/src/components/SomeThingWrong.tsx @@ -0,0 +1,16 @@ +import { useTranslations } from "next-intl"; +import { MdError } from "react-icons/md"; + +export default function SomeThingWrong() { + const t = useTranslations("SomeThingWrong"); + return ( +
    +
    + +

    + {t("SomeThingWrong")} +

    +
    +
    + ); +} diff --git a/zbook_frontend/src/components/TableOfContent.tsx b/zbook_frontend/src/components/TableOfContent.tsx new file mode 100644 index 0000000..a79b28a --- /dev/null +++ b/zbook_frontend/src/components/TableOfContent.tsx @@ -0,0 +1,182 @@ +"use client"; +import parse from "html-react-parser"; + +import React, { useState, useEffect } from "react"; +import { LuListMinus } from "react-icons/lu"; +export enum ThemeColor { + Violet = "violet", + Green = "green", + Red = "red", + Yellow = "yellow", + Teal = "teal", + Sky = "sky", + Cyan = "cyan", + Pink = "pink", + Indigo = "indigo", +} +function getColorClasses(color: ThemeColor) { + return { + hoverClass: `hover:text-${color}-500 hover:dark:text-${color}-400 hover:font-semibold`, + activeClass: `text-${color}-500 dark:text-${color}-400 font-semibold`, + }; +} +import { + domToReact, + attributesToProps, + DOMNode, + Element, + HTMLReactParserOptions, +} from "html-react-parser"; +import RightSideBarWrapper from "./sidebars/RightSideBarWrapper"; +import { useTranslations } from "next-intl"; +interface TableOfContentProps { + sectionIds: string[]; + markdownlist: string; + theme_color: ThemeColor; +} + +export default function TableOfContent(props: TableOfContentProps) { + const [activeSectionId, setActiveSectionId] = useState(""); + const t = useTranslations("RightSideBar"); + function get_act() { + return activeSectionId; + } + const handleClick = (e: React.ChangeEvent) => { + e.preventDefault(); + var href = e.target.getAttribute("href"); + const escapedSelector = href.replace(/#(\d)/, "#\\3$1 "); + const section1 = document.querySelector(escapedSelector); + const navHeight = -35; + window.scrollTo({ + top: section1.offsetTop - navHeight, + behavior: "smooth", + }); + }; + useEffect(() => { + const handleScroll = () => { + const visibleSectionId = props.sectionIds.find((sectionId) => { + const section = document.getElementById(sectionId); + if (section) { + const rect = section.getBoundingClientRect(); + return rect.top >= 70 && rect.top <= 100; + } + return false; + }); + if (visibleSectionId != undefined) { + setActiveSectionId(visibleSectionId); + } + }; + + window.addEventListener("scroll", handleScroll); + return () => { + window.removeEventListener("scroll", handleScroll); + }; + }, [props.sectionIds]); + const { hoverClass, activeClass } = getColorClasses(props.theme_color); + console.log("hoverClass:", hoverClass); + var html_parser_options_list: HTMLReactParserOptions = { + replace: (domNode: DOMNode) => { + if (domNode instanceof Element && domNode.name === "ul") { + // 访问父元素的属性 + const parent = domNode.parent; + //@ts-ignore + const parentAttr = parent != undefined && parent.attribs != undefined; + if (parentAttr) { + return ( +
      + {domToReact(domNode.children, html_parser_options_list)} +
    + ); + } else { + return ( +
      + {domToReact(domNode.children, html_parser_options_list)} +
    + ); + } + } + if (domNode instanceof Element && domNode.name === "li") { + // 访问父元素的属性 + const parent = domNode.parent; + //@ts-ignore + const parentAttr = parent != undefined && parent.attribs != undefined; + + if (parentAttr) { + //@ts-ignore + const id = parent.attribs.id; + if (id && id == "content_title") { + if (domNode.firstChild?.nextSibling != undefined) { + let title = domNode.firstChild?.nextSibling as Element; + if (title?.name == "a") { + return ( +
  • + {domToReact( + domNode.children.slice(2, -1), + html_parser_options_list + )} +
  • + ); + } + } + } + } + return ( +
  • + {domToReact(domNode.children, html_parser_options_list)} +
  • + ); + } else if (domNode instanceof Element && domNode.name === "a") { + const props = attributesToProps(domNode.attribs); + // 访问父元素的属性 + const parent = domNode.parent; + if (!parent || !parent.parent || !parent.parent.parent) { + return ( + + {domToReact(domNode.children, html_parser_options_list)} + + ); + } + return ( + + {domToReact(domNode.children, html_parser_options_list)} + + ); + } + }, + }; + + return ( + +
    + {/* 确保父元素具有固定高度或最大高度 */} +
    + {/* 子元素充满父元素的高度 */} +
    + + {t("OnThisPage")} +
    + {parse(props.markdownlist, html_parser_options_list)} +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/components/TimeElement.tsx b/zbook_frontend/src/components/TimeElement.tsx new file mode 100644 index 0000000..f4e4b16 --- /dev/null +++ b/zbook_frontend/src/components/TimeElement.tsx @@ -0,0 +1,48 @@ +import { useTranslations } from "next-intl"; +export default function TimeElement({ timeInfo }: { timeInfo: string }) { + const ut = useTranslations("Time"); + function convertTime(givenTime: string): string { + // 解析给定时间字符串 + const ct = new Date(givenTime); + + // 获取当前时间和时区 + const now = new Date(); + + // 计算时间差 + const diff = ct.getTime() - now.getTime(); + + // 小于一分钟 + if (Math.abs(diff) < 60 * 1000) { + return ut("JustNow"); + } + // 小于一小时 + else if (Math.abs(diff) < 60 * 60 * 1000) { + const minutes = Math.floor(Math.abs(diff) / (60 * 1000)); + if (diff < 0) { + return ut("MinuteAgo", { duration: minutes }); + } else { + return ut("MinuteAfter", { duration: minutes }); + } + } + // 小于一天 + else if (Math.abs(diff) < 24 * 60 * 60 * 1000) { + const hours = Math.floor(Math.abs(diff) / (60 * 60 * 1000)); + if (diff < 0) { + return ut("HourAgo", { duration: hours }); + } else { + return ut("HourAfter", { duration: hours }); + } + } + // 大于一天 + else { + const days = Math.floor(Math.abs(diff) / (24 * 60 * 60 * 1000)); + // return `${days} 天${diff > 0 ? "后" : "前"}`; + if (diff < 0) { + return ut("DayAgo", { duration: days }); + } else { + return ut("DayAfter", { duration: days }); + } + } + } + return <>{convertTime(timeInfo)}; +} diff --git a/zbook_frontend/src/components/ToolTip.tsx b/zbook_frontend/src/components/ToolTip.tsx new file mode 100644 index 0000000..882386d --- /dev/null +++ b/zbook_frontend/src/components/ToolTip.tsx @@ -0,0 +1,20 @@ +"use client"; +import Tippy from "@tippyjs/react"; +import "tippy.js/dist/tippy.css"; +import "tippy.js/themes/material.css"; +import "tippy.js/animations/scale.css"; +import React, { ReactElement } from "react"; + +export default function ToolTip({ + message, + children, +}: { + message: string; + children: ReactElement; +}) { + return ( + + {children} + + ); +} diff --git a/zbook_frontend/src/components/WarningDialog.tsx b/zbook_frontend/src/components/WarningDialog.tsx new file mode 100644 index 0000000..d315685 --- /dev/null +++ b/zbook_frontend/src/components/WarningDialog.tsx @@ -0,0 +1,53 @@ +import DialogComponent from "@/components/DialogComponent"; +export default function WarngingDialog({ + title, + showDialog, + setShowDialog, + cancelFunc, + submitFunc, + cancelTitle, + submitTitle, +}: { + title: string; + showDialog: boolean; + setShowDialog: React.Dispatch>; + cancelFunc: any; + submitFunc: any; + cancelTitle: string; + submitTitle: string; +}) { + return ( + +
    +
    +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/components/WikiInfo.tsx b/zbook_frontend/src/components/WikiInfo.tsx new file mode 100644 index 0000000..871c6c1 --- /dev/null +++ b/zbook_frontend/src/components/WikiInfo.tsx @@ -0,0 +1,77 @@ +import HtmlParser from "@/components/parsers/HtmlParser"; +import { auth } from "@/auth"; +interface WikiInfoProps { + sectionIds: string[]; + markdownlist: string; + markdowntext: string; + prefixPath: string; + NavBarOpen: boolean; + markdown_id: number; + currentPage: number; + searchParams?: SearchParams; + username: string; + repo_name: string; + prev: string; + next: string; + footers: FooterSocial[]; + updated_at: string; + theme_color: ThemeColor; +} +import CreateComment from "./comments/CreateComment"; +import MainContentWrapper from "./wrappers/MainContentWrapper"; +import { FooterSocial, SearchParams } from "@/types/interface"; +import ListLevelOneComment from "./comments/ListLevelOneComment"; +import TableOfContent, { ThemeColor } from "./TableOfContent"; +import { getTranslations } from "next-intl/server"; +import MainContentFooter from "./MainContentFooter"; +export default async function WikiInfo(props: WikiInfoProps) { + const session = await auth(); + const t = await getTranslations("Footer"); + return ( + + } + > + + + + + {session?.access_token && ( + <> + + +
    + +
    + + )} +
    + ); +} diff --git a/zbook_frontend/src/components/charts/AreaChart.tsx b/zbook_frontend/src/components/charts/AreaChart.tsx new file mode 100644 index 0000000..e1aefec --- /dev/null +++ b/zbook_frontend/src/components/charts/AreaChart.tsx @@ -0,0 +1,57 @@ +"use client"; +import dynamic from "next/dynamic"; +import { useTranslations } from "next-intl"; +const ApexChart = dynamic(() => import("react-apexcharts"), { ssr: false }); +import { useTheme } from "next-themes"; +import { getAreaChartOptions } from "@/utils/const_value"; + +export default function AreaChart({ + dates, + counts, + title, + label, +}: { + dates: string[]; + counts: number[]; + title: string; + label: string; +}) { + const { theme } = useTheme(); + const t = useTranslations("AdminOverView"); + + counts = counts || []; + dates = dates || []; + const totalCount = counts.reduce((sum, count) => sum + count, 0); + let options = getAreaChartOptions(theme, dates); + let series = [ + { + name: label, + data: counts, + color: "#7E3BF2", + }, + ]; + return ( +
    +
    +
    +
    +
    + {totalCount} +
    +

    + {t("DailyVisitors")} +

    +
    +
    +
    + + +
    + ); +} diff --git a/zbook_frontend/src/components/charts/AreaUserChart.tsx b/zbook_frontend/src/components/charts/AreaUserChart.tsx new file mode 100644 index 0000000..c3a7c34 --- /dev/null +++ b/zbook_frontend/src/components/charts/AreaUserChart.tsx @@ -0,0 +1,79 @@ +"use client"; +import dynamic from "next/dynamic"; +import { useTranslations } from "next-intl"; +const ApexChart = dynamic(() => import("react-apexcharts"), { ssr: false }); +import { useTheme } from "next-themes"; +import EnableElement from "./EnableElement"; +import { getAreaChartOptions } from "@/utils/const_value"; + +interface WebTrafficProps { + newUserCounts: number[]; + activeUserCounts: number[]; + allow_login: boolean; + allow_registration: boolean; + allow_invitation: boolean; + dates: string[]; +} + +export default function AreaUserChart({ + newUserCounts, + dates, + activeUserCounts, + allow_login, + allow_registration, + allow_invitation, +}: WebTrafficProps) { + const { theme } = useTheme(); + const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; + console.log("client timezone:", timezone); + const t = useTranslations("AdminOverView"); + + let options = getAreaChartOptions(theme, dates); + + let series = [ + { + name: t("newUserLabel"), + data: newUserCounts, + color: "#7E3BF2", + }, + { + name: t("activeUserLabel"), + data: activeUserCounts, + color: "#1A56DB", + }, + ]; + return ( +
    +
    +
    + {t("DailyUsers")} +
    +
    + + + + +
    +
    + +
    + ); +} diff --git a/zbook_frontend/src/components/charts/BarChart.tsx b/zbook_frontend/src/components/charts/BarChart.tsx new file mode 100644 index 0000000..b844b5d --- /dev/null +++ b/zbook_frontend/src/components/charts/BarChart.tsx @@ -0,0 +1,110 @@ +"use client"; +import dynamic from "next/dynamic"; +const ApexChart = dynamic(() => import("react-apexcharts"), { ssr: false }); +import { useTheme } from "next-themes"; + +interface WebTrafficProps { + ips: string[]; + counts: number[]; + title: string; + label: string; +} +export default function BarChart({ + ips, + counts, + title, + label, +}: WebTrafficProps) { + const { theme } = useTheme(); + + var options = { + chart: { + type: "bar" as "bar", + toolbar: { + show: false, + }, + }, + grid: { + borderColor: theme === "dark" ? "#334155" : "#E2E8F0", + xaxis: { + lines: { + show: false, + }, + }, + yaxis: { + lines: { + show: true, + }, + }, + }, + tooltip: { + theme: theme == "dark" ? "dark" : "light", + enabled: true, + x: { + show: false, + }, + }, + plotOptions: { + bar: { + borderRadius: 4, + borderRadiusApplication: "end" as "end", + horizontal: true, + }, + }, + dataLabels: { + enabled: false, + }, + legend: { + show: true, + labels: { + colors: theme == "dark" ? "#CBD5E1" : "#334155", + }, + }, + + stroke: { + width: 2, + }, + xaxis: { + categories: ips, + labels: { + style: { + colors: theme === "dark" ? "#CBD5E1" : "#334155", + }, + }, + }, + yaxis: { + show: true, + labels: { + style: { + colors: theme === "dark" ? "#CBD5E1" : "#334155", + }, + }, + }, + }; + let series = [ + { + name: label, + data: counts, + }, + ]; + return ( +
    +
    +
    +
    +
    + {title} +
    +
    +
    +
    + +
    + ); +} diff --git a/zbook_frontend/src/components/charts/DonutChart.tsx b/zbook_frontend/src/components/charts/DonutChart.tsx new file mode 100644 index 0000000..944bc21 --- /dev/null +++ b/zbook_frontend/src/components/charts/DonutChart.tsx @@ -0,0 +1,85 @@ +"use client"; +import dynamic from "next/dynamic"; +import { useTranslations } from "next-intl"; +const ApexChart = dynamic(() => import("react-apexcharts"), { ssr: false }); +import { useTheme } from "next-themes"; +export default function DonuChart({ agentCounts }: { agentCounts: any }) { + const { theme } = useTheme(); + const t = useTranslations("AdminOverView"); + let options = { + colors: ["#1C64F2", "#16BDCA", "#FDBA8C", "#E74694", "#57E694"], + chart: { + height: "100%", + width: "100%", + type: "donut" as "donut", + }, + stroke: { + colors: ["transparent"], + // lineCap: "", + }, + grid: { + padding: { + top: -2, + }, + }, + labels: [t("Computer"), t("Phone"), t("Tablet"), t("Bot"), t("Unknown")], + dataLabels: { + enabled: false, + }, + legend: { + position: "bottom" as "bottom", + fontFamily: "Inter, sans-serif", + labels: { + colors: theme == "dark" ? "#CBD5E1" : "#334155", + }, + }, + yaxis: { + labels: { + formatter: function (value: any) { + return value; + }, + }, + }, + xaxis: { + labels: { + formatter: function (value: any) { + return value; + }, + }, + axisTicks: { + show: false, + }, + axisBorder: { + show: false, + }, + }, + }; + let series = [ + agentCounts.computer, + agentCounts.phone, + agentCounts.tablet, + agentCounts.bot, + agentCounts.unknown, + ]; + return ( +
    +
    +
    +
    +
    + {t("VisitorAnalysis")} +
    +
    +
    +
    + + +
    + ); +} diff --git a/zbook_frontend/src/components/charts/EarthChart.tsx b/zbook_frontend/src/components/charts/EarthChart.tsx new file mode 100644 index 0000000..a7e0195 --- /dev/null +++ b/zbook_frontend/src/components/charts/EarthChart.tsx @@ -0,0 +1,178 @@ +"use client"; +import { useEffect, useRef } from "react"; +import * as d3 from "d3"; +import { GeoProjection, GeoPath } from "d3"; +import { FeatureCollection, GeoJsonProperties, Geometry } from "geojson"; + +interface Marker { + long: number; + lat: number; + city: string; +} + +export default function EarthChart({ + landData, + lakeData, + riverData, + markers, + isSmall, +}: { + landData: FeatureCollection; + lakeData: FeatureCollection; + riverData: FeatureCollection; + markers: Marker[]; + isSmall: boolean; +}) { + const svgRef = useRef(null); + + useEffect(() => { + const svg = d3.select(svgRef.current); + const width = +svg.attr("width")!; + const height = +svg.attr("height")!; + + const tooltip = d3 + .select("body") + .append("div") + .style("position", "absolute") + .style("background", "white") + .style("border", "1px solid black") + .style("padding", "5px") + .style("border-radius", "5px") + .style("font-size", "12px") + .style("color", "black") + .style("pointer-events", "none") + .style("opacity", 0); + + const projection: GeoProjection = d3 + .geoOrthographic() + .center([0, 0]) + .scale(isSmall ? 150 : 300) + .clipAngle(90) + .translate([width / 2, height / 2]) + .rotate([0, 0]); + + const path: GeoPath = d3.geoPath().projection(projection); + + let currentRotation = [0, 0, 0]; + + const drag = d3 + .drag() + .subject(function () { + const r = projection.rotate(); + return { x: r[0] / 0.5, y: -r[1] / 0.5 }; + }) + .on("drag", function (event) { + const rotate = projection.rotate(); + projection.rotate([event.x * 0.5, -event.y * 0.5, rotate[2]]); + svg.selectAll("path").attr("d", path); + + svg + .selectAll("circle") + .attr("cx", (d) => { + const coords = projection([d.long, d.lat]); + return coords ? coords[0] : 0; + }) + .attr("cy", (d) => { + const coords = projection([d.long, d.lat]); + return coords ? coords[1] : 0; + }) + .attr("display", (d) => { + const distance = d3.geoDistance( + [d.long, d.lat], + [-projection.rotate()[0], -projection.rotate()[1]] + ); + return distance > Math.PI / 2 ? "none" : "inline"; + }); + + currentRotation = projection.rotate(); + }); + + // 这里进行类型转换以解决类型不兼容问题 + (svg as unknown as d3.Selection).call( + drag + ); + + // Draw land + const landGroup = svg.append("g"); + landGroup + .selectAll("path") + .data(landData.features) + .enter() + .append("path") + .attr("d", path) + .style("fill", "#cce5ff") + .style("stroke", "#333") + .style("stroke-width", 0.5); + + // Draw lakes + const lakeGroup = svg.append("g"); + lakeGroup + .selectAll("path") + .data(lakeData.features) + .enter() + .append("path") + .attr("d", path) + .style("fill", "#99ccff") + .style("stroke", "#333") + .style("stroke-width", 0.5); + + // Draw rivers + const riverGroup = svg.append("g"); + riverGroup + .selectAll("path") + .data(riverData.features) + .enter() + .append("path") + .attr("d", (d) => { + const geometry = d.geometry; + if (geometry.type === "LineString") { + return path(geometry.coordinates); + } else if (geometry.type === "MultiLineString") { + return geometry.coordinates + .map((coords: any) => path(coords)) + .join(" "); + } else { + return ""; + } + }) + .style("fill", "none") + .style("stroke", "#a8d6ff") + .style("stroke-width", 1); + + // Draw markers + svg + .append("g") + .selectAll("circle") + .data(markers) + .enter() + .append("circle") + .attr("cx", (d: Marker) => projection([d.long, d.lat])![0]) + .attr("cy", (d: Marker) => projection([d.long, d.lat])![1]) + .attr("r", 3) + .style("fill", "brown") + .on("mouseover", (event, d) => { + tooltip + .html(d.city) + .style("left", `${event.pageX + 10}px`) + .style("top", `${event.pageY + 10}px`) + .style("opacity", 1); + }) + .on("mousemove", (event) => { + tooltip + .style("left", `${event.pageX + 10}px`) + .style("top", `${event.pageY + 10}px`); + }) + .on("mouseout", () => { + tooltip.style("opacity", 0); + }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + return ( + + ); +} diff --git a/zbook_frontend/src/components/charts/EnableElement.tsx b/zbook_frontend/src/components/charts/EnableElement.tsx new file mode 100644 index 0000000..608d129 --- /dev/null +++ b/zbook_frontend/src/components/charts/EnableElement.tsx @@ -0,0 +1,71 @@ +import { useState } from "react"; +import { Switch } from "@headlessui/react"; +import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth"; +import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util"; +import ToolTip from "@/components/ToolTip"; +import { useTranslations } from "next-intl"; +import { FetchError } from "@/fetchs/util"; +import { logger } from "@/utils/logger"; + +export default function EnableElement({ + config_name, + label, + initEnabled, +}: { + config_name: string; + label: string; + initEnabled: boolean; +}) { + const [enabled, setEnabled] = useState(initEnabled); + const t = useTranslations("AdminOverView"); + return ( + +
    + + + <>{label} + + + { + try { + const data = await fetchServerWithAuthWrapper({ + endpoint: + FetchServerWithAuthWrapperEndPoint.UpdateConfiguration, + xforward: "", + agent: "", + tags: [], + values: { config_name: config_name, config_value: !enabled }, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } + setEnabled(!enabled); + } catch (error) { + let e = error as FetchError; + logger.error(`setEnabled failed:${e.message}`, e.status); + } + }} + className={`${ + enabled ? "bg-green-600" : "bg-gray-200 dark:bg-gray-700" + } relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-none`} + > + + +
    +
    + ); +} diff --git a/zbook_frontend/src/components/charts/NDay.tsx b/zbook_frontend/src/components/charts/NDay.tsx new file mode 100644 index 0000000..918a1da --- /dev/null +++ b/zbook_frontend/src/components/charts/NDay.tsx @@ -0,0 +1,61 @@ +"use client"; +import { useSearchParams } from "next/navigation"; +import { usePathname, useRouter } from "@/navigation"; +import { useTranslations } from "next-intl"; +export default function NDay({ oldNdays }: { oldNdays: number }) { + const searchParams = useSearchParams(); + const pathname = usePathname(); + const { replace } = useRouter(); + const t = useTranslations("AdminOverView"); + function handleSearch(ndays: string) { + if (searchParams) { + const params = new URLSearchParams(searchParams); + if (ndays) { + params.set("ndays", ndays); + } else { + params.delete("ndays"); + } + replace(`${pathname}?${params.toString()}`); + } + } + return ( +
    +
    { + handleSearch("1"); + }} + className={`cursor-pointer md:px-4 px-2 md:py-2 py-1.5 rounded-md ${ + oldNdays == 1 + ? "bg-sky-500 text-white dark:bg-sky-600" + : "text-slate-600 dark:text-slate-200" + }`} + > + {t("LastDay")} +
    +
    { + handleSearch("7"); + }} + className={`cursor-pointer md:px-4 px-2 md:py-2 py-1.5 rounded-md ${ + oldNdays == 7 + ? "bg-sky-500 text-white dark:bg-sky-600" + : "text-slate-600 dark:text-slate-200" + }`} + > + {t("LastWeek")} +
    +
    { + handleSearch("31"); + }} + className={`cursor-pointer md:px-4 px-2 md:py-2 py-1.5 rounded-md ${ + oldNdays == 31 + ? "bg-sky-500 text-white dark:bg-sky-600" + : "text-slate-600 dark:text-slate-200" + }`} + > + {t("LastMonth")} +
    +
    + ); +} diff --git a/zbook_frontend/src/components/charts/PieChart.tsx b/zbook_frontend/src/components/charts/PieChart.tsx new file mode 100644 index 0000000..2356694 --- /dev/null +++ b/zbook_frontend/src/components/charts/PieChart.tsx @@ -0,0 +1,71 @@ +"use client"; +import dynamic from "next/dynamic"; +import { useTranslations } from "next-intl"; +const ApexChart = dynamic(() => import("react-apexcharts"), { ssr: false }); +import { useTheme } from "next-themes"; +export default function PieChart({ + repo_count, + comment_count, + comment_report_count, + user_count, +}: { + repo_count: string; + comment_count: string; + comment_report_count: string; + user_count: string; +}) { + const { theme } = useTheme(); + const t = useTranslations("AdminOverView"); + let repo_count_n = parseInt(repo_count); + let comment_count_n = parseInt(comment_count); + let comment_report_count_n = parseInt(comment_report_count); + let user_count_n = parseInt(user_count); + + let options = { + colors: ["#1C64F2", "#16BDCA", "#9061F9", "#8FAAF9"], + labels: [t("Repositories"), t("Comments"), t("CommentReports"), t("Users")], + legend: { + fontSize: "14px", + fontFamily: "Inter, sans-serif", + position: "bottom" as "bottom", + labels: { + colors: theme == "dark" ? "#CBD5E1" : "#334155", + }, + }, + total: { + color: "#373d3f", + }, + stroke: { + colors: ["white"], + width: theme == "dark" ? 0 : 1, + lineCap: "square" as "square", + }, + }; + let series = [ + repo_count_n, + comment_count_n, + comment_report_count_n, + user_count_n, + ]; + + return ( +
    +
    +
    +
    +
    + {t("ResourceDistribution")} +
    +
    +
    +
    + +
    + ); +} diff --git a/zbook_frontend/src/components/comments/CommentLevelOne.tsx b/zbook_frontend/src/components/comments/CommentLevelOne.tsx new file mode 100644 index 0000000..4534d83 --- /dev/null +++ b/zbook_frontend/src/components/comments/CommentLevelOne.tsx @@ -0,0 +1,100 @@ +"use client"; +import { useState, useEffect } from "react"; +import { ListCommentInfo, CommentCountInfo } from "@/types/model"; +interface CommentLevelOneProps { + ListCommentInfo: ListCommentInfo; + markdown_id: number; + authname: string; +} + +import ListLevelTwoComment from "./ListLevelTwoComment"; +import CommentOperationMore from "./CommentOperationMore"; +import CommentOperationCount from "./CommentOperationCount"; +import AvatarImageClient from "../AvatarImageClient"; +function getPageNumber(n: number) { + let nn = parseInt(String(n)); + return Math.floor((nn + parseInt("4")) / 5); +} +export default function CommentLevelOne(props: CommentLevelOneProps) { + const [commentCountInfo, setCommentCountInfo] = useState(); + const [isDeleted, setIsDeleted] = useState(false); + + const [isHovered, setIsHovered] = useState(false); + + const handleMouseEnter = () => { + setIsHovered(true); + }; + const handleMouseLeave = () => { + setIsHovered(false); + }; + useEffect(() => { + let commentCountInfo: CommentCountInfo = { + like_count: props.ListCommentInfo.like_count, + reply_count: props.ListCommentInfo.reply_count, + is_liked: props.ListCommentInfo.is_liked, + is_disliked: props.ListCommentInfo.is_disliked, + is_shared: props.ListCommentInfo.is_shared, + is_reported: props.ListCommentInfo.is_reported, + }; + setCommentCountInfo(commentCountInfo); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + if (isDeleted) { + return <>; + } + + return ( +
    +
    + +
    +
    + {props.ListCommentInfo.username} +
    +
    +
    + {props.ListCommentInfo.comment_content} +
    +
    + + {isHovered && ( + + )} +
    +
    + +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/components/comments/CommentLevelTwo.tsx b/zbook_frontend/src/components/comments/CommentLevelTwo.tsx new file mode 100644 index 0000000..f112e67 --- /dev/null +++ b/zbook_frontend/src/components/comments/CommentLevelTwo.tsx @@ -0,0 +1,100 @@ +"use client"; +import { useEffect, useState } from "react"; +import React, { useContext } from "react"; +import { Link } from "@/navigation"; +import { ListCommentInfo, CommentCountInfo } from "@/types/model"; +interface CommentLevelTwoProps { + ListCommentInfo: ListCommentInfo; + markdown_id: number; + pusername: string; + authname: string; +} +import { useTranslations } from "next-intl"; +import CommentOperationCount from "./CommentOperationCount"; +import CommentOperationMore from "./CommentOperationMore"; +import AvatarImageClient from "../AvatarImageClient"; + +export default function CommentLevelTwo(props: CommentLevelTwoProps) { + const t = useTranslations("Dialog"); + const [commentCountInfo, setCommentCountInfo] = useState(); + const [isDeleted, setIsDeleted] = useState(false); + const [isHovered, setIsHovered] = useState(false); + const handleMouseEnter = () => { + setIsHovered(true); + }; + useEffect(() => { + let commentCountInfo: CommentCountInfo = { + like_count: props.ListCommentInfo.like_count, + reply_count: props.ListCommentInfo.reply_count, + is_liked: props.ListCommentInfo.is_liked, + is_disliked: props.ListCommentInfo.is_disliked, + is_shared: props.ListCommentInfo.is_shared, + is_reported: props.ListCommentInfo.is_reported, + }; + setCommentCountInfo(commentCountInfo); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + const handleMouseLeave = () => { + setIsHovered(false); + }; + if (isDeleted) { + return <>; + } + return ( +
    +
    + +
    +
    + + {props.ListCommentInfo.username} + + + {t("Reply")} {t("At")} + + {props.pusername} + + {" "} + + {props.ListCommentInfo.comment_content} + +
    +
    + + {isHovered && ( + + )} +
    +
    +
    +
    + ); +} diff --git a/zbook_frontend/src/components/comments/CommentLoadingList.tsx b/zbook_frontend/src/components/comments/CommentLoadingList.tsx new file mode 100644 index 0000000..e985817 --- /dev/null +++ b/zbook_frontend/src/components/comments/CommentLoadingList.tsx @@ -0,0 +1,37 @@ +import LoadingElement from "../loadings/LoadingElement"; + +export default function CommentLoadingList({ + itemCount, +}: { + itemCount: number; +}) { + const placeholderItems = Array.from( + { length: itemCount }, + (_, index) => index + ); + + return ( +
    + {placeholderItems.map((_, index) => ( +
    +
    + +
    + +
    + +
    + + +
    +
    +
    +
    +
    + ))} +
    + ); +} diff --git a/zbook_frontend/src/components/comments/CommentOperationCount.tsx b/zbook_frontend/src/components/comments/CommentOperationCount.tsx new file mode 100644 index 0000000..5250886 --- /dev/null +++ b/zbook_frontend/src/components/comments/CommentOperationCount.tsx @@ -0,0 +1,218 @@ +import { + AiOutlineHeart, + AiFillHeart, + AiFillDislike, + AiOutlineDislike, +} from "react-icons/ai"; +import { useContext } from "react"; + +import { CommentCountInfo } from "@/types/model"; +import React, { useState, useEffect } from "react"; +import { OperationContext } from "@/providers/OperationProvider"; + +import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth"; +import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util"; +import TimeElement from "../TimeElement"; +import { useTranslations } from "next-intl"; +import { FetchError } from "@/fetchs/util"; +import { logger } from "@/utils/logger"; +interface CommentOperationLineProps { + created_at: string | undefined; + commentCountInfo: CommentCountInfo | undefined; + setCommentCountInfo: React.Dispatch< + React.SetStateAction + >; + comment_id: number; + markdown_id: number; +} + +export default function CommentOperationCount( + props: CommentOperationLineProps +) { + const t = useTranslations("Dialog"); + const { + mutationUpdateComment, + setMutationUpdateComment, + setOperationCommentID, + operationCommentID, + } = useContext(OperationContext); + const { + createCommentOpen, + setCreateCommentOpen, + setOperationParentID, + setOperationMarkdownID, + setOperationRootID, + } = useContext(OperationContext); + + const [isMounted, setIsMounted] = useState(false); + + const IconText = ({ + Icon, + text, + onClick, + }: { + Icon: any; + text: number; + onClick: () => void; + }) => ( +
    + + {text} +
    + ); + const IconFill = ({ + Icon, + onClick, + }: { + Icon: any; + + onClick: () => void; + }) => ( + + + + ); + + useEffect(() => { + setIsMounted(true); + }, []); + useEffect(() => { + if (isMounted && operationCommentID == props.comment_id) { + fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.GET_COMMENT_COUNT_INFO, + xforward: "", + agent: "", + tags: [], + values: { + comment_id: props.comment_id, + }, + }).then((data) => { + if (data?.comment_count_info) { + props.setCommentCountInfo(data?.comment_count_info); + } + }); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [mutationUpdateComment]); + + return ( +
    + + {" "} + + { + try { + const data = await fetchServerWithAuthWrapper({ + endpoint: + FetchServerWithAuthWrapperEndPoint.DELETE_COMMENT_RELATION, + xforward: "", + agent: "", + tags: [], + values: { + comment_id: props.comment_id, + relation_type: "like", + }, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } else { + setOperationCommentID(props.comment_id); + setMutationUpdateComment(!mutationUpdateComment); + } + } catch (error) { + let e = error as FetchError; + logger.error( + `delete comment relation failed:${e.message}`, + e.status + ); + } + } + : async () => { + try { + const data = await fetchServerWithAuthWrapper({ + endpoint: + FetchServerWithAuthWrapperEndPoint.CREATE_COMMENT_RELATION, + xforward: "", + agent: "", + tags: [], + values: { + comment_id: props.comment_id, + relation_type: "like", + }, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } else { + setOperationCommentID(props.comment_id); + setMutationUpdateComment(!mutationUpdateComment); + } + } catch (error) { + let e = error as FetchError; + logger.error( + `create comment relation failed:${e.message}`, + e.status + ); + } + } + } + /> + { + fetchServerWithAuthWrapper({ + endpoint: + FetchServerWithAuthWrapperEndPoint.DELETE_COMMENT_RELATION, + tags: [], + xforward: "", + agent: "", + values: { + comment_id: props.comment_id, + relation_type: "dislike", + }, + }).then((data) => { + setOperationCommentID(props.comment_id); + setMutationUpdateComment(!mutationUpdateComment); + }); + } + : () => { + fetchServerWithAuthWrapper({ + endpoint: + FetchServerWithAuthWrapperEndPoint.CREATE_COMMENT_RELATION, + xforward: "", + agent: "", + tags: [], + values: { + comment_id: props.comment_id, + relation_type: "dislike", + }, + }).then((data) => { + setOperationCommentID(props.comment_id); + setMutationUpdateComment(!mutationUpdateComment); + }); + } + } + /> + + { + setOperationParentID(props.comment_id); + setOperationMarkdownID(props.markdown_id); + setOperationRootID(props.comment_id); + setCreateCommentOpen(!createCommentOpen); + }} + className="cursor-pointer" + > + {t("Reply")} + +
    + ); +} diff --git a/zbook_frontend/src/components/comments/CommentOperationMore.tsx b/zbook_frontend/src/components/comments/CommentOperationMore.tsx new file mode 100644 index 0000000..bcb93c0 --- /dev/null +++ b/zbook_frontend/src/components/comments/CommentOperationMore.tsx @@ -0,0 +1,87 @@ +"use client"; +import { Popover, Transition } from "@headlessui/react"; +import { Fragment } from "react"; +import { MdOutlineMoreVert } from "react-icons/md"; +import DeleteCommentDialog from "./DeleteCommentDialog"; +import React, { useState, useContext } from "react"; +import { OperationContext } from "@/providers/OperationProvider"; +import { toast } from "react-toastify"; +import { CommentCountInfo } from "@/types/model"; +import { useTranslations } from "next-intl"; +interface CommentOperationMoreProps { + comment_id: number; + markdown_id: number; + setIsDeleted: React.Dispatch>; + commentCountInfo: CommentCountInfo | undefined; + owned: boolean; +} +export default function CommentOperationMore(props: CommentOperationMoreProps) { + const t = useTranslations("Dialog"); + const [showDialog, setShowDialog] = useState(false); + const { setCreateCommentReportOpen, setOperationCommentID } = + useContext(OperationContext); + return ( +
    + + + {({ open }) => ( + <> + + + + + + {props.owned && ( +
    { + setShowDialog(true); + }} + className="flex items-center rounded-t-md justify-center hover:dark:bg-sky-900 hover:bg-sky-200 px-4 py-2 min-w-[4rem]" + > + {t("Delete")} +
    + )} + {!props.owned && ( +
    { + if (props.commentCountInfo?.is_reported) { + toast(t("AlreadyReported"), { + type: "error", + isLoading: false, + autoClose: 1500, + }); + return; + } + setOperationCommentID(props.comment_id); + setCreateCommentReportOpen(true); + }} + className="flex items-center rounded-t-md justify-center hover:dark:bg-sky-900 hover:bg-sky-200 px-4 py-2 min-w-[4rem]" + > + {t("Report")} +
    + )} +
    +
    + + )} +
    +
    + ); +} diff --git a/zbook_frontend/src/components/comments/CreateComment.tsx b/zbook_frontend/src/components/comments/CreateComment.tsx new file mode 100644 index 0000000..8f85518 --- /dev/null +++ b/zbook_frontend/src/components/comments/CreateComment.tsx @@ -0,0 +1,21 @@ +"use client"; +import { ThemeColor } from "../TableOfContent"; +import CreateCommentForm from "./CreateCommentForm"; +interface CommentFormProps { + markdownID: number; + parentID: number; + username: string; + theme_color: ThemeColor; +} +export default function CreateComment(props: CommentFormProps) { + return ( +
    + +
    + ); +} diff --git a/zbook_frontend/src/components/comments/CreateCommentDialog.tsx b/zbook_frontend/src/components/comments/CreateCommentDialog.tsx new file mode 100644 index 0000000..5e7f3f7 --- /dev/null +++ b/zbook_frontend/src/components/comments/CreateCommentDialog.tsx @@ -0,0 +1,40 @@ +"use client"; + +import DialogComponent from "../DialogComponent"; +import { OperationContext } from "@/providers/OperationProvider"; +import React, { useContext, useEffect, useState } from "react"; +import CreateCommentForm from "@/components/comments/CreateCommentForm"; +import { useSession } from "next-auth/react"; +import { ThemeColor } from "../TableOfContent"; +export default function CreateCommentDialog() { + const [username, setUsername] = useState(""); + const { data, status } = useSession(); + useEffect(() => { + if (data?.username) { + setUsername(data.username); + } + }, [data]); + + const { + createCommentOpen, + setCreateCommentOpen, + operationMarkdownID, + operationParentID, + } = useContext(OperationContext); + + return ( + +
    + +
    +
    + ); +} diff --git a/zbook_frontend/src/components/comments/CreateCommentForm.tsx b/zbook_frontend/src/components/comments/CreateCommentForm.tsx new file mode 100644 index 0000000..baec1b6 --- /dev/null +++ b/zbook_frontend/src/components/comments/CreateCommentForm.tsx @@ -0,0 +1,120 @@ +"use client"; +import { OperationContext } from "@/providers/OperationProvider"; +import { useFormik } from "formik"; +import { toast } from "react-toastify"; +import React, { useContext } from "react"; +import { BsFillSendFill } from "react-icons/bs"; +import { fetchServerWithAuthWrapper } from "@/fetchs/server_with_auth"; +import { FetchServerWithAuthWrapperEndPoint } from "@/fetchs/server_with_auth_util"; +import AvatarImageClient from "../AvatarImageClient"; +import { useTranslations } from "next-intl"; +import { FetchError } from "@/fetchs/util"; +import { ThemeColor } from "../TableOfContent"; + +function getCommentColorClasses(color: ThemeColor) { + return { + textAreaClass: `border-${color}-400 dark:border-${color}-800 focus:border-${color}-500 dark:focus:border-${color}-600`, + buttonClass: `bg-${color}-600 hover:bg-${color}-700 dark:bg-${color}-700/50 hover:dark:bg-${color}-800/50`, + }; +} +export default function CreateCommentForm({ + markdownID, + parentID, + username, + theme_color, +}: { + markdownID: number; + parentID: number; + username: string; + theme_color: ThemeColor; +}) { + let { textAreaClass, buttonClass } = getCommentColorClasses(theme_color); + const t = useTranslations("Dialog"); + const { + mutationCreateComment, + setMutationCreateComment, + setCreateCommentContent, + setOperationCommentID, + setOperationRootID, + setOperationMarkdownID, + setOperationParentID, + operationParentID, + setCreateCommentOpen, + } = useContext(OperationContext); + const formik = useFormik({ + initialValues: { + markdown_id: 0, + parent_id: 0, + comment_content: "", + }, + onSubmit: handleSubmit, + }); + + async function handleSubmit(values: any) { + values.markdown_id = markdownID; + values.parent_id = parentID; + try { + const data = await fetchServerWithAuthWrapper({ + endpoint: FetchServerWithAuthWrapperEndPoint.CREATE_COMMENT, + xforward: "", + agent: "", + tags: [], + values: { + markdown_id: values.markdown_id, + comment_content: values.comment_content, + parent_id: values.parent_id, + }, + }); + if (data.error) { + throw new FetchError(data.message, data.status); + } + setOperationCommentID(data.comment.comment_id); + setOperationMarkdownID(data.comment.markdown_id); + setOperationRootID(data.comment.root_id ?? 0); + setOperationParentID(data.comment.parent_id ?? 0); + setCreateCommentContent(data.comment.comment_content); + setMutationCreateComment(!mutationCreateComment); + setCreateCommentOpen(false); + formik.resetForm(); + } catch { + toast(t("FailedCreateComment"), { + type: "error", + isLoading: false, + autoClose: 1500, + }); + } + } + + return ( +
    +
    + +